chore(packages): move dom types down

This commit is contained in:
Rahim
2025-10-30 02:55:17 +00:00
parent c6e45fde16
commit 2778b20ca3
11 changed files with 25 additions and 7 deletions
+2
View File
@@ -1,6 +1,8 @@
{
"extends": "../../tsconfig.base.json",
"compilerOptions": {
// This will be removed.
"lib": ["ES2020", "DOM", "DOM.Iterable"],
"baseUrl": ".",
"paths": {
"@/*": ["src/*"]
+1
View File
@@ -1,6 +1,7 @@
{
"extends": "../../tsconfig.base.json",
"compilerOptions": {
"lib": ["ES2020", "DOM", "DOM.Iterable"],
"baseUrl": ".",
"paths": {
"@/*": ["src/*"]
+1
View File
@@ -63,6 +63,7 @@
"devDependencies": {
"@svgr/babel-plugin-add-jsx-attribute": "^8.0.0",
"@svgr/cli": "^8.1.0",
"@svgr/core": "^8.1.0",
"@svgr/plugin-jsx": "^8.1.0",
"@tailwindcss/cli": "^4.1.0",
"@types/postcss-prefix-selector": "^1.16.3",
+1
View File
@@ -1,5 +1,6 @@
import path from 'node:path';
/** @type {import('@svgr/core').Config & { indexTemplate: (filePaths: { path: string }[]) => string }} */
export default {
plugins: ['@svgr/plugin-jsx'],
typescript: true,
+1
View File
@@ -3,6 +3,7 @@
"compilerOptions": {
"jsx": "react-jsx",
"jsxImportSource": "react",
"lib": ["ES2020", "DOM", "DOM.Iterable"],
"baseUrl": ".",
"paths": {
"@/*": ["src/*"]
+8
View File
@@ -0,0 +1,8 @@
{
"extends": "../../tsconfig.json",
"compilerOptions": {
"composite": true,
"lib": ["ES2020", "DOM", "DOM.Iterable"]
},
"include": ["./**/*.ts"]
}
+1 -1
View File
@@ -3,7 +3,7 @@
* so we may treat them specifically as unequal if they are not a) both arrays
* or b) don't contain the same (shallowly compared) elements.
*/
export function shallowEqual(objA: any, objB: any): boolean {
export function shallowEqual(objA: object, objB: object): boolean {
// Using Object.is as a first pass, as it covers a lot of the "simple" cases that are
// more complex than strict equality and is a built-in. For discussion, see, e.g.:
// https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object/is#description
+4 -5
View File
@@ -1,9 +1,8 @@
/**
* Checks if a value is a valid number (not NaN, null, undefined, or Infinity)
*/
function isValidNumber(value: unknown): value is number {
return typeof value === 'number' && isFinite(value);
return typeof value === 'number' && Number.isFinite(value);
}
const UnitLabels = [
@@ -29,7 +28,7 @@ function toTimeUnitPhrase(timeUnitValue: number, unitIndex: number): string {
/**
* Converts numeric seconds into a human-readable phrase for accessibility.
*
*
* @param seconds - A (positive or negative) time, represented as seconds
* @returns The time, represented as a phrase of hours, minutes, and seconds
*
@@ -96,7 +95,7 @@ export function formatTime(seconds: number, guide?: number): string {
const gh = guide ? Math.floor(guide / 3600) : 0;
// Handle invalid times
if (isNaN(seconds) || seconds === Infinity) {
if (Number.isNaN(seconds) || seconds === Infinity) {
// '-' is false for all relational operators (e.g. <, >=) so this setting
// will add the minimum number of fields specified by the guide
h = m = s = '0';
@@ -118,7 +117,7 @@ export function formatTime(seconds: number, guide?: number): string {
/**
* Formats a time value with fallback handling for invalid values.
*
*
* @param time - The time value to format in seconds (duration, currentTime, etc.)
* @param guide - Optional guide time for consistent formatting
* @param fallback - Fallback text when time is invalid (default: "--:--")
+2
View File
@@ -1,10 +1,12 @@
{
"extends": "../../tsconfig.base.json",
"compilerOptions": {
"composite": true,
"baseUrl": ".",
"paths": {
"@/*": ["src/*"]
}
},
"references": [{ "path": "./src/dom" }],
"include": ["src"]
}
+3
View File
@@ -211,6 +211,9 @@ importers:
'@svgr/cli':
specifier: ^8.1.0
version: 8.1.0(typescript@5.9.3)
'@svgr/core':
specifier: ^8.1.0
version: 8.1.0(typescript@5.9.3)
'@svgr/plugin-jsx':
specifier: ^8.1.0
version: 8.1.0(@svgr/core@8.1.0(typescript@5.9.3))
+1 -1
View File
@@ -3,7 +3,7 @@
"incremental": true,
"composite": true,
"target": "ES2020",
"lib": ["ES2020", "DOM", "DOM.Iterable"],
"lib": ["ES2020"],
"module": "ESNext",
"moduleResolution": "bundler",
"resolveJsonModule": true,