inferno
Version:
An extremely fast, React-like JavaScript library for building modern user interfaces
966 lines • 112 kB
TypeScript
import type { NativeClipboardEvent, NativeCompositionEvent, NativeDragEvent, NativeFocusEvent } from './nativetypes';
import type { ChildFlags, VNodeFlags } from 'inferno-vnode-flags';
import type { PropertiesHyphen } from 'csstype';
export interface LinkedEvent<T, E extends Event> {
data: T;
event: (data: T, event: E) => void;
}
export type InfernoText = string | number;
export type InfernoChild = Inferno.InfernoElement | InfernoText;
interface InfernoNodeArray extends Array<InfernoNode> {
}
export type InfernoFragment = {} | InfernoNodeArray;
export type InfernoSingleNode = InfernoChild | boolean | null | undefined;
export type InfernoNode = InfernoSingleNode | InfernoFragment;
export type InfernoKeyedNode = Inferno.InfernoElement & {
key: string | number;
};
export type NonEmptyProps = Record<string, unknown>;
export type ContextObject = Record<string, unknown>;
export type ParentDOM = Element | SVGAElement | ShadowRoot | DocumentFragment | HTMLElement | Node | null;
export interface IComponent<P, S> {
state: S | null;
props: Readonly<{
children?: InfernoNode;
} & P>;
context?: any;
displayName?: string;
refs?: any;
forceUpdate(callback?: Function): any;
setState<K extends keyof S>(newState: ((prevState: Readonly<S>, props: Readonly<{
children?: InfernoNode;
} & P>) => Pick<S, K> | S | null) | (Pick<S, K> | S | null), callback?: () => void): void;
componentDidMount?(): void;
componentWillMount?(): void;
componentWillReceiveProps?(nextProps: Readonly<{
children?: InfernoNode;
} & P>, nextContext: any): void;
shouldComponentUpdate?(nextProps: Readonly<{
children?: InfernoNode;
} & P>, nextState: Readonly<S>, context: any): boolean;
componentWillUpdate?(nextProps: Readonly<{
children?: InfernoNode;
} & P>, nextState: Readonly<S>, context: any): void;
componentDidUpdate?(prevProps: Readonly<{
children?: InfernoNode;
} & P>, prevState: Readonly<S>, snapshot: any): void;
componentWillUnmount?(): void;
componentDidAppear?(domNode: Element): void;
componentWillDisappear?(domNode: Element, callback: Function): void;
componentWillMove?(parentVNode: VNode, parentDOM: Element, dom: Element): void;
getChildContext?(): void;
getSnapshotBeforeUpdate?(prevProps: Readonly<{
children?: InfernoNode;
} & P>, prevState: Readonly<S>): any;
render(nextProps: Readonly<{
children?: InfernoNode;
} & P>, nextState: Readonly<S>, nextContext: any): InfernoNode;
}
export interface SemiSyntheticEvent<T> extends Event {
/**
* A reference to the element on which the event listener is registered.
*/
currentTarget: EventTarget & T;
isDefaultPrevented?: () => boolean;
isPropagationStopped?: () => boolean;
}
export type ClipboardEvent<T> = SemiSyntheticEvent<T> & NativeClipboardEvent;
export type CompositionEvent<T> = SemiSyntheticEvent<T> & NativeCompositionEvent;
export type DragEvent<T> = InfernoMouseEvent<T> & NativeDragEvent;
export type FocusEvent<T> = SemiSyntheticEvent<T> & NativeFocusEvent;
export interface FormEvent<T> extends SemiSyntheticEvent<T> {
target: EventTarget & T;
}
export interface ChangeEvent<T> extends SemiSyntheticEvent<T> {
target: EventTarget & T;
}
export type InfernoKeyboardEvent<T> = SemiSyntheticEvent<T> & KeyboardEvent;
export type InfernoMouseEvent<T> = SemiSyntheticEvent<T> & MouseEvent & {
target: EventTarget & T;
};
export type InfernoTouchEvent<T> = SemiSyntheticEvent<T> & TouchEvent;
export type InfernoPointerEvent<T> = SemiSyntheticEvent<T> & PointerEvent;
export type InfernoUIEvent<T> = SemiSyntheticEvent<T> & UIEvent;
export type InfernoWheelEvent<T> = InfernoMouseEvent<T> & WheelEvent;
export type InfernoAnimationEvent<T> = SemiSyntheticEvent<T> & AnimationEvent;
export type InfernoTransitionEvent<T> = SemiSyntheticEvent<T> & TransitionEvent;
type Booleanish = boolean | 'true' | 'false';
export type EventHandler<E extends SemiSyntheticEvent<any>> = {
bivarianceHack(event: E): void;
}['bivarianceHack'] | LinkedEvent<any, E> | null;
export type InfernoEventHandler<T = Element> = EventHandler<SemiSyntheticEvent<T>>;
export type ClipboardEventHandler<T = Element> = EventHandler<ClipboardEvent<T>>;
export type CompositionEventHandler<T = Element> = EventHandler<CompositionEvent<T>>;
export type DragEventHandler<T = Element> = EventHandler<DragEvent<T>>;
export type FocusEventHandler<T = Element> = EventHandler<FocusEvent<T>>;
export type FormEventHandler<T = Element> = EventHandler<FormEvent<T>>;
export type ChangeEventHandler<T = Element> = EventHandler<ChangeEvent<T>>;
export type KeyboardEventHandler<T = Element> = EventHandler<InfernoKeyboardEvent<T>>;
export type MouseEventHandler<T = Element> = EventHandler<InfernoMouseEvent<T>>;
export type TouchEventHandler<T = Element> = EventHandler<InfernoTouchEvent<T>>;
export type PointerEventHandler<T = Element> = EventHandler<InfernoPointerEvent<T>>;
export type UIEventHandler<T = Element> = EventHandler<InfernoUIEvent<T>>;
export type WheelEventHandler<T = Element> = EventHandler<InfernoWheelEvent<T>>;
export type AnimationEventHandler<T = Element> = EventHandler<InfernoAnimationEvent<T>>;
export type TransitionEventHandler<T = Element> = EventHandler<InfernoTransitionEvent<T>>;
export type Key = string | number | undefined | null;
type CrossOrigin = 'anonymous' | 'use-credentials' | '' | null | undefined;
export interface VNode {
children: InfernoNode;
childFlags: ChildFlags;
dom: Element | null;
className: string | null | undefined;
flags: VNodeFlags;
isValidated?: boolean;
key: Key;
props: any;
ref: any;
type: any;
}
export interface RefObject<T> {
readonly current: T | null;
}
export type Ref<T = Element> = {
bivarianceHack(instance: T | null): any;
}['bivarianceHack'];
export interface ForwardRef<P, T> extends Inferno.StatelessComponent<P> {
ref: Ref<T>;
}
export interface Refs<P> {
onComponentDidMount?: (domNode: Element | null, nextProps: Readonly<{
children?: InfernoNode;
} & P>) => void;
onComponentWillMount?(props: Readonly<{
children?: InfernoNode;
} & P>): void;
onComponentShouldUpdate?(lastProps: Readonly<{
children?: InfernoNode;
} & P>, nextProps: Readonly<{
children?: InfernoNode;
} & P>): boolean;
onComponentWillUpdate?(lastProps: Readonly<{
children?: InfernoNode;
} & P>, nextProps: Readonly<{
children?: InfernoNode;
} & P>): void;
onComponentDidUpdate?(lastProps: Readonly<{
children?: InfernoNode;
} & P>, nextProps: Readonly<{
children?: InfernoNode;
} & P>): void;
onComponentWillUnmount?(domNode: Element, nextProps: Readonly<{
children?: InfernoNode;
} & P>): void;
onComponentDidAppear?(domNode: Element, props: Readonly<{
children?: InfernoNode;
} & P>): void;
onComponentWillDisappear?(domNode: Element, props: Readonly<{
children?: InfernoNode;
} & P>, callback: Function): void;
onComponentWillMove?(parentVNode: VNode, parentDOM: Element, dom: Element, props: Readonly<{
children?: InfernoNode;
} & P>): void;
}
export interface Props<T> {
children?: InfernoNode;
key?: Key;
ref?: Ref<T> | undefined;
}
export declare namespace Inferno {
type ComponentState = {};
type ExoticComponent<P = {}> = (props: P) => InfernoElement;
interface Attributes {
key?: Key;
$ReCreate?: boolean;
$HasVNodeChildren?: boolean;
$HasNonKeyedChildren?: boolean;
$HasKeyedChildren?: boolean;
$HasTextChildren?: boolean;
$ChildFlag?: number;
}
interface ClassAttributes<T> extends Attributes {
ref?: Ref<T> | RefObject<T> | null | undefined;
}
interface InfernoElement<P = any> {
type: string | ComponentClass<P> | SFC<P>;
props: P;
key?: Key;
}
interface SFCElement<P> extends InfernoElement<P> {
type: SFC<P>;
}
type CElement<P, T extends IComponent<P, ComponentState>> = ComponentElement<P, T>;
interface ComponentElement<P, T extends IComponent<P, ComponentState>> extends InfernoElement<P> {
type: ComponentClass<P>;
ref?: Ref<T> | undefined;
}
interface DOMElement<P extends HTMLAttributes<T> | SVGAttributes<T>, T extends Element> extends InfernoElement<P> {
type: string;
ref: Ref<T>;
}
interface InfernoHTMLElement<T extends HTMLElement> extends DetailedInfernoHTMLElement<AllHTMLAttributes<T>, T> {
}
interface DetailedInfernoHTMLElement<P extends HTMLAttributes<T>, T extends HTMLElement> extends DOMElement<P, T> {
type: keyof InfernoHTML;
}
interface InfernoSVGElement extends DOMElement<SVGAttributes<SVGElement>, SVGElement> {
type: keyof InfernoSVG;
}
type Factory<P> = (props?: Attributes & P, ...children: InfernoNode[]) => InfernoElement<P>;
type SFCFactory<P> = (props?: Attributes & P, ...children: InfernoNode[]) => SFCElement<P>;
type ComponentFactory<P, T extends IComponent<P, ComponentState>> = (props?: ClassAttributes<T> & P, ...children: InfernoNode[]) => CElement<P, T>;
type CFactory<P, T extends IComponent<P, ComponentState>> = ComponentFactory<P, T>;
type DOMFactory<P extends DOMAttributes<T>, T extends Element> = (props?: (ClassAttributes<T> & P) | null, ...children: InfernoNode[]) => DOMElement<P, T>;
interface HTMLFactory<T extends HTMLElement> extends DetailedHTMLFactory<AllHTMLAttributes<T>, T> {
}
interface DetailedHTMLFactory<P extends HTMLAttributes<T>, T extends HTMLElement> extends DOMFactory<P, T> {
(props?: (ClassAttributes<T> & P) | null, ...children: InfernoNode[]): DetailedInfernoHTMLElement<P, T>;
}
interface SVGFactory extends DOMFactory<SVGAttributes<SVGElement>, SVGElement> {
(props?: (ClassAttributes<SVGElement> & SVGAttributes<SVGElement>) | null, ...children: InfernoNode[]): InfernoSVGElement;
}
const version: string;
interface ChildContextProvider<CC> {
getChildContext(): CC;
}
type SFC<P = {}> = StatelessComponent<P>;
interface StatelessComponent<P = {}> {
(props: {
children?: InfernoNode;
} & P & Refs<P>, context?: any): InfernoElement | null;
defaultProps?: Partial<P> | undefined | null;
defaultHooks?: Refs<P> | undefined | null;
}
interface ComponentClass<P = {}> {
new (props?: {
children?: InfernoNode;
} & P, context?: any): IComponent<P, ComponentState>;
defaultProps?: Partial<P> | undefined | null;
}
interface HTMLProps<T> extends AllHTMLAttributes<T>, ClassAttributes<T> {
}
type DetailedHTMLProps<E extends HTMLAttributes<T>, T> = ClassAttributes<T> & E;
interface SVGProps<T> extends SVGAttributes<T>, ClassAttributes<T> {
}
interface DOMAttributes<T> {
children?: InfernoNode;
dangerouslySetInnerHTML?: {
__html: string;
} | null | undefined;
onCopy?: ClipboardEventHandler<T> | undefined;
onCut?: ClipboardEventHandler<T> | undefined;
onPaste?: ClipboardEventHandler<T> | undefined;
onCompositionEnd?: CompositionEventHandler<T> | undefined;
onCompositionStart?: CompositionEventHandler<T> | undefined;
onCompositionUpdate?: CompositionEventHandler<T> | undefined;
onFocus?: FocusEventHandler<T> | undefined;
onBlur?: FocusEventHandler<T> | undefined;
onChange?: FormEventHandler<T> | undefined | null;
onBeforeInput?: FormEventHandler<T> | undefined;
onInput?: FormEventHandler<T> | undefined;
onReset?: FormEventHandler<T> | undefined;
onSubmit?: FormEventHandler<T> | undefined;
onInvalid?: FormEventHandler<T> | undefined;
onLoad?: InfernoEventHandler<T> | undefined;
onError?: InfernoEventHandler<T> | undefined;
onKeyDown?: KeyboardEventHandler<T> | undefined;
onKeyPress?: KeyboardEventHandler<T> | undefined;
onKeyUp?: KeyboardEventHandler<T> | undefined;
onAbort?: InfernoEventHandler<T> | undefined;
onCanPlay?: InfernoEventHandler<T> | undefined;
onCanPlayThrough?: InfernoEventHandler<T> | undefined;
onDurationChange?: InfernoEventHandler<T> | undefined;
onEmptied?: InfernoEventHandler<T> | undefined;
onEncrypted?: InfernoEventHandler<T> | undefined;
onEnded?: InfernoEventHandler<T> | undefined;
onLoadedData?: InfernoEventHandler<T> | undefined;
onLoadedMetadata?: InfernoEventHandler<T> | undefined;
onLoadStart?: InfernoEventHandler<T> | undefined;
onPause?: InfernoEventHandler<T> | undefined;
onPlay?: InfernoEventHandler<T> | undefined;
onPlaying?: InfernoEventHandler<T> | undefined;
onProgress?: InfernoEventHandler<T> | undefined;
onRateChange?: InfernoEventHandler<T> | undefined;
onSeeked?: InfernoEventHandler<T> | undefined;
onSeeking?: InfernoEventHandler<T> | undefined;
onStalled?: InfernoEventHandler<T> | undefined;
onSuspend?: InfernoEventHandler<T> | undefined;
onTimeUpdate?: InfernoEventHandler<T> | undefined;
onVolumeChange?: InfernoEventHandler<T> | undefined;
onWaiting?: InfernoEventHandler<T> | undefined;
onAuxClick?: MouseEventHandler<T> | undefined;
onClick?: MouseEventHandler<T> | undefined;
onContextMenu?: MouseEventHandler<T> | undefined;
onDblClick?: MouseEventHandler<T> | undefined;
onDrag?: DragEventHandler<T> | undefined;
onDragEnd?: DragEventHandler<T> | undefined;
onDragEnter?: DragEventHandler<T> | undefined;
onDragExit?: DragEventHandler<T> | undefined;
onDragLeave?: DragEventHandler<T> | undefined;
onDragOver?: DragEventHandler<T> | undefined;
onDragStart?: DragEventHandler<T> | undefined;
onDrop?: DragEventHandler<T> | undefined;
onMouseDown?: MouseEventHandler<T> | undefined;
onMouseEnter?: MouseEventHandler<T> | undefined;
onMouseLeave?: MouseEventHandler<T> | undefined;
onMouseMove?: MouseEventHandler<T> | undefined;
onMouseOut?: MouseEventHandler<T> | undefined;
onMouseOver?: MouseEventHandler<T> | undefined;
onMouseUp?: MouseEventHandler<T> | undefined;
onSelect?: InfernoEventHandler<T> | undefined;
onTouchCancel?: TouchEventHandler<T> | undefined;
onTouchEnd?: TouchEventHandler<T> | undefined;
onTouchMove?: TouchEventHandler<T> | undefined;
onTouchStart?: TouchEventHandler<T> | undefined;
onPointerDown?: PointerEventHandler<T> | undefined;
onPointerMove?: PointerEventHandler<T> | undefined;
onPointerUp?: PointerEventHandler<T> | undefined;
onPointerCancel?: PointerEventHandler<T> | undefined;
onPointerEnter?: PointerEventHandler<T> | undefined;
onPointerLeave?: PointerEventHandler<T> | undefined;
onPointerOver?: PointerEventHandler<T> | undefined;
onPointerOut?: PointerEventHandler<T> | undefined;
onScroll?: UIEventHandler<T> | undefined;
onWheel?: WheelEventHandler<T> | undefined;
onAnimationStart?: AnimationEventHandler<T> | undefined;
onAnimationEnd?: AnimationEventHandler<T> | undefined;
onAnimationIteration?: AnimationEventHandler<T> | undefined;
onTransitionEnd?: TransitionEventHandler<T> | undefined;
oncopy?: ClipboardEventHandler<T> | undefined;
oncut?: ClipboardEventHandler<T> | undefined;
onpaste?: ClipboardEventHandler<T> | undefined;
oncompositionend?: CompositionEventHandler<T> | undefined;
oncompositionstart?: CompositionEventHandler<T> | undefined;
oncompositionupdate?: CompositionEventHandler<T> | undefined;
onfocus?: FocusEventHandler<T> | undefined;
onblur?: FocusEventHandler<T> | undefined;
onchange?: FormEventHandler<T> | undefined | null;
onbeforeinput?: FormEventHandler<T> | undefined;
oninput?: FormEventHandler<T> | undefined;
onreset?: FormEventHandler<T> | undefined;
onsubmit?: FormEventHandler<T> | undefined;
oninvalid?: FormEventHandler<T> | undefined;
onload?: InfernoEventHandler<T> | undefined;
onerror?: InfernoEventHandler<T> | undefined;
onkeydown?: KeyboardEventHandler<T> | undefined;
onkeypress?: KeyboardEventHandler<T> | undefined;
onkeyup?: KeyboardEventHandler<T> | undefined;
onabort?: InfernoEventHandler<T> | undefined;
oncanplay?: InfernoEventHandler<T> | undefined;
oncanplaythrough?: InfernoEventHandler<T> | undefined;
ondurationchange?: InfernoEventHandler<T> | undefined;
onemptied?: InfernoEventHandler<T> | undefined;
onencrypted?: InfernoEventHandler<T> | undefined;
onended?: InfernoEventHandler<T> | undefined;
onloadeddata?: InfernoEventHandler<T> | undefined;
onloadedmetadata?: InfernoEventHandler<T> | undefined;
onloadstart?: InfernoEventHandler<T> | undefined;
onpause?: InfernoEventHandler<T> | undefined;
onplay?: InfernoEventHandler<T> | undefined;
onplaying?: InfernoEventHandler<T> | undefined;
onprogress?: InfernoEventHandler<T> | undefined;
onratechange?: InfernoEventHandler<T> | undefined;
onseeked?: InfernoEventHandler<T> | undefined;
onseeking?: InfernoEventHandler<T> | undefined;
onstalled?: InfernoEventHandler<T> | undefined;
onsuspend?: InfernoEventHandler<T> | undefined;
ontimeupdate?: InfernoEventHandler<T> | undefined;
onvolumechange?: InfernoEventHandler<T> | undefined;
onwaiting?: InfernoEventHandler<T> | undefined;
onauxclick?: MouseEventHandler<T> | undefined;
onclick?: MouseEventHandler<T> | undefined;
oncontextmenu?: MouseEventHandler<T> | undefined;
ondblclick?: MouseEventHandler<T> | undefined;
ondrag?: DragEventHandler<T> | undefined;
ondragend?: DragEventHandler<T> | undefined;
ondragenter?: DragEventHandler<T> | undefined;
ondragexit?: DragEventHandler<T> | undefined;
ondragLeave?: DragEventHandler<T> | undefined;
ondragover?: DragEventHandler<T> | undefined;
ondragstart?: DragEventHandler<T> | undefined;
ondrop?: DragEventHandler<T> | undefined;
onmousedown?: MouseEventHandler<T> | undefined;
onmouseenter?: MouseEventHandler<T> | undefined;
onmouseleave?: MouseEventHandler<T> | undefined;
onmousemove?: MouseEventHandler<T> | undefined;
onmouseout?: MouseEventHandler<T> | undefined;
onmouseover?: MouseEventHandler<T> | undefined;
onmouseup?: MouseEventHandler<T> | undefined;
onselect?: InfernoEventHandler<T> | undefined;
ontouchcancel?: TouchEventHandler<T> | undefined;
ontouchend?: TouchEventHandler<T> | undefined;
ontouchmove?: TouchEventHandler<T> | undefined;
ontouchstart?: TouchEventHandler<T> | undefined;
onpointerdown?: PointerEventHandler<T> | undefined;
onpointermove?: PointerEventHandler<T> | undefined;
onpointerup?: PointerEventHandler<T> | undefined;
onpointercancel?: PointerEventHandler<T> | undefined;
onpointerenter?: PointerEventHandler<T> | undefined;
onpointerleave?: PointerEventHandler<T> | undefined;
onpointerover?: PointerEventHandler<T> | undefined;
onpointerout?: PointerEventHandler<T> | undefined;
onscroll?: UIEventHandler<T> | undefined;
onwheel?: WheelEventHandler<T> | undefined;
onanimationstart?: AnimationEventHandler<T> | undefined;
onanimationend?: AnimationEventHandler<T> | undefined;
onanimationiteration?: AnimationEventHandler<T> | undefined;
ontransitionend?: TransitionEventHandler<T> | undefined;
}
interface AriaAttributes {
/** Identifies the currently active element when DOM focus is on a composite widget, textbox, group, or application. */
'aria-activedescendant'?: string | null | undefined;
/** 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'?: Booleanish | null | undefined;
/**
* 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' | null | undefined;
/** 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. */
/**
* Defines a string value that labels the current element, which is intended to be converted into Braille.
* @see aria-label.
*/
'aria-braillelabel'?: string | null | undefined;
/**
* Defines a human-readable, author-localized abbreviated description for the role of an element, which is intended to be converted into Braille.
* @see aria-roledescription.
*/
'aria-brailleroledescription'?: string | null | undefined;
'aria-busy'?: Booleanish | null | undefined;
/**
* Indicates the current "checked" state of checkboxes, radio buttons, and other widgets.
* @see aria-pressed @see aria-selected.
*/
'aria-checked'?: boolean | 'false' | 'mixed' | 'true' | null | undefined;
/**
* Defines the total number of columns in a table, grid, or treegrid.
* @see aria-colindex.
*/
'aria-colcount'?: number | null | undefined;
/**
* 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 | null | undefined;
/**
* Defines a human readable text alternative of aria-colindex.
* @see aria-rowindextext.
*/
'aria-colindextext'?: string | null | undefined;
/**
* 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 | null | undefined;
/**
* Identifies the element (or elements) whose contents or presence are controlled by the current element.
* @see aria-owns.
*/
'aria-controls'?: string | null | undefined;
/** 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' | null | undefined;
/**
* Identifies the element (or elements) that describes the object.
* @see aria-labelledby
*/
'aria-describedby'?: string | null | undefined;
/**
* Defines a string value that describes or annotates the current element.
* @see related aria-describedby.
*/
'aria-description'?: string | null | undefined;
/**
* Identifies the element that provides a detailed, extended description for the object.
* @see aria-describedby.
*/
'aria-details'?: string | null | undefined;
/**
* Indicates that the element is perceivable but disabled, so it is not editable or otherwise operable.
* @see aria-hidden @see aria-readonly.
*/
'aria-disabled'?: Booleanish | null | undefined;
/**
* 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' | null | undefined;
/**
* Identifies the element that provides an error message for the object.
* @see aria-invalid @see aria-describedby.
*/
'aria-errormessage'?: string | null | undefined;
/** Indicates whether the element, or another grouping element it controls, is currently expanded or collapsed. */
'aria-expanded'?: Booleanish | null | undefined;
/**
* 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 | null | undefined;
/**
* Indicates an element's "grabbed" state in a drag-and-drop operation.
* @deprecated in ARIA 1.1
*/
'aria-grabbed'?: Booleanish | null | undefined;
/** 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' | null | undefined;
/**
* Indicates whether the element is exposed to an accessibility API.
* @see aria-disabled.
*/
'aria-hidden'?: Booleanish | null | undefined;
/**
* Indicates the entered value does not conform to the format expected by the application.
* @see aria-errormessage.
*/
'aria-invalid'?: boolean | 'false' | 'true' | 'grammar' | 'spelling' | null | undefined;
/** Indicates keyboard shortcuts that an author has implemented to activate or give focus to an element. */
'aria-keyshortcuts'?: string | null | undefined;
/**
* Defines a string value that labels the current element.
* @see aria-labelledby.
*/
'aria-label'?: string | null | undefined;
/**
* Identifies the element (or elements) that labels the current element.
* @see aria-describedby.
*/
'aria-labelledby'?: string | null | undefined;
/** Defines the hierarchical level of an element within a structure. */
'aria-level'?: number | null | undefined;
/** 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' | null | undefined;
/** Indicates whether an element is modal when displayed. */
'aria-modal'?: Booleanish | null | undefined;
/** Indicates whether a text box accepts multiple lines of input or only a single line. */
'aria-multiline'?: Booleanish | null | undefined;
/** Indicates that the user may select more than one item from the current selectable descendants. */
'aria-multiselectable'?: Booleanish | null | undefined;
/** Indicates whether the element's orientation is horizontal, vertical, or unknown/ambiguous. */
'aria-orientation'?: 'horizontal' | 'vertical' | null | undefined;
/**
* 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 | null | undefined;
/**
* 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 | null | undefined;
/**
* 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 | null | undefined;
/**
* Indicates the current "pressed" state of toggle buttons.
* @see aria-checked @see aria-selected.
*/
'aria-pressed'?: boolean | 'false' | 'mixed' | 'true' | null | undefined;
/**
* Indicates that the element is not editable, but is otherwise operable.
* @see aria-disabled.
*/
'aria-readonly'?: Booleanish | null | undefined;
/**
* 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' | null | undefined;
/** Indicates that user input is required on the element before a form may be submitted. */
'aria-required'?: Booleanish | null | undefined;
/** Defines a human-readable, author-localized description for the role of an element. */
'aria-roledescription'?: string | null | undefined;
/**
* Defines the total number of rows in a table, grid, or treegrid.
* @see aria-rowindex.
*/
'aria-rowcount'?: number | null | undefined;
/**
* 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 | null | undefined;
/**
* Defines a human readable text alternative of aria-rowindex.
* @see aria-colindextext.
*/
'aria-rowindextext'?: string | null | undefined;
/**
* 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 | null | undefined;
/**
* Indicates the current "selected" state of various widgets.
* @see aria-checked @see aria-pressed.
*/
'aria-selected'?: Booleanish | null | undefined;
/**
* 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 | null | undefined;
/** Indicates if items in a table or grid are sorted in ascending or descending order. */
'aria-sort'?: 'none' | 'ascending' | 'descending' | 'other' | null | undefined;
/** Defines the maximum allowed value for a range widget. */
'aria-valuemax'?: number | null | undefined;
/** Defines the minimum allowed value for a range widget. */
'aria-valuemin'?: number | null | undefined;
/**
* Defines the current value for a range widget.
* @see aria-valuetext.
*/
'aria-valuenow'?: number | null | undefined;
/** Defines the human readable text alternative of aria-valuenow for a range widget. */
'aria-valuetext'?: string | null | undefined;
}
type AriaRole = 'alert' | 'alertdialog' | 'application' | 'article' | 'banner' | 'button' | 'cell' | 'checkbox' | 'columnheader' | 'combobox' | 'complementary' | 'contentinfo' | 'definition' | 'dialog' | 'directory' | 'document' | 'feed' | 'figure' | 'form' | 'grid' | 'gridcell' | 'group' | 'heading' | 'img' | 'link' | 'list' | 'listbox' | 'listitem' | 'log' | 'main' | 'marquee' | 'math' | 'menu' | 'menubar' | 'menuitem' | 'menuitemcheckbox' | 'menuitemradio' | 'navigation' | 'none' | 'note' | 'option' | 'presentation' | 'progressbar' | 'radio' | 'radiogroup' | 'region' | 'row' | 'rowgroup' | 'rowheader' | 'scrollbar' | 'search' | 'searchbox' | 'separator' | 'slider' | 'spinbutton' | 'status' | 'switch' | 'tab' | 'table' | 'tablist' | 'tabpanel' | 'term' | 'textbox' | 'timer' | 'toolbar' | 'tooltip' | 'tree' | 'treegrid' | 'treeitem' | (string & {});
interface CssVariables {
[key: `--${string}`]: string;
}
interface HTMLAttributes<T> extends AriaAttributes, DOMAttributes<T> {
class?: string | null | undefined;
defaultChecked?: boolean | null | undefined;
defaultValue?: string | number | readonly string[] | null | undefined;
accessKey?: string | null | undefined;
autoCapitalize?: 'off' | 'none' | 'on' | 'sentences' | 'words' | 'characters' | null | undefined | (string & {});
autoFocus?: boolean | null | undefined;
className?: string | null | undefined;
contentEditable?: Booleanish | 'inherit' | 'plaintext-only' | null | undefined;
contextMenu?: string | null | undefined;
dir?: string | null | undefined;
draggable?: Booleanish | null | undefined;
enterKeyHint?: 'enter' | 'done' | 'go' | 'next' | 'previous' | 'search' | 'send' | null | undefined;
hidden?: boolean | null | undefined;
id?: string | null | undefined;
lang?: string | null | undefined;
nonce?: string | null | undefined;
slot?: string | null | undefined;
spellCheck?: Booleanish | null | undefined;
style?: PropertiesHyphen | string | null | undefined | CssVariables;
tabIndex?: number | null | undefined;
title?: string | null | undefined;
translate?: 'yes' | 'no' | null | undefined;
radioGroup?: string | null | undefined;
role?: AriaRole | null | undefined;
about?: string | null | undefined;
content?: string | null | undefined;
datatype?: string | null | undefined;
inlist?: any;
prefix?: string | null | undefined;
property?: string | null | undefined;
rel?: string | null | undefined;
resource?: string | null | undefined;
rev?: string | null | undefined;
typeof?: string | null | undefined;
vocab?: string | null | undefined;
autoCorrect?: string | null | undefined;
autoSave?: string | null | undefined;
color?: string | null | undefined;
itemProp?: string | null | undefined;
itemScope?: boolean | null | undefined;
itemType?: string | null | undefined;
itemID?: string | null | undefined;
itemRef?: string | null | undefined;
results?: number | null | undefined;
security?: string | null | undefined;
unselectable?: 'on' | 'off' | null | undefined;
/**
* Hints at the type of data that might be entered by the user while editing the element or its contents
* @see {@link https://html.spec.whatwg.org/multipage/interaction.html#input-modalities:-the-inputmode-attribute}
*/
inputMode?: 'none' | 'text' | 'tel' | 'url' | 'email' | 'numeric' | 'decimal' | 'search' | null | undefined;
/**
* Specify that a standard HTML element should behave like a defined custom built-in element
* @see {@link https://html.spec.whatwg.org/multipage/custom-elements.html#attr-is}
*/
is?: string | null | undefined;
}
interface AllHTMLAttributes<T> extends HTMLAttributes<T> {
accept?: string | null | undefined;
acceptCharset?: string | null | undefined;
action?: string | null | undefined;
allowFullScreen?: boolean | null | undefined;
allowTransparency?: boolean | null | undefined;
alt?: string | null | undefined;
as?: string | null | undefined;
async?: boolean | null | undefined;
autoComplete?: string | null | undefined;
autoPlay?: boolean | null | undefined;
capture?: boolean | 'user' | 'environment' | null | undefined;
cellPadding?: number | string | null | undefined;
cellSpacing?: number | string | null | undefined;
charSet?: string | null | undefined;
challenge?: string | null | undefined;
checked?: boolean | null | undefined;
cite?: string | null | undefined;
classID?: string | null | undefined;
cols?: number | null | undefined;
colSpan?: number | null | undefined;
controls?: boolean | null | undefined;
coords?: string | null | undefined;
crossOrigin?: CrossOrigin;
data?: string | null | undefined;
dateTime?: string | null | undefined;
default?: boolean | null | undefined;
defer?: boolean | null | undefined;
disabled?: boolean | null | undefined;
download?: any;
encType?: string | null | undefined;
form?: string | null | undefined;
formAction?: string | null | undefined;
formEncType?: string | null | undefined;
formMethod?: string | null | undefined;
formNoValidate?: boolean | null | undefined;
formTarget?: string | null | undefined;
frameBorder?: number | string | null | undefined;
headers?: string | null | undefined;
height?: number | string | null | undefined;
high?: number | null | undefined;
href?: string | null | undefined;
hrefLang?: string | null | undefined;
htmlFor?: string | null | undefined;
httpEquiv?: string | null | undefined;
integrity?: string | null | undefined;
keyParams?: string | null | undefined;
keyType?: string | null | undefined;
kind?: string | null | undefined;
label?: string | null | undefined;
list?: string | null | undefined;
loop?: boolean | null | undefined;
low?: number | null | undefined;
manifest?: string | null | undefined;
marginHeight?: number | null | undefined;
marginWidth?: number | null | undefined;
max?: number | string | null | undefined;
maxLength?: number | null | undefined;
media?: string | null | undefined;
mediaGroup?: string | null | undefined;
method?: string | null | undefined;
min?: number | string | null | undefined;
minLength?: number | null | undefined;
multiple?: boolean | null | undefined;
muted?: boolean | null | undefined;
name?: string | null | undefined;
noValidate?: boolean | null | undefined;
open?: boolean | null | undefined;
optimum?: number | null | undefined;
pattern?: string | null | undefined;
placeholder?: string | null | undefined;
playsInline?: boolean | null | undefined;
poster?: string | null | undefined;
preload?: string | null | undefined;
readOnly?: boolean | null | undefined;
required?: boolean | null | undefined;
reversed?: boolean | null | undefined;
rows?: number | null | undefined;
rowSpan?: number | null | undefined;
sandbox?: string | null | undefined;
scope?: string | null | undefined;
scoped?: boolean | null | undefined;
scrolling?: string | null | undefined;
seamless?: boolean | null | undefined;
selected?: boolean | null | undefined;
shape?: string | null | undefined;
size?: number | null | undefined;
sizes?: string | null | undefined;
span?: number | null | undefined;
src?: string | null | undefined;
srcDoc?: string | null | undefined;
srcLang?: string | null | undefined;
srcSet?: string | null | undefined;
start?: number | null | undefined;
step?: number | string | null | undefined;
summary?: string | null | undefined;
target?: string | null | undefined;
type?: string | null | undefined;
useMap?: string | null | undefined;
value?: string | readonly string[] | number | null | undefined;
width?: number | string | null | undefined;
wmode?: string | null | undefined;
wrap?: string | null | undefined;
}
type HTMLAttributeReferrerPolicy = '' | 'no-referrer' | 'no-referrer-when-downgrade' | 'origin' | 'origin-when-cross-origin' | 'same-origin' | 'strict-origin' | 'strict-origin-when-cross-origin' | 'unsafe-url';
type HTMLAttributeAnchorTarget = '_self' | '_blank' | '_parent' | '_top' | (string & {});
interface AnchorHTMLAttributes<T> extends HTMLAttributes<T> {
download?: any;
href?: string | null | undefined;
hrefLang?: string | null | undefined;
media?: string | null | undefined;
ping?: string | null | undefined;
target?: HTMLAttributeAnchorTarget | null | undefined;
type?: string | null | undefined;
referrerPolicy?: HTMLAttributeReferrerPolicy | null | undefined;
}
interface AudioHTMLAttributes<T> extends MediaHTMLAttributes<T> {
}
interface AreaHTMLAttributes<T> extends HTMLAttributes<T> {
alt?: string | null | undefined;
coords?: string | null | undefined;
download?: any;
href?: string | null | undefined;
hrefLang?: string | null | undefined;
media?: string | null | undefined;
referrerPolicy?: HTMLAttributeReferrerPolicy | null | undefined;
shape?: string | null | undefined;
target?: string | null | undefined;
}
interface BaseHTMLAttributes<T> extends HTMLAttributes<T> {
href?: string | null | undefined;
target?: string | null | undefined;
}
interface BlockquoteHTMLAttributes<T> extends HTMLAttributes<T> {
cite?: string | null | undefined;
}
interface ButtonHTMLAttributes<T> extends HTMLAttributes<T> {
disabled?: boolean | null | undefined;
form?: string | null | undefined;
formAction?: string | null | undefined;
formEncType?: string | null | undefined;
formMethod?: string | null | undefined;
formNoValidate?: boolean | null | undefined;
formTarget?: string | null | undefined;
name?: string | null | undefined;
type?: 'submit' | 'reset' | 'button' | null | undefined;
value?: string | readonly string[] | number | null | undefined;
}
interface CanvasHTMLAttributes<T> extends HTMLAttributes<T> {
height?: number | string | null | undefined;
width?: number | string | null | undefined;
}
interface ColHTMLAttributes<T> extends HTMLAttributes<T> {
span?: number | null | undefined;
width?: number | string | null | undefined;
}
interface ColgroupHTMLAttributes<T> extends HTMLAttributes<T> {
span?: number | null | undefined;
}
interface DataHTMLAttributes<T> extends HTMLAttributes<T> {
value?: string | readonly string[] | number | null | undefined;
}
interface DetailsHTMLAttributes<T> extends HTMLAttributes<T> {
open?: boolean | null | undefined;
onToggle?: InfernoEventHandler<T> | null | undefined;
name?: string | null | undefined;
}
interface DelHTMLAttributes<T> extends HTMLAttributes<T> {
cite?: string | null | undefined;
dateTime?: string | null | undefined;
}
interface DialogHTMLAttributes<T> extends HTMLAttributes<T> {
onCancel?: InfernoEventHandler<T> | null | undefined;
onClose?: InfernoEventHandler<T> | null | undefined;
open?: boolean | null | undefined;
}
interface EmbedHTMLAttributes<T> extends HTMLAttributes<T> {
height?: number | string | null | undefined;
src?: string | null | undefined;
type?: string | null | undefined;
width?: number | string | null | undefined;
}
interface FieldsetHTMLAttributes<T> extends HTMLAttributes<T> {
disabled?: boolean | null | undefined;
form?: string | null | undefined;
name?: string | null | undefined;
}
interface FormHTMLAttributes<T> extends HTMLAttributes<T> {
acceptCharset?: string | null | undefined;
action?: string | null | undefined;
autoComplete?: string | null | undefined;
encType?: string | null | undefined;
method?: string | null | undefined;
name?: string | null | undefined;
noValidate?: boolean | null | undefined;
target?: string | null | undefined;
}
interface HtmlHTMLAttributes<T> extends HTMLAttributes<T> {
manifest?: string | null | undefined;
}
interface IframeHTMLAttributes<T> extends HTMLAttributes<T> {
allow?: string | null | undefined;
allowFullScreen?: boolean | null | undefined;
allowTransparency?: boolean | null | undefined;
/** @deprecated */
frameBorder?: number | string | null | undefined;
height?: number | string | null | undefined;
loading?: 'eager' | 'lazy' | null | undefined;
/** @deprecated */
marginHeight?: number | null | undefined;
/** @deprecated */
marginWidth?: number | null | undefined;
name?: string | null | undefined;
referrerPolicy?: HTMLAttributeReferrerPolicy | null | undefined;
sandbox?: string | null | undefined;
/** @deprecated */
scrolling?: string | null | undefined;
seamless?: boolean | null | undefined;
src?: string | null | undefined;
srcDoc?: string | null | undefined;
width?: number | string | null | undefined;
}
interface ImgHTMLAttributes<T> extends HTMLAttributes<T> {
alt?: string | null | undefined;
crossOrigin?: CrossOrigin;
decoding?: 'async' | 'auto' | 'sync' | null | undefined;
fetchPriority?: 'high' | 'low' | 'auto';
height?: number | string | null | undefined;
loading?: 'eager' | 'lazy' | null | undefined;
referrerPolicy?: HTMLAttributeReferrerPolicy | null | undefined;
sizes?: string | null | undefined;
src?: string | null | undefined;
srcSet?: string | null | undefined;
useMap?: string | null | undefined;
width?: number | string | null | undefined;
}
interface InsHTMLAttributes<T> extends HTMLAttributes<T> {
cite?: string | null | undefined;
dateTime?: string | null | undefined;
}
type HTMLInputTypeAttribute = 'button' | 'checkbox' | 'color' | 'date' | 'datetime-local' | 'email' | 'file' | 'hidden' | 'image' | 'month' | 'number' | 'password' | 'radio' | 'range' | 'reset' | 'search' | 'submit' | 'tel' | 'text' | 'time' | 'url' | 'week' | (string & {});
type AutoFillAddressKind = 'billing' | 'shipping';
type AutoFillBase = '' | 'off' | 'on';
type AutoFillContactField = 'email' | 'tel' | 'tel-area-code' | 'tel-country-code' | 'tel-extension' | 'tel-local' | 'tel-local-prefix' | 'tel-local-suffix' | 'tel-national';
type AutoFillContactKind = 'home' | 'mobile' | 'work';
type AutoFillCredentialField = 'webauthn';
type AutoFillNormalField = 'additional-name' | 'address-level1' | 'address-level2' | 'address-level3' | 'address-level4' | 'address-line1' | 'address-line2' | 'address-line3' | 'bday-day' | 'bday-month' | 'bday-year' | 'cc-csc' | 'cc-exp' | 'cc-exp-month' | 'cc-exp-year' | 'cc-family-name' | 'cc-given-name' | 'cc-name' | 'cc-number' | 'cc-type' | 'country' | 'country-name' | 'current-password' | 'family-name' | 'given-name' | 'honorific-prefix' | 'honorific-suffix' | 'name' | 'new-password' | 'one-time-code' | 'organization' | 'postal-code' | 'street-address' | 'transaction-amount' | 'transaction-currency' | 'username';
type OptionalPrefixToken<T extends string> = `${T} ` | '';
type OptionalPostfixToken<T extends string> = ` ${T}` | '';
type AutoFillField = AutoFillNormalField | `${OptionalPrefixToken<AutoFillContactKind>}${AutoFillContactField}`;
type AutoFillSection = `section-${string}`;
type AutoFill = AutoFillBase | `${OptionalPrefixToken<AutoFillSection>}${OptionalPrefixToken<AutoFillAddressKind>}${AutoFillField}${OptionalPostfixToken<AutoFillCredentialField>}`;
type HTMLInputAutoCompleteAttribute = AutoFill | (string & {});
interface InputHTMLAttributes<T> extends HTMLAttributes<T> {
accept?: string | null | undefined;
alt?: string | null | undefined;
autoComplete?: HTMLInputAutoCompleteAttribute | null | undefined;
capture?: boolean | 'user' | 'environment' | null | undefined;
checked?: boolean | null | undefined;
disabled?: boolean | null | undefined;
form?: string | null | undefined;
formAction?: string | null | undefined;
formEncType?: string | null | undefined;
formMethod?: string | null | undefined;
formNoValidate?: boolean | null | undefined;
formTarget?: string | null | undefined;
height?: number | string | null | undefined;
indeterminate?: boolean | null | undefined;
list?: string | null | undefined;
max?: number | string | null | undefined;
maxLength?: number | null | undefined;
min?: number | string | null | undefined;
minLength?: number | null | undefined;
multiple?: boolean | null | undefined;
name?: string | null | undefined;
pattern?: string | null | undefined;
placeholder?: string | null | undefined;
readOnly?: boolean | null | undefined;
required?: boolean | null | undefined;
size?: number | null | undefined;
src?: string | null | undefined;
step?: number | string | null | undefined;
type?: HTMLInputTypeAttribute | null | undefined;
value?: string | readonly string[] | number | null | undefined;
width?: number | string | nul