diff --git a/types/react/index.d.ts b/types/react/index.d.ts index 2fe1975501..27e385463b 100644 --- a/types/react/index.d.ts +++ b/types/react/index.d.ts @@ -1447,65 +1447,8 @@ declare namespace React { */ } - interface HTMLAttributes extends DOMAttributes { - // React-specific Attributes - defaultChecked?: boolean; - defaultValue?: string | string[]; - suppressContentEditableWarning?: boolean; - suppressHydrationWarning?: boolean; - - // Standard HTML Attributes - accessKey?: string; - className?: string; - contentEditable?: boolean; - contextMenu?: string; - dir?: string; - draggable?: boolean; - hidden?: boolean; - id?: string; - lang?: string; - placeholder?: string; - slot?: string; - spellCheck?: boolean; - style?: CSSProperties; - tabIndex?: number; - title?: string; - - // Unknown - inputMode?: string; - is?: string; - radioGroup?: string; // , - - // WAI-ARIA - role?: string; - - // RDFa Attributes - about?: string; - datatype?: string; - inlist?: any; - prefix?: string; - property?: string; - resource?: string; - typeof?: string; - vocab?: string; - - // Non-standard Attributes - autoCapitalize?: string; - autoCorrect?: string; - autoSave?: string; - color?: string; - itemProp?: string; - itemScope?: boolean; - itemType?: string; - itemID?: string; - itemRef?: string; - results?: number; - security?: string; - unselectable?: 'on' | 'off'; - } - // All the WAI-ARIA 1.1 attributes from https://www.w3.org/TR/wai-aria-1.1/ - interface HTMLAttributes extends DOMAttributes { + interface AriaAttributes { /** Identifies the currently active element when DOM focus is on a composite widget, textbox, group, or application. */ 'aria-activedescendant'?: string; /** Indicates whether assistive technologies will present all, or only parts of, the changed region based on the change notifications defined by the aria-relevant attribute. */ @@ -1692,6 +1635,63 @@ declare namespace React { 'aria-valuetext'?: string; } + interface HTMLAttributes extends AriaAttributes, DOMAttributes { + // React-specific Attributes + defaultChecked?: boolean; + defaultValue?: string | string[]; + suppressContentEditableWarning?: boolean; + suppressHydrationWarning?: boolean; + + // Standard HTML Attributes + accessKey?: string; + className?: string; + contentEditable?: boolean; + contextMenu?: string; + dir?: string; + draggable?: boolean; + hidden?: boolean; + id?: string; + lang?: string; + placeholder?: string; + slot?: string; + spellCheck?: boolean; + style?: CSSProperties; + tabIndex?: number; + title?: string; + + // Unknown + inputMode?: string; + is?: string; + radioGroup?: string; // , + + // WAI-ARIA + role?: string; + + // RDFa Attributes + about?: string; + datatype?: string; + inlist?: any; + prefix?: string; + property?: string; + resource?: string; + typeof?: string; + vocab?: string; + + // Non-standard Attributes + autoCapitalize?: string; + autoCorrect?: string; + autoSave?: string; + color?: string; + itemProp?: string; + itemScope?: boolean; + itemType?: string; + itemID?: string; + itemRef?: string; + results?: number; + security?: string; + unselectable?: 'on' | 'off'; + } + interface AllHTMLAttributes extends HTMLAttributes { // Standard HTML Attributes accept?: string; @@ -2205,7 +2205,7 @@ declare namespace React { // - "number | string" // - "string" // - union of string literals - interface SVGAttributes extends DOMAttributes { + interface SVGAttributes extends AriaAttributes, DOMAttributes { // Attributes which also defined in HTMLAttributes // See comment in SVGDOMPropertyConfig.js className?: string; diff --git a/types/react/v15/index.d.ts b/types/react/v15/index.d.ts index d4f6300588..01c98e1554 100644 --- a/types/react/v15/index.d.ts +++ b/types/react/v15/index.d.ts @@ -2392,63 +2392,8 @@ declare namespace React { [propertyName: string]: any; } - interface HTMLAttributes extends DOMAttributes { - // React-specific Attributes - defaultChecked?: boolean; - defaultValue?: string | string[]; - suppressContentEditableWarning?: boolean; - - // Standard HTML Attributes - accessKey?: string; - className?: string; - contentEditable?: boolean; - contextMenu?: string; - dir?: string; - draggable?: boolean; - hidden?: boolean; - id?: string; - lang?: string; - slot?: string; - spellCheck?: boolean; - style?: CSSProperties; - tabIndex?: number; - title?: string; - - // Unknown - inputMode?: string; - is?: string; - radioGroup?: string; // , - - // WAI-ARIA - role?: string; - - // RDFa Attributes - about?: string; - datatype?: string; - inlist?: any; - prefix?: string; - property?: string; - resource?: string; - typeof?: string; - vocab?: string; - - // Non-standard Attributes - autoCapitalize?: string; - autoCorrect?: string; - autoSave?: string; - color?: string; - itemProp?: string; - itemScope?: boolean; - itemType?: string; - itemID?: string; - itemRef?: string; - results?: number; - security?: string; - unselectable?: boolean; - } - // All the WAI-ARIA 1.1 attributes from https://www.w3.org/TR/wai-aria-1.1/ - interface HTMLAttributes extends DOMAttributes { + interface AriaAttributes { /** Identifies the currently active element when DOM focus is on a composite widget, textbox, group, or application. */ 'aria-activedescendant'?: string; /** Indicates whether assistive technologies will present all, or only parts of, the changed region based on the change notifications defined by the aria-relevant attribute. */ @@ -2635,6 +2580,61 @@ declare namespace React { 'aria-valuetext'?: string; } + interface HTMLAttributes extends AriaAttributes, DOMAttributes { + // React-specific Attributes + defaultChecked?: boolean; + defaultValue?: string | string[]; + suppressContentEditableWarning?: boolean; + + // Standard HTML Attributes + accessKey?: string; + className?: string; + contentEditable?: boolean; + contextMenu?: string; + dir?: string; + draggable?: boolean; + hidden?: boolean; + id?: string; + lang?: string; + slot?: string; + spellCheck?: boolean; + style?: CSSProperties; + tabIndex?: number; + title?: string; + + // Unknown + inputMode?: string; + is?: string; + radioGroup?: string; // , + + // WAI-ARIA + role?: string; + + // RDFa Attributes + about?: string; + datatype?: string; + inlist?: any; + prefix?: string; + property?: string; + resource?: string; + typeof?: string; + vocab?: string; + + // Non-standard Attributes + autoCapitalize?: string; + autoCorrect?: string; + autoSave?: string; + color?: string; + itemProp?: string; + itemScope?: boolean; + itemType?: string; + itemID?: string; + itemRef?: string; + results?: number; + security?: string; + unselectable?: boolean; + } + interface AllHTMLAttributes extends HTMLAttributes { // Standard HTML Attributes accept?: string; @@ -3133,7 +3133,7 @@ declare namespace React { // - "number | string" // - "string" // - union of string literals - interface SVGAttributes extends DOMAttributes { + interface SVGAttributes extends AriaAttributes, DOMAttributes { // Attributes which also defined in HTMLAttributes // See comment in SVGDOMPropertyConfig.js className?: string;