From a24aee6125213ba20a5bda15a5d4fce8b60b2f57 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?St=C3=A9phane=20Goetz?= Date: Mon, 10 Jul 2017 22:43:07 +0200 Subject: [PATCH] Improve react typings for HTML attributes, fix tests in other libraries --- types/material-ui/index.d.ts | 9 +- types/react-dropzone/index.d.ts | 2 +- types/react-input-mask/index.d.ts | 2 +- types/react-router-dom/index.d.ts | 2 +- .../CustomLink.tsx | 1 + .../react-user-tour/react-user-tour-tests.tsx | 2 +- types/react/index.d.ts | 1078 +++++++++++------ types/reactstrap/lib/Input.d.ts | 2 +- types/reactstrap/lib/Label.d.ts | 2 +- 9 files changed, 744 insertions(+), 356 deletions(-) diff --git a/types/material-ui/index.d.ts b/types/material-ui/index.d.ts index d44911add5..ec7ad246b4 100644 --- a/types/material-ui/index.d.ts +++ b/types/material-ui/index.d.ts @@ -1128,6 +1128,7 @@ declare namespace __MaterialUI { secondaryText?: React.ReactNode; secondaryTextLines?: number; // 1 or 2 style?: React.CSSProperties; + value?: any; } export class ListItem extends React.Component { } @@ -1174,6 +1175,7 @@ declare namespace __MaterialUI { focusState?: string; // 'none', 'focused', or 'keyboard-focused' innerDivStyle?: React.CSSProperties; insetChildren?: boolean; + label?: string | React.ReactNode; leftIcon?: React.ReactElement; menuItems?: React.ReactNode; onTouchTap?: TouchTapEventHandler; @@ -1181,7 +1183,6 @@ declare namespace __MaterialUI { rightIcon?: React.ReactElement; secondaryText?: React.ReactNode; style?: React.CSSProperties; - value?: any; containerElement?: React.ReactNode | string; } export class MenuItem extends React.Component { @@ -1264,6 +1265,8 @@ declare namespace __MaterialUI { style?: React.CSSProperties; transitionEnabled?: boolean; zDepth?: number; + width?: number | string; + height?: number | string; } export class Paper extends React.Component { } @@ -1413,7 +1416,8 @@ declare namespace __MaterialUI { namespace Switches { // what's not commonly overridden by Checkbox, RadioButton, or Toggle - interface CommonEnhancedSwitchProps extends React.HTMLAttributes<{}>, React.Props { + interface CommonEnhancedSwitchProps extends React.InputHTMLAttributes<{}>, React.Props { + label?: React.ReactNode; } interface EnhancedSwitchProps extends CommonEnhancedSwitchProps { @@ -1427,7 +1431,6 @@ declare namespace __MaterialUI { id?: string; inputStyle: React.CSSProperties; inputType: string; - label?: string; labelPosition?: string; // oneOf(['left', 'right']) labelStyle?: React.CSSProperties; name?: string; diff --git a/types/react-dropzone/index.d.ts b/types/react-dropzone/index.d.ts index c47b64d9bc..cd07fd3341 100644 --- a/types/react-dropzone/index.d.ts +++ b/types/react-dropzone/index.d.ts @@ -28,7 +28,7 @@ declare module "react-dropzone" { disablePreview?: boolean; // Enable/disable preview generation disableClick?: boolean; // Disallow clicking on the dropzone container to open file dialog - inputProps?: React.ChangeTargetHTMLProps; // Pass additional attributes to the tag + inputProps?: React.InputHTMLAttributes; // Pass additional attributes to the tag multiple?: boolean; // Allow dropping multiple files accept?: string; // Allow specific types of files. See https://github.com/okonet/attr-accept for more information name?: string; // name attribute for the input tag diff --git a/types/react-input-mask/index.d.ts b/types/react-input-mask/index.d.ts index 4396198fde..a830650812 100644 --- a/types/react-input-mask/index.d.ts +++ b/types/react-input-mask/index.d.ts @@ -7,7 +7,7 @@ import * as React from "react"; declare namespace reactInputMask { - interface ReactInputMaskProps extends React.HTMLAttributes { + interface ReactInputMaskProps extends React.InputHTMLAttributes { /** * Mask string. Format characters are: * * `9`: `0-9` diff --git a/types/react-router-dom/index.d.ts b/types/react-router-dom/index.d.ts index 52ec2352f2..a70613fa81 100644 --- a/types/react-router-dom/index.d.ts +++ b/types/react-router-dom/index.d.ts @@ -39,7 +39,7 @@ declare module 'react-router-dom' { } class HashRouter extends React.Component {} - interface LinkProps extends React.HTMLAttributes { + interface LinkProps extends React.AnchorHTMLAttributes { to: H.LocationDescriptor; replace?: boolean; } diff --git a/types/react-router/test/examples-from-react-router-website/CustomLink.tsx b/types/react-router/test/examples-from-react-router-website/CustomLink.tsx index 4ec8be4c87..f3b1fb180e 100644 --- a/types/react-router/test/examples-from-react-router-website/CustomLink.tsx +++ b/types/react-router/test/examples-from-react-router-website/CustomLink.tsx @@ -20,6 +20,7 @@ const CustomLinkExample = () => ( interface OldSchoolMenuLinkProps extends LinkProps { activeOnlyWhenExact?: boolean; + label: string; } const OldSchoolMenuLink: React.SFC = ({ label, to, activeOnlyWhenExact }) => ( diff --git a/types/react-user-tour/react-user-tour-tests.tsx b/types/react-user-tour/react-user-tour-tests.tsx index c961ee5bbd..56e4e2c2ce 100644 --- a/types/react-user-tour/react-user-tour-tests.tsx +++ b/types/react-user-tour/react-user-tour-tests.tsx @@ -44,7 +44,7 @@ class TestApp extends React.Component<{}, State> { ]} />; - return
+ return
{Tour}
; } diff --git a/types/react/index.d.ts b/types/react/index.d.ts index df4a9f5374..537b6eefde 100644 --- a/types/react/index.d.ts +++ b/types/react/index.d.ts @@ -11,6 +11,7 @@ // Albert Kurniawan // Tanguy Krotoff // Dovydas Navickas +// Stéphane Goetz // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped // TypeScript Version: 2.3 @@ -76,7 +77,10 @@ declare namespace React { } // ReactHTML for ReactHTMLElement - interface ReactHTMLElement extends DOMElement, T> { + // tslint:disable-next-line:no-empty-interface + interface ReactHTMLElement extends DetailedReactHTMLElement, T> { } + + interface DetailedReactHTMLElement

