This is meant to improve on the JSX types supplied here https://github.com/DefinitelyTyped/DefinitelyTyped/blob/master/types/mithril/index.d.ts
It's cribbed from https://github.com/DefinitelyTyped/DefinitelyTyped/blob/master/types/react/index.d.ts
This is meant to improve on the JSX types supplied here https://github.com/DefinitelyTyped/DefinitelyTyped/blob/master/types/mithril/index.d.ts
It's cribbed from https://github.com/DefinitelyTyped/DefinitelyTyped/blob/master/types/react/index.d.ts
import * as CSS from 'csstype'; | |
import m from 'mithril'; | |
declare module 'mithril' { | |
module JSX { | |
// tslint:disable-next-line:no-empty-interface | |
interface Element extends m.Vnode {} | |
// tslint:disable-next-line:no-empty-interface | |
interface IntrinsicAttributes extends m.Attributes {} | |
// tslint:disable-next-line:no-empty-interface | |
interface IntrinsicClassAttributes extends m.Attributes {} | |
//////// | |
type NativeAnimationEvent = AnimationEvent; | |
type NativeClipboardEvent = ClipboardEvent; | |
type NativeCompositionEvent = CompositionEvent; | |
type NativeDragEvent = DragEvent; | |
type NativeFocusEvent = FocusEvent; | |
type NativeKeyboardEvent = KeyboardEvent; | |
type NativeMouseEvent = MouseEvent; | |
type NativeTouchEvent = TouchEvent; | |
type NativePointerEvent = PointerEvent; | |
type NativeTransitionEvent = TransitionEvent; | |
type NativeUIEvent = UIEvent; | |
type NativeWheelEvent = WheelEvent; | |
type Booleanish = boolean | 'true' | 'false'; | |
// | |
// Browser Interfaces | |
// https://github.com/nikeee/2048-typescript/blob/master/2048/js/touch.d.ts | |
// ---------------------------------------------------------------------- | |
interface AbstractView { | |
styleMedia: StyleMedia; | |
document: Document; | |
} | |
interface Touch { | |
identifier: number; | |
target: EventTarget; | |
screenX: number; | |
screenY: number; | |
clientX: number; | |
clientY: number; | |
pageX: number; | |
pageY: number; | |
} | |
interface TouchList { | |
[index: number]: Touch; | |
length: number; | |
item(index: number): Touch; | |
identifiedTouch(identifier: number): Touch; | |
} | |
// | |
// Event System | |
// ---------------------------------------------------------------------- | |
// TODO: change any to unknown when moving to TS v3 | |
interface BaseSyntheticEvent<E = object, C = any, T = any> { | |
currentTarget: C; | |
target: T; | |
bubbles: boolean; | |
cancelable: boolean; | |
defaultPrevented: boolean; | |
eventPhase: number; | |
isTrusted: boolean; | |
preventDefault(): void; | |
isDefaultPrevented(): boolean; | |
stopPropagation(): void; | |
isPropagationStopped(): boolean; | |
persist(): void; | |
timeStamp: number; | |
type: string; | |
} | |
/** | |
* currentTarget - a reference to the element on which the event listener is registered. | |
* | |
* target - a reference to the element from which the event was originally dispatched. | |
* This might be a child element to the element on which the event listener is registered. | |
* If you thought this should be `EventTarget & T`, see https://github.com/DefinitelyTyped/DefinitelyTyped/issues/11508#issuecomment-256045682 | |
*/ | |
interface SyntheticEvent<T = Element, E = Event> extends BaseSyntheticEvent<E, EventTarget & T, EventTarget> {} | |
interface ClipboardEvent<T = Element> extends SyntheticEvent<T, NativeClipboardEvent> { | |
clipboardData: DataTransfer; | |
} | |
interface CompositionEvent<T = Element> extends SyntheticEvent<T, NativeCompositionEvent> { | |
data: string; | |
} | |
interface DragEvent<T = Element> extends MouseEvent<T, NativeDragEvent> { | |
dataTransfer: DataTransfer; | |
} | |
interface PointerEvent<T = Element> extends MouseEvent<T, NativePointerEvent> { | |
pointerId: number; | |
pressure: number; | |
tangentialPressure: number; | |
tiltX: number; | |
tiltY: number; | |
twist: number; | |
width: number; | |
height: number; | |
pointerType: 'mouse' | 'pen' | 'touch'; | |
isPrimary: boolean; | |
} | |
interface FocusEvent<T = Element> extends SyntheticEvent<T, NativeFocusEvent> { | |
relatedTarget: EventTarget | null; | |
target: EventTarget & T; | |
} | |
interface FormEvent<T = Element> extends SyntheticEvent<T> { | |
} | |
interface InvalidEvent<T = Element> extends SyntheticEvent<T> { | |
target: EventTarget & T; | |
} | |
interface ChangeEvent<T = Element> extends SyntheticEvent<T> { | |
target: EventTarget & T; | |
} | |
interface KeyboardEvent<T = Element> extends SyntheticEvent<T, NativeKeyboardEvent> { | |
altKey: boolean; | |
/** @deprecated */ | |
charCode: number; | |
ctrlKey: boolean; | |
code: string; | |
/** | |
* See [DOM Level 3 Events spec](https://www.w3.org/TR/uievents-key/#keys-modifier). for a list of valid (case-sensitive) arguments to this method. | |
*/ | |
getModifierState(key: string): boolean; | |
/** | |
* See the [DOM Level 3 Events spec](https://www.w3.org/TR/uievents-key/#named-key-attribute-values). for possible values | |
*/ | |
key: string; | |
/** @deprecated */ | |
keyCode: number; | |
locale: string; | |
location: number; | |
metaKey: boolean; | |
repeat: boolean; | |
shiftKey: boolean; | |
/** @deprecated */ | |
which: number; | |
} | |
interface MouseEvent<T = Element, E = NativeMouseEvent> extends UIEvent<T, E> { | |
altKey: boolean; | |
button: number; | |
buttons: number; | |
clientX: number; | |
clientY: number; | |
ctrlKey: boolean; | |
/** | |
* See [DOM Level 3 Events spec](https://www.w3.org/TR/uievents-key/#keys-modifier). for a list of valid (case-sensitive) arguments to this method. | |
*/ | |
getModifierState(key: string): boolean; | |
metaKey: boolean; | |
movementX: number; | |
movementY: number; | |
pageX: number; | |
pageY: number; | |
relatedTarget: EventTarget | null; | |
screenX: number; | |
screenY: number; | |
shiftKey: boolean; | |
} | |
interface TouchEvent<T = Element> extends UIEvent<T, NativeTouchEvent> { | |
altKey: boolean; | |
changedTouches: TouchList; | |
ctrlKey: boolean; | |
/** | |
* See [DOM Level 3 Events spec](https://www.w3.org/TR/uievents-key/#keys-modifier). for a list of valid (case-sensitive) arguments to this method. | |
*/ | |
getModifierState(key: string): boolean; | |
metaKey: boolean; | |
shiftKey: boolean; | |
targetTouches: TouchList; | |
touches: TouchList; | |
} | |
interface UIEvent<T = Element, E = NativeUIEvent> extends SyntheticEvent<T, E> { | |
detail: number; | |
view: AbstractView; | |
} | |
interface WheelEvent<T = Element> extends MouseEvent<T, NativeWheelEvent> { | |
deltaMode: number; | |
deltaX: number; | |
deltaY: number; | |
deltaZ: number; | |
} | |
interface AnimationEvent<T = Element> extends SyntheticEvent<T, NativeAnimationEvent> { | |
animationName: string; | |
elapsedTime: number; | |
pseudoElement: string; | |
} | |
interface TransitionEvent<T = Element> extends SyntheticEvent<T, NativeTransitionEvent> { | |
elapsedTime: number; | |
propertyName: string; | |
pseudoElement: string; | |
} | |
// | |
// Event Handler Types | |
// ---------------------------------------------------------------------- | |
type EventHandler<E extends SyntheticEvent<any>> = { bivarianceHack(event: E): void }["bivarianceHack"]; | |
type MithrilEventHandler<T = Element> = EventHandler<SyntheticEvent<T>>; | |
type ClipboardEventHandler<T = Element> = EventHandler<ClipboardEvent<T>>; | |
type CompositionEventHandler<T = Element> = EventHandler<CompositionEvent<T>>; | |
type DragEventHandler<T = Element> = EventHandler<DragEvent<T>>; | |
type FocusEventHandler<T = Element> = EventHandler<FocusEvent<T>>; | |
type FormEventHandler<T = Element> = EventHandler<FormEvent<T>>; | |
type ChangeEventHandler<T = Element> = EventHandler<ChangeEvent<T>>; | |
type KeyboardEventHandler<T = Element> = EventHandler<KeyboardEvent<T>>; | |
type MouseEventHandler<T = Element> = EventHandler<MouseEvent<T>>; | |
type TouchEventHandler<T = Element> = EventHandler<TouchEvent<T>>; | |
type PointerEventHandler<T = Element> = EventHandler<PointerEvent<T>>; | |
type UIEventHandler<T = Element> = EventHandler<UIEvent<T>>; | |
type WheelEventHandler<T = Element> = EventHandler<WheelEvent<T>>; | |
type AnimationEventHandler<T = Element> = EventHandler<AnimationEvent<T>>; | |
type TransitionEventHandler<T = Element> = EventHandler<TransitionEvent<T>>; | |
interface HTMLProps<T> extends AllHTMLAttributes<T>, Attributes { | |
} | |
type DetailedHTMLProps<E extends HTMLAttributes<T>, T> = Attributes & E; | |
interface SVGProps<T> extends SVGAttributes<T>, Attributes { | |
} | |
interface DOMAttributes<T> extends m.Attributes { | |
// Clipboard Events | |
onCopy?: ClipboardEventHandler<T>; | |
onCopyCapture?: ClipboardEventHandler<T>; | |
onCut?: ClipboardEventHandler<T>; | |
onCutCapture?: ClipboardEventHandler<T>; | |
onPaste?: ClipboardEventHandler<T>; | |
onPasteCapture?: ClipboardEventHandler<T>; | |
// Composition Events | |
onCompositionEnd?: CompositionEventHandler<T>; | |
onCompositionEndCapture?: CompositionEventHandler<T>; | |
onCompositionStart?: CompositionEventHandler<T>; | |
onCompositionStartCapture?: CompositionEventHandler<T>; | |
onCompositionUpdate?: CompositionEventHandler<T>; | |
onCompositionUpdateCapture?: CompositionEventHandler<T>; | |
// Focus Events | |
onFocus?: FocusEventHandler<T>; | |
onFocusCapture?: FocusEventHandler<T>; | |
onBlur?: FocusEventHandler<T>; | |
onBlurCapture?: FocusEventHandler<T>; | |
// Form Events | |
onChange?: FormEventHandler<T>; | |
onChangeCapture?: FormEventHandler<T>; | |
onBeforeInput?: FormEventHandler<T>; | |
onBeforeInputCapture?: FormEventHandler<T>; | |
onInput?: FormEventHandler<T>; | |
onInputCapture?: FormEventHandler<T>; | |
onReset?: FormEventHandler<T>; | |
onResetCapture?: FormEventHandler<T>; | |
onSubmit?: FormEventHandler<T>; | |
onSubmitCapture?: FormEventHandler<T>; | |
onInvalid?: FormEventHandler<T>; | |
onInvalidCapture?: FormEventHandler<T>; | |
// Image Events | |
onLoad?: MithrilEventHandler<T>; | |
onLoadCapture?: MithrilEventHandler<T>; | |
onError?: MithrilEventHandler<T>; // also a Media Event | |
onErrorCapture?: MithrilEventHandler<T>; // also a Media Event | |
// Keyboard Events | |
onKeyDown?: KeyboardEventHandler<T>; | |
onKeyDownCapture?: KeyboardEventHandler<T>; | |
onKeyPress?: KeyboardEventHandler<T>; | |
onKeyPressCapture?: KeyboardEventHandler<T>; | |
onKeyUp?: KeyboardEventHandler<T>; | |
onKeyUpCapture?: KeyboardEventHandler<T>; | |
// Media Events | |
onAbort?: MithrilEventHandler<T>; | |
onAbortCapture?: MithrilEventHandler<T>; | |
onCanPlay?: MithrilEventHandler<T>; | |
onCanPlayCapture?: MithrilEventHandler<T>; | |
onCanPlayThrough?: MithrilEventHandler<T>; | |
onCanPlayThroughCapture?: MithrilEventHandler<T>; | |
onDurationChange?: MithrilEventHandler<T>; | |
onDurationChangeCapture?: MithrilEventHandler<T>; | |
onEmptied?: MithrilEventHandler<T>; | |
onEmptiedCapture?: MithrilEventHandler<T>; | |
onEncrypted?: MithrilEventHandler<T>; | |
onEncryptedCapture?: MithrilEventHandler<T>; | |
onEnded?: MithrilEventHandler<T>; | |
onEndedCapture?: MithrilEventHandler<T>; | |
onLoadedData?: MithrilEventHandler<T>; | |
onLoadedDataCapture?: MithrilEventHandler<T>; | |
onLoadedMetadata?: MithrilEventHandler<T>; | |
onLoadedMetadataCapture?: MithrilEventHandler<T>; | |
onLoadStart?: MithrilEventHandler<T>; | |
onLoadStartCapture?: MithrilEventHandler<T>; | |
onPause?: MithrilEventHandler<T>; | |
onPauseCapture?: MithrilEventHandler<T>; | |
onPlay?: MithrilEventHandler<T>; | |
onPlayCapture?: MithrilEventHandler<T>; | |
onPlaying?: MithrilEventHandler<T>; | |
onPlayingCapture?: MithrilEventHandler<T>; | |
onProgress?: MithrilEventHandler<T>; | |
onProgressCapture?: MithrilEventHandler<T>; | |
onRateChange?: MithrilEventHandler<T>; | |
onRateChangeCapture?: MithrilEventHandler<T>; | |
onSeeked?: MithrilEventHandler<T>; | |
onSeekedCapture?: MithrilEventHandler<T>; | |
onSeeking?: MithrilEventHandler<T>; | |
onSeekingCapture?: MithrilEventHandler<T>; | |
onStalled?: MithrilEventHandler<T>; | |
onStalledCapture?: MithrilEventHandler<T>; | |
onSuspend?: MithrilEventHandler<T>; | |
onSuspendCapture?: MithrilEventHandler<T>; | |
onTimeUpdate?: MithrilEventHandler<T>; | |
onTimeUpdateCapture?: MithrilEventHandler<T>; | |
onVolumeChange?: MithrilEventHandler<T>; | |
onVolumeChangeCapture?: MithrilEventHandler<T>; | |
onWaiting?: MithrilEventHandler<T>; | |
onWaitingCapture?: MithrilEventHandler<T>; | |
// MouseEvents | |
onAuxClick?: MouseEventHandler<T>; | |
onAuxClickCapture?: MouseEventHandler<T>; | |
onClick?: MouseEventHandler<T>; | |
onClickCapture?: MouseEventHandler<T>; | |
onContextMenu?: MouseEventHandler<T>; | |
onContextMenuCapture?: MouseEventHandler<T>; | |
onDoubleClick?: MouseEventHandler<T>; | |
onDoubleClickCapture?: MouseEventHandler<T>; | |
onDrag?: DragEventHandler<T>; | |
onDragCapture?: DragEventHandler<T>; | |
onDragEnd?: DragEventHandler<T>; | |
onDragEndCapture?: DragEventHandler<T>; | |
onDragEnter?: DragEventHandler<T>; | |
onDragEnterCapture?: DragEventHandler<T>; | |
onDragExit?: DragEventHandler<T>; | |
onDragExitCapture?: DragEventHandler<T>; | |
onDragLeave?: DragEventHandler<T>; | |
onDragLeaveCapture?: DragEventHandler<T>; | |
onDragOver?: DragEventHandler<T>; | |
onDragOverCapture?: DragEventHandler<T>; | |
onDragStart?: DragEventHandler<T>; | |
onDragStartCapture?: DragEventHandler<T>; | |
onDrop?: DragEventHandler<T>; | |
onDropCapture?: DragEventHandler<T>; | |
onMouseDown?: MouseEventHandler<T>; | |
onMouseDownCapture?: MouseEventHandler<T>; | |
onMouseEnter?: MouseEventHandler<T>; | |
onMouseLeave?: MouseEventHandler<T>; | |
onMouseMove?: MouseEventHandler<T>; | |
onMouseMoveCapture?: MouseEventHandler<T>; | |
onMouseOut?: MouseEventHandler<T>; | |
onMouseOutCapture?: MouseEventHandler<T>; | |
onMouseOver?: MouseEventHandler<T>; | |
onMouseOverCapture?: MouseEventHandler<T>; | |
onMouseUp?: MouseEventHandler<T>; | |
onMouseUpCapture?: MouseEventHandler<T>; | |
// Selection Events | |
onSelect?: MithrilEventHandler<T>; | |
onSelectCapture?: MithrilEventHandler<T>; | |
// Touch Events | |
onTouchCancel?: TouchEventHandler<T>; | |
onTouchCancelCapture?: TouchEventHandler<T>; | |
onTouchEnd?: TouchEventHandler<T>; | |
onTouchEndCapture?: TouchEventHandler<T>; | |
onTouchMove?: TouchEventHandler<T>; | |
onTouchMoveCapture?: TouchEventHandler<T>; | |
onTouchStart?: TouchEventHandler<T>; | |
onTouchStartCapture?: TouchEventHandler<T>; | |
// Pointer Events | |
onPointerDown?: PointerEventHandler<T>; | |
onPointerDownCapture?: PointerEventHandler<T>; | |
onPointerMove?: PointerEventHandler<T>; | |
onPointerMoveCapture?: PointerEventHandler<T>; | |
onPointerUp?: PointerEventHandler<T>; | |
onPointerUpCapture?: PointerEventHandler<T>; | |
onPointerCancel?: PointerEventHandler<T>; | |
onPointerCancelCapture?: PointerEventHandler<T>; | |
onPointerEnter?: PointerEventHandler<T>; | |
onPointerEnterCapture?: PointerEventHandler<T>; | |
onPointerLeave?: PointerEventHandler<T>; | |
onPointerLeaveCapture?: PointerEventHandler<T>; | |
onPointerOver?: PointerEventHandler<T>; | |
onPointerOverCapture?: PointerEventHandler<T>; | |
onPointerOut?: PointerEventHandler<T>; | |
onPointerOutCapture?: PointerEventHandler<T>; | |
onGotPointerCapture?: PointerEventHandler<T>; | |
onGotPointerCaptureCapture?: PointerEventHandler<T>; | |
onLostPointerCapture?: PointerEventHandler<T>; | |
onLostPointerCaptureCapture?: PointerEventHandler<T>; | |
// UI Events | |
onScroll?: UIEventHandler<T>; | |
onScrollCapture?: UIEventHandler<T>; | |
// Wheel Events | |
onWheel?: WheelEventHandler<T>; | |
onWheelCapture?: WheelEventHandler<T>; | |
// Animation Events | |
onAnimationStart?: AnimationEventHandler<T>; | |
onAnimationStartCapture?: AnimationEventHandler<T>; | |
onAnimationEnd?: AnimationEventHandler<T>; | |
onAnimationEndCapture?: AnimationEventHandler<T>; | |
onAnimationIteration?: AnimationEventHandler<T>; | |
onAnimationIterationCapture?: AnimationEventHandler<T>; | |
// Transition Events | |
onTransitionEnd?: TransitionEventHandler<T>; | |
onTransitionEndCapture?: TransitionEventHandler<T>; | |
} | |
interface HTMLAttributes<T> extends AriaAttributes, DOMAttributes<T> { | |
// React-specific Attributes | |
defaultChecked?: boolean; | |
defaultValue?: string | number | ReadonlyArray<string>; | |
suppressContentEditableWarning?: boolean; | |
suppressHydrationWarning?: boolean; | |
// Standard HTML Attributes | |
accessKey?: string; | |
className?: string; | |
contentEditable?: Booleanish | "inherit"; | |
contextMenu?: string; | |
dir?: string; | |
draggable?: Booleanish; | |
hidden?: boolean; | |
id?: string; | |
lang?: string; | |
placeholder?: string; | |
slot?: string; | |
spellCheck?: Booleanish; | |
style?: CSSProperties; | |
tabIndex?: number; | |
title?: string; | |
translate?: 'yes' | 'no'; | |
// Unknown | |
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'; | |
// Living Standard | |
/** | |
* Hints at the type of data that might be entered by the user while editing the element or its contents | |
* @see https://html.spec.whatwg.org/multipage/interaction.html#input-modalities:-the-inputmode-attribute | |
*/ | |
inputMode?: 'none' | 'text' | 'tel' | 'url' | 'email' | 'numeric' | 'decimal' | 'search'; | |
/** | |
* Specify that a standard HTML element should behave like a defined custom built-in element | |
* @see https://html.spec.whatwg.org/multipage/custom-elements.html#attr-is | |
*/ | |
is?: string; | |
} | |
export interface CSSProperties extends CSS.Properties<string | number> { | |
/** | |
* The index signature was removed to enable closed typing for style | |
* using CSSType. You're able to use type assertion or module augmentation | |
* to add properties or an index signature of your own. | |
* | |
* For examples and more information, visit: | |
* https://github.com/frenic/csstype#what-should-i-do-when-i-get-type-errors | |
*/ | |
} | |
// All the WAI-ARIA 1.1 attributes from https://www.w3.org/TR/wai-aria-1.1/ | |
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. */ | |
'aria-atomic'?: boolean | 'false' | 'true'; | |
/** | |
* Indicates whether inputting text could trigger display of one or more predictions of the user's intended value for an input and specifies how predictions would be | |
* presented if they are made. | |
*/ | |
'aria-autocomplete'?: 'none' | 'inline' | 'list' | 'both'; | |
/** Indicates an element is being modified and that assistive technologies MAY want to wait until the modifications are complete before exposing them to the user. */ | |
'aria-busy'?: boolean | 'false' | 'true'; | |
/** | |
* Indicates the current "checked" state of checkboxes, radio buttons, and other widgets. | |
* @see aria-pressed @see aria-selected. | |
*/ | |
'aria-checked'?: boolean | 'false' | 'mixed' | 'true'; | |
/** | |
* Defines the total number of columns in a table, grid, or treegrid. | |
* @see aria-colindex. | |
*/ | |
'aria-colcount'?: number; | |
/** | |
* Defines an element's column index or position with respect to the total number of columns within a table, grid, or treegrid. | |
* @see aria-colcount @see aria-colspan. | |
*/ | |
'aria-colindex'?: number; | |
/** | |
* Defines the number of columns spanned by a cell or gridcell within a table, grid, or treegrid. | |
* @see aria-colindex @see aria-rowspan. | |
*/ | |
'aria-colspan'?: number; | |
/** | |
* Identifies the element (or elements) whose contents or presence are controlled by the current element. | |
* @see aria-owns. | |
*/ | |
'aria-controls'?: string; | |
/** Indicates the element that represents the current item within a container or set of related elements. */ | |
'aria-current'?: boolean | 'false' | 'true' | 'page' | 'step' | 'location' | 'date' | 'time'; | |
/** | |
* Identifies the element (or elements) that describes the object. | |
* @see aria-labelledby | |
*/ | |
'aria-describedby'?: string; | |
/** | |
* Identifies the element that provides a detailed, extended description for the object. | |
* @see aria-describedby. | |
*/ | |
'aria-details'?: string; | |
/** | |
* Indicates that the element is perceivable but disabled, so it is not editable or otherwise operable. | |
* @see aria-hidden @see aria-readonly. | |
*/ | |
'aria-disabled'?: boolean | 'false' | 'true'; | |
/** | |
* Indicates what functions can be performed when a dragged object is released on the drop target. | |
* @deprecated in ARIA 1.1 | |
*/ | |
'aria-dropeffect'?: 'none' | 'copy' | 'execute' | 'link' | 'move' | 'popup'; | |
/** | |
* Identifies the element that provides an error message for the object. | |
* @see aria-invalid @see aria-describedby. | |
*/ | |
'aria-errormessage'?: string; | |
/** Indicates whether the element, or another grouping element it controls, is currently expanded or collapsed. */ | |
'aria-expanded'?: boolean | 'false' | 'true'; | |
/** | |
* Identifies the next element (or elements) in an alternate reading order of content which, at the user's discretion, | |
* allows assistive technology to override the general default of reading in document source order. | |
*/ | |
'aria-flowto'?: string; | |
/** | |
* Indicates an element's "grabbed" state in a drag-and-drop operation. | |
* @deprecated in ARIA 1.1 | |
*/ | |
'aria-grabbed'?: boolean | 'false' | 'true'; | |
/** Indicates the availability and type of interactive popup element, such as menu or dialog, that can be triggered by an element. */ | |
'aria-haspopup'?: boolean | 'false' | 'true' | 'menu' | 'listbox' | 'tree' | 'grid' | 'dialog'; | |
/** | |
* Indicates whether the element is exposed to an accessibility API. | |
* @see aria-disabled. | |
*/ | |
'aria-hidden'?: boolean | 'false' | 'true'; | |
/** | |
* Indicates the entered value does not conform to the format expected by the application. | |
* @see aria-errormessage. | |
*/ | |
'aria-invalid'?: boolean | 'false' | 'true' | 'grammar' | 'spelling'; | |
/** Indicates keyboard shortcuts that an author has implemented to activate or give focus to an element. */ | |
'aria-keyshortcuts'?: string; | |
/** | |
* Defines a string value that labels the current element. | |
* @see aria-labelledby. | |
*/ | |
'aria-label'?: string; | |
/** | |
* Identifies the element (or elements) that labels the current element. | |
* @see aria-describedby. | |
*/ | |
'aria-labelledby'?: string; | |
/** Defines the hierarchical level of an element within a structure. */ | |
'aria-level'?: number; | |
/** Indicates that an element will be updated, and describes the types of updates the user agents, assistive technologies, and user can expect from the live region. */ | |
'aria-live'?: 'off' | 'assertive' | 'polite'; | |
/** Indicates whether an element is modal when displayed. */ | |
'aria-modal'?: boolean | 'false' | 'true'; | |
/** Indicates whether a text box accepts multiple lines of input or only a single line. */ | |
'aria-multiline'?: boolean | 'false' | 'true'; | |
/** Indicates that the user may select more than one item from the current selectable descendants. */ | |
'aria-multiselectable'?: boolean | 'false' | 'true'; | |
/** Indicates whether the element's orientation is horizontal, vertical, or unknown/ambiguous. */ | |
'aria-orientation'?: 'horizontal' | 'vertical'; | |
/** | |
* Identifies an element (or elements) in order to define a visual, functional, or contextual parent/child relationship | |
* between DOM elements where the DOM hierarchy cannot be used to represent the relationship. | |
* @see aria-controls. | |
*/ | |
'aria-owns'?: string; | |
/** | |
* Defines a short hint (a word or short phrase) intended to aid the user with data entry when the control has no value. | |
* A hint could be a sample value or a brief description of the expected format. | |
*/ | |
'aria-placeholder'?: string; | |
/** | |
* Defines an element's number or position in the current set of listitems or treeitems. Not required if all elements in the set are present in the DOM. | |
* @see aria-setsize. | |
*/ | |
'aria-posinset'?: number; | |
/** | |
* Indicates the current "pressed" state of toggle buttons. | |
* @see aria-checked @see aria-selected. | |
*/ | |
'aria-pressed'?: boolean | 'false' | 'mixed' | 'true'; | |
/** | |
* Indicates that the element is not editable, but is otherwise operable. | |
* @see aria-disabled. | |
*/ | |
'aria-readonly'?: boolean | 'false' | 'true'; | |
/** | |
* Indicates what notifications the user agent will trigger when the accessibility tree within a live region is modified. | |
* @see aria-atomic. | |
*/ | |
'aria-relevant'?: 'additions' | 'additions removals' | 'additions text' | 'all' | 'removals' | 'removals additions' | 'removals text' | 'text' | 'text additions' | 'text removals'; | |
/** Indicates that user input is required on the element before a form may be submitted. */ | |
'aria-required'?: boolean | 'false' | 'true'; | |
/** Defines a human-readable, author-localized description for the role of an element. */ | |
'aria-roledescription'?: string; | |
/** | |
* Defines the total number of rows in a table, grid, or treegrid. | |
* @see aria-rowindex. | |
*/ | |
'aria-rowcount'?: number; | |
/** | |
* Defines an element's row index or position with respect to the total number of rows within a table, grid, or treegrid. | |
* @see aria-rowcount @see aria-rowspan. | |
*/ | |
'aria-rowindex'?: number; | |
/** | |
* Defines the number of rows spanned by a cell or gridcell within a table, grid, or treegrid. | |
* @see aria-rowindex @see aria-colspan. | |
*/ | |
'aria-rowspan'?: number; | |
/** | |
* Indicates the current "selected" state of various widgets. | |
* @see aria-checked @see aria-pressed. | |
*/ | |
'aria-selected'?: boolean | 'false' | 'true'; | |
/** | |
* Defines the number of items in the current set of listitems or treeitems. Not required if all elements in the set are present in the DOM. | |
* @see aria-posinset. | |
*/ | |
'aria-setsize'?: number; | |
/** Indicates if items in a table or grid are sorted in ascending or descending order. */ | |
'aria-sort'?: 'none' | 'ascending' | 'descending' | 'other'; | |
/** Defines the maximum allowed value for a range widget. */ | |
'aria-valuemax'?: number; | |
/** Defines the minimum allowed value for a range widget. */ | |
'aria-valuemin'?: number; | |
/** | |
* Defines the current value for a range widget. | |
* @see aria-valuetext. | |
*/ | |
'aria-valuenow'?: number; | |
/** Defines the human readable text alternative of aria-valuenow for a range widget. */ | |
'aria-valuetext'?: string; | |
} | |
interface HTMLAttributes<T> extends AriaAttributes, DOMAttributes<T> { | |
// React-specific Attributes | |
defaultChecked?: boolean; | |
defaultValue?: string | number | ReadonlyArray<string>; | |
suppressContentEditableWarning?: boolean; | |
suppressHydrationWarning?: boolean; | |
// Standard HTML Attributes | |
accessKey?: string; | |
className?: string; | |
contentEditable?: Booleanish | "inherit"; | |
contextMenu?: string; | |
dir?: string; | |
draggable?: Booleanish; | |
hidden?: boolean; | |
id?: string; | |
lang?: string; | |
placeholder?: string; | |
slot?: string; | |
spellCheck?: Booleanish; | |
style?: CSSProperties; | |
tabIndex?: number; | |
title?: string; | |
translate?: 'yes' | 'no'; | |
// Unknown | |
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'; | |
// Living Standard | |
/** | |
* Hints at the type of data that might be entered by the user while editing the element or its contents | |
* @see https://html.spec.whatwg.org/multipage/interaction.html#input-modalities:-the-inputmode-attribute | |
*/ | |
inputMode?: 'none' | 'text' | 'tel' | 'url' | 'email' | 'numeric' | 'decimal' | 'search'; | |
/** | |
* Specify that a standard HTML element should behave like a defined custom built-in element | |
* @see https://html.spec.whatwg.org/multipage/custom-elements.html#attr-is | |
*/ | |
is?: string; | |
} | |
interface AllHTMLAttributes<T> extends HTMLAttributes<T> { | |
// Standard HTML Attributes | |
accept?: string; | |
acceptCharset?: string; | |
action?: string; | |
allowFullScreen?: boolean; | |
allowTransparency?: boolean; | |
alt?: string; | |
as?: string; | |
async?: boolean; | |
autoComplete?: string; | |
autoFocus?: boolean; | |
autoPlay?: boolean; | |
capture?: boolean | string; | |
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 | ReadonlyArray<string> | number; | |
width?: number | string; | |
wmode?: string; | |
wrap?: string; | |
} | |
type HTMLAttributeReferrerPolicy = | |
| '' | |
| 'no-referrer' | |
| 'no-referrer-when-downgrade' | |
| 'origin' | |
| 'origin-when-cross-origin' | |
| 'same-origin' | |
| 'strict-origin' | |
| 'strict-origin-when-cross-origin' | |
| 'unsafe-url'; | |
interface AnchorHTMLAttributes<T> extends HTMLAttributes<T> { | |
download?: any; | |
href?: string; | |
hrefLang?: string; | |
media?: string; | |
ping?: string; | |
rel?: string; | |
target?: string; | |
type?: string; | |
referrerPolicy?: HTMLAttributeReferrerPolicy; | |
} | |
interface AudioHTMLAttributes<T> extends MediaHTMLAttributes<T> {} | |
interface AreaHTMLAttributes<T> extends HTMLAttributes<T> { | |
alt?: string; | |
coords?: string; | |
download?: any; | |
href?: string; | |
hrefLang?: string; | |
media?: string; | |
referrerPolicy?: HTMLAttributeReferrerPolicy; | |
rel?: string; | |
shape?: string; | |
target?: string; | |
} | |
interface BaseHTMLAttributes<T> extends HTMLAttributes<T> { | |
href?: string; | |
target?: string; | |
} | |
interface BlockquoteHTMLAttributes<T> extends HTMLAttributes<T> { | |
cite?: string; | |
} | |
interface ButtonHTMLAttributes<T> extends HTMLAttributes<T> { | |
autoFocus?: boolean; | |
disabled?: boolean; | |
form?: string; | |
formAction?: string; | |
formEncType?: string; | |
formMethod?: string; | |
formNoValidate?: boolean; | |
formTarget?: string; | |
name?: string; | |
type?: 'submit' | 'reset' | 'button'; | |
value?: string | ReadonlyArray<string> | number; | |
} | |
interface CanvasHTMLAttributes<T> extends HTMLAttributes<T> { | |
height?: number | string; | |
width?: number | string; | |
} | |
interface ColHTMLAttributes<T> extends HTMLAttributes<T> { | |
span?: number; | |
width?: number | string; | |
} | |
interface ColgroupHTMLAttributes<T> extends HTMLAttributes<T> { | |
span?: number; | |
} | |
interface DataHTMLAttributes<T> extends HTMLAttributes<T> { | |
value?: string | ReadonlyArray<string> | number; | |
} | |
interface DetailsHTMLAttributes<T> extends HTMLAttributes<T> { | |
open?: boolean; | |
onToggle?: MithrilEventHandler<T>; | |
} | |
interface DelHTMLAttributes<T> extends HTMLAttributes<T> { | |
cite?: string; | |
dateTime?: string; | |
} | |
interface DialogHTMLAttributes<T> extends HTMLAttributes<T> { | |
open?: boolean; | |
} | |
interface EmbedHTMLAttributes<T> extends HTMLAttributes<T> { | |
height?: number | string; | |
src?: string; | |
type?: string; | |
width?: number | string; | |
} | |
interface FieldsetHTMLAttributes<T> extends HTMLAttributes<T> { | |
disabled?: boolean; | |
form?: string; | |
name?: string; | |
} | |
interface FormHTMLAttributes<T> extends HTMLAttributes<T> { | |
acceptCharset?: string; | |
action?: string; | |
autoComplete?: string; | |
encType?: string; | |
method?: string; | |
name?: string; | |
noValidate?: boolean; | |
target?: string; | |
} | |
interface HtmlHTMLAttributes<T> extends HTMLAttributes<T> { | |
manifest?: string; | |
} | |
interface IframeHTMLAttributes<T> extends HTMLAttributes<T> { | |
allow?: string; | |
allowFullScreen?: boolean; | |
allowTransparency?: boolean; | |
/** @deprecated */ | |
frameBorder?: number | string; | |
height?: number | string; | |
loading?: "eager" | "lazy"; | |
/** @deprecated */ | |
marginHeight?: number; | |
/** @deprecated */ | |
marginWidth?: number; | |
name?: string; | |
referrerPolicy?: HTMLAttributeReferrerPolicy; | |
sandbox?: string; | |
/** @deprecated */ | |
scrolling?: string; | |
seamless?: boolean; | |
src?: string; | |
srcDoc?: string; | |
width?: number | string; | |
} | |
interface ImgHTMLAttributes<T> extends HTMLAttributes<T> { | |
alt?: string; | |
crossOrigin?: "anonymous" | "use-credentials" | ""; | |
decoding?: "async" | "auto" | "sync"; | |
height?: number | string; | |
loading?: "eager" | "lazy"; | |
referrerPolicy?: HTMLAttributeReferrerPolicy; | |
sizes?: string; | |
src?: string; | |
srcSet?: string; | |
useMap?: string; | |
width?: number | string; | |
} | |
interface InsHTMLAttributes<T> extends HTMLAttributes<T> { | |
cite?: string; | |
dateTime?: string; | |
} | |
interface InputHTMLAttributes<T> extends HTMLAttributes<T> { | |
accept?: string; | |
alt?: string; | |
autoComplete?: string; | |
autoFocus?: boolean; | |
capture?: boolean | string; // https://www.w3.org/TR/html-media-capture/#the-capture-attribute | |
checked?: boolean; | |
crossOrigin?: string; | |
disabled?: boolean; | |
enterKeyHint?: 'enter' | 'done' | 'go' | 'next' | 'previous' | 'search' | 'send'; | |
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 | ReadonlyArray<string> | number; | |
width?: number | string; | |
onChange?: ChangeEventHandler<T>; | |
} | |
interface KeygenHTMLAttributes<T> extends HTMLAttributes<T> { | |
autoFocus?: boolean; | |
challenge?: string; | |
disabled?: boolean; | |
form?: string; | |
keyType?: string; | |
keyParams?: string; | |
name?: string; | |
} | |
interface LabelHTMLAttributes<T> extends HTMLAttributes<T> { | |
form?: string; | |
htmlFor?: string; | |
} | |
interface LiHTMLAttributes<T> extends HTMLAttributes<T> { | |
value?: string | ReadonlyArray<string> | number; | |
} | |
interface LinkHTMLAttributes<T> extends HTMLAttributes<T> { | |
as?: string; | |
crossOrigin?: string; | |
href?: string; | |
hrefLang?: string; | |
integrity?: string; | |
media?: string; | |
referrerPolicy?: HTMLAttributeReferrerPolicy; | |
rel?: string; | |
sizes?: string; | |
type?: string; | |
charSet?: string; | |
} | |
interface MapHTMLAttributes<T> extends HTMLAttributes<T> { | |
name?: string; | |
} | |
interface MenuHTMLAttributes<T> extends HTMLAttributes<T> { | |
type?: string; | |
} | |
interface MediaHTMLAttributes<T> extends HTMLAttributes<T> { | |
autoPlay?: boolean; | |
controls?: boolean; | |
controlsList?: string; | |
crossOrigin?: string; | |
loop?: boolean; | |
mediaGroup?: string; | |
muted?: boolean; | |
playsInline?: boolean; | |
preload?: string; | |
src?: string; | |
} | |
interface MetaHTMLAttributes<T> extends HTMLAttributes<T> { | |
charSet?: string; | |
content?: string; | |
httpEquiv?: string; | |
name?: string; | |
} | |
interface MeterHTMLAttributes<T> extends HTMLAttributes<T> { | |
form?: string; | |
high?: number; | |
low?: number; | |
max?: number | string; | |
min?: number | string; | |
optimum?: number; | |
value?: string | ReadonlyArray<string> | number; | |
} | |
interface QuoteHTMLAttributes<T> extends HTMLAttributes<T> { | |
cite?: string; | |
} | |
interface ObjectHTMLAttributes<T> extends HTMLAttributes<T> { | |
classID?: string; | |
data?: string; | |
form?: string; | |
height?: number | string; | |
name?: string; | |
type?: string; | |
useMap?: string; | |
width?: number | string; | |
wmode?: string; | |
} | |
interface OlHTMLAttributes<T> extends HTMLAttributes<T> { | |
reversed?: boolean; | |
start?: number; | |
type?: '1' | 'a' | 'A' | 'i' | 'I'; | |
} | |
interface OptgroupHTMLAttributes<T> extends HTMLAttributes<T> { | |
disabled?: boolean; | |
label?: string; | |
} | |
interface OptionHTMLAttributes<T> extends HTMLAttributes<T> { | |
disabled?: boolean; | |
label?: string; | |
selected?: boolean; | |
value?: string | ReadonlyArray<string> | number; | |
} | |
interface OutputHTMLAttributes<T> extends HTMLAttributes<T> { | |
form?: string; | |
htmlFor?: string; | |
name?: string; | |
} | |
interface ParamHTMLAttributes<T> extends HTMLAttributes<T> { | |
name?: string; | |
value?: string | ReadonlyArray<string> | number; | |
} | |
interface ProgressHTMLAttributes<T> extends HTMLAttributes<T> { | |
max?: number | string; | |
value?: string | ReadonlyArray<string> | number; | |
} | |
interface SlotHTMLAttributes<T> extends HTMLAttributes<T> { | |
name?: string; | |
} | |
interface ScriptHTMLAttributes<T> extends HTMLAttributes<T> { | |
async?: boolean; | |
/** @deprecated */ | |
charSet?: string; | |
crossOrigin?: string; | |
defer?: boolean; | |
integrity?: string; | |
noModule?: boolean; | |
nonce?: string; | |
referrerPolicy?: HTMLAttributeReferrerPolicy; | |
src?: string; | |
type?: string; | |
} | |
interface SelectHTMLAttributes<T> extends HTMLAttributes<T> { | |
autoComplete?: string; | |
autoFocus?: boolean; | |
disabled?: boolean; | |
form?: string; | |
multiple?: boolean; | |
name?: string; | |
required?: boolean; | |
size?: number; | |
value?: string | ReadonlyArray<string> | number; | |
onChange?: ChangeEventHandler<T>; | |
} | |
interface SourceHTMLAttributes<T> extends HTMLAttributes<T> { | |
media?: string; | |
sizes?: string; | |
src?: string; | |
srcSet?: string; | |
type?: string; | |
} | |
interface StyleHTMLAttributes<T> extends HTMLAttributes<T> { | |
media?: string; | |
nonce?: string; | |
scoped?: boolean; | |
type?: string; | |
} | |
interface TableHTMLAttributes<T> extends HTMLAttributes<T> { | |
cellPadding?: number | string; | |
cellSpacing?: number | string; | |
summary?: string; | |
width?: number | string; | |
} | |
interface TextareaHTMLAttributes<T> extends HTMLAttributes<T> { | |
autoComplete?: string; | |
autoFocus?: boolean; | |
cols?: number; | |
dirName?: string; | |
disabled?: boolean; | |
form?: string; | |
maxLength?: number; | |
minLength?: number; | |
name?: string; | |
placeholder?: string; | |
readOnly?: boolean; | |
required?: boolean; | |
rows?: number; | |
value?: string | ReadonlyArray<string> | number; | |
wrap?: string; | |
onChange?: ChangeEventHandler<T>; | |
} | |
interface TdHTMLAttributes<T> extends HTMLAttributes<T> { | |
align?: "left" | "center" | "right" | "justify" | "char"; | |
colSpan?: number; | |
headers?: string; | |
rowSpan?: number; | |
scope?: string; | |
abbr?: string; | |
height?: number | string; | |
width?: number | string; | |
valign?: "top" | "middle" | "bottom" | "baseline"; | |
} | |
interface ThHTMLAttributes<T> extends HTMLAttributes<T> { | |
align?: "left" | "center" | "right" | "justify" | "char"; | |
colSpan?: number; | |
headers?: string; | |
rowSpan?: number; | |
scope?: string; | |
abbr?: string; | |
} | |
interface TimeHTMLAttributes<T> extends HTMLAttributes<T> { | |
dateTime?: string; | |
} | |
interface TrackHTMLAttributes<T> extends HTMLAttributes<T> { | |
default?: boolean; | |
kind?: string; | |
label?: string; | |
src?: string; | |
srcLang?: string; | |
} | |
interface VideoHTMLAttributes<T> extends MediaHTMLAttributes<T> { | |
height?: number | string; | |
playsInline?: boolean; | |
poster?: string; | |
width?: number | string; | |
disablePictureInPicture?: boolean; | |
disableRemotePlayback?: boolean; | |
} | |
// 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<T> extends AriaAttributes, DOMAttributes<T> { | |
// Attributes which also defined in HTMLAttributes | |
// See comment in SVGDOMPropertyConfig.js | |
className?: string; | |
color?: string; | |
height?: number | string; | |
id?: string; | |
lang?: string; | |
max?: number | string; | |
media?: string; | |
method?: string; | |
min?: number | string; | |
name?: string; | |
style?: CSSProperties; | |
target?: string; | |
type?: string; | |
width?: number | string; | |
// Other HTML properties supported by SVG elements in browsers | |
role?: string; | |
tabIndex?: number; | |
crossOrigin?: "anonymous" | "use-credentials" | ""; | |
// SVG Specific attributes | |
accentHeight?: number | string; | |
accumulate?: "none" | "sum"; | |
additive?: "replace" | "sum"; | |
alignmentBaseline?: "auto" | "baseline" | "before-edge" | "text-before-edge" | "middle" | "central" | "after-edge" | | |
"text-after-edge" | "ideographic" | "alphabetic" | "hanging" | "mathematical" | "inherit"; | |
allowReorder?: "no" | "yes"; | |
alphabetic?: number | string; | |
amplitude?: number | string; | |
arabicForm?: "initial" | "medial" | "terminal" | "isolated"; | |
ascent?: number | string; | |
attributeName?: string; | |
attributeType?: string; | |
autoReverse?: Booleanish; | |
azimuth?: number | string; | |
baseFrequency?: number | string; | |
baselineShift?: number | string; | |
baseProfile?: number | string; | |
bbox?: number | string; | |
begin?: number | string; | |
bias?: number | string; | |
by?: number | string; | |
calcMode?: number | string; | |
capHeight?: number | string; | |
clip?: number | string; | |
clipPath?: string; | |
clipPathUnits?: number | string; | |
clipRule?: number | string; | |
colorInterpolation?: number | string; | |
colorInterpolationFilters?: "auto" | "sRGB" | "linearRGB" | "inherit"; | |
colorProfile?: number | string; | |
colorRendering?: number | string; | |
contentScriptType?: number | string; | |
contentStyleType?: number | string; | |
cursor?: number | string; | |
cx?: number | string; | |
cy?: number | string; | |
d?: string; | |
decelerate?: number | string; | |
descent?: number | string; | |
diffuseConstant?: number | string; | |
direction?: number | string; | |
display?: number | string; | |
divisor?: number | string; | |
dominantBaseline?: number | string; | |
dur?: number | string; | |
dx?: number | string; | |
dy?: number | string; | |
edgeMode?: number | string; | |
elevation?: number | string; | |
enableBackground?: number | string; | |
end?: number | string; | |
exponent?: number | string; | |
externalResourcesRequired?: Booleanish; | |
fill?: string; | |
fillOpacity?: number | string; | |
fillRule?: "nonzero" | "evenodd" | "inherit"; | |
filter?: string; | |
filterRes?: number | string; | |
filterUnits?: number | string; | |
floodColor?: number | string; | |
floodOpacity?: number | string; | |
focusable?: Booleanish | "auto"; | |
fontFamily?: string; | |
fontSize?: number | string; | |
fontSizeAdjust?: number | string; | |
fontStretch?: number | string; | |
fontStyle?: number | string; | |
fontVariant?: number | string; | |
fontWeight?: number | string; | |
format?: number | string; | |
from?: number | string; | |
fx?: number | string; | |
fy?: number | string; | |
g1?: number | string; | |
g2?: number | string; | |
glyphName?: number | string; | |
glyphOrientationHorizontal?: number | string; | |
glyphOrientationVertical?: number | string; | |
glyphRef?: number | string; | |
gradientTransform?: string; | |
gradientUnits?: string; | |
hanging?: number | string; | |
horizAdvX?: number | string; | |
horizOriginX?: number | string; | |
href?: string; | |
ideographic?: number | string; | |
imageRendering?: number | string; | |
in2?: number | string; | |
in?: string; | |
intercept?: number | string; | |
k1?: number | string; | |
k2?: number | string; | |
k3?: number | string; | |
k4?: number | string; | |
k?: number | string; | |
kernelMatrix?: number | string; | |
kernelUnitLength?: number | string; | |
kerning?: number | string; | |
keyPoints?: number | string; | |
keySplines?: number | string; | |
keyTimes?: number | string; | |
lengthAdjust?: number | string; | |
letterSpacing?: number | string; | |
lightingColor?: number | string; | |
limitingConeAngle?: number | string; | |
local?: number | string; | |
markerEnd?: string; | |
markerHeight?: number | string; | |
markerMid?: string; | |
markerStart?: string; | |
markerUnits?: number | string; | |
markerWidth?: number | string; | |
mask?: string; | |
maskContentUnits?: number | string; | |
maskUnits?: number | string; | |
mathematical?: number | string; | |
mode?: number | string; | |
numOctaves?: number | string; | |
offset?: number | string; | |
opacity?: number | string; | |
operator?: number | string; | |
order?: number | string; | |
orient?: number | string; | |
orientation?: number | string; | |
origin?: number | string; | |
overflow?: number | string; | |
overlinePosition?: number | string; | |
overlineThickness?: number | string; | |
paintOrder?: number | string; | |
panose1?: number | string; | |
path?: string; | |
pathLength?: number | string; | |
patternContentUnits?: string; | |
patternTransform?: number | string; | |
patternUnits?: string; | |
pointerEvents?: number | string; | |
points?: string; | |
pointsAtX?: number | string; | |
pointsAtY?: number | string; | |
pointsAtZ?: number | string; | |
preserveAlpha?: Booleanish; | |
preserveAspectRatio?: string; | |
primitiveUnits?: number | string; | |
r?: number | string; | |
radius?: number | string; | |
refX?: number | string; | |
refY?: number | string; | |
renderingIntent?: number | string; | |
repeatCount?: number | string; | |
repeatDur?: number | string; | |
requiredExtensions?: number | string; | |
requiredFeatures?: number | string; | |
restart?: number | string; | |
result?: string; | |
rotate?: number | string; | |
rx?: number | string; | |
ry?: number | string; | |
scale?: number | string; | |
seed?: number | string; | |
shapeRendering?: number | string; | |
slope?: number | string; | |
spacing?: number | string; | |
specularConstant?: number | string; | |
specularExponent?: number | string; | |
speed?: number | string; | |
spreadMethod?: string; | |
startOffset?: number | string; | |
stdDeviation?: number | string; | |
stemh?: number | string; | |
stemv?: number | string; | |
stitchTiles?: number | string; | |
stopColor?: string; | |
stopOpacity?: number | string; | |
strikethroughPosition?: number | string; | |
strikethroughThickness?: number | string; | |
string?: number | string; | |
stroke?: string; | |
strokeDasharray?: string | number; | |
strokeDashoffset?: string | number; | |
strokeLinecap?: "butt" | "round" | "square" | "inherit"; | |
strokeLinejoin?: "miter" | "round" | "bevel" | "inherit"; | |
strokeMiterlimit?: number | string; | |
strokeOpacity?: number | string; | |
strokeWidth?: number | string; | |
surfaceScale?: number | string; | |
systemLanguage?: number | string; | |
tableValues?: number | string; | |
targetX?: number | string; | |
targetY?: number | string; | |
textAnchor?: string; | |
textDecoration?: number | string; | |
textLength?: number | string; | |
textRendering?: number | string; | |
to?: number | string; | |
transform?: string; | |
u1?: number | string; | |
u2?: number | string; | |
underlinePosition?: number | string; | |
underlineThickness?: number | string; | |
unicode?: number | string; | |
unicodeBidi?: number | string; | |
unicodeRange?: number | string; | |
unitsPerEm?: number | string; | |
vAlphabetic?: number | string; | |
values?: string; | |
vectorEffect?: number | string; | |
version?: string; | |
vertAdvY?: number | string; | |
vertOriginX?: number | string; | |
vertOriginY?: number | string; | |
vHanging?: number | string; | |
vIdeographic?: number | string; | |
viewBox?: string; | |
viewTarget?: number | string; | |
visibility?: number | string; | |
vMathematical?: number | string; | |
widths?: number | string; | |
wordSpacing?: number | string; | |
writingMode?: number | string; | |
x1?: number | string; | |
x2?: number | string; | |
x?: number | string; | |
xChannelSelector?: string; | |
xHeight?: number | string; | |
xlinkActuate?: string; | |
xlinkArcrole?: string; | |
xlinkHref?: string; | |
xlinkRole?: string; | |
xlinkShow?: string; | |
xlinkTitle?: string; | |
xlinkType?: string; | |
xmlBase?: string; | |
xmlLang?: string; | |
xmlns?: string; | |
xmlnsXlink?: string; | |
xmlSpace?: string; | |
y1?: number | string; | |
y2?: number | string; | |
y?: number | string; | |
yChannelSelector?: string; | |
z?: number | string; | |
zoomAndPan?: string; | |
} | |
interface IntrinsicElements { | |
// HTML | |
a: m.Attributes & AnchorHTMLAttributes<HTMLAnchorElement>; | |
abbr: m.Attributes & HTMLAttributes<HTMLElement>; | |
address: m.Attributes & HTMLAttributes<HTMLElement>; | |
area: m.Attributes & HTMLAttributes<HTMLElement>; | |
article: m.Attributes & HTMLAttributes<HTMLElement>; | |
aside: m.Attributes & HTMLAttributes<HTMLElement>; | |
audio: m.Attributes & AudioHTMLAttributes<HTMLAudioElement> | |
b: m.Attributes & HTMLAttributes<HTMLElement> | |
base: m.Attributes & BaseHTMLAttributes<HTMLBaseElement> | |
bdi: m.Attributes & HTMLAttributes<HTMLElement> | |
bdo: m.Attributes & HTMLAttributes<HTMLElement> | |
big: m.Attributes & HTMLAttributes<HTMLElement> | |
blockquote: m.Attributes & BlockquoteHTMLAttributes<HTMLElement> | |
body: m.Attributes & HTMLAttributes<HTMLBodyElement> | |
br: m.Attributes & HTMLAttributes<HTMLBRElement> | |
button: m.Attributes & ButtonHTMLAttributes<HTMLButtonElement> | |
canvas: m.Attributes & CanvasHTMLAttributes<HTMLCanvasElement> | |
caption: m.Attributes & HTMLAttributes<HTMLElement> | |
cite: m.Attributes & HTMLAttributes<HTMLElement> | |
code: m.Attributes & HTMLAttributes<HTMLElement> | |
col: m.Attributes & ColHTMLAttributes<HTMLTableColElement> | |
colgroup: m.Attributes & ColgroupHTMLAttributes<HTMLTableColElement> | |
data: m.Attributes & DataHTMLAttributes<HTMLDataElement> | |
datalist: m.Attributes & HTMLAttributes<HTMLDataListElement> | |
dd: m.Attributes & HTMLAttributes<HTMLElement> | |
del: m.Attributes & DelHTMLAttributes<HTMLElement> | |
details: m.Attributes & DetailsHTMLAttributes<HTMLElement> | |
dfn: m.Attributes & HTMLAttributes<HTMLElement> | |
dialog: m.Attributes & DialogHTMLAttributes<HTMLDialogElement> | |
div: m.Attributes & HTMLAttributes<HTMLDivElement> | |
dl: m.Attributes & HTMLAttributes<HTMLDListElement> | |
dt: m.Attributes & HTMLAttributes<HTMLElement> | |
em: m.Attributes & HTMLAttributes<HTMLElement> | |
embed: m.Attributes & EmbedHTMLAttributes<HTMLEmbedElement> | |
fieldset: m.Attributes & FieldsetHTMLAttributes<HTMLFieldSetElement> | |
figcaption: m.Attributes & HTMLAttributes<HTMLElement> | |
figure: m.Attributes & HTMLAttributes<HTMLElement> | |
footer: m.Attributes & HTMLAttributes<HTMLElement> | |
form: m.Attributes & FormHTMLAttributes<HTMLFormElement> | |
h1: m.Attributes & HTMLAttributes<HTMLHeadingElement> | |
h2: m.Attributes & HTMLAttributes<HTMLHeadingElement> | |
h3: m.Attributes & HTMLAttributes<HTMLHeadingElement> | |
h4: m.Attributes & HTMLAttributes<HTMLHeadingElement> | |
h5: m.Attributes & HTMLAttributes<HTMLHeadingElement> | |
h6: m.Attributes & HTMLAttributes<HTMLHeadingElement> | |
head: m.Attributes & HTMLAttributes<HTMLHeadElement> | |
header: m.Attributes & HTMLAttributes<HTMLElement> | |
hgroup: m.Attributes & HTMLAttributes<HTMLElement> | |
hr: m.Attributes & HTMLAttributes<HTMLHRElement> | |
html: m.Attributes & HtmlHTMLAttributes<HTMLHtmlElement> | |
i: m.Attributes & HTMLAttributes<HTMLElement> | |
iframe: m.Attributes & IframeHTMLAttributes<HTMLIFrameElement> | |
img: m.Attributes & ImgHTMLAttributes<HTMLImageElement> | |
input: m.Attributes & InputHTMLAttributes<HTMLInputElement> | |
ins: m.Attributes & InsHTMLAttributes<HTMLModElement> | |
kbd: m.Attributes & HTMLAttributes<HTMLElement> | |
keygen: m.Attributes & KeygenHTMLAttributes<HTMLElement> | |
label: m.Attributes & LabelHTMLAttributes<HTMLLabelElement> | |
legend: m.Attributes & HTMLAttributes<HTMLLegendElement> | |
li: m.Attributes & LiHTMLAttributes<HTMLLIElement> | |
link: m.Attributes & LinkHTMLAttributes<HTMLLinkElement> | |
main: m.Attributes & HTMLAttributes<HTMLElement> | |
map: m.Attributes & MapHTMLAttributes<HTMLMapElement> | |
mark: m.Attributes & HTMLAttributes<HTMLElement> | |
menu: m.Attributes & MenuHTMLAttributes<HTMLElement> | |
menuitem: m.Attributes & HTMLAttributes<HTMLElement> | |
meta: m.Attributes & MetaHTMLAttributes<HTMLMetaElement> | |
meter: m.Attributes & MeterHTMLAttributes<HTMLElement> | |
nav: m.Attributes & HTMLAttributes<HTMLElement> | |
// noindex: m.Attributes & HTMLAttributes<HTMLElement> OLD | |
noscript: m.Attributes & HTMLAttributes<HTMLElement> | |
object: m.Attributes & ObjectHTMLAttributes<HTMLObjectElement> | |
ol: m.Attributes & OlHTMLAttributes<HTMLOListElement> | |
optgroup: m.Attributes & OptgroupHTMLAttributes<HTMLOptGroupElement> | |
option: m.Attributes & OptionHTMLAttributes<HTMLOptionElement> | |
output: m.Attributes & OutputHTMLAttributes<HTMLElement> | |
p: m.Attributes & HTMLAttributes<HTMLParagraphElement> | |
param: m.Attributes & ParamHTMLAttributes<HTMLParamElement> | |
picture: m.Attributes & HTMLAttributes<HTMLElement> | |
pre: m.Attributes & HTMLAttributes<HTMLPreElement> | |
progress: m.Attributes & ProgressHTMLAttributes<HTMLProgressElement> | |
q: m.Attributes & QuoteHTMLAttributes<HTMLQuoteElement> | |
rp: m.Attributes & HTMLAttributes<HTMLElement> | |
rt: m.Attributes & HTMLAttributes<HTMLElement> | |
ruby: m.Attributes & HTMLAttributes<HTMLElement> | |
s: m.Attributes & HTMLAttributes<HTMLElement> | |
samp: m.Attributes & HTMLAttributes<HTMLElement> | |
slot: m.Attributes & SlotHTMLAttributes<HTMLSlotElement> // NEW | |
script: m.Attributes & ScriptHTMLAttributes<HTMLScriptElement> | |
section: m.Attributes & HTMLAttributes<HTMLElement> | |
select: m.Attributes & SelectHTMLAttributes<HTMLSelectElement> | |
small: m.Attributes & HTMLAttributes<HTMLElement> | |
source: m.Attributes & SourceHTMLAttributes<HTMLSourceElement> | |
span: m.Attributes & HTMLAttributes<HTMLSpanElement> | |
strong: m.Attributes & HTMLAttributes<HTMLElement> | |
style: m.Attributes & StyleHTMLAttributes<HTMLStyleElement> | |
sub: m.Attributes & HTMLAttributes<HTMLElement> | |
summary: m.Attributes & HTMLAttributes<HTMLElement> | |
sup: m.Attributes & HTMLAttributes<HTMLElement> | |
table: m.Attributes & TableHTMLAttributes<HTMLTableElement> | |
template: m.Attributes & HTMLAttributes<HTMLTemplateElement> | |
tbody: m.Attributes & HTMLAttributes<HTMLTableSectionElement> | |
td: m.Attributes & TdHTMLAttributes<HTMLTableDataCellElement> | |
textarea: m.Attributes & TextareaHTMLAttributes<HTMLTextAreaElement> | |
tfoot: m.Attributes & HTMLAttributes<HTMLTableSectionElement> | |
th: m.Attributes & ThHTMLAttributes<HTMLTableHeaderCellElement> | |
thead: m.Attributes & HTMLAttributes<HTMLTableSectionElement> | |
time: m.Attributes & TimeHTMLAttributes<HTMLElement> | |
title: m.Attributes & HTMLAttributes<HTMLTitleElement> | |
tr: m.Attributes & HTMLAttributes<HTMLTableRowElement> | |
track: m.Attributes & TrackHTMLAttributes<HTMLTrackElement> | |
u: m.Attributes & HTMLAttributes<HTMLElement> | |
ul: m.Attributes & HTMLAttributes<HTMLUListElement> | |
var: m.Attributes & HTMLAttributes<HTMLElement> | |
video: m.Attributes & VideoHTMLAttributes<HTMLVideoElement> | |
wbr: m.Attributes & HTMLAttributes<HTMLElement> | |
// SVG | |
svg: m.Attributes & SVGProps<SVGElement> | |
animate: m.Attributes & SVGProps<SVGElement> // TODO: It is SVGAnimateElement but is not in TypeScript's lib.dom.d.ts for now. | |
animateMotion: m.Attributes & SVGProps<SVGElement> | |
animateTransform: m.Attributes & SVGProps<SVGElement> // TODO: It is SVGAnimateTransformElement but is not in TypeScript's lib.dom.d.ts for now. | |
circle: m.Attributes & SVGProps<SVGCircleElement> | |
clipPath: m.Attributes & SVGProps<SVGClipPathElement> | |
defs: m.Attributes & SVGProps<SVGDefsElement> | |
desc: m.Attributes & SVGProps<SVGDescElement> | |
ellipse: m.Attributes & SVGProps<SVGEllipseElement> | |
feBlend: m.Attributes & SVGProps<SVGFEBlendElement> | |
feColorMatrix: m.Attributes & SVGProps<SVGFEColorMatrixElement> | |
feComponentTransfer: m.Attributes & SVGProps<SVGFEComponentTransferElement> | |
feComposite: m.Attributes & SVGProps<SVGFECompositeElement> | |
feConvolveMatrix: m.Attributes & SVGProps<SVGFEConvolveMatrixElement> | |
feDiffuseLighting: m.Attributes & SVGProps<SVGFEDiffuseLightingElement> | |
feDisplacementMap: m.Attributes & SVGProps<SVGFEDisplacementMapElement> | |
feDistantLight: m.Attributes & SVGProps<SVGFEDistantLightElement> | |
feDropShadow: m.Attributes & SVGProps<SVGFEDropShadowElement> | |
feFlood: m.Attributes & SVGProps<SVGFEFloodElement> | |
feFuncA: m.Attributes & SVGProps<SVGFEFuncAElement> | |
feFuncB: m.Attributes & SVGProps<SVGFEFuncBElement> | |
feFuncG: m.Attributes & SVGProps<SVGFEFuncGElement> | |
feFuncR: m.Attributes & SVGProps<SVGFEFuncRElement> | |
feGaussianBlur: m.Attributes & SVGProps<SVGFEGaussianBlurElement> | |
feImage: m.Attributes & SVGProps<SVGFEImageElement> | |
feMerge: m.Attributes & SVGProps<SVGFEMergeElement> | |
feMergeNode: m.Attributes & SVGProps<SVGFEMergeNodeElement> | |
feMorphology: m.Attributes & SVGProps<SVGFEMorphologyElement> | |
feOffset: m.Attributes & SVGProps<SVGFEOffsetElement> | |
fePointLight: m.Attributes & SVGProps<SVGFEPointLightElement> | |
feSpecularLighting: m.Attributes & SVGProps<SVGFESpecularLightingElement> | |
feSpotLight: m.Attributes & SVGProps<SVGFESpotLightElement> | |
feTile: m.Attributes & SVGProps<SVGFETileElement> | |
feTurbulence: m.Attributes & SVGProps<SVGFETurbulenceElement> | |
filter: m.Attributes & SVGProps<SVGFilterElement> | |
foreignObject: m.Attributes & SVGProps<SVGForeignObjectElement> | |
g: m.Attributes & SVGProps<SVGGElement> | |
image: m.Attributes & SVGProps<SVGImageElement> | |
line: m.Attributes & SVGProps<SVGLineElement> | |
linearGradient: m.Attributes & SVGProps<SVGLinearGradientElement> | |
marker: m.Attributes & SVGProps<SVGMarkerElement> | |
mask: m.Attributes & SVGProps<SVGMaskElement> | |
metadata: m.Attributes & SVGProps<SVGMetadataElement> | |
mpath: m.Attributes & SVGProps<SVGElement> | |
path: m.Attributes & SVGProps<SVGPathElement> | |
pattern: m.Attributes & SVGProps<SVGPatternElement> | |
polygon: m.Attributes & SVGProps<SVGPolygonElement> | |
polyline: m.Attributes & SVGProps<SVGPolylineElement> | |
radialGradient: m.Attributes & SVGProps<SVGRadialGradientElement> | |
rect: m.Attributes & SVGProps<SVGRectElement> | |
stop: m.Attributes & SVGProps<SVGStopElement> | |
switch: m.Attributes & SVGProps<SVGSwitchElement> | |
symbol: m.Attributes & SVGProps<SVGSymbolElement> | |
text: m.Attributes & SVGProps<SVGTextElement> | |
textPath: m.Attributes & SVGProps<SVGTextPathElement> | |
tspan: m.Attributes & SVGProps<SVGTSpanElement> | |
use: m.Attributes & SVGProps<SVGUseElement> | |
view: m.Attributes & SVGProps<SVGViewElement> | |
// Special m types | |
'[': m.Attributes & HTMLAttributes<HTMLElement> | |
} | |
} | |
} |