From 7b364fbe1874fd1a27e9fe433026f49c60cbd485 Mon Sep 17 00:00:00 2001 From: Samsam Ahmadi Date: Tue, 15 Aug 2023 22:38:56 +0200 Subject: [PATCH 1/5] type[compat]: add html attributes types --- compat/src/index.d.ts | 846 ++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 846 insertions(+) diff --git a/compat/src/index.d.ts b/compat/src/index.d.ts index f0d49f393b..6f3a940216 100644 --- a/compat/src/index.d.ts +++ b/compat/src/index.d.ts @@ -68,12 +68,858 @@ declare namespace React { // HTML export interface HTMLAttributes extends JSXInternal.HTMLAttributes {} + export import DetailedHTMLProps = JSXInternal.DetailedHTMLProps; export import CSSProperties = JSXInternal.CSSProperties; + export interface SVGProps extends JSXInternal.SVGAttributes, preact.ClassAttributes {} + type HTMLAttributeReferrerPolicy = + | '' + | 'no-referrer' + | 'no-referrer-when-downgrade' + | 'origin' + | 'origin-when-cross-origin' + | 'same-origin' + | 'strict-origin' + | 'strict-origin-when-cross-origin' + | 'unsafe-url'; + + type HTMLAttributeAnchorTarget = + | '_self' + | '_blank' + | '_parent' + | '_top' + | (string & {}); + + interface AnchorHTMLAttributes extends HTMLAttributes { + download?: any; + href?: string | undefined; + hrefLang?: string | undefined; + media?: string | undefined; + ping?: string | undefined; + target?: HTMLAttributeAnchorTarget | undefined; + type?: string | undefined; + referrerPolicy?: HTMLAttributeReferrerPolicy | undefined; + } + + interface AudioHTMLAttributes extends MediaHTMLAttributes {} + + interface AreaHTMLAttributes extends HTMLAttributes { + alt?: string | undefined; + coords?: string | undefined; + download?: any; + href?: string | undefined; + hrefLang?: string | undefined; + media?: string | undefined; + referrerPolicy?: HTMLAttributeReferrerPolicy | undefined; + shape?: string | undefined; + target?: string | undefined; + } + + interface BaseHTMLAttributes extends HTMLAttributes { + href?: string | undefined; + target?: string | undefined; + } + + interface BlockquoteHTMLAttributes extends HTMLAttributes { + cite?: string | undefined; + } + + interface ButtonHTMLAttributes extends HTMLAttributes { + disabled?: boolean | undefined; + form?: string | undefined; + formAction?: string | undefined; + formEncType?: string | undefined; + formMethod?: string | undefined; + formNoValidate?: boolean | undefined; + formTarget?: string | undefined; + name?: string | undefined; + type?: 'submit' | 'reset' | 'button' | undefined; + value?: string | ReadonlyArray | number | undefined; + } + + interface CanvasHTMLAttributes extends HTMLAttributes { + height?: number | string | undefined; + width?: number | string | undefined; + } + + interface ColHTMLAttributes extends HTMLAttributes { + span?: number | undefined; + width?: number | string | undefined; + } + + interface ColgroupHTMLAttributes extends HTMLAttributes { + span?: number | undefined; + } + + interface DataHTMLAttributes extends HTMLAttributes { + value?: string | ReadonlyArray | number | undefined; + } + + interface DetailsHTMLAttributes extends HTMLAttributes { + open?: boolean | undefined; + onToggle?: ReactEventHandler | undefined; + } + + interface DelHTMLAttributes extends HTMLAttributes { + cite?: string | undefined; + dateTime?: string | undefined; + } + + interface DialogHTMLAttributes extends HTMLAttributes { + onCancel?: ReactEventHandler | undefined; + onClose?: ReactEventHandler | undefined; + open?: boolean | undefined; + } + + interface EmbedHTMLAttributes extends HTMLAttributes { + height?: number | string | undefined; + src?: string | undefined; + type?: string | undefined; + width?: number | string | undefined; + } + + interface FieldsetHTMLAttributes extends HTMLAttributes { + disabled?: boolean | undefined; + form?: string | undefined; + name?: string | undefined; + } + + interface FormHTMLAttributes extends HTMLAttributes { + acceptCharset?: string | undefined; + action?: string | undefined; + autoComplete?: string | undefined; + encType?: string | undefined; + method?: string | undefined; + name?: string | undefined; + noValidate?: boolean | undefined; + target?: string | undefined; + } + + interface HtmlHTMLAttributes extends HTMLAttributes { + manifest?: string | undefined; + } + + interface IframeHTMLAttributes extends HTMLAttributes { + allow?: string | undefined; + allowFullScreen?: boolean | undefined; + allowTransparency?: boolean | undefined; + /** @deprecated */ + frameBorder?: number | string | undefined; + height?: number | string | undefined; + loading?: 'eager' | 'lazy' | undefined; + /** @deprecated */ + marginHeight?: number | undefined; + /** @deprecated */ + marginWidth?: number | undefined; + name?: string | undefined; + referrerPolicy?: HTMLAttributeReferrerPolicy | undefined; + sandbox?: string | undefined; + /** @deprecated */ + scrolling?: string | undefined; + seamless?: boolean | undefined; + src?: string | undefined; + srcDoc?: string | undefined; + width?: number | string | undefined; + } + + interface ImgHTMLAttributes extends HTMLAttributes { + alt?: string | undefined; + crossOrigin?: CrossOrigin; + decoding?: 'async' | 'auto' | 'sync' | undefined; + height?: number | string | undefined; + loading?: 'eager' | 'lazy' | undefined; + referrerPolicy?: HTMLAttributeReferrerPolicy | undefined; + sizes?: string | undefined; + src?: string | undefined; + srcSet?: string | undefined; + useMap?: string | undefined; + width?: number | string | undefined; + } + + interface InsHTMLAttributes extends HTMLAttributes { + cite?: string | undefined; + dateTime?: string | undefined; + } + + type HTMLInputTypeAttribute = + | 'button' + | 'checkbox' + | 'color' + | 'date' + | 'datetime-local' + | 'email' + | 'file' + | 'hidden' + | 'image' + | 'month' + | 'number' + | 'password' + | 'radio' + | 'range' + | 'reset' + | 'search' + | 'submit' + | 'tel' + | 'text' + | 'time' + | 'url' + | 'week' + | (string & {}); + + interface InputHTMLAttributes extends HTMLAttributes { + accept?: string | undefined; + alt?: string | undefined; + autoComplete?: string | undefined; + capture?: boolean | 'user' | 'environment' | undefined; // https://www.w3.org/TR/html-media-capture/#the-capture-attribute + checked?: boolean | undefined; + disabled?: boolean | undefined; + enterKeyHint?: + | 'enter' + | 'done' + | 'go' + | 'next' + | 'previous' + | 'search' + | 'send' + | undefined; + form?: string | undefined; + formAction?: string | undefined; + formEncType?: string | undefined; + formMethod?: string | undefined; + formNoValidate?: boolean | undefined; + formTarget?: string | undefined; + height?: number | string | undefined; + list?: string | undefined; + max?: number | string | undefined; + maxLength?: number | undefined; + min?: number | string | undefined; + minLength?: number | undefined; + multiple?: boolean | undefined; + name?: string | undefined; + pattern?: string | undefined; + placeholder?: string | undefined; + readOnly?: boolean | undefined; + required?: boolean | undefined; + size?: number | undefined; + src?: string | undefined; + step?: number | string | undefined; + type?: HTMLInputTypeAttribute | undefined; + value?: string | ReadonlyArray | number | undefined; + width?: number | string | undefined; + + onChange?: ChangeEventHandler | undefined; + } + + interface KeygenHTMLAttributes extends HTMLAttributes { + challenge?: string | undefined; + disabled?: boolean | undefined; + form?: string | undefined; + keyType?: string | undefined; + keyParams?: string | undefined; + name?: string | undefined; + } + + interface LabelHTMLAttributes extends HTMLAttributes { + form?: string | undefined; + htmlFor?: string | undefined; + } + + interface LiHTMLAttributes extends HTMLAttributes { + value?: string | ReadonlyArray | number | undefined; + } + + interface LinkHTMLAttributes extends HTMLAttributes { + as?: string | undefined; + crossOrigin?: CrossOrigin; + fetchPriority?: 'high' | 'low' | 'auto'; + href?: string | undefined; + hrefLang?: string | undefined; + integrity?: string | undefined; + media?: string | undefined; + imageSrcSet?: string | undefined; + referrerPolicy?: HTMLAttributeReferrerPolicy | undefined; + sizes?: string | undefined; + type?: string | undefined; + charSet?: string | undefined; + } + + interface MapHTMLAttributes extends HTMLAttributes { + name?: string | undefined; + } + + interface MenuHTMLAttributes extends HTMLAttributes { + type?: string | undefined; + } + + interface MediaHTMLAttributes extends HTMLAttributes { + autoPlay?: boolean | undefined; + controls?: boolean | undefined; + controlsList?: string | undefined; + crossOrigin?: CrossOrigin; + loop?: boolean | undefined; + mediaGroup?: string | undefined; + muted?: boolean | undefined; + playsInline?: boolean | undefined; + preload?: string | undefined; + src?: string | undefined; + } + + interface MetaHTMLAttributes extends HTMLAttributes { + charSet?: string | undefined; + httpEquiv?: string | undefined; + name?: string | undefined; + media?: string | undefined; + } + + interface MeterHTMLAttributes extends HTMLAttributes { + form?: string | undefined; + high?: number | undefined; + low?: number | undefined; + max?: number | string | undefined; + min?: number | string | undefined; + optimum?: number | undefined; + value?: string | ReadonlyArray | number | undefined; + } + + interface QuoteHTMLAttributes extends HTMLAttributes { + cite?: string | undefined; + } + + interface ObjectHTMLAttributes extends HTMLAttributes { + classID?: string | undefined; + data?: string | undefined; + form?: string | undefined; + height?: number | string | undefined; + name?: string | undefined; + type?: string | undefined; + useMap?: string | undefined; + width?: number | string | undefined; + wmode?: string | undefined; + } + + interface OlHTMLAttributes extends HTMLAttributes { + reversed?: boolean | undefined; + start?: number | undefined; + type?: '1' | 'a' | 'A' | 'i' | 'I' | undefined; + } + + interface OptgroupHTMLAttributes extends HTMLAttributes { + disabled?: boolean | undefined; + label?: string | undefined; + } + + interface OptionHTMLAttributes extends HTMLAttributes { + disabled?: boolean | undefined; + label?: string | undefined; + selected?: boolean | undefined; + value?: string | ReadonlyArray | number | undefined; + } + + interface OutputHTMLAttributes extends HTMLAttributes { + form?: string | undefined; + htmlFor?: string | undefined; + name?: string | undefined; + } + + interface ParamHTMLAttributes extends HTMLAttributes { + name?: string | undefined; + value?: string | ReadonlyArray | number | undefined; + } + + interface ProgressHTMLAttributes extends HTMLAttributes { + max?: number | string | undefined; + value?: string | ReadonlyArray | number | undefined; + } + + interface SlotHTMLAttributes extends HTMLAttributes { + name?: string | undefined; + } + + interface ScriptHTMLAttributes extends HTMLAttributes { + async?: boolean | undefined; + /** @deprecated */ + charSet?: string | undefined; + crossOrigin?: CrossOrigin; + defer?: boolean | undefined; + integrity?: string | undefined; + noModule?: boolean | undefined; + referrerPolicy?: HTMLAttributeReferrerPolicy | undefined; + src?: string | undefined; + type?: string | undefined; + } + + interface SelectHTMLAttributes extends HTMLAttributes { + autoComplete?: string | undefined; + disabled?: boolean | undefined; + form?: string | undefined; + multiple?: boolean | undefined; + name?: string | undefined; + required?: boolean | undefined; + size?: number | undefined; + value?: string | ReadonlyArray | number | undefined; + onChange?: ChangeEventHandler | undefined; + } + + interface SourceHTMLAttributes extends HTMLAttributes { + height?: number | string | undefined; + media?: string | undefined; + sizes?: string | undefined; + src?: string | undefined; + srcSet?: string | undefined; + type?: string | undefined; + width?: number | string | undefined; + } + + interface StyleHTMLAttributes extends HTMLAttributes { + media?: string | undefined; + scoped?: boolean | undefined; + type?: string | undefined; + } + + interface TableHTMLAttributes extends HTMLAttributes { + cellPadding?: number | string | undefined; + cellSpacing?: number | string | undefined; + summary?: string | undefined; + width?: number | string | undefined; + } + + interface TextareaHTMLAttributes extends HTMLAttributes { + autoComplete?: string | undefined; + cols?: number | undefined; + dirName?: string | undefined; + disabled?: boolean | undefined; + form?: string | undefined; + maxLength?: number | undefined; + minLength?: number | undefined; + name?: string | undefined; + placeholder?: string | undefined; + readOnly?: boolean | undefined; + required?: boolean | undefined; + rows?: number | undefined; + value?: string | ReadonlyArray | number | undefined; + wrap?: string | undefined; + + onChange?: ChangeEventHandler | undefined; + } + + interface TdHTMLAttributes extends HTMLAttributes { + align?: 'left' | 'center' | 'right' | 'justify' | 'char' | undefined; + colSpan?: number | undefined; + headers?: string | undefined; + rowSpan?: number | undefined; + scope?: string | undefined; + abbr?: string | undefined; + height?: number | string | undefined; + width?: number | string | undefined; + valign?: 'top' | 'middle' | 'bottom' | 'baseline' | undefined; + } + + interface ThHTMLAttributes extends HTMLAttributes { + align?: 'left' | 'center' | 'right' | 'justify' | 'char' | undefined; + colSpan?: number | undefined; + headers?: string | undefined; + rowSpan?: number | undefined; + scope?: string | undefined; + abbr?: string | undefined; + } + + interface TimeHTMLAttributes extends HTMLAttributes { + dateTime?: string | undefined; + } + + interface TrackHTMLAttributes extends HTMLAttributes { + default?: boolean | undefined; + kind?: string | undefined; + label?: string | undefined; + src?: string | undefined; + srcLang?: string | undefined; + } + + interface VideoHTMLAttributes extends MediaHTMLAttributes { + height?: number | string | undefined; + playsInline?: boolean | undefined; + poster?: string | undefined; + width?: number | string | undefined; + disablePictureInPicture?: boolean | undefined; + disableRemotePlayback?: boolean | undefined; + } + + // this list is "complete" in that it contains every SVG attribute + // that React supports, but the types can be improved. + // Full list here: https://facebook.github.io/react/docs/dom-elements.html + // + // The three broad type categories are (in order of restrictiveness): + // - "number | string" + // - "string" + // - union of string literals + interface SVGAttributes extends AriaAttributes, DOMAttributes { + // Attributes which also defined in HTMLAttributes + // See comment in SVGDOMPropertyConfig.js + className?: string | undefined; + color?: string | undefined; + height?: number | string | undefined; + id?: string | undefined; + lang?: string | undefined; + max?: number | string | undefined; + media?: string | undefined; + method?: string | undefined; + min?: number | string | undefined; + name?: string | undefined; + style?: CSSProperties | undefined; + target?: string | undefined; + type?: string | undefined; + width?: number | string | undefined; + + // Other HTML properties supported by SVG elements in browsers + role?: AriaRole | undefined; + tabIndex?: number | undefined; + crossOrigin?: CrossOrigin; + + // SVG Specific attributes + accentHeight?: number | string | undefined; + accumulate?: 'none' | 'sum' | undefined; + additive?: 'replace' | 'sum' | undefined; + alignmentBaseline?: + | 'auto' + | 'baseline' + | 'before-edge' + | 'text-before-edge' + | 'middle' + | 'central' + | 'after-edge' + | 'text-after-edge' + | 'ideographic' + | 'alphabetic' + | 'hanging' + | 'mathematical' + | 'inherit' + | undefined; + allowReorder?: 'no' | 'yes' | undefined; + alphabetic?: number | string | undefined; + amplitude?: number | string | undefined; + arabicForm?: 'initial' | 'medial' | 'terminal' | 'isolated' | undefined; + ascent?: number | string | undefined; + attributeName?: string | undefined; + attributeType?: string | undefined; + autoReverse?: Booleanish | undefined; + azimuth?: number | string | undefined; + baseFrequency?: number | string | undefined; + baselineShift?: number | string | undefined; + baseProfile?: number | string | undefined; + bbox?: number | string | undefined; + begin?: number | string | undefined; + bias?: number | string | undefined; + by?: number | string | undefined; + calcMode?: number | string | undefined; + capHeight?: number | string | undefined; + clip?: number | string | undefined; + clipPath?: string | undefined; + clipPathUnits?: number | string | undefined; + clipRule?: number | string | undefined; + colorInterpolation?: number | string | undefined; + colorInterpolationFilters?: + | 'auto' + | 'sRGB' + | 'linearRGB' + | 'inherit' + | undefined; + colorProfile?: number | string | undefined; + colorRendering?: number | string | undefined; + contentScriptType?: number | string | undefined; + contentStyleType?: number | string | undefined; + cursor?: number | string | undefined; + cx?: number | string | undefined; + cy?: number | string | undefined; + d?: string | undefined; + decelerate?: number | string | undefined; + descent?: number | string | undefined; + diffuseConstant?: number | string | undefined; + direction?: number | string | undefined; + display?: number | string | undefined; + divisor?: number | string | undefined; + dominantBaseline?: number | string | undefined; + dur?: number | string | undefined; + dx?: number | string | undefined; + dy?: number | string | undefined; + edgeMode?: number | string | undefined; + elevation?: number | string | undefined; + enableBackground?: number | string | undefined; + end?: number | string | undefined; + exponent?: number | string | undefined; + externalResourcesRequired?: Booleanish | undefined; + fill?: string | undefined; + fillOpacity?: number | string | undefined; + fillRule?: 'nonzero' | 'evenodd' | 'inherit' | undefined; + filter?: string | undefined; + filterRes?: number | string | undefined; + filterUnits?: number | string | undefined; + floodColor?: number | string | undefined; + floodOpacity?: number | string | undefined; + focusable?: Booleanish | 'auto' | undefined; + fontFamily?: string | undefined; + fontSize?: number | string | undefined; + fontSizeAdjust?: number | string | undefined; + fontStretch?: number | string | undefined; + fontStyle?: number | string | undefined; + fontVariant?: number | string | undefined; + fontWeight?: number | string | undefined; + format?: number | string | undefined; + fr?: number | string | undefined; + from?: number | string | undefined; + fx?: number | string | undefined; + fy?: number | string | undefined; + g1?: number | string | undefined; + g2?: number | string | undefined; + glyphName?: number | string | undefined; + glyphOrientationHorizontal?: number | string | undefined; + glyphOrientationVertical?: number | string | undefined; + glyphRef?: number | string | undefined; + gradientTransform?: string | undefined; + gradientUnits?: string | undefined; + hanging?: number | string | undefined; + horizAdvX?: number | string | undefined; + horizOriginX?: number | string | undefined; + href?: string | undefined; + ideographic?: number | string | undefined; + imageRendering?: number | string | undefined; + in2?: number | string | undefined; + in?: string | undefined; + intercept?: number | string | undefined; + k1?: number | string | undefined; + k2?: number | string | undefined; + k3?: number | string | undefined; + k4?: number | string | undefined; + k?: number | string | undefined; + kernelMatrix?: number | string | undefined; + kernelUnitLength?: number | string | undefined; + kerning?: number | string | undefined; + keyPoints?: number | string | undefined; + keySplines?: number | string | undefined; + keyTimes?: number | string | undefined; + lengthAdjust?: number | string | undefined; + letterSpacing?: number | string | undefined; + lightingColor?: number | string | undefined; + limitingConeAngle?: number | string | undefined; + local?: number | string | undefined; + markerEnd?: string | undefined; + markerHeight?: number | string | undefined; + markerMid?: string | undefined; + markerStart?: string | undefined; + markerUnits?: number | string | undefined; + markerWidth?: number | string | undefined; + mask?: string | undefined; + maskContentUnits?: number | string | undefined; + maskUnits?: number | string | undefined; + mathematical?: number | string | undefined; + mode?: number | string | undefined; + numOctaves?: number | string | undefined; + offset?: number | string | undefined; + opacity?: number | string | undefined; + operator?: number | string | undefined; + order?: number | string | undefined; + orient?: number | string | undefined; + orientation?: number | string | undefined; + origin?: number | string | undefined; + overflow?: number | string | undefined; + overlinePosition?: number | string | undefined; + overlineThickness?: number | string | undefined; + paintOrder?: number | string | undefined; + panose1?: number | string | undefined; + path?: string | undefined; + pathLength?: number | string | undefined; + patternContentUnits?: string | undefined; + patternTransform?: number | string | undefined; + patternUnits?: string | undefined; + pointerEvents?: number | string | undefined; + points?: string | undefined; + pointsAtX?: number | string | undefined; + pointsAtY?: number | string | undefined; + pointsAtZ?: number | string | undefined; + preserveAlpha?: Booleanish | undefined; + preserveAspectRatio?: string | undefined; + primitiveUnits?: number | string | undefined; + r?: number | string | undefined; + radius?: number | string | undefined; + refX?: number | string | undefined; + refY?: number | string | undefined; + renderingIntent?: number | string | undefined; + repeatCount?: number | string | undefined; + repeatDur?: number | string | undefined; + requiredExtensions?: number | string | undefined; + requiredFeatures?: number | string | undefined; + restart?: number | string | undefined; + result?: string | undefined; + rotate?: number | string | undefined; + rx?: number | string | undefined; + ry?: number | string | undefined; + scale?: number | string | undefined; + seed?: number | string | undefined; + shapeRendering?: number | string | undefined; + slope?: number | string | undefined; + spacing?: number | string | undefined; + specularConstant?: number | string | undefined; + specularExponent?: number | string | undefined; + speed?: number | string | undefined; + spreadMethod?: string | undefined; + startOffset?: number | string | undefined; + stdDeviation?: number | string | undefined; + stemh?: number | string | undefined; + stemv?: number | string | undefined; + stitchTiles?: number | string | undefined; + stopColor?: string | undefined; + stopOpacity?: number | string | undefined; + strikethroughPosition?: number | string | undefined; + strikethroughThickness?: number | string | undefined; + string?: number | string | undefined; + stroke?: string | undefined; + strokeDasharray?: string | number | undefined; + strokeDashoffset?: string | number | undefined; + strokeLinecap?: 'butt' | 'round' | 'square' | 'inherit' | undefined; + strokeLinejoin?: 'miter' | 'round' | 'bevel' | 'inherit' | undefined; + strokeMiterlimit?: number | string | undefined; + strokeOpacity?: number | string | undefined; + strokeWidth?: number | string | undefined; + surfaceScale?: number | string | undefined; + systemLanguage?: number | string | undefined; + tableValues?: number | string | undefined; + targetX?: number | string | undefined; + targetY?: number | string | undefined; + textAnchor?: string | undefined; + textDecoration?: number | string | undefined; + textLength?: number | string | undefined; + textRendering?: number | string | undefined; + to?: number | string | undefined; + transform?: string | undefined; + u1?: number | string | undefined; + u2?: number | string | undefined; + underlinePosition?: number | string | undefined; + underlineThickness?: number | string | undefined; + unicode?: number | string | undefined; + unicodeBidi?: number | string | undefined; + unicodeRange?: number | string | undefined; + unitsPerEm?: number | string | undefined; + vAlphabetic?: number | string | undefined; + values?: string | undefined; + vectorEffect?: number | string | undefined; + version?: string | undefined; + vertAdvY?: number | string | undefined; + vertOriginX?: number | string | undefined; + vertOriginY?: number | string | undefined; + vHanging?: number | string | undefined; + vIdeographic?: number | string | undefined; + viewBox?: string | undefined; + viewTarget?: number | string | undefined; + visibility?: number | string | undefined; + vMathematical?: number | string | undefined; + widths?: number | string | undefined; + wordSpacing?: number | string | undefined; + writingMode?: number | string | undefined; + x1?: number | string | undefined; + x2?: number | string | undefined; + x?: number | string | undefined; + xChannelSelector?: string | undefined; + xHeight?: number | string | undefined; + xlinkActuate?: string | undefined; + xlinkArcrole?: string | undefined; + xlinkHref?: string | undefined; + xlinkRole?: string | undefined; + xlinkShow?: string | undefined; + xlinkTitle?: string | undefined; + xlinkType?: string | undefined; + xmlBase?: string | undefined; + xmlLang?: string | undefined; + xmlns?: string | undefined; + xmlnsXlink?: string | undefined; + xmlSpace?: string | undefined; + y1?: number | string | undefined; + y2?: number | string | undefined; + y?: number | string | undefined; + yChannelSelector?: string | undefined; + z?: number | string | undefined; + zoomAndPan?: string | undefined; + } + + interface WebViewHTMLAttributes extends HTMLAttributes { + allowFullScreen?: boolean | undefined; + allowpopups?: boolean | undefined; + autosize?: boolean | undefined; + blinkfeatures?: string | undefined; + disableblinkfeatures?: string | undefined; + disableguestresize?: boolean | undefined; + disablewebsecurity?: boolean | undefined; + guestinstance?: string | undefined; + httpreferrer?: string | undefined; + nodeintegration?: boolean | undefined; + partition?: string | undefined; + plugins?: boolean | undefined; + preload?: string | undefined; + src?: string | undefined; + useragent?: string | undefined; + webpreferences?: string | undefined; + } + + interface ReactSVG { + animate: SVGFactory; + circle: SVGFactory; + clipPath: SVGFactory; + defs: SVGFactory; + desc: SVGFactory; + ellipse: SVGFactory; + feBlend: SVGFactory; + feColorMatrix: SVGFactory; + feComponentTransfer: SVGFactory; + feComposite: SVGFactory; + feConvolveMatrix: SVGFactory; + feDiffuseLighting: SVGFactory; + feDisplacementMap: SVGFactory; + feDistantLight: SVGFactory; + feDropShadow: SVGFactory; + feFlood: SVGFactory; + feFuncA: SVGFactory; + feFuncB: SVGFactory; + feFuncG: SVGFactory; + feFuncR: SVGFactory; + feGaussianBlur: SVGFactory; + feImage: SVGFactory; + feMerge: SVGFactory; + feMergeNode: SVGFactory; + feMorphology: SVGFactory; + feOffset: SVGFactory; + fePointLight: SVGFactory; + feSpecularLighting: SVGFactory; + feSpotLight: SVGFactory; + feTile: SVGFactory; + feTurbulence: SVGFactory; + filter: SVGFactory; + foreignObject: SVGFactory; + g: SVGFactory; + image: SVGFactory; + line: SVGFactory; + linearGradient: SVGFactory; + marker: SVGFactory; + mask: SVGFactory; + metadata: SVGFactory; + path: SVGFactory; + pattern: SVGFactory; + polygon: SVGFactory; + polyline: SVGFactory; + radialGradient: SVGFactory; + rect: SVGFactory; + stop: SVGFactory; + svg: SVGFactory; + switch: SVGFactory; + symbol: SVGFactory; + text: SVGFactory; + textPath: SVGFactory; + tspan: SVGFactory; + use: SVGFactory; + view: SVGFactory; + } + // Events export import TargetedEvent = JSXInternal.TargetedEvent; export import ChangeEvent = JSXInternal.TargetedEvent; From 767e7baa2cc28d171bfe9e277e959f06f0713f96 Mon Sep 17 00:00:00 2001 From: Samsam Ahmadi Date: Wed, 16 Aug 2023 08:46:51 +0200 Subject: [PATCH 2/5] refactor: remove duplicate types --- compat/src/index.d.ts | 353 ------------------------------------------ 1 file changed, 353 deletions(-) diff --git a/compat/src/index.d.ts b/compat/src/index.d.ts index 6f3a940216..40d5bcab64 100644 --- a/compat/src/index.d.ts +++ b/compat/src/index.d.ts @@ -548,301 +548,6 @@ declare namespace React { disableRemotePlayback?: boolean | undefined; } - // this list is "complete" in that it contains every SVG attribute - // that React supports, but the types can be improved. - // Full list here: https://facebook.github.io/react/docs/dom-elements.html - // - // The three broad type categories are (in order of restrictiveness): - // - "number | string" - // - "string" - // - union of string literals - interface SVGAttributes extends AriaAttributes, DOMAttributes { - // Attributes which also defined in HTMLAttributes - // See comment in SVGDOMPropertyConfig.js - className?: string | undefined; - color?: string | undefined; - height?: number | string | undefined; - id?: string | undefined; - lang?: string | undefined; - max?: number | string | undefined; - media?: string | undefined; - method?: string | undefined; - min?: number | string | undefined; - name?: string | undefined; - style?: CSSProperties | undefined; - target?: string | undefined; - type?: string | undefined; - width?: number | string | undefined; - - // Other HTML properties supported by SVG elements in browsers - role?: AriaRole | undefined; - tabIndex?: number | undefined; - crossOrigin?: CrossOrigin; - - // SVG Specific attributes - accentHeight?: number | string | undefined; - accumulate?: 'none' | 'sum' | undefined; - additive?: 'replace' | 'sum' | undefined; - alignmentBaseline?: - | 'auto' - | 'baseline' - | 'before-edge' - | 'text-before-edge' - | 'middle' - | 'central' - | 'after-edge' - | 'text-after-edge' - | 'ideographic' - | 'alphabetic' - | 'hanging' - | 'mathematical' - | 'inherit' - | undefined; - allowReorder?: 'no' | 'yes' | undefined; - alphabetic?: number | string | undefined; - amplitude?: number | string | undefined; - arabicForm?: 'initial' | 'medial' | 'terminal' | 'isolated' | undefined; - ascent?: number | string | undefined; - attributeName?: string | undefined; - attributeType?: string | undefined; - autoReverse?: Booleanish | undefined; - azimuth?: number | string | undefined; - baseFrequency?: number | string | undefined; - baselineShift?: number | string | undefined; - baseProfile?: number | string | undefined; - bbox?: number | string | undefined; - begin?: number | string | undefined; - bias?: number | string | undefined; - by?: number | string | undefined; - calcMode?: number | string | undefined; - capHeight?: number | string | undefined; - clip?: number | string | undefined; - clipPath?: string | undefined; - clipPathUnits?: number | string | undefined; - clipRule?: number | string | undefined; - colorInterpolation?: number | string | undefined; - colorInterpolationFilters?: - | 'auto' - | 'sRGB' - | 'linearRGB' - | 'inherit' - | undefined; - colorProfile?: number | string | undefined; - colorRendering?: number | string | undefined; - contentScriptType?: number | string | undefined; - contentStyleType?: number | string | undefined; - cursor?: number | string | undefined; - cx?: number | string | undefined; - cy?: number | string | undefined; - d?: string | undefined; - decelerate?: number | string | undefined; - descent?: number | string | undefined; - diffuseConstant?: number | string | undefined; - direction?: number | string | undefined; - display?: number | string | undefined; - divisor?: number | string | undefined; - dominantBaseline?: number | string | undefined; - dur?: number | string | undefined; - dx?: number | string | undefined; - dy?: number | string | undefined; - edgeMode?: number | string | undefined; - elevation?: number | string | undefined; - enableBackground?: number | string | undefined; - end?: number | string | undefined; - exponent?: number | string | undefined; - externalResourcesRequired?: Booleanish | undefined; - fill?: string | undefined; - fillOpacity?: number | string | undefined; - fillRule?: 'nonzero' | 'evenodd' | 'inherit' | undefined; - filter?: string | undefined; - filterRes?: number | string | undefined; - filterUnits?: number | string | undefined; - floodColor?: number | string | undefined; - floodOpacity?: number | string | undefined; - focusable?: Booleanish | 'auto' | undefined; - fontFamily?: string | undefined; - fontSize?: number | string | undefined; - fontSizeAdjust?: number | string | undefined; - fontStretch?: number | string | undefined; - fontStyle?: number | string | undefined; - fontVariant?: number | string | undefined; - fontWeight?: number | string | undefined; - format?: number | string | undefined; - fr?: number | string | undefined; - from?: number | string | undefined; - fx?: number | string | undefined; - fy?: number | string | undefined; - g1?: number | string | undefined; - g2?: number | string | undefined; - glyphName?: number | string | undefined; - glyphOrientationHorizontal?: number | string | undefined; - glyphOrientationVertical?: number | string | undefined; - glyphRef?: number | string | undefined; - gradientTransform?: string | undefined; - gradientUnits?: string | undefined; - hanging?: number | string | undefined; - horizAdvX?: number | string | undefined; - horizOriginX?: number | string | undefined; - href?: string | undefined; - ideographic?: number | string | undefined; - imageRendering?: number | string | undefined; - in2?: number | string | undefined; - in?: string | undefined; - intercept?: number | string | undefined; - k1?: number | string | undefined; - k2?: number | string | undefined; - k3?: number | string | undefined; - k4?: number | string | undefined; - k?: number | string | undefined; - kernelMatrix?: number | string | undefined; - kernelUnitLength?: number | string | undefined; - kerning?: number | string | undefined; - keyPoints?: number | string | undefined; - keySplines?: number | string | undefined; - keyTimes?: number | string | undefined; - lengthAdjust?: number | string | undefined; - letterSpacing?: number | string | undefined; - lightingColor?: number | string | undefined; - limitingConeAngle?: number | string | undefined; - local?: number | string | undefined; - markerEnd?: string | undefined; - markerHeight?: number | string | undefined; - markerMid?: string | undefined; - markerStart?: string | undefined; - markerUnits?: number | string | undefined; - markerWidth?: number | string | undefined; - mask?: string | undefined; - maskContentUnits?: number | string | undefined; - maskUnits?: number | string | undefined; - mathematical?: number | string | undefined; - mode?: number | string | undefined; - numOctaves?: number | string | undefined; - offset?: number | string | undefined; - opacity?: number | string | undefined; - operator?: number | string | undefined; - order?: number | string | undefined; - orient?: number | string | undefined; - orientation?: number | string | undefined; - origin?: number | string | undefined; - overflow?: number | string | undefined; - overlinePosition?: number | string | undefined; - overlineThickness?: number | string | undefined; - paintOrder?: number | string | undefined; - panose1?: number | string | undefined; - path?: string | undefined; - pathLength?: number | string | undefined; - patternContentUnits?: string | undefined; - patternTransform?: number | string | undefined; - patternUnits?: string | undefined; - pointerEvents?: number | string | undefined; - points?: string | undefined; - pointsAtX?: number | string | undefined; - pointsAtY?: number | string | undefined; - pointsAtZ?: number | string | undefined; - preserveAlpha?: Booleanish | undefined; - preserveAspectRatio?: string | undefined; - primitiveUnits?: number | string | undefined; - r?: number | string | undefined; - radius?: number | string | undefined; - refX?: number | string | undefined; - refY?: number | string | undefined; - renderingIntent?: number | string | undefined; - repeatCount?: number | string | undefined; - repeatDur?: number | string | undefined; - requiredExtensions?: number | string | undefined; - requiredFeatures?: number | string | undefined; - restart?: number | string | undefined; - result?: string | undefined; - rotate?: number | string | undefined; - rx?: number | string | undefined; - ry?: number | string | undefined; - scale?: number | string | undefined; - seed?: number | string | undefined; - shapeRendering?: number | string | undefined; - slope?: number | string | undefined; - spacing?: number | string | undefined; - specularConstant?: number | string | undefined; - specularExponent?: number | string | undefined; - speed?: number | string | undefined; - spreadMethod?: string | undefined; - startOffset?: number | string | undefined; - stdDeviation?: number | string | undefined; - stemh?: number | string | undefined; - stemv?: number | string | undefined; - stitchTiles?: number | string | undefined; - stopColor?: string | undefined; - stopOpacity?: number | string | undefined; - strikethroughPosition?: number | string | undefined; - strikethroughThickness?: number | string | undefined; - string?: number | string | undefined; - stroke?: string | undefined; - strokeDasharray?: string | number | undefined; - strokeDashoffset?: string | number | undefined; - strokeLinecap?: 'butt' | 'round' | 'square' | 'inherit' | undefined; - strokeLinejoin?: 'miter' | 'round' | 'bevel' | 'inherit' | undefined; - strokeMiterlimit?: number | string | undefined; - strokeOpacity?: number | string | undefined; - strokeWidth?: number | string | undefined; - surfaceScale?: number | string | undefined; - systemLanguage?: number | string | undefined; - tableValues?: number | string | undefined; - targetX?: number | string | undefined; - targetY?: number | string | undefined; - textAnchor?: string | undefined; - textDecoration?: number | string | undefined; - textLength?: number | string | undefined; - textRendering?: number | string | undefined; - to?: number | string | undefined; - transform?: string | undefined; - u1?: number | string | undefined; - u2?: number | string | undefined; - underlinePosition?: number | string | undefined; - underlineThickness?: number | string | undefined; - unicode?: number | string | undefined; - unicodeBidi?: number | string | undefined; - unicodeRange?: number | string | undefined; - unitsPerEm?: number | string | undefined; - vAlphabetic?: number | string | undefined; - values?: string | undefined; - vectorEffect?: number | string | undefined; - version?: string | undefined; - vertAdvY?: number | string | undefined; - vertOriginX?: number | string | undefined; - vertOriginY?: number | string | undefined; - vHanging?: number | string | undefined; - vIdeographic?: number | string | undefined; - viewBox?: string | undefined; - viewTarget?: number | string | undefined; - visibility?: number | string | undefined; - vMathematical?: number | string | undefined; - widths?: number | string | undefined; - wordSpacing?: number | string | undefined; - writingMode?: number | string | undefined; - x1?: number | string | undefined; - x2?: number | string | undefined; - x?: number | string | undefined; - xChannelSelector?: string | undefined; - xHeight?: number | string | undefined; - xlinkActuate?: string | undefined; - xlinkArcrole?: string | undefined; - xlinkHref?: string | undefined; - xlinkRole?: string | undefined; - xlinkShow?: string | undefined; - xlinkTitle?: string | undefined; - xlinkType?: string | undefined; - xmlBase?: string | undefined; - xmlLang?: string | undefined; - xmlns?: string | undefined; - xmlnsXlink?: string | undefined; - xmlSpace?: string | undefined; - y1?: number | string | undefined; - y2?: number | string | undefined; - y?: number | string | undefined; - yChannelSelector?: string | undefined; - z?: number | string | undefined; - zoomAndPan?: string | undefined; - } - interface WebViewHTMLAttributes extends HTMLAttributes { allowFullScreen?: boolean | undefined; allowpopups?: boolean | undefined; @@ -862,64 +567,6 @@ declare namespace React { webpreferences?: string | undefined; } - interface ReactSVG { - animate: SVGFactory; - circle: SVGFactory; - clipPath: SVGFactory; - defs: SVGFactory; - desc: SVGFactory; - ellipse: SVGFactory; - feBlend: SVGFactory; - feColorMatrix: SVGFactory; - feComponentTransfer: SVGFactory; - feComposite: SVGFactory; - feConvolveMatrix: SVGFactory; - feDiffuseLighting: SVGFactory; - feDisplacementMap: SVGFactory; - feDistantLight: SVGFactory; - feDropShadow: SVGFactory; - feFlood: SVGFactory; - feFuncA: SVGFactory; - feFuncB: SVGFactory; - feFuncG: SVGFactory; - feFuncR: SVGFactory; - feGaussianBlur: SVGFactory; - feImage: SVGFactory; - feMerge: SVGFactory; - feMergeNode: SVGFactory; - feMorphology: SVGFactory; - feOffset: SVGFactory; - fePointLight: SVGFactory; - feSpecularLighting: SVGFactory; - feSpotLight: SVGFactory; - feTile: SVGFactory; - feTurbulence: SVGFactory; - filter: SVGFactory; - foreignObject: SVGFactory; - g: SVGFactory; - image: SVGFactory; - line: SVGFactory; - linearGradient: SVGFactory; - marker: SVGFactory; - mask: SVGFactory; - metadata: SVGFactory; - path: SVGFactory; - pattern: SVGFactory; - polygon: SVGFactory; - polyline: SVGFactory; - radialGradient: SVGFactory; - rect: SVGFactory; - stop: SVGFactory; - svg: SVGFactory; - switch: SVGFactory; - symbol: SVGFactory; - text: SVGFactory; - textPath: SVGFactory; - tspan: SVGFactory; - use: SVGFactory; - view: SVGFactory; - } - // Events export import TargetedEvent = JSXInternal.TargetedEvent; export import ChangeEvent = JSXInternal.TargetedEvent; From 1cc0de207fd65b776f3443f8874d033dcd47832c Mon Sep 17 00:00:00 2001 From: Samsam Ahmadi Date: Wed, 16 Aug 2023 20:49:11 +0200 Subject: [PATCH 3/5] extract the svg types and reexport them --- compat/src/index.d.ts | 4 ++ src/jsx.d.ts | 125 +++++++++++++++++++++--------------------- 2 files changed, 67 insertions(+), 62 deletions(-) diff --git a/compat/src/index.d.ts b/compat/src/index.d.ts index 40d5bcab64..94aaa1fc4b 100644 --- a/compat/src/index.d.ts +++ b/compat/src/index.d.ts @@ -76,6 +76,10 @@ declare namespace React { extends JSXInternal.SVGAttributes, preact.ClassAttributes {} + interface SVGAttributes extends JSXInternal.SVGAttributes {} + + interface ReactSVG extends JSXInternal.SVGElements {} + type HTMLAttributeReferrerPolicy = | '' | 'no-referrer' diff --git a/src/jsx.d.ts b/src/jsx.d.ts index feeed9486d..a09d7d4f25 100644 --- a/src/jsx.d.ts +++ b/src/jsx.d.ts @@ -2021,7 +2021,69 @@ export namespace JSXInternal { | SignalLike; } - export interface IntrinsicElements { + export interface SVGElements { + svg: SVGAttributes; + animate: SVGAttributes; + circle: SVGAttributes; + animateMotion: SVGAttributes; + animateTransform: SVGAttributes; + clipPath: SVGAttributes; + defs: SVGAttributes; + desc: SVGAttributes; + ellipse: SVGAttributes; + feBlend: SVGAttributes; + feColorMatrix: SVGAttributes; + feComponentTransfer: SVGAttributes; + feComposite: SVGAttributes; + feConvolveMatrix: SVGAttributes; + feDiffuseLighting: SVGAttributes; + feDisplacementMap: SVGAttributes; + feDistantLight: SVGAttributes; + feDropShadow: SVGAttributes; + feFlood: SVGAttributes; + feFuncA: SVGAttributes; + feFuncB: SVGAttributes; + feFuncG: SVGAttributes; + feFuncR: SVGAttributes; + feGaussianBlur: SVGAttributes; + feImage: SVGAttributes; + feMerge: SVGAttributes; + feMergeNode: SVGAttributes; + feMorphology: SVGAttributes; + feOffset: SVGAttributes; + fePointLight: SVGAttributes; + feSpecularLighting: SVGAttributes; + feSpotLight: SVGAttributes; + feTile: SVGAttributes; + feTurbulence: SVGAttributes; + filter: SVGAttributes; + foreignObject: SVGAttributes; + g: SVGAttributes; + image: SVGAttributes; + line: SVGAttributes; + linearGradient: SVGAttributes; + marker: SVGAttributes; + mask: SVGAttributes; + metadata: SVGAttributes; + mpath: SVGAttributes; + path: SVGAttributes; + pattern: SVGAttributes; + polygon: SVGAttributes; + polyline: SVGAttributes; + radialGradient: SVGAttributes; + rect: SVGAttributes; + set: SVGAttributes; + stop: SVGAttributes; + switch: SVGAttributes; + symbol: SVGAttributes; + text: SVGAttributes; + textPath: SVGAttributes; + tspan: SVGAttributes; + use: SVGAttributes; + view: SVGAttributes; + } + + export interface IntrinsicElements extends SVGElements { // HTML a: HTMLAttributes; abbr: HTMLAttributes; @@ -2139,66 +2201,5 @@ export namespace JSXInternal { var: HTMLAttributes; video: HTMLAttributes; wbr: HTMLAttributes; - - //SVG - svg: SVGAttributes; - animate: SVGAttributes; - circle: SVGAttributes; - animateMotion: SVGAttributes; - animateTransform: SVGAttributes; - clipPath: SVGAttributes; - defs: SVGAttributes; - desc: SVGAttributes; - ellipse: SVGAttributes; - feBlend: SVGAttributes; - feColorMatrix: SVGAttributes; - feComponentTransfer: SVGAttributes; - feComposite: SVGAttributes; - feConvolveMatrix: SVGAttributes; - feDiffuseLighting: SVGAttributes; - feDisplacementMap: SVGAttributes; - feDistantLight: SVGAttributes; - feDropShadow: SVGAttributes; - feFlood: SVGAttributes; - feFuncA: SVGAttributes; - feFuncB: SVGAttributes; - feFuncG: SVGAttributes; - feFuncR: SVGAttributes; - feGaussianBlur: SVGAttributes; - feImage: SVGAttributes; - feMerge: SVGAttributes; - feMergeNode: SVGAttributes; - feMorphology: SVGAttributes; - feOffset: SVGAttributes; - fePointLight: SVGAttributes; - feSpecularLighting: SVGAttributes; - feSpotLight: SVGAttributes; - feTile: SVGAttributes; - feTurbulence: SVGAttributes; - filter: SVGAttributes; - foreignObject: SVGAttributes; - g: SVGAttributes; - image: SVGAttributes; - line: SVGAttributes; - linearGradient: SVGAttributes; - marker: SVGAttributes; - mask: SVGAttributes; - metadata: SVGAttributes; - mpath: SVGAttributes; - path: SVGAttributes; - pattern: SVGAttributes; - polygon: SVGAttributes; - polyline: SVGAttributes; - radialGradient: SVGAttributes; - rect: SVGAttributes; - set: SVGAttributes; - stop: SVGAttributes; - switch: SVGAttributes; - symbol: SVGAttributes; - text: SVGAttributes; - textPath: SVGAttributes; - tspan: SVGAttributes; - use: SVGAttributes; - view: SVGAttributes; } } From f5840a6f1ea4c8926e13d36485d4c5faa1f94d51 Mon Sep 17 00:00:00 2001 From: Samsam Ahmadi Date: Thu, 17 Aug 2023 10:24:49 +0200 Subject: [PATCH 4/5] fix: update the name of type --- compat/src/index.d.ts | 2 +- src/jsx.d.ts | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/compat/src/index.d.ts b/compat/src/index.d.ts index 94aaa1fc4b..73a48973fe 100644 --- a/compat/src/index.d.ts +++ b/compat/src/index.d.ts @@ -78,7 +78,7 @@ declare namespace React { interface SVGAttributes extends JSXInternal.SVGAttributes {} - interface ReactSVG extends JSXInternal.SVGElements {} + interface ReactSVG extends JSXInternal.IntrinsicSVGElements {} type HTMLAttributeReferrerPolicy = | '' diff --git a/src/jsx.d.ts b/src/jsx.d.ts index a09d7d4f25..898bdd9f7d 100644 --- a/src/jsx.d.ts +++ b/src/jsx.d.ts @@ -2021,7 +2021,7 @@ export namespace JSXInternal { | SignalLike; } - export interface SVGElements { + export interface IntrinsicSVGElements { svg: SVGAttributes; animate: SVGAttributes; circle: SVGAttributes; @@ -2083,7 +2083,7 @@ export namespace JSXInternal { view: SVGAttributes; } - export interface IntrinsicElements extends SVGElements { + export interface IntrinsicElements extends IntrinsicSVGElements { // HTML a: HTMLAttributes; abbr: HTMLAttributes; From 146de2dac588f85c9596541ab2b2f8343815c7a5 Mon Sep 17 00:00:00 2001 From: Ryan Christian Date: Mon, 1 Jul 2024 14:48:42 -0500 Subject: [PATCH 5/5] chore: Wrap attributes in `Signalish<>` --- compat/src/index.d.ts | 751 +++++++++++++++++++++++------------------- 1 file changed, 403 insertions(+), 348 deletions(-) diff --git a/compat/src/index.d.ts b/compat/src/index.d.ts index ec7cade3f1..d9656f95a6 100644 --- a/compat/src/index.d.ts +++ b/compat/src/index.d.ts @@ -4,6 +4,14 @@ import { JSXInternal } from '../../src/jsx'; import * as _Suspense from './suspense'; import * as _SuspenseList from './suspense-list'; +interface SignalLike { + value: T; + peek(): T; + subscribe(fn: (value: T) => void): () => void; +} + +type Signalish = T | SignalLike; + // export default React; export = React; export as namespace React; @@ -104,155 +112,173 @@ declare namespace React { | '_top' | (string & {}); - interface AnchorHTMLAttributes extends HTMLAttributes { - download?: any; - href?: string | undefined; - hrefLang?: string | undefined; - media?: string | undefined; - ping?: string | undefined; - target?: HTMLAttributeAnchorTarget | undefined; - type?: string | undefined; - referrerPolicy?: HTMLAttributeReferrerPolicy | undefined; + interface AnchorHTMLAttributes + extends HTMLAttributes { + download?: Signalish; + href?: Signalish; + hrefLang?: Signalish; + media?: Signalish; + ping?: Signalish; + target?: Signalish; + type?: Signalish; + referrerPolicy?: Signalish; } - interface AudioHTMLAttributes extends MediaHTMLAttributes {} + interface AudioHTMLAttributes + extends MediaHTMLAttributes {} - interface AreaHTMLAttributes extends HTMLAttributes { - alt?: string | undefined; - coords?: string | undefined; - download?: any; - href?: string | undefined; - hrefLang?: string | undefined; - media?: string | undefined; - referrerPolicy?: HTMLAttributeReferrerPolicy | undefined; - shape?: string | undefined; - target?: string | undefined; + interface AreaHTMLAttributes + extends HTMLAttributes { + alt?: Signalish; + coords?: Signalish; + download?: Signalish; + href?: Signalish; + hrefLang?: Signalish; + media?: Signalish; + referrerPolicy?: Signalish; + shape?: Signalish; + target?: Signalish; } - interface BaseHTMLAttributes extends HTMLAttributes { - href?: string | undefined; - target?: string | undefined; + interface BaseHTMLAttributes + extends HTMLAttributes { + href?: Signalish; + target?: Signalish; } - interface BlockquoteHTMLAttributes extends HTMLAttributes { - cite?: string | undefined; + interface BlockquoteHTMLAttributes + extends HTMLAttributes { + cite?: Signalish; } - interface ButtonHTMLAttributes extends HTMLAttributes { - disabled?: boolean | undefined; - form?: string | undefined; - formAction?: string | undefined; - formEncType?: string | undefined; - formMethod?: string | undefined; - formNoValidate?: boolean | undefined; - formTarget?: string | undefined; - name?: string | undefined; - type?: 'submit' | 'reset' | 'button' | undefined; - value?: string | ReadonlyArray | number | undefined; + interface ButtonHTMLAttributes + extends HTMLAttributes { + disabled?: Signalish; + form?: Signalish; + formAction?: Signalish; + formEncType?: Signalish; + formMethod?: Signalish; + formNoValidate?: Signalish; + formTarget?: Signalish; + name?: Signalish; + type?: Signalish<'submit' | 'reset' | 'button' | undefined>; + value?: Signalish; } - interface CanvasHTMLAttributes extends HTMLAttributes { - height?: number | string | undefined; - width?: number | string | undefined; + interface CanvasHTMLAttributes + extends HTMLAttributes { + height?: Signalish; + width?: Signalish; } - interface ColHTMLAttributes extends HTMLAttributes { - span?: number | undefined; - width?: number | string | undefined; + interface ColHTMLAttributes extends HTMLAttributes { + span?: Signalish; + width?: Signalish; } - interface ColgroupHTMLAttributes extends HTMLAttributes { - span?: number | undefined; + interface ColgroupHTMLAttributes + extends HTMLAttributes { + span?: Signalish; } - interface DataHTMLAttributes extends HTMLAttributes { - value?: string | ReadonlyArray | number | undefined; + interface DataHTMLAttributes + extends HTMLAttributes { + value?: Signalish; } - interface DetailsHTMLAttributes extends HTMLAttributes { - open?: boolean | undefined; - onToggle?: ReactEventHandler | undefined; + interface DetailsHTMLAttributes + extends HTMLAttributes { + open?: Signalish; + onToggle?: ChangeEventHandler | undefined; } - interface DelHTMLAttributes extends HTMLAttributes { - cite?: string | undefined; - dateTime?: string | undefined; + interface DelHTMLAttributes extends HTMLAttributes { + cite?: Signalish; + dateTime?: Signalish; } - interface DialogHTMLAttributes extends HTMLAttributes { - onCancel?: ReactEventHandler | undefined; - onClose?: ReactEventHandler | undefined; - open?: boolean | undefined; + interface DialogHTMLAttributes + extends HTMLAttributes { + onCancel?: ChangeEventHandler | undefined; + onClose?: ChangeEventHandler | undefined; + open?: Signalish; } - interface EmbedHTMLAttributes extends HTMLAttributes { - height?: number | string | undefined; - src?: string | undefined; - type?: string | undefined; - width?: number | string | undefined; + interface EmbedHTMLAttributes + extends HTMLAttributes { + height?: Signalish; + src?: Signalish; + type?: Signalish; + width?: Signalish; } - interface FieldsetHTMLAttributes extends HTMLAttributes { - disabled?: boolean | undefined; - form?: string | undefined; - name?: string | undefined; + interface FieldsetHTMLAttributes + extends HTMLAttributes { + disabled?: Signalish; + form?: Signalish; + name?: Signalish; } - interface FormHTMLAttributes extends HTMLAttributes { - acceptCharset?: string | undefined; - action?: string | undefined; - autoComplete?: string | undefined; - encType?: string | undefined; - method?: string | undefined; - name?: string | undefined; - noValidate?: boolean | undefined; - target?: string | undefined; + interface FormHTMLAttributes + extends HTMLAttributes { + acceptCharset?: Signalish; + action?: Signalish; + autoComplete?: Signalish; + encType?: Signalish; + method?: Signalish; + name?: Signalish; + noValidate?: Signalish; + target?: Signalish; } - interface HtmlHTMLAttributes extends HTMLAttributes { - manifest?: string | undefined; + interface HtmlHTMLAttributes + extends HTMLAttributes { + manifest?: Signalish; } - interface IframeHTMLAttributes extends HTMLAttributes { - allow?: string | undefined; - allowFullScreen?: boolean | undefined; - allowTransparency?: boolean | undefined; + interface IframeHTMLAttributes + extends HTMLAttributes { + allow?: Signalish; + allowFullScreen?: Signalish; + allowTransparency?: Signalish; /** @deprecated */ - frameBorder?: number | string | undefined; - height?: number | string | undefined; + frameBorder?: Signalish; + height?: Signalish; loading?: 'eager' | 'lazy' | undefined; /** @deprecated */ - marginHeight?: number | undefined; + marginHeight?: Signalish; /** @deprecated */ - marginWidth?: number | undefined; - name?: string | undefined; - referrerPolicy?: HTMLAttributeReferrerPolicy | undefined; - sandbox?: string | undefined; + marginWidth?: Signalish; + name?: Signalish; + referrerPolicy?: Signalish; + sandbox?: Signalish; /** @deprecated */ - scrolling?: string | undefined; - seamless?: boolean | undefined; - src?: string | undefined; - srcDoc?: string | undefined; - width?: number | string | undefined; - } - - interface ImgHTMLAttributes extends HTMLAttributes { - alt?: string | undefined; - crossOrigin?: CrossOrigin; - decoding?: 'async' | 'auto' | 'sync' | undefined; - height?: number | string | undefined; - loading?: 'eager' | 'lazy' | undefined; - referrerPolicy?: HTMLAttributeReferrerPolicy | undefined; - sizes?: string | undefined; - src?: string | undefined; - srcSet?: string | undefined; - useMap?: string | undefined; - width?: number | string | undefined; + scrolling?: Signalish; + seamless?: Signalish; + src?: Signalish; + srcDoc?: Signalish; + width?: Signalish; + } + + type HTMLAttributeCrossOrigin = 'anonymous' | 'use-credentials'; + + interface ImgHTMLAttributes extends HTMLAttributes { + alt?: Signalish; + crossOrigin?: Signalish; + decoding?: Signalish<'async' | 'auto' | 'sync' | undefined>; + height?: Signalish; + loading?: Signalish<'eager' | 'lazy' | undefined>; + referrerPolicy?: Signalish; + sizes?: Signalish; + src?: Signalish; + srcSet?: Signalish; + useMap?: Signalish; + width?: Signalish; } - interface InsHTMLAttributes extends HTMLAttributes { - cite?: string | undefined; - dateTime?: string | undefined; + interface InsHTMLAttributes extends HTMLAttributes { + cite?: Signalish; + dateTime?: Signalish; } type HTMLInputTypeAttribute = @@ -280,14 +306,15 @@ declare namespace React { | 'week' | (string & {}); - interface InputHTMLAttributes extends HTMLAttributes { - accept?: string | undefined; - alt?: string | undefined; - autoComplete?: string | undefined; - capture?: boolean | 'user' | 'environment' | undefined; // https://www.w3.org/TR/html-media-capture/#the-capture-attribute - checked?: boolean | undefined; - disabled?: boolean | undefined; - enterKeyHint?: + interface InputHTMLAttributes + extends HTMLAttributes { + accept?: Signalish; + alt?: Signalish; + autoComplete?: Signalish; + capture?: Signalish<'user' | 'environment' | undefined>; // https://www.w3.org/TR/html-media-capture/#the-capture-attribute + checked?: Signalish; + disabled?: Signalish; + enterKeyHint?: Signalish< | 'enter' | 'done' | 'go' @@ -295,286 +322,314 @@ declare namespace React { | 'previous' | 'search' | 'send' - | undefined; - form?: string | undefined; - formAction?: string | undefined; - formEncType?: string | undefined; - formMethod?: string | undefined; - formNoValidate?: boolean | undefined; - formTarget?: string | undefined; - height?: number | string | undefined; - list?: string | undefined; - max?: number | string | undefined; - maxLength?: number | undefined; - min?: number | string | undefined; - minLength?: number | undefined; - multiple?: boolean | undefined; - name?: string | undefined; - pattern?: string | undefined; - placeholder?: string | undefined; - readOnly?: boolean | undefined; - required?: boolean | undefined; - size?: number | undefined; - src?: string | undefined; - step?: number | string | undefined; + | undefined + >; + form?: Signalish; + formAction?: Signalish; + formEncType?: Signalish; + formMethod?: Signalish; + formNoValidate?: Signalish; + formTarget?: Signalish; + height?: Signalish; + list?: Signalish; + max?: Signalish; + maxLength?: Signalish; + min?: Signalish; + minLength?: Signalish; + multiple?: Signalish; + name?: Signalish; + pattern?: Signalish; + placeholder?: Signalish; + readOnly?: Signalish; + required?: Signalish; + size?: Signalish; + src?: Signalish; + step?: Signalish; type?: HTMLInputTypeAttribute | undefined; - value?: string | ReadonlyArray | number | undefined; - width?: number | string | undefined; - + value?: Signalish; + width?: Signalish; onChange?: ChangeEventHandler | undefined; } - interface KeygenHTMLAttributes extends HTMLAttributes { - challenge?: string | undefined; - disabled?: boolean | undefined; - form?: string | undefined; - keyType?: string | undefined; - keyParams?: string | undefined; - name?: string | undefined; + interface KeygenHTMLAttributes + extends HTMLAttributes { + challenge?: Signalish; + disabled?: Signalish; + form?: Signalish; + keyType?: Signalish; + keyParams?: Signalish; + name?: Signalish; } - interface LabelHTMLAttributes extends HTMLAttributes { - form?: string | undefined; - htmlFor?: string | undefined; + interface LabelHTMLAttributes + extends HTMLAttributes { + form?: Signalish; + htmlFor?: Signalish; } - interface LiHTMLAttributes extends HTMLAttributes { - value?: string | ReadonlyArray | number | undefined; + interface LiHTMLAttributes extends HTMLAttributes { + value?: Signalish; } - interface LinkHTMLAttributes extends HTMLAttributes { - as?: string | undefined; - crossOrigin?: CrossOrigin; - fetchPriority?: 'high' | 'low' | 'auto'; - href?: string | undefined; - hrefLang?: string | undefined; - integrity?: string | undefined; - media?: string | undefined; - imageSrcSet?: string | undefined; + interface LinkHTMLAttributes + extends HTMLAttributes { + as?: Signalish; + crossOrigin?: Signalish; + fetchPriority?: Signalish<'high' | 'low' | 'auto'>; + href?: Signalish; + hrefLang?: Signalish; + integrity?: Signalish; + media?: Signalish; + imageSrcSet?: Signalish; referrerPolicy?: HTMLAttributeReferrerPolicy | undefined; - sizes?: string | undefined; - type?: string | undefined; - charSet?: string | undefined; + sizes?: Signalish; + type?: Signalish; + charSet?: Signalish; } - interface MapHTMLAttributes extends HTMLAttributes { - name?: string | undefined; + interface MapHTMLAttributes extends HTMLAttributes { + name?: Signalish; } - interface MenuHTMLAttributes extends HTMLAttributes { - type?: string | undefined; + interface MenuHTMLAttributes + extends HTMLAttributes { + type?: Signalish; } - interface MediaHTMLAttributes extends HTMLAttributes { - autoPlay?: boolean | undefined; - controls?: boolean | undefined; - controlsList?: string | undefined; - crossOrigin?: CrossOrigin; - loop?: boolean | undefined; - mediaGroup?: string | undefined; - muted?: boolean | undefined; - playsInline?: boolean | undefined; - preload?: string | undefined; - src?: string | undefined; + interface MediaHTMLAttributes + extends HTMLAttributes { + autoPlay?: Signalish; + controls?: Signalish; + controlsList?: Signalish; + crossOrigin?: Signalish; + loop?: Signalish; + mediaGroup?: Signalish; + muted?: Signalish; + playsInline?: Signalish; + preload?: Signalish; + src?: Signalish; } - interface MetaHTMLAttributes extends HTMLAttributes { - charSet?: string | undefined; - httpEquiv?: string | undefined; - name?: string | undefined; - media?: string | undefined; + interface MetaHTMLAttributes + extends HTMLAttributes { + charSet?: Signalish; + httpEquiv?: Signalish; + name?: Signalish; + media?: Signalish; } - interface MeterHTMLAttributes extends HTMLAttributes { - form?: string | undefined; - high?: number | undefined; - low?: number | undefined; - max?: number | string | undefined; - min?: number | string | undefined; - optimum?: number | undefined; - value?: string | ReadonlyArray | number | undefined; + interface MeterHTMLAttributes + extends HTMLAttributes { + form?: Signalish; + high?: Signalish; + low?: Signalish; + max?: Signalish; + min?: Signalish; + optimum?: Signalish; + value?: Signalish; } - interface QuoteHTMLAttributes extends HTMLAttributes { - cite?: string | undefined; + interface QuoteHTMLAttributes + extends HTMLAttributes { + cite?: Signalish; } - interface ObjectHTMLAttributes extends HTMLAttributes { - classID?: string | undefined; - data?: string | undefined; - form?: string | undefined; - height?: number | string | undefined; - name?: string | undefined; - type?: string | undefined; - useMap?: string | undefined; - width?: number | string | undefined; - wmode?: string | undefined; + interface ObjectHTMLAttributes + extends HTMLAttributes { + classID?: Signalish; + data?: Signalish; + form?: Signalish; + height?: Signalish; + name?: Signalish; + type?: Signalish; + useMap?: Signalish; + width?: Signalish; + wmode?: Signalish; } - interface OlHTMLAttributes extends HTMLAttributes { - reversed?: boolean | undefined; - start?: number | undefined; - type?: '1' | 'a' | 'A' | 'i' | 'I' | undefined; + interface OlHTMLAttributes extends HTMLAttributes { + reversed?: Signalish; + start?: Signalish; + type?: Signalish<'1' | 'a' | 'A' | 'i' | 'I' | undefined>; } - interface OptgroupHTMLAttributes extends HTMLAttributes { - disabled?: boolean | undefined; - label?: string | undefined; + interface OptgroupHTMLAttributes + extends HTMLAttributes { + disabled?: Signalish; + label?: Signalish; } - interface OptionHTMLAttributes extends HTMLAttributes { - disabled?: boolean | undefined; - label?: string | undefined; - selected?: boolean | undefined; - value?: string | ReadonlyArray | number | undefined; + interface OptionHTMLAttributes + extends HTMLAttributes { + disabled?: Signalish; + label?: Signalish; + selected?: Signalish; + value?: Signalish; } - interface OutputHTMLAttributes extends HTMLAttributes { - form?: string | undefined; - htmlFor?: string | undefined; - name?: string | undefined; + interface OutputHTMLAttributes + extends HTMLAttributes { + form?: Signalish; + htmlFor?: Signalish; + name?: Signalish; } - interface ParamHTMLAttributes extends HTMLAttributes { - name?: string | undefined; - value?: string | ReadonlyArray | number | undefined; + interface ParamHTMLAttributes + extends HTMLAttributes { + name?: Signalish; + value?: Signalish; } - interface ProgressHTMLAttributes extends HTMLAttributes { - max?: number | string | undefined; - value?: string | ReadonlyArray | number | undefined; + interface ProgressHTMLAttributes + extends HTMLAttributes { + max?: Signalish; + value?: Signalish; } - interface SlotHTMLAttributes extends HTMLAttributes { - name?: string | undefined; + interface SlotHTMLAttributes + extends HTMLAttributes { + name?: Signalish; } - interface ScriptHTMLAttributes extends HTMLAttributes { - async?: boolean | undefined; + interface ScriptHTMLAttributes + extends HTMLAttributes { + async?: Signalish; /** @deprecated */ - charSet?: string | undefined; - crossOrigin?: CrossOrigin; - defer?: boolean | undefined; - integrity?: string | undefined; - noModule?: boolean | undefined; + charSet?: Signalish; + crossOrigin?: Signalish; + defer?: Signalish; + integrity?: Signalish; + noModule?: Signalish; referrerPolicy?: HTMLAttributeReferrerPolicy | undefined; - src?: string | undefined; - type?: string | undefined; - } - - interface SelectHTMLAttributes extends HTMLAttributes { - autoComplete?: string | undefined; - disabled?: boolean | undefined; - form?: string | undefined; - multiple?: boolean | undefined; - name?: string | undefined; - required?: boolean | undefined; - size?: number | undefined; - value?: string | ReadonlyArray | number | undefined; + src?: Signalish; + type?: Signalish; + } + + interface SelectHTMLAttributes + extends HTMLAttributes { + autoComplete?: Signalish; + disabled?: Signalish; + form?: Signalish; + multiple?: Signalish; + name?: Signalish; + required?: Signalish; + size?: Signalish; + value?: Signalish; onChange?: ChangeEventHandler | undefined; } - interface SourceHTMLAttributes extends HTMLAttributes { - height?: number | string | undefined; - media?: string | undefined; - sizes?: string | undefined; - src?: string | undefined; - srcSet?: string | undefined; - type?: string | undefined; - width?: number | string | undefined; - } - - interface StyleHTMLAttributes extends HTMLAttributes { - media?: string | undefined; - scoped?: boolean | undefined; - type?: string | undefined; - } - - interface TableHTMLAttributes extends HTMLAttributes { - cellPadding?: number | string | undefined; - cellSpacing?: number | string | undefined; - summary?: string | undefined; - width?: number | string | undefined; - } - - interface TextareaHTMLAttributes extends HTMLAttributes { - autoComplete?: string | undefined; - cols?: number | undefined; - dirName?: string | undefined; - disabled?: boolean | undefined; - form?: string | undefined; - maxLength?: number | undefined; - minLength?: number | undefined; - name?: string | undefined; - placeholder?: string | undefined; - readOnly?: boolean | undefined; - required?: boolean | undefined; - rows?: number | undefined; - value?: string | ReadonlyArray | number | undefined; - wrap?: string | undefined; - + interface SourceHTMLAttributes + extends HTMLAttributes { + height?: Signalish; + media?: Signalish; + sizes?: Signalish; + src?: Signalish; + srcSet?: Signalish; + type?: Signalish; + width?: Signalish; + } + + interface StyleHTMLAttributes + extends HTMLAttributes { + media?: Signalish; + scoped?: Signalish; + type?: Signalish; + } + + interface TableHTMLAttributes + extends HTMLAttributes { + cellPadding?: Signalish; + cellSpacing?: Signalish; + summary?: Signalish; + width?: Signalish; + } + + interface TextareaHTMLAttributes + extends HTMLAttributes { + autoComplete?: Signalish; + cols?: Signalish; + dirName?: Signalish; + disabled?: Signalish; + form?: Signalish; + maxLength?: Signalish; + minLength?: Signalish; + name?: Signalish; + placeholder?: Signalish; + readOnly?: Signalish; + required?: Signalish; + rows?: Signalish; + value?: Signalish; + wrap?: Signalish; onChange?: ChangeEventHandler | undefined; } - interface TdHTMLAttributes extends HTMLAttributes { - align?: 'left' | 'center' | 'right' | 'justify' | 'char' | undefined; - colSpan?: number | undefined; - headers?: string | undefined; - rowSpan?: number | undefined; - scope?: string | undefined; - abbr?: string | undefined; - height?: number | string | undefined; - width?: number | string | undefined; - valign?: 'top' | 'middle' | 'bottom' | 'baseline' | undefined; - } - - interface ThHTMLAttributes extends HTMLAttributes { - align?: 'left' | 'center' | 'right' | 'justify' | 'char' | undefined; - colSpan?: number | undefined; - headers?: string | undefined; - rowSpan?: number | undefined; - scope?: string | undefined; - abbr?: string | undefined; - } - - interface TimeHTMLAttributes extends HTMLAttributes { - dateTime?: string | undefined; - } - - interface TrackHTMLAttributes extends HTMLAttributes { - default?: boolean | undefined; - kind?: string | undefined; - label?: string | undefined; - src?: string | undefined; - srcLang?: string | undefined; - } - - interface VideoHTMLAttributes extends MediaHTMLAttributes { - height?: number | string | undefined; - playsInline?: boolean | undefined; - poster?: string | undefined; - width?: number | string | undefined; - disablePictureInPicture?: boolean | undefined; - disableRemotePlayback?: boolean | undefined; - } - - interface WebViewHTMLAttributes extends HTMLAttributes { - allowFullScreen?: boolean | undefined; - allowpopups?: boolean | undefined; - autosize?: boolean | undefined; - blinkfeatures?: string | undefined; - disableblinkfeatures?: string | undefined; - disableguestresize?: boolean | undefined; - disablewebsecurity?: boolean | undefined; - guestinstance?: string | undefined; - httpreferrer?: string | undefined; - nodeintegration?: boolean | undefined; - partition?: string | undefined; - plugins?: boolean | undefined; - preload?: string | undefined; - src?: string | undefined; - useragent?: string | undefined; - webpreferences?: string | undefined; + interface TdHTMLAttributes extends HTMLAttributes { + align?: Signalish< + 'left' | 'center' | 'right' | 'justify' | 'char' | undefined + >; + colSpan?: Signalish; + headers?: Signalish; + rowSpan?: Signalish; + scope?: Signalish; + abbr?: Signalish; + height?: Signalish; + width?: Signalish; + valign?: Signalish<'top' | 'middle' | 'bottom' | 'baseline' | undefined>; + } + + interface ThHTMLAttributes extends HTMLAttributes { + align?: Signalish< + 'left' | 'center' | 'right' | 'justify' | 'char' | undefined + >; + colSpan?: Signalish; + headers?: Signalish; + rowSpan?: Signalish; + scope?: Signalish; + abbr?: Signalish; + } + + interface TimeHTMLAttributes + extends HTMLAttributes { + dateTime?: Signalish; + } + + interface TrackHTMLAttributes + extends HTMLAttributes { + default?: Signalish; + kind?: Signalish; + label?: Signalish; + src?: Signalish; + srcLang?: Signalish; + } + + interface VideoHTMLAttributes + extends MediaHTMLAttributes { + height?: Signalish; + playsInline?: Signalish; + poster?: Signalish; + width?: Signalish; + disablePictureInPicture?: Signalish; + disableRemotePlayback?: Signalish; + } + + interface WebViewHTMLAttributes + extends HTMLAttributes { + allowFullScreen?: Signalish; + allowpopups?: Signalish; + autosize?: Signalish; + blinkfeatures?: Signalish; + disableblinkfeatures?: Signalish; + disableguestresize?: Signalish; + disablewebsecurity?: Signalish; + guestinstance?: Signalish; + httpreferrer?: Signalish; + nodeintegration?: Signalish; + partition?: Signalish; + plugins?: Signalish; + preload?: Signalish; + src?: Signalish; + useragent?: Signalish; + webpreferences?: Signalish; } // Events