, T extends HTMLElement> extends DOMElement { type: keyof ReactHTML; } @@ -102,12 +106,11 @@ declare namespace React { type DOMFactory

, T extends Element> = (props?: ClassAttributes & P | null, ...children: ReactNode[]) => DOMElement; - interface HTMLFactory extends DOMFactory, T> { - (props?: ClassAttributes & HTMLAttributes | null, ...children: ReactNode[]): ReactHTMLElement; - } + // tslint:disable-next-line:no-empty-interface + interface HTMLFactory extends DetailedHTMLFactory, T> {} - interface ChangeTargetHTMLFactory extends DOMFactory, T> { - (props?: ClassAttributes & ChangeTargetHTMLAttributes | null, ...children: ReactNode[]): ReactHTMLElement; + interface DetailedHTMLFactory

, T extends HTMLElement> extends DOMFactory { + (props?: ClassAttributes & P | null, ...children: ReactNode[]): DetailedReactHTMLElement; } interface SVGFactory extends DOMFactory, SVGElement> { @@ -152,7 +155,7 @@ declare namespace React { function createElement

, T extends HTMLElement>( type: keyof ReactHTML, props?: ClassAttributes & P, - ...children: ReactNode[]): ReactHTMLElement; + ...children: ReactNode[]): DetailedReactHTMLElement; function createElement

, T extends SVGElement>( type: keyof ReactSVG, props?: ClassAttributes & P, @@ -182,6 +185,11 @@ declare namespace React { // DOM Elements // ReactHTMLElement + function cloneElement

, T extends HTMLElement>( + element: DetailedReactHTMLElement, + props?: P, + ...children: ReactNode[]): DetailedReactHTMLElement; + // ReactHTMLElement, less specific function cloneElement

, T extends HTMLElement>( element: ReactHTMLElement, props?: P, @@ -511,11 +519,10 @@ declare namespace React { ref?: Ref; } - interface HTMLProps extends HTMLAttributes, ClassAttributes { + interface HTMLProps extends AllHTMLAttributes, ClassAttributes { } - interface ChangeTargetHTMLProps extends ChangeTargetHTMLAttributes, ClassAttributes { - } + type DetailedHTMLProps, T> = ClassAttributes & E; interface SVGProps extends SVGAttributes, ClassAttributes { } @@ -2327,129 +2334,28 @@ declare namespace React { suppressContentEditableWarning?: boolean; // Standard HTML Attributes - accept?: string; - acceptCharset?: string; accessKey?: string; - action?: string; - allowFullScreen?: boolean; - allowTransparency?: boolean; - alt?: string; - async?: boolean; - autoComplete?: string; - autoFocus?: boolean; - autoPlay?: boolean; - capture?: boolean; - cellPadding?: number | string; - cellSpacing?: number | string; - charSet?: string; - challenge?: string; - checked?: boolean; - cite?: string; - classID?: string; className?: string; - cols?: number; - colSpan?: number; - content?: string; contentEditable?: boolean; contextMenu?: string; - controls?: boolean; - coords?: string; - crossOrigin?: string; - data?: string; - dateTime?: string; - default?: boolean; - defer?: boolean; dir?: string; - disabled?: boolean; - download?: any; draggable?: boolean; - encType?: string; - form?: string; - formAction?: string; - formEncType?: string; - formMethod?: string; - formNoValidate?: boolean; - formTarget?: string; - frameBorder?: number | string; - headers?: string; - height?: number | string; hidden?: boolean; - high?: number; - href?: string; - hrefLang?: string; - htmlFor?: string; - httpEquiv?: string; id?: string; - inputMode?: string; - integrity?: string; - is?: string; - keyParams?: string; - keyType?: string; - kind?: string; - label?: string; lang?: string; - list?: string; - loop?: boolean; - low?: number; - manifest?: string; - marginHeight?: number; - marginWidth?: number; - max?: number | string; - maxLength?: number; - media?: string; - mediaGroup?: string; - method?: string; - min?: number | string; - minLength?: number; - multiple?: boolean; - muted?: boolean; - name?: string; - nonce?: string; - noValidate?: boolean; - open?: boolean; - optimum?: number; - pattern?: string; - placeholder?: string; - playsInline?: boolean; - poster?: string; - preload?: string; - radioGroup?: string; - readOnly?: boolean; - rel?: string; - required?: boolean; - reversed?: boolean; - role?: string; - rows?: number; - rowSpan?: number; - sandbox?: string; - scope?: string; - scoped?: boolean; - scrolling?: string; - seamless?: boolean; - selected?: boolean; - shape?: string; - size?: number; - sizes?: string; slot?: string; - span?: number; spellCheck?: boolean; - src?: string; - srcDoc?: string; - srcLang?: string; - srcSet?: string; - start?: number; - step?: number | string; style?: CSSProperties; - summary?: string; tabIndex?: number; - target?: string; title?: string; - type?: string; - useMap?: string; - value?: string | string[] | number; - width?: number | string; - wmode?: string; - wrap?: string; + + // Unknown + inputMode?: string; + is?: string; + radioGroup?: string; // , + + // WAI-ARIA + role?: string; // RDFa Attributes about?: string; @@ -2476,10 +2382,488 @@ declare namespace React { unselectable?: boolean; } - interface ChangeTargetHTMLAttributes extends HTMLAttributes { + interface AllHTMLAttributes extends HTMLAttributes { + // Standard HTML Attributes + accept?: string; + acceptCharset?: string; + action?: string; + allowFullScreen?: boolean; + allowTransparency?: boolean; + alt?: string; + async?: boolean; + autoComplete?: string; + autoFocus?: boolean; + autoPlay?: boolean; + capture?: boolean; + cellPadding?: number | string; + cellSpacing?: number | string; + charSet?: string; + challenge?: string; + checked?: boolean; + cite?: string; + classID?: string; + cols?: number; + colSpan?: number; + content?: string; + controls?: boolean; + coords?: string; + crossOrigin?: string; + data?: string; + dateTime?: string; + default?: boolean; + defer?: boolean; + disabled?: boolean; + download?: any; + encType?: string; + form?: string; + formAction?: string; + formEncType?: string; + formMethod?: string; + formNoValidate?: boolean; + formTarget?: string; + frameBorder?: number | string; + headers?: string; + height?: number | string; + high?: number; + href?: string; + hrefLang?: string; + htmlFor?: string; + httpEquiv?: string; + integrity?: string; + keyParams?: string; + keyType?: string; + kind?: string; + label?: string; + list?: string; + loop?: boolean; + low?: number; + manifest?: string; + marginHeight?: number; + marginWidth?: number; + max?: number | string; + maxLength?: number; + media?: string; + mediaGroup?: string; + method?: string; + min?: number | string; + minLength?: number; + multiple?: boolean; + muted?: boolean; + name?: string; + nonce?: string; + noValidate?: boolean; + open?: boolean; + optimum?: number; + pattern?: string; + placeholder?: string; + playsInline?: boolean; + poster?: string; + preload?: string; + readOnly?: boolean; + rel?: string; + required?: boolean; + reversed?: boolean; + rows?: number; + rowSpan?: number; + sandbox?: string; + scope?: string; + scoped?: boolean; + scrolling?: string; + seamless?: boolean; + selected?: boolean; + shape?: string; + size?: number; + sizes?: string; + span?: number; + src?: string; + srcDoc?: string; + srcLang?: string; + srcSet?: string; + start?: number; + step?: number | string; + summary?: string; + target?: string; + type?: string; + useMap?: string; + value?: string | string[] | number; + width?: number | string; + wmode?: string; + wrap?: string; + } + + interface AnchorHTMLAttributes extends HTMLAttributes { + download?: any; + href?: string; + hrefLang?: string; + media?: string; + rel?: string; + target?: string; + } + + // tslint:disable-next-line:no-empty-interface + interface AudioHTMLAttributes extends MediaHTMLAttributes {} + + interface AreaHTMLAttributes extends HTMLAttributes { + alt?: string; + coords?: string; + download?: any; + href?: string; + hrefLang?: string; + media?: string; + rel?: string; + shape?: string; + target?: string; + } + + interface BaseHTMLAttributes extends HTMLAttributes { + href?: string; + target?: string; + } + + interface BlockquoteHTMLAttributes extends HTMLAttributes { + cite?: string; + } + + interface ButtonHTMLAttributes extends HTMLAttributes { + autoFocus?: boolean; + disabled?: boolean; + form?: string; + formAction?: string; + formEncType?: string; + formMethod?: string; + formNoValidate?: boolean; + formTarget?: string; + name?: string; + type?: string; + value?: string | string[] | number; + } + + interface CanvasHTMLAttributes extends HTMLAttributes { + height?: number | string; + width?: number | string; + } + + interface ColHTMLAttributes extends HTMLAttributes { + span?: number; + } + + interface ColgroupHTMLAttributes extends HTMLAttributes { + span?: number; + } + + interface DetailsHTMLAttributes extends HTMLAttributes { + open?: boolean; + } + + interface DelHTMLAttributes extends HTMLAttributes { + cite?: string; + dateTime?: string; + } + + interface EmbedHTMLAttributes extends HTMLAttributes { + height?: number | string; + src?: string; + type?: string; + width?: number | string; + } + + interface FieldsetHTMLAttributes extends HTMLAttributes { + disabled?: boolean; + form?: string; + name?: string; + } + + interface FormHTMLAttributes extends HTMLAttributes { + acceptCharset?: string; + action?: string; + autoComplete?: string; + encType?: string; + method?: string; + name?: string; + noValidate?: boolean; + target?: string; + } + + interface HtmlHTMLAttributes extends HTMLAttributes { + manifest?: string; + } + + interface IframeHTMLAttributes extends HTMLAttributes { + allowFullScreen?: boolean; + allowTransparency?: boolean; + frameBorder?: number | string; + height?: number | string; + marginHeight?: number; + marginWidth?: number; + name?: string; + sandbox?: string; + scrolling?: string; + seamless?: boolean; + src?: string; + srcDoc?: string; + width?: number | string; + } + + interface ImgHTMLAttributes extends HTMLAttributes { + alt?: string; + height?: number | string; + sizes?: string; + src?: string; + srcSet?: string; + useMap?: string; + width?: number | string; + } + + interface InsHTMLAttributes extends HTMLAttributes { + cite?: string; + dateTime?: string; + } + + interface InputHTMLAttributes extends HTMLAttributes { + accept?: string; + alt?: string; + autoComplete?: string; + autoFocus?: boolean; + capture?: boolean; // https://www.w3.org/TR/html-media-capture/#the-capture-attribute + checked?: boolean; + crossOrigin?: string; + disabled?: boolean; + form?: string; + formAction?: string; + formEncType?: string; + formMethod?: string; + formNoValidate?: boolean; + formTarget?: string; + height?: number | string; + list?: string; + max?: number | string; + maxLength?: number; + min?: number | string; + minLength?: number; + multiple?: boolean; + name?: string; + pattern?: string; + placeholder?: string; + readOnly?: boolean; + required?: boolean; + size?: number; + src?: string; + step?: number | string; + type?: string; + value?: string | string[] | number; + width?: number | string; + onChange?: ChangeEventHandler; } + interface KeygenHTMLAttributes extends HTMLAttributes { + autoFocus?: boolean; + challenge?: string; + disabled?: boolean; + form?: string; + keyType?: string; + keyParams?: string; + name?: string; + } + + interface LabelHTMLAttributes extends HTMLAttributes { + form?: string; + htmlFor?: string; + } + + interface LiHTMLAttributes extends HTMLAttributes { + value?: string | string[] | number; + } + + interface LinkHTMLAttributes extends HTMLAttributes { + href?: string; + hrefLang?: string; + integrity?: string; + media?: string; + rel?: string; + sizes?: string; + type?: string; + } + + interface MapHTMLAttributes extends HTMLAttributes { + name?: string; + } + + interface MenuHTMLAttributes extends HTMLAttributes { + type?: string; + } + + interface MediaHTMLAttributes extends HTMLAttributes { + autoPlay?: boolean; + controls?: boolean; + crossOrigin?: string; + loop?: boolean; + mediaGroup?: string; + muted?: boolean; + preload?: string; + src?: string; + } + + interface MetaHTMLAttributes extends HTMLAttributes { + charSet?: string; + content?: string; + httpEquiv?: string; + name?: string; + } + + interface MeterHTMLAttributes extends HTMLAttributes { + form?: string; + high?: number; + low?: number; + max?: number | string; + min?: number | string; + optimum?: number; + value?: string | string[] | number; + } + + interface QuoteHTMLAttributes extends HTMLAttributes { + cite?: string; + } + + interface ObjectHTMLAttributes extends HTMLAttributes { + classID?: string; + data?: string; + form?: string; + height?: number | string; + name?: string; + type?: string; + useMap?: string; + width?: number | string; + wmode?: string; + } + + interface OlHTMLAttributes extends HTMLAttributes { + reversed?: boolean; + start?: number; + } + + interface OptgroupHTMLAttributes extends HTMLAttributes { + disabled?: boolean; + label?: string; + } + + interface OptionHTMLAttributes extends HTMLAttributes { + disabled?: boolean; + label?: string; + selected?: boolean; + value?: string | string[] | number; + } + + interface OutputHTMLAttributes extends HTMLAttributes { + form?: string; + htmlFor?: string; + name?: string; + } + + interface ParamHTMLAttributes extends HTMLAttributes { + name?: string; + value?: string | string[] | number; + } + + interface ProgressHTMLAttributes extends HTMLAttributes { + max?: number | string; + value?: string | string[] | number; + } + + interface ScriptHTMLAttributes extends HTMLAttributes { + async?: boolean; + charSet?: string; + crossOrigin?: string; + defer?: boolean; + integrity?: string; + nonce?: string; + src?: string; + type?: string; + } + + interface SelectHTMLAttributes extends HTMLAttributes { + autoFocus?: boolean; + disabled?: boolean; + form?: string; + multiple?: boolean; + name?: string; + required?: boolean; + size?: number; + + onChange?: ChangeEventHandler; + } + + interface SourceHTMLAttributes extends HTMLAttributes { + media?: string; + sizes?: string; + src?: string; + srcSet?: string; + type?: string; + } + + interface StyleHTMLAttributes extends HTMLAttributes { + media?: string; + nonce?: string; + scoped?: boolean; + type?: string; + } + + interface TableHTMLAttributes extends HTMLAttributes { + cellPadding?: number | string; + cellSpacing?: number | string; + summary?: string; + } + + interface TextareaHTMLAttributes extends HTMLAttributes { + autoFocus?: boolean; + cols?: number; + disabled?: boolean; + form?: string; + maxLength?: number; + minLength?: number; + name?: string; + placeholder?: string; + readOnly?: boolean; + required?: boolean; + rows?: number; + value?: string | string[] | number; + wrap?: string; + + onChange?: ChangeEventHandler; + } + + interface TdHTMLAttributes extends HTMLAttributes { + colSpan?: number; + headers?: string; + rowSpan?: number; + } + + interface ThHTMLAttributes extends HTMLAttributes { + colSpan?: number; + headers?: string; + rowSpan?: number; + scope?: string; + } + + interface TimeHTMLAttributes extends HTMLAttributes { + dateTime?: string; + } + + interface TrackHTMLAttributes extends HTMLAttributes { + default?: boolean; + kind?: string; + label?: string; + src?: string; + srcLang?: string; + } + + interface VideoHTMLAttributes extends MediaHTMLAttributes { + height?: number | string; + playsInline?: boolean; + poster?: string; + width?: number | string; + } + // 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 @@ -2758,119 +3142,119 @@ declare namespace React { // ---------------------------------------------------------------------- interface ReactHTML { - a: HTMLFactory; - abbr: HTMLFactory; - address: HTMLFactory; - area: HTMLFactory; - article: HTMLFactory; - aside: HTMLFactory; - audio: HTMLFactory; - b: HTMLFactory; - base: HTMLFactory; - bdi: HTMLFactory; - bdo: HTMLFactory; - big: HTMLFactory; - blockquote: HTMLFactory; - body: HTMLFactory; - br: HTMLFactory; - button: HTMLFactory; - canvas: HTMLFactory; - caption: HTMLFactory; - cite: HTMLFactory; - code: HTMLFactory; - col: HTMLFactory; - colgroup: HTMLFactory; - data: HTMLFactory; - datalist: HTMLFactory; - dd: HTMLFactory; - del: HTMLFactory; - details: HTMLFactory; - dfn: HTMLFactory; - dialog: HTMLFactory; - div: HTMLFactory; - dl: HTMLFactory; - dt: HTMLFactory; - em: HTMLFactory; - embed: HTMLFactory; - fieldset: HTMLFactory; - figcaption: HTMLFactory; - figure: HTMLFactory; - footer: HTMLFactory; - form: HTMLFactory; - h1: HTMLFactory; - h2: HTMLFactory; - h3: HTMLFactory; - h4: HTMLFactory; - h5: HTMLFactory; - h6: HTMLFactory; - head: HTMLFactory; - header: HTMLFactory; - hgroup: HTMLFactory; - hr: HTMLFactory; - html: HTMLFactory; - i: HTMLFactory; - iframe: HTMLFactory; - img: HTMLFactory; - input: ChangeTargetHTMLFactory; - ins: HTMLFactory; - kbd: HTMLFactory; - keygen: HTMLFactory; - label: HTMLFactory; - legend: HTMLFactory; - li: HTMLFactory; - link: HTMLFactory; - main: HTMLFactory; - map: HTMLFactory; - mark: HTMLFactory; - menu: HTMLFactory; - menuitem: HTMLFactory; - meta: HTMLFactory; - meter: HTMLFactory; - nav: HTMLFactory; - noscript: HTMLFactory; - object: HTMLFactory; - ol: HTMLFactory; - optgroup: HTMLFactory; - option: HTMLFactory; - output: HTMLFactory; - p: HTMLFactory; - param: HTMLFactory; - picture: HTMLFactory; - pre: HTMLFactory; - progress: HTMLFactory; - q: HTMLFactory; - rp: HTMLFactory; - rt: HTMLFactory; - ruby: HTMLFactory; - s: HTMLFactory; - samp: HTMLFactory; - script: HTMLFactory; - section: HTMLFactory; - select: ChangeTargetHTMLFactory; - small: HTMLFactory; - source: HTMLFactory; - span: HTMLFactory; - strong: HTMLFactory; - style: HTMLFactory; - sub: HTMLFactory; - summary: HTMLFactory; - sup: HTMLFactory; - table: HTMLFactory; - tbody: HTMLFactory; - td: HTMLFactory; - textarea: ChangeTargetHTMLFactory; - tfoot: HTMLFactory; - th: HTMLFactory; - thead: HTMLFactory; - time: HTMLFactory; - title: HTMLFactory; - tr: HTMLFactory; - track: HTMLFactory; - u: HTMLFactory; - ul: HTMLFactory; - "var": HTMLFactory; - video: HTMLFactory; - wbr: HTMLFactory; + a: DetailedHTMLFactory, HTMLAnchorElement>; + abbr: DetailedHTMLFactory, HTMLElement>; + address: DetailedHTMLFactory, HTMLElement>; + area: DetailedHTMLFactory, HTMLAreaElement>; + article: DetailedHTMLFactory, HTMLElement>; + aside: DetailedHTMLFactory, HTMLElement>; + audio: DetailedHTMLFactory, HTMLAudioElement>; + b: DetailedHTMLFactory, HTMLElement>; + base: DetailedHTMLFactory, HTMLBaseElement>; + bdi: DetailedHTMLFactory, HTMLElement>; + bdo: DetailedHTMLFactory, HTMLElement>; + big: DetailedHTMLFactory, HTMLElement>; + blockquote: DetailedHTMLFactory, HTMLElement>; + body: DetailedHTMLFactory, HTMLBodyElement>; + br: DetailedHTMLFactory, HTMLBRElement>; + button: DetailedHTMLFactory, HTMLButtonElement>; + canvas: DetailedHTMLFactory, HTMLCanvasElement>; + caption: DetailedHTMLFactory, HTMLElement>; + cite: DetailedHTMLFactory, HTMLElement>; + code: DetailedHTMLFactory, HTMLElement>; + col: DetailedHTMLFactory, HTMLTableColElement>; + colgroup: DetailedHTMLFactory, HTMLTableColElement>; + data: DetailedHTMLFactory, HTMLElement>; + datalist: DetailedHTMLFactory, HTMLDataListElement>; + dd: DetailedHTMLFactory, HTMLElement>; + del: DetailedHTMLFactory, HTMLElement>; + details: DetailedHTMLFactory, HTMLElement>; + dfn: DetailedHTMLFactory, HTMLElement>; + dialog: DetailedHTMLFactory, HTMLElement>; + div: DetailedHTMLFactory, HTMLDivElement>; + dl: DetailedHTMLFactory, HTMLDListElement>; + dt: DetailedHTMLFactory, HTMLElement>; + em: DetailedHTMLFactory, HTMLElement>; + embed: DetailedHTMLFactory, HTMLEmbedElement>; + fieldset: DetailedHTMLFactory, HTMLFieldSetElement>; + figcaption: DetailedHTMLFactory, HTMLElement>; + figure: DetailedHTMLFactory, HTMLElement>; + footer: DetailedHTMLFactory, HTMLElement>; + form: DetailedHTMLFactory, HTMLFormElement>; + h1: DetailedHTMLFactory, HTMLHeadingElement>; + h2: DetailedHTMLFactory, HTMLHeadingElement>; + h3: DetailedHTMLFactory, HTMLHeadingElement>; + h4: DetailedHTMLFactory, HTMLHeadingElement>; + h5: DetailedHTMLFactory, HTMLHeadingElement>; + h6: DetailedHTMLFactory, HTMLHeadingElement>; + head: DetailedHTMLFactory, HTMLHeadElement>; + header: DetailedHTMLFactory, HTMLElement>; + hgroup: DetailedHTMLFactory, HTMLElement>; + hr: DetailedHTMLFactory, HTMLHRElement>; + html: DetailedHTMLFactory, HTMLHtmlElement>; + i: DetailedHTMLFactory, HTMLElement>; + iframe: DetailedHTMLFactory, HTMLIFrameElement>; + img: DetailedHTMLFactory, HTMLImageElement>; + input: DetailedHTMLFactory, HTMLInputElement>; + ins: DetailedHTMLFactory, HTMLModElement>; + kbd: DetailedHTMLFactory, HTMLElement>; + keygen: DetailedHTMLFactory, HTMLElement>; + label: DetailedHTMLFactory, HTMLLabelElement>; + legend: DetailedHTMLFactory, HTMLLegendElement>; + li: DetailedHTMLFactory, HTMLLIElement>; + link: DetailedHTMLFactory, HTMLLinkElement>; + main: DetailedHTMLFactory, HTMLElement>; + map: DetailedHTMLFactory, HTMLMapElement>; + mark: DetailedHTMLFactory, HTMLElement>; + menu: DetailedHTMLFactory, HTMLElement>; + menuitem: DetailedHTMLFactory, HTMLElement>; + meta: DetailedHTMLFactory, HTMLMetaElement>; + meter: DetailedHTMLFactory, HTMLElement>; + nav: DetailedHTMLFactory, HTMLElement>; + noscript: DetailedHTMLFactory, HTMLElement>; + object: DetailedHTMLFactory, HTMLObjectElement>; + ol: DetailedHTMLFactory, HTMLOListElement>; + optgroup: DetailedHTMLFactory, HTMLOptGroupElement>; + option: DetailedHTMLFactory, HTMLOptionElement>; + output: DetailedHTMLFactory, HTMLElement>; + p: DetailedHTMLFactory, HTMLParagraphElement>; + param: DetailedHTMLFactory, HTMLParamElement>; + picture: DetailedHTMLFactory, HTMLElement>; + pre: DetailedHTMLFactory, HTMLPreElement>; + progress: DetailedHTMLFactory, HTMLProgressElement>; + q: DetailedHTMLFactory, HTMLQuoteElement>; + rp: DetailedHTMLFactory, HTMLElement>; + rt: DetailedHTMLFactory, HTMLElement>; + ruby: DetailedHTMLFactory, HTMLElement>; + s: DetailedHTMLFactory, HTMLElement>; + samp: DetailedHTMLFactory, HTMLElement>; + script: DetailedHTMLFactory, HTMLScriptElement>; + section: DetailedHTMLFactory, HTMLElement>; + select: DetailedHTMLFactory, HTMLSelectElement>; + small: DetailedHTMLFactory, HTMLElement>; + source: DetailedHTMLFactory, HTMLSourceElement>; + span: DetailedHTMLFactory, HTMLSpanElement>; + strong: DetailedHTMLFactory, HTMLElement>; + style: DetailedHTMLFactory, HTMLStyleElement>; + sub: DetailedHTMLFactory, HTMLElement>; + summary: DetailedHTMLFactory, HTMLElement>; + sup: DetailedHTMLFactory, HTMLElement>; + table: DetailedHTMLFactory, HTMLTableElement>; + tbody: DetailedHTMLFactory, HTMLTableSectionElement>; + td: DetailedHTMLFactory, HTMLTableDataCellElement>; + textarea: DetailedHTMLFactory, HTMLTextAreaElement>; + tfoot: DetailedHTMLFactory, HTMLTableSectionElement>; + th: DetailedHTMLFactory, HTMLTableHeaderCellElement>; + thead: DetailedHTMLFactory, HTMLTableSectionElement>; + time: DetailedHTMLFactory, HTMLElement>; + title: DetailedHTMLFactory, HTMLTitleElement>; + tr: DetailedHTMLFactory, HTMLTableRowElement>; + track: DetailedHTMLFactory, HTMLTrackElement>; + u: DetailedHTMLFactory, HTMLElement>; + ul: DetailedHTMLFactory, HTMLUListElement>; + "var": DetailedHTMLFactory, HTMLElement>; + video: DetailedHTMLFactory, HTMLVideoElement>; + wbr: DetailedHTMLFactory, HTMLElement>; } interface ReactSVG { @@ -2986,120 +3370,120 @@ declare global { interface IntrinsicElements { // HTML - a: React.HTMLProps; - abbr: React.HTMLProps; - address: React.HTMLProps; - area: React.HTMLProps; - article: React.HTMLProps; - aside: React.HTMLProps; - audio: React.HTMLProps; - b: React.HTMLProps; - base: React.HTMLProps; - bdi: React.HTMLProps; - bdo: React.HTMLProps; - big: React.HTMLProps; - blockquote: React.HTMLProps; - body: React.HTMLProps; - br: React.HTMLProps; - button: React.HTMLProps; - canvas: React.HTMLProps; - caption: React.HTMLProps; - cite: React.HTMLProps; - code: React.HTMLProps; - col: React.HTMLProps; - colgroup: React.HTMLProps; - data: React.HTMLProps; - datalist: React.HTMLProps; - dd: React.HTMLProps; - del: React.HTMLProps; - details: React.HTMLProps; - dfn: React.HTMLProps; - dialog: React.HTMLProps; - div: React.HTMLProps; - dl: React.HTMLProps; - dt: React.HTMLProps; - em: React.HTMLProps; - embed: React.HTMLProps; - fieldset: React.HTMLProps; - figcaption: React.HTMLProps; - figure: React.HTMLProps; - footer: React.HTMLProps; - form: React.HTMLProps; - h1: React.HTMLProps; - h2: React.HTMLProps; - h3: React.HTMLProps; - h4: React.HTMLProps; - h5: React.HTMLProps; - h6: React.HTMLProps; - head: React.HTMLProps; - header: React.HTMLProps; - hgroup: React.HTMLProps; - hr: React.HTMLProps; - html: React.HTMLProps; - i: React.HTMLProps; - iframe: React.HTMLProps; - img: React.HTMLProps; - input: React.ChangeTargetHTMLProps; - ins: React.HTMLProps; - kbd: React.HTMLProps; - keygen: React.HTMLProps; - label: React.HTMLProps; - legend: React.HTMLProps; - li: React.HTMLProps; - link: React.HTMLProps; - main: React.HTMLProps; - map: React.HTMLProps; - mark: React.HTMLProps; - menu: React.HTMLProps; - menuitem: React.HTMLProps; - meta: React.HTMLProps; - meter: React.HTMLProps; - nav: React.HTMLProps; - noindex: React.HTMLProps; - noscript: React.HTMLProps; - object: React.HTMLProps; - ol: React.HTMLProps; - optgroup: React.HTMLProps; - option: React.HTMLProps; - output: React.HTMLProps; - p: React.HTMLProps; - param: React.HTMLProps; - picture: React.HTMLProps; - pre: React.HTMLProps; - progress: React.HTMLProps; - q: React.HTMLProps; - rp: React.HTMLProps; - rt: React.HTMLProps; - ruby: React.HTMLProps; - s: React.HTMLProps; - samp: React.HTMLProps; - script: React.HTMLProps; - section: React.HTMLProps; - select: React.ChangeTargetHTMLProps; - small: React.HTMLProps; - source: React.HTMLProps; - span: React.HTMLProps; - strong: React.HTMLProps; - style: React.HTMLProps; - sub: React.HTMLProps; - summary: React.HTMLProps; - sup: React.HTMLProps; - table: React.HTMLProps; - tbody: React.HTMLProps; - td: React.HTMLProps; - textarea: React.ChangeTargetHTMLProps; - tfoot: React.HTMLProps; - th: React.HTMLProps; - thead: React.HTMLProps; - time: React.HTMLProps; - title: React.HTMLProps; - tr: React.HTMLProps; - track: React.HTMLProps; - u: React.HTMLProps; - ul: React.HTMLProps; - "var": React.HTMLProps; - video: React.HTMLProps; - wbr: React.HTMLProps; + a: React.DetailedHTMLProps, HTMLAnchorElement>; + abbr: React.DetailedHTMLProps, HTMLElement>; + address: React.DetailedHTMLProps, HTMLElement>; + area: React.DetailedHTMLProps, HTMLAreaElement>; + article: React.DetailedHTMLProps, HTMLElement>; + aside: React.DetailedHTMLProps, HTMLElement>; + audio: React.DetailedHTMLProps, HTMLAudioElement>; + b: React.DetailedHTMLProps, HTMLElement>; + base: React.DetailedHTMLProps, HTMLBaseElement>; + bdi: React.DetailedHTMLProps, HTMLElement>; + bdo: React.DetailedHTMLProps, HTMLElement>; + big: React.DetailedHTMLProps, HTMLElement>; + blockquote: React.DetailedHTMLProps, HTMLElement>; + body: React.DetailedHTMLProps, HTMLBodyElement>; + br: React.DetailedHTMLProps, HTMLBRElement>; + button: React.DetailedHTMLProps, HTMLButtonElement>; + canvas: React.DetailedHTMLProps, HTMLCanvasElement>; + caption: React.DetailedHTMLProps, HTMLElement>; + cite: React.DetailedHTMLProps, HTMLElement>; + code: React.DetailedHTMLProps, HTMLElement>; + col: React.DetailedHTMLProps, HTMLTableColElement>; + colgroup: React.DetailedHTMLProps, HTMLTableColElement>; + data: React.DetailedHTMLProps, HTMLElement>; + datalist: React.DetailedHTMLProps, HTMLDataListElement>; + dd: React.DetailedHTMLProps, HTMLElement>; + del: React.DetailedHTMLProps, HTMLElement>; + details: React.DetailedHTMLProps, HTMLElement>; + dfn: React.DetailedHTMLProps, HTMLElement>; + dialog: React.DetailedHTMLProps, HTMLElement>; + div: React.DetailedHTMLProps, HTMLDivElement>; + dl: React.DetailedHTMLProps, HTMLDListElement>; + dt: React.DetailedHTMLProps, HTMLElement>; + em: React.DetailedHTMLProps, HTMLElement>; + embed: React.DetailedHTMLProps, HTMLEmbedElement>; + fieldset: React.DetailedHTMLProps, HTMLFieldSetElement>; + figcaption: React.DetailedHTMLProps, HTMLElement>; + figure: React.DetailedHTMLProps, HTMLElement>; + footer: React.DetailedHTMLProps, HTMLElement>; + form: React.DetailedHTMLProps, HTMLFormElement>; + h1: React.DetailedHTMLProps, HTMLHeadingElement>; + h2: React.DetailedHTMLProps, HTMLHeadingElement>; + h3: React.DetailedHTMLProps, HTMLHeadingElement>; + h4: React.DetailedHTMLProps, HTMLHeadingElement>; + h5: React.DetailedHTMLProps, HTMLHeadingElement>; + h6: React.DetailedHTMLProps, HTMLHeadingElement>; + head: React.DetailedHTMLProps, HTMLHeadElement>; + header: React.DetailedHTMLProps, HTMLElement>; + hgroup: React.DetailedHTMLProps, HTMLElement>; + hr: React.DetailedHTMLProps, HTMLHRElement>; + html: React.DetailedHTMLProps, HTMLHtmlElement>; + i: React.DetailedHTMLProps, HTMLElement>; + iframe: React.DetailedHTMLProps, HTMLIFrameElement>; + img: React.DetailedHTMLProps, HTMLImageElement>; + input: React.DetailedHTMLProps, HTMLInputElement>; + ins: React.DetailedHTMLProps, HTMLModElement>; + kbd: React.DetailedHTMLProps, HTMLElement>; + keygen: React.DetailedHTMLProps, HTMLElement>; + label: React.DetailedHTMLProps, HTMLLabelElement>; + legend: React.DetailedHTMLProps, HTMLLegendElement>; + li: React.DetailedHTMLProps, HTMLLIElement>; + link: React.DetailedHTMLProps, HTMLLinkElement>; + main: React.DetailedHTMLProps, HTMLElement>; + map: React.DetailedHTMLProps, HTMLMapElement>; + mark: React.DetailedHTMLProps, HTMLElement>; + menu: React.DetailedHTMLProps, HTMLElement>; + menuitem: React.DetailedHTMLProps, HTMLElement>; + meta: React.DetailedHTMLProps, HTMLMetaElement>; + meter: React.DetailedHTMLProps, HTMLElement>; + nav: React.DetailedHTMLProps, HTMLElement>; + noindex: React.DetailedHTMLProps, HTMLElement>; + noscript: React.DetailedHTMLProps, HTMLElement>; + object: React.DetailedHTMLProps, HTMLObjectElement>; + ol: React.DetailedHTMLProps, HTMLOListElement>; + optgroup: React.DetailedHTMLProps, HTMLOptGroupElement>; + option: React.DetailedHTMLProps, HTMLOptionElement>; + output: React.DetailedHTMLProps, HTMLElement>; + p: React.DetailedHTMLProps, HTMLParagraphElement>; + param: React.DetailedHTMLProps, HTMLParamElement>; + picture: React.DetailedHTMLProps, HTMLElement>; + pre: React.DetailedHTMLProps, HTMLPreElement>; + progress: React.DetailedHTMLProps, HTMLProgressElement>; + q: React.DetailedHTMLProps, HTMLQuoteElement>; + rp: React.DetailedHTMLProps, HTMLElement>; + rt: React.DetailedHTMLProps, HTMLElement>; + ruby: React.DetailedHTMLProps, HTMLElement>; + s: React.DetailedHTMLProps, HTMLElement>; + samp: React.DetailedHTMLProps, HTMLElement>; + script: React.DetailedHTMLProps, HTMLScriptElement>; + section: React.DetailedHTMLProps, HTMLElement>; + select: React.DetailedHTMLProps, HTMLSelectElement>; + small: React.DetailedHTMLProps, HTMLElement>; + source: React.DetailedHTMLProps, HTMLSourceElement>; + span: React.DetailedHTMLProps, HTMLSpanElement>; + strong: React.DetailedHTMLProps, HTMLElement>; + style: React.DetailedHTMLProps, HTMLStyleElement>; + sub: React.DetailedHTMLProps, HTMLElement>; + summary: React.DetailedHTMLProps, HTMLElement>; + sup: React.DetailedHTMLProps, HTMLElement>; + table: React.DetailedHTMLProps, HTMLTableElement>; + tbody: React.DetailedHTMLProps, HTMLTableSectionElement>; + td: React.DetailedHTMLProps, HTMLTableDataCellElement>; + textarea: React.DetailedHTMLProps, HTMLTextAreaElement>; + tfoot: React.DetailedHTMLProps, HTMLTableSectionElement>; + th: React.DetailedHTMLProps, HTMLTableHeaderCellElement>; + thead: React.DetailedHTMLProps, HTMLTableSectionElement>; + time: React.DetailedHTMLProps, HTMLElement>; + title: React.DetailedHTMLProps, HTMLTitleElement>; + tr: React.DetailedHTMLProps, HTMLTableRowElement>; + track: React.DetailedHTMLProps, HTMLTrackElement>; + u: React.DetailedHTMLProps, HTMLElement>; + ul: React.DetailedHTMLProps, HTMLUListElement>; + "var": React.DetailedHTMLProps, HTMLElement>; + video: React.DetailedHTMLProps, HTMLVideoElement>; + wbr: React.DetailedHTMLProps, HTMLElement>; // SVG svg: React.SVGProps; diff --git a/types/reactstrap/lib/Input.d.ts b/types/reactstrap/lib/Input.d.ts index 816add1137..c9d7a1329d 100644 --- a/types/reactstrap/lib/Input.d.ts +++ b/types/reactstrap/lib/Input.d.ts @@ -27,7 +27,7 @@ type InputType = // Intermediate interface to "redefine" the type of size to string // size:number => size:any => size:string -interface Intermediate extends React.ChangeTargetHTMLProps { +interface Intermediate extends React.InputHTMLAttributes { size?: any; } diff --git a/types/reactstrap/lib/Label.d.ts b/types/reactstrap/lib/Label.d.ts index 04cf76e3a0..383378dc4e 100644 --- a/types/reactstrap/lib/Label.d.ts +++ b/types/reactstrap/lib/Label.d.ts @@ -1,6 +1,6 @@ import { ColumnProps } from './Col'; -interface Intermediate extends React.ChangeTargetHTMLProps { +interface Intermediate extends React.LabelHTMLAttributes { size?: any; }