diff --git a/src/jsx.d.ts b/src/jsx.d.ts index c2705030ac..2131b8fd09 100644 --- a/src/jsx.d.ts +++ b/src/jsx.d.ts @@ -1,14 +1,7 @@ // Users who only use Preact for SSR might not specify "dom" in their lib in tsconfig.json /// -import { - Component, - ComponentType, - FunctionComponent, - VNode, -} from 'preact'; - -import * as dom from './dom'; +import * as preact from 'preact'; type Defaultize = // Distribute over unions @@ -34,9 +27,11 @@ export namespace JSXInternal { ? K : never; }[keyof IntrinsicElements] - | ComponentType

; - export interface Element extends VNode {} - export type ElementClass = Component | FunctionComponent; + | preact.ComponentType

; + export interface Element extends preact.VNode {} + export type ElementClass = + | preact.Component + | preact.FunctionComponent; export interface ElementAttributesProperty { props: any; @@ -47,224 +42,224 @@ export namespace JSXInternal { } export interface IntrinsicSVGElements { - svg: dom.SVGAttributes; - animate: dom.SVGAttributes; - circle: dom.SVGAttributes; - animateMotion: dom.SVGAttributes; - animateTransform: dom.SVGAttributes; - clipPath: dom.SVGAttributes; - defs: dom.SVGAttributes; - desc: dom.SVGAttributes; - ellipse: dom.SVGAttributes; - feBlend: dom.SVGAttributes; - feColorMatrix: dom.SVGAttributes; - feComponentTransfer: dom.SVGAttributes; - feComposite: dom.SVGAttributes; - feConvolveMatrix: dom.SVGAttributes; - feDiffuseLighting: dom.SVGAttributes; - feDisplacementMap: dom.SVGAttributes; - feDistantLight: dom.SVGAttributes; - feDropShadow: dom.SVGAttributes; - feFlood: dom.SVGAttributes; - feFuncA: dom.SVGAttributes; - feFuncB: dom.SVGAttributes; - feFuncG: dom.SVGAttributes; - feFuncR: dom.SVGAttributes; - feGaussianBlur: dom.SVGAttributes; - feImage: dom.SVGAttributes; - feMerge: dom.SVGAttributes; - feMergeNode: dom.SVGAttributes; - feMorphology: dom.SVGAttributes; - feOffset: dom.SVGAttributes; - fePointLight: dom.SVGAttributes; - feSpecularLighting: dom.SVGAttributes; - feSpotLight: dom.SVGAttributes; - feTile: dom.SVGAttributes; - feTurbulence: dom.SVGAttributes; - filter: dom.SVGAttributes; - foreignObject: dom.SVGAttributes; - g: dom.SVGAttributes; - image: dom.SVGAttributes; - line: dom.SVGAttributes; - linearGradient: dom.SVGAttributes; - marker: dom.SVGAttributes; - mask: dom.SVGAttributes; - metadata: dom.SVGAttributes; - mpath: dom.SVGAttributes; - path: dom.SVGAttributes; - pattern: dom.SVGAttributes; - polygon: dom.SVGAttributes; - polyline: dom.SVGAttributes; - radialGradient: dom.SVGAttributes; - rect: dom.SVGAttributes; - set: dom.SVGAttributes; - stop: dom.SVGAttributes; - switch: dom.SVGAttributes; - symbol: dom.SVGAttributes; - text: dom.SVGAttributes; - textPath: dom.SVGAttributes; - tspan: dom.SVGAttributes; - use: dom.SVGAttributes; - view: dom.SVGAttributes; + svg: preact.SVGAttributes; + animate: preact.SVGAttributes; + circle: preact.SVGAttributes; + animateMotion: preact.SVGAttributes; + animateTransform: preact.SVGAttributes; + clipPath: preact.SVGAttributes; + defs: preact.SVGAttributes; + desc: preact.SVGAttributes; + ellipse: preact.SVGAttributes; + feBlend: preact.SVGAttributes; + feColorMatrix: preact.SVGAttributes; + feComponentTransfer: preact.SVGAttributes; + feComposite: preact.SVGAttributes; + feConvolveMatrix: preact.SVGAttributes; + feDiffuseLighting: preact.SVGAttributes; + feDisplacementMap: preact.SVGAttributes; + feDistantLight: preact.SVGAttributes; + feDropShadow: preact.SVGAttributes; + feFlood: preact.SVGAttributes; + feFuncA: preact.SVGAttributes; + feFuncB: preact.SVGAttributes; + feFuncG: preact.SVGAttributes; + feFuncR: preact.SVGAttributes; + feGaussianBlur: preact.SVGAttributes; + feImage: preact.SVGAttributes; + feMerge: preact.SVGAttributes; + feMergeNode: preact.SVGAttributes; + feMorphology: preact.SVGAttributes; + feOffset: preact.SVGAttributes; + fePointLight: preact.SVGAttributes; + feSpecularLighting: preact.SVGAttributes; + feSpotLight: preact.SVGAttributes; + feTile: preact.SVGAttributes; + feTurbulence: preact.SVGAttributes; + filter: preact.SVGAttributes; + foreignObject: preact.SVGAttributes; + g: preact.SVGAttributes; + image: preact.SVGAttributes; + line: preact.SVGAttributes; + linearGradient: preact.SVGAttributes; + marker: preact.SVGAttributes; + mask: preact.SVGAttributes; + metadata: preact.SVGAttributes; + mpath: preact.SVGAttributes; + path: preact.SVGAttributes; + pattern: preact.SVGAttributes; + polygon: preact.SVGAttributes; + polyline: preact.SVGAttributes; + radialGradient: preact.SVGAttributes; + rect: preact.SVGAttributes; + set: preact.SVGAttributes; + stop: preact.SVGAttributes; + switch: preact.SVGAttributes; + symbol: preact.SVGAttributes; + text: preact.SVGAttributes; + textPath: preact.SVGAttributes; + tspan: preact.SVGAttributes; + use: preact.SVGAttributes; + view: preact.SVGAttributes; } export interface IntrinsicMathMLElements { - annotation: dom.AnnotationMathMLAttributes; - 'annotation-xml': dom.AnnotationXmlMathMLAttributes; + annotation: preact.AnnotationMathMLAttributes; + 'annotation-xml': preact.AnnotationXmlMathMLAttributes; /** @deprecated See https://developer.mozilla.org/en-US/docs/Web/MathML/Element/maction */ - maction: dom.MActionMathMLAttributes; - math: dom.MathMathMLAttributes; + maction: preact.MActionMathMLAttributes; + math: preact.MathMathMLAttributes; /** This feature is non-standard. See https://developer.mozilla.org/en-US/docs/Web/MathML/Element/menclose */ - menclose: dom.MEncloseMathMLAttributes; - merror: dom.MErrorMathMLAttributes; + menclose: preact.MEncloseMathMLAttributes; + merror: preact.MErrorMathMLAttributes; /** @deprecated See https://developer.mozilla.org/en-US/docs/Web/MathML/Element/mfenced */ - mfenced: dom.MFencedMathMLAttributes; - mfrac: dom.MFracMathMLAttributes; - mi: dom.MiMathMLAttributes; - mmultiscripts: dom.MmultiScriptsMathMLAttributes; - mn: dom.MNMathMLAttributes; - mo: dom.MOMathMLAttributes; - mover: dom.MOverMathMLAttributes; - mpadded: dom.MPaddedMathMLAttributes; - mphantom: dom.MPhantomMathMLAttributes; - mprescripts: dom.MPrescriptsMathMLAttributes; - mroot: dom.MRootMathMLAttributes; - mrow: dom.MRowMathMLAttributes; - ms: dom.MSMathMLAttributes; - mspace: dom.MSpaceMathMLAttributes; - msqrt: dom.MSqrtMathMLAttributes; - mstyle: dom.MStyleMathMLAttributes; - msub: dom.MSubMathMLAttributes; - msubsup: dom.MSubsupMathMLAttributes; - msup: dom.MSupMathMLAttributes; - mtable: dom.MTableMathMLAttributes; - mtd: dom.MTdMathMLAttributes; - mtext: dom.MTextMathMLAttributes; - mtr: dom.MTrMathMLAttributes; - munder: dom.MUnderMathMLAttributes; - munderover: dom.MUnderMathMLAttributes; - semantics: dom.SemanticsMathMLAttributes; + mfenced: preact.MFencedMathMLAttributes; + mfrac: preact.MFracMathMLAttributes; + mi: preact.MiMathMLAttributes; + mmultiscripts: preact.MmultiScriptsMathMLAttributes; + mn: preact.MNMathMLAttributes; + mo: preact.MOMathMLAttributes; + mover: preact.MOverMathMLAttributes; + mpadded: preact.MPaddedMathMLAttributes; + mphantom: preact.MPhantomMathMLAttributes; + mprescripts: preact.MPrescriptsMathMLAttributes; + mroot: preact.MRootMathMLAttributes; + mrow: preact.MRowMathMLAttributes; + ms: preact.MSMathMLAttributes; + mspace: preact.MSpaceMathMLAttributes; + msqrt: preact.MSqrtMathMLAttributes; + mstyle: preact.MStyleMathMLAttributes; + msub: preact.MSubMathMLAttributes; + msubsup: preact.MSubsupMathMLAttributes; + msup: preact.MSupMathMLAttributes; + mtable: preact.MTableMathMLAttributes; + mtd: preact.MTdMathMLAttributes; + mtext: preact.MTextMathMLAttributes; + mtr: preact.MTrMathMLAttributes; + munder: preact.MUnderMathMLAttributes; + munderover: preact.MUnderMathMLAttributes; + semantics: preact.SemanticsMathMLAttributes; } export interface IntrinsicElements extends IntrinsicSVGElements, IntrinsicMathMLElements { - a: dom.AccessibleAnchorHTMLAttributes; - abbr: dom.HTMLAttributes; - address: dom.HTMLAttributes; - area: dom.AccessibleAreaHTMLAttributes; - article: dom.ArticleHTMLAttributes; - aside: dom.AsideHTMLAttributes; - audio: dom.AudioHTMLAttributes; - b: dom.HTMLAttributes; - base: dom.BaseHTMLAttributes; - bdi: dom.HTMLAttributes; - bdo: dom.HTMLAttributes; - big: dom.HTMLAttributes; - blockquote: dom.BlockquoteHTMLAttributes; - body: dom.HTMLAttributes; - br: dom.BrHTMLAttributes; - button: dom.ButtonHTMLAttributes; - canvas: dom.CanvasHTMLAttributes; - caption: dom.CaptionHTMLAttributes; - cite: dom.HTMLAttributes; - code: dom.HTMLAttributes; - col: dom.ColHTMLAttributes; - colgroup: dom.ColgroupHTMLAttributes; - data: dom.DataHTMLAttributes; - datalist: dom.DataListHTMLAttributes; - dd: dom.DdHTMLAttributes; - del: dom.DelHTMLAttributes; - details: dom.DetailsHTMLAttributes; - dfn: dom.HTMLAttributes; - dialog: dom.DialogHTMLAttributes; - div: dom.HTMLAttributes; - dl: dom.DlHTMLAttributes; - dt: dom.DtHTMLAttributes; - em: dom.HTMLAttributes; - embed: dom.EmbedHTMLAttributes; - fieldset: dom.FieldsetHTMLAttributes; - figcaption: dom.FigcaptionHTMLAttributes; - figure: dom.HTMLAttributes; - footer: dom.FooterHTMLAttributes; - form: dom.FormHTMLAttributes; - h1: dom.HeadingHTMLAttributes; - h2: dom.HeadingHTMLAttributes; - h3: dom.HeadingHTMLAttributes; - h4: dom.HeadingHTMLAttributes; - h5: dom.HeadingHTMLAttributes; - h6: dom.HeadingHTMLAttributes; - head: dom.HeadHTMLAttributes; - header: dom.HeaderHTMLAttributes; - hgroup: dom.HTMLAttributes; - hr: dom.HrHTMLAttributes; - html: dom.HtmlHTMLAttributes; - i: dom.HTMLAttributes; - iframe: dom.IframeHTMLAttributes; - img: dom.AccessibleImgHTMLAttributes; - input: dom.AccessibleInputHTMLAttributes; - ins: dom.InsHTMLAttributes; - kbd: dom.HTMLAttributes; - keygen: dom.KeygenHTMLAttributes; - label: dom.LabelHTMLAttributes; - legend: dom.LegendHTMLAttributes; - li: dom.LiHTMLAttributes; - link: dom.LinkHTMLAttributes; - main: dom.MainHTMLAttributes; - map: dom.MapHTMLAttributes; - mark: dom.HTMLAttributes; - marquee: dom.MarqueeHTMLAttributes; - menu: dom.MenuHTMLAttributes; - menuitem: dom.HTMLAttributes; - meta: dom.MetaHTMLAttributes; - meter: dom.MeterHTMLAttributes; - nav: dom.NavHTMLAttributes; - noscript: dom.NoScriptHTMLAttributes; - object: dom.ObjectHTMLAttributes; - ol: dom.OlHTMLAttributes; - optgroup: dom.OptgroupHTMLAttributes; - option: dom.OptionHTMLAttributes; - output: dom.OutputHTMLAttributes; - p: dom.HTMLAttributes; - param: dom.ParamHTMLAttributes; - picture: dom.PictureHTMLAttributes; - pre: dom.HTMLAttributes; - progress: dom.ProgressHTMLAttributes; - q: dom.QuoteHTMLAttributes; - rp: dom.HTMLAttributes; - rt: dom.HTMLAttributes; - ruby: dom.HTMLAttributes; - s: dom.HTMLAttributes; - samp: dom.HTMLAttributes; - script: dom.ScriptHTMLAttributes; - search: dom.SearchHTMLAttributes; - section: dom.HTMLAttributes; - select: dom.AccessibleSelectHTMLAttributes; - slot: dom.SlotHTMLAttributes; - small: dom.HTMLAttributes; - source: dom.SourceHTMLAttributes; - span: dom.HTMLAttributes; - strong: dom.HTMLAttributes; - style: dom.StyleHTMLAttributes; - sub: dom.HTMLAttributes; - summary: dom.HTMLAttributes; - sup: dom.HTMLAttributes; - table: dom.TableHTMLAttributes; - tbody: dom.HTMLAttributes; - td: dom.TdHTMLAttributes; - template: dom.TemplateHTMLAttributes; - textarea: dom.TextareaHTMLAttributes; - tfoot: dom.HTMLAttributes; - th: dom.ThHTMLAttributes; - thead: dom.HTMLAttributes; - time: dom.TimeHTMLAttributes; - title: dom.TitleHTMLAttributes; - tr: dom.HTMLAttributes; - track: dom.TrackHTMLAttributes; - u: dom.UlHTMLAttributes; - ul: dom.HTMLAttributes; - var: dom.HTMLAttributes; - video: dom.VideoHTMLAttributes; - wbr: dom.WbrHTMLAttributes; + a: preact.AccessibleAnchorHTMLAttributes; + abbr: preact.HTMLAttributes; + address: preact.HTMLAttributes; + area: preact.AccessibleAreaHTMLAttributes; + article: preact.ArticleHTMLAttributes; + aside: preact.AsideHTMLAttributes; + audio: preact.AudioHTMLAttributes; + b: preact.HTMLAttributes; + base: preact.BaseHTMLAttributes; + bdi: preact.HTMLAttributes; + bdo: preact.HTMLAttributes; + big: preact.HTMLAttributes; + blockquote: preact.BlockquoteHTMLAttributes; + body: preact.HTMLAttributes; + br: preact.BrHTMLAttributes; + button: preact.ButtonHTMLAttributes; + canvas: preact.CanvasHTMLAttributes; + caption: preact.CaptionHTMLAttributes; + cite: preact.HTMLAttributes; + code: preact.HTMLAttributes; + col: preact.ColHTMLAttributes; + colgroup: preact.ColgroupHTMLAttributes; + data: preact.DataHTMLAttributes; + datalist: preact.DataListHTMLAttributes; + dd: preact.DdHTMLAttributes; + del: preact.DelHTMLAttributes; + details: preact.DetailsHTMLAttributes; + dfn: preact.HTMLAttributes; + dialog: preact.DialogHTMLAttributes; + div: preact.HTMLAttributes; + dl: preact.DlHTMLAttributes; + dt: preact.DtHTMLAttributes; + em: preact.HTMLAttributes; + embed: preact.EmbedHTMLAttributes; + fieldset: preact.FieldsetHTMLAttributes; + figcaption: preact.FigcaptionHTMLAttributes; + figure: preact.HTMLAttributes; + footer: preact.FooterHTMLAttributes; + form: preact.FormHTMLAttributes; + h1: preact.HeadingHTMLAttributes; + h2: preact.HeadingHTMLAttributes; + h3: preact.HeadingHTMLAttributes; + h4: preact.HeadingHTMLAttributes; + h5: preact.HeadingHTMLAttributes; + h6: preact.HeadingHTMLAttributes; + head: preact.HeadHTMLAttributes; + header: preact.HeaderHTMLAttributes; + hgroup: preact.HTMLAttributes; + hr: preact.HrHTMLAttributes; + html: preact.HtmlHTMLAttributes; + i: preact.HTMLAttributes; + iframe: preact.IframeHTMLAttributes; + img: preact.AccessibleImgHTMLAttributes; + input: preact.AccessibleInputHTMLAttributes; + ins: preact.InsHTMLAttributes; + kbd: preact.HTMLAttributes; + keygen: preact.KeygenHTMLAttributes; + label: preact.LabelHTMLAttributes; + legend: preact.LegendHTMLAttributes; + li: preact.LiHTMLAttributes; + link: preact.LinkHTMLAttributes; + main: preact.MainHTMLAttributes; + map: preact.MapHTMLAttributes; + mark: preact.HTMLAttributes; + marquee: preact.MarqueeHTMLAttributes; + menu: preact.MenuHTMLAttributes; + menuitem: preact.HTMLAttributes; + meta: preact.MetaHTMLAttributes; + meter: preact.MeterHTMLAttributes; + nav: preact.NavHTMLAttributes; + noscript: preact.NoScriptHTMLAttributes; + object: preact.ObjectHTMLAttributes; + ol: preact.OlHTMLAttributes; + optgroup: preact.OptgroupHTMLAttributes; + option: preact.OptionHTMLAttributes; + output: preact.OutputHTMLAttributes; + p: preact.HTMLAttributes; + param: preact.ParamHTMLAttributes; + picture: preact.PictureHTMLAttributes; + pre: preact.HTMLAttributes; + progress: preact.ProgressHTMLAttributes; + q: preact.QuoteHTMLAttributes; + rp: preact.HTMLAttributes; + rt: preact.HTMLAttributes; + ruby: preact.HTMLAttributes; + s: preact.HTMLAttributes; + samp: preact.HTMLAttributes; + script: preact.ScriptHTMLAttributes; + search: preact.SearchHTMLAttributes; + section: preact.HTMLAttributes; + select: preact.AccessibleSelectHTMLAttributes; + slot: preact.SlotHTMLAttributes; + small: preact.HTMLAttributes; + source: preact.SourceHTMLAttributes; + span: preact.HTMLAttributes; + strong: preact.HTMLAttributes; + style: preact.StyleHTMLAttributes; + sub: preact.HTMLAttributes; + summary: preact.HTMLAttributes; + sup: preact.HTMLAttributes; + table: preact.TableHTMLAttributes; + tbody: preact.HTMLAttributes; + td: preact.TdHTMLAttributes; + template: preact.TemplateHTMLAttributes; + textarea: preact.TextareaHTMLAttributes; + tfoot: preact.HTMLAttributes; + th: preact.ThHTMLAttributes; + thead: preact.HTMLAttributes; + time: preact.TimeHTMLAttributes; + title: preact.TitleHTMLAttributes; + tr: preact.HTMLAttributes; + track: preact.TrackHTMLAttributes; + u: preact.UlHTMLAttributes; + ul: preact.HTMLAttributes; + var: preact.HTMLAttributes; + video: preact.VideoHTMLAttributes; + wbr: preact.WbrHTMLAttributes; } }