web: Fix globals.d.ts file type declarations

This commit is contained in:
Daniel Jacobs 2024-07-21 12:22:26 -04:00 committed by TÖRÖK Attila
parent 9e3035a8bb
commit a7ee776750
1 changed files with 27 additions and 47 deletions

View File

@ -1,56 +1,36 @@
interface Error { import "tsx-dom-types";
avmStack?: string;
} declare module "tsx-dom-types" {
// Just updating this module seems to disable type checking for tsx-dom
// See https://github.com/Lusito/tsx-dom/issues/22#issuecomment-2236710966
// Because of that, all the other changes are unneeded, but they're what I think
// should be used if this worked properly
module "tsx-dom-types" {
// eslint-disable-next-line @typescript-eslint/no-unused-vars
interface HTMLAttributes { interface HTMLAttributes {
// Removable after a release with https://github.com/Lusito/tsx-dom/pull/24
autocapitalize?: string; autocapitalize?: string;
// Type definition will not be updated in tsx-dom unless https://github.com/whatwg/html/pull/5841 is merged
autocorrect?: string; autocorrect?: string;
} }
// eslint-disable-next-line @typescript-eslint/no-unused-vars // Removable after a release with https://github.com/Lusito/tsx-dom/pull/23
interface SVGAttributes { interface SVGAttributes {
d?: string; d?: string;
} }
} }
interface SVGSVGElement {
xmlns?: string; declare global {
scale?: string | number; interface Error {
} avmStack?: string;
interface SVGPathElement { }
xmlns?: string; // Per https://github.com/Lusito/tsx-dom/issues/22, attributes solely defined on SVGAttributes need type updates
fill?: string; interface SVGElement {
stroke?: string; // Only SVGSVGElement would need to use xmlns if tsx-dom would use createElementNS without that
d?: string; xmlns?: string;
} fill?: string;
interface SVGTextElement { stroke?: string;
xmlns?: string; }
fill?: string; interface SVGPathElement {
stroke?: string; d?: string;
} }
interface SVGCircleElement { interface HTMLInputElement {
xmlns?: string; // Removable after a release with https://github.com/Lusito/tsx-dom/pull/24
fill?: string; autocapitalize?: string;
} // Type definition will not be updated in tsx-dom unless https://github.com/whatwg/html/pull/5841 is merged
interface SVGDefsElement { autocorrect?: string;
xmlns?: string; }
}
interface SVGGElement {
xmlns?: string;
}
interface SVGLinearGradientElement {
xmlns?: string;
}
interface SVGStopElement {
xmlns?: string;
}
interface SVGUseElement {
xmlns?: string;
}
interface HTMLInputElement {
autocapitalize?: string;
autocorrect?: string;
} }