Skip to content

Commit

Permalink
Refacto aria attributes for svg
Browse files Browse the repository at this point in the history
  • Loading branch information
diontools committed Apr 20, 2019
1 parent 95f214c commit f9e95b5
Showing 1 changed file with 53 additions and 53 deletions.
106 changes: 53 additions & 53 deletions types/Html.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -458,59 +458,8 @@ declare namespace TyperApp {
*/
}

interface HTMLAttributes<T> extends DOMAttributes<T> {
// Standard HTML Attributes
accessKey?: string;
class?: Class;
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; // <command>, <menuitem>

// 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<T> extends DOMAttributes<T> {
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. */
Expand Down Expand Up @@ -697,6 +646,57 @@ declare namespace TyperApp {
'aria-valuetext'?: string;
}

interface HTMLAttributes<T> extends AriaAttributes, DOMAttributes<T> {
// Standard HTML Attributes
accessKey?: string;
class?: Class;
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; // <command>, <menuitem>

// 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<T> extends HTMLAttributes<T> {
// Standard HTML Attributes
accept?: string;
Expand Down Expand Up @@ -1210,7 +1210,7 @@ declare namespace TyperApp {
// - "number | string"
// - "string"
// - union of string literals
interface SVGAttributes<T> extends DOMAttributes<T> {
interface SVGAttributes<T> extends AriaAttributes, DOMAttributes<T> {
// Attributes which also defined in HTMLAttributes
// See comment in SVGDOMPropertyConfig.js
class?: Class;
Expand Down

0 comments on commit f9e95b5

Please sign in to comment.