UNPKG

109 kBTypeScriptView Raw
1// Type definitions for React 16.4
2// Project: http://facebook.github.io/react/
3// Definitions by: Asana <https://asana.com>
4// AssureSign <http://www.assuresign.com>
5// Microsoft <https://microsoft.com>
6// John Reilly <https://github.com/johnnyreilly>
7// Benoit Benezech <https://github.com/bbenezech>
8// Patricio Zavolinsky <https://github.com/pzavolinsky>
9// Digiguru <https://github.com/digiguru>
10// Eric Anderson <https://github.com/ericanderson>
11// Albert Kurniawan <https://github.com/morcerf>
12// Tanguy Krotoff <https://github.com/tkrotoff>
13// Dovydas Navickas <https://github.com/DovydasNavickas>
14// Stéphane Goetz <https://github.com/onigoetz>
15// Josh Rutherford <https://github.com/theruther4d>
16// Guilherme Hübner <https://github.com/guilhermehubner>
17// Ferdy Budhidharma <https://github.com/ferdaber>
18// Johann Rakotoharisoa <https://github.com/jrakotoharisoa>
19// Olivier Pascal <https://github.com/pascaloliv>
20// Martin Hochel <https://github.com/hotell>
21// Frank Li <https://github.com/franklixuefei>
22// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
23// TypeScript Version: 2.8
24
25/// <reference path="global.d.ts" />
26
27import * as CSS from 'csstype';
28import * as PropTypes from 'prop-types';
29
30type NativeAnimationEvent = AnimationEvent;
31type NativeClipboardEvent = ClipboardEvent;
32type NativeCompositionEvent = CompositionEvent;
33type NativeDragEvent = DragEvent;
34type NativeFocusEvent = FocusEvent;
35type NativeKeyboardEvent = KeyboardEvent;
36type NativeMouseEvent = MouseEvent;
37type NativeTouchEvent = TouchEvent;
38type NativePointerEvent = PointerEvent;
39type NativeTransitionEvent = TransitionEvent;
40type NativeUIEvent = UIEvent;
41type NativeWheelEvent = WheelEvent;
42
43// tslint:disable-next-line:export-just-namespace
44export = React;
45export as namespace React;
46
47declare namespace React {
48 //
49 // React Elements
50 // ----------------------------------------------------------------------
51
52 type ReactType<P = any> = string | ComponentType<P>;
53 type ComponentType<P = {}> = ComponentClass<P> | StatelessComponent<P>;
54
55 type Key = string | number;
56
57 interface RefObject<T> {
58 readonly current: T | null;
59 }
60
61 type Ref<T> = string | { bivarianceHack(instance: T | null): any }["bivarianceHack"] | RefObject<T>;
62
63 type ComponentState = any;
64
65 interface Attributes {
66 key?: Key;
67 }
68 interface ClassAttributes<T> extends Attributes {
69 ref?: Ref<T>;
70 }
71
72 interface ReactElement<P> {
73 type: string | ComponentClass<P> | SFC<P>;
74 props: P;
75 key: Key | null;
76 }
77
78 interface SFCElement<P> extends ReactElement<P> {
79 type: SFC<P>;
80 }
81
82 type CElement<P, T extends Component<P, ComponentState>> = ComponentElement<P, T>;
83 interface ComponentElement<P, T extends Component<P, ComponentState>> extends ReactElement<P> {
84 type: ComponentClass<P>;
85 ref?: Ref<T>;
86 }
87
88 type ClassicElement<P> = CElement<P, ClassicComponent<P, ComponentState>>;
89
90 // string fallback for custom web-components
91 interface DOMElement<P extends HTMLAttributes<T> | SVGAttributes<T>, T extends Element> extends ReactElement<P> {
92 type: string;
93 ref: Ref<T>;
94 }
95
96 // ReactHTML for ReactHTMLElement
97 // tslint:disable-next-line:no-empty-interface
98 interface ReactHTMLElement<T extends HTMLElement> extends DetailedReactHTMLElement<AllHTMLAttributes<T>, T> { }
99
100 interface DetailedReactHTMLElement<P extends HTMLAttributes<T>, T extends HTMLElement> extends DOMElement<P, T> {
101 type: keyof ReactHTML;
102 }
103
104 // ReactSVG for ReactSVGElement
105 interface ReactSVGElement extends DOMElement<SVGAttributes<SVGElement>, SVGElement> {
106 type: keyof ReactSVG;
107 }
108
109 interface ReactPortal extends ReactElement<any> {
110 key: Key | null;
111 children: ReactNode;
112 }
113
114 //
115 // Factories
116 // ----------------------------------------------------------------------
117
118 type Factory<P> = (props?: Attributes & P, ...children: ReactNode[]) => ReactElement<P>;
119
120 type SFCFactory<P> = (props?: Attributes & P, ...children: ReactNode[]) => SFCElement<P>;
121
122 type ComponentFactory<P, T extends Component<P, ComponentState>> =
123 (props?: ClassAttributes<T> & P, ...children: ReactNode[]) => CElement<P, T>;
124
125 type CFactory<P, T extends Component<P, ComponentState>> = ComponentFactory<P, T>;
126 type ClassicFactory<P> = CFactory<P, ClassicComponent<P, ComponentState>>;
127
128 type DOMFactory<P extends DOMAttributes<T>, T extends Element> =
129 (props?: ClassAttributes<T> & P | null, ...children: ReactNode[]) => DOMElement<P, T>;
130
131 // tslint:disable-next-line:no-empty-interface
132 interface HTMLFactory<T extends HTMLElement> extends DetailedHTMLFactory<AllHTMLAttributes<T>, T> {}
133
134 interface DetailedHTMLFactory<P extends HTMLAttributes<T>, T extends HTMLElement> extends DOMFactory<P, T> {
135 (props?: ClassAttributes<T> & P | null, ...children: ReactNode[]): DetailedReactHTMLElement<P, T>;
136 }
137
138 interface SVGFactory extends DOMFactory<SVGAttributes<SVGElement>, SVGElement> {
139 (props?: ClassAttributes<SVGElement> & SVGAttributes<SVGElement> | null, ...children: ReactNode[]): ReactSVGElement;
140 }
141
142 //
143 // React Nodes
144 // http://facebook.github.io/react/docs/glossary.html
145 // ----------------------------------------------------------------------
146
147 type ReactText = string | number;
148 type ReactChild = ReactElement<any> | ReactText;
149
150 interface ReactNodeArray extends Array<ReactNode> {}
151 type ReactFragment = {} | ReactNodeArray;
152 type ReactNode = ReactChild | ReactFragment | ReactPortal | string | number | boolean | null | undefined;
153
154 //
155 // Top Level API
156 // ----------------------------------------------------------------------
157
158 // DOM Elements
159 function createFactory<T extends HTMLElement>(
160 type: keyof ReactHTML): HTMLFactory<T>;
161 function createFactory(
162 type: keyof ReactSVG): SVGFactory;
163 function createFactory<P extends DOMAttributes<T>, T extends Element>(
164 type: string): DOMFactory<P, T>;
165
166 // Custom components
167 function createFactory<P>(type: SFC<P>): SFCFactory<P>;
168 function createFactory<P>(
169 type: ClassType<P, ClassicComponent<P, ComponentState>, ClassicComponentClass<P>>): CFactory<P, ClassicComponent<P, ComponentState>>;
170 function createFactory<P, T extends Component<P, ComponentState>, C extends ComponentClass<P>>(
171 type: ClassType<P, T, C>): CFactory<P, T>;
172 function createFactory<P>(type: ComponentClass<P>): Factory<P>;
173
174 // DOM Elements
175 // TODO: generalize this to everything in `keyof ReactHTML`, not just "input"
176 function createElement(
177 type: "input",
178 props?: InputHTMLAttributes<HTMLInputElement> & ClassAttributes<HTMLInputElement> | null,
179 ...children: ReactNode[]): DetailedReactHTMLElement<InputHTMLAttributes<HTMLInputElement>, HTMLInputElement>;
180 function createElement<P extends HTMLAttributes<T>, T extends HTMLElement>(
181 type: keyof ReactHTML,
182 props?: ClassAttributes<T> & P | null,
183 ...children: ReactNode[]): DetailedReactHTMLElement<P, T>;
184 function createElement<P extends SVGAttributes<T>, T extends SVGElement>(
185 type: keyof ReactSVG,
186 props?: ClassAttributes<T> & P | null,
187 ...children: ReactNode[]): ReactSVGElement;
188 function createElement<P extends DOMAttributes<T>, T extends Element>(
189 type: string,
190 props?: ClassAttributes<T> & P | null,
191 ...children: ReactNode[]): DOMElement<P, T>;
192
193 // Custom components
194 function createElement<P>(
195 type: SFC<P>,
196 props?: Attributes & P | null,
197 ...children: ReactNode[]): SFCElement<P>;
198 function createElement<P>(
199 type: ClassType<P, ClassicComponent<P, ComponentState>, ClassicComponentClass<P>>,
200 props?: ClassAttributes<ClassicComponent<P, ComponentState>> & P | null,
201 ...children: ReactNode[]): CElement<P, ClassicComponent<P, ComponentState>>;
202 function createElement<P, T extends Component<P, ComponentState>, C extends ComponentClass<P>>(
203 type: ClassType<P, T, C>,
204 props?: ClassAttributes<T> & P | null,
205 ...children: ReactNode[]): CElement<P, T>;
206 function createElement<P>(
207 type: SFC<P> | ComponentClass<P> | string,
208 props?: Attributes & P | null,
209 ...children: ReactNode[]): ReactElement<P>;
210
211 // DOM Elements
212 // ReactHTMLElement
213 function cloneElement<P extends HTMLAttributes<T>, T extends HTMLElement>(
214 element: DetailedReactHTMLElement<P, T>,
215 props?: P,
216 ...children: ReactNode[]): DetailedReactHTMLElement<P, T>;
217 // ReactHTMLElement, less specific
218 function cloneElement<P extends HTMLAttributes<T>, T extends HTMLElement>(
219 element: ReactHTMLElement<T>,
220 props?: P,
221 ...children: ReactNode[]): ReactHTMLElement<T>;
222 // SVGElement
223 function cloneElement<P extends SVGAttributes<T>, T extends SVGElement>(
224 element: ReactSVGElement,
225 props?: P,
226 ...children: ReactNode[]): ReactSVGElement;
227 // DOM Element (has to be the last, because type checking stops at first overload that fits)
228 function cloneElement<P extends DOMAttributes<T>, T extends Element>(
229 element: DOMElement<P, T>,
230 props?: DOMAttributes<T> & P,
231 ...children: ReactNode[]): DOMElement<P, T>;
232
233 // Custom components
234 function cloneElement<P>(
235 element: SFCElement<P>,
236 props?: Partial<P> & Attributes,
237 ...children: ReactNode[]): SFCElement<P>;
238 function cloneElement<P, T extends Component<P, ComponentState>>(
239 element: CElement<P, T>,
240 props?: Partial<P> & ClassAttributes<T>,
241 ...children: ReactNode[]): CElement<P, T>;
242 function cloneElement<P>(
243 element: ReactElement<P>,
244 props?: Partial<P> & Attributes,
245 ...children: ReactNode[]): ReactElement<P>;
246
247 // Context via RenderProps
248 interface ProviderProps<T> {
249 value: T;
250 children?: ReactNode;
251 }
252
253 interface ConsumerProps<T> {
254 children: (value: T) => ReactNode;
255 unstable_observedBits?: number;
256 }
257
258 type Provider<T> = ComponentType<ProviderProps<T>>;
259 type Consumer<T> = ComponentType<ConsumerProps<T>>;
260 interface Context<T> {
261 Provider: Provider<T>;
262 Consumer: Consumer<T>;
263 }
264 function createContext<T>(
265 defaultValue: T,
266 calculateChangedBits?: (prev: T, next: T) => number
267 ): Context<T>;
268
269 function isValidElement<P>(object: {} | null | undefined): object is ReactElement<P>;
270
271 const Children: ReactChildren;
272 const Fragment: ComponentType;
273 const StrictMode: ComponentType;
274 const version: string;
275
276 //
277 // Component API
278 // ----------------------------------------------------------------------
279
280 type ReactInstance = Component<any> | Element;
281
282 // Base component for plain JS classes
283 // tslint:disable-next-line:no-empty-interface
284 interface Component<P = {}, S = {}, SS = any> extends ComponentLifecycle<P, S, SS> { }
285 class Component<P, S> {
286 constructor(props: Readonly<P>);
287 /**
288 * @deprecated
289 * https://reactjs.org/docs/legacy-context.html
290 */
291 constructor(props: P, context?: any);
292
293 // We MUST keep setState() as a unified signature because it allows proper checking of the method return type.
294 // See: https://github.com/DefinitelyTyped/DefinitelyTyped/issues/18365#issuecomment-351013257
295 // Also, the ` | S` allows intellisense to not be dumbisense
296 setState<K extends keyof S>(
297 state: ((prevState: Readonly<S>, props: Readonly<P>) => (Pick<S, K> | S | null)) | (Pick<S, K> | S | null),
298 callback?: () => void
299 ): void;
300
301 forceUpdate(callBack?: () => void): void;
302 render(): ReactNode;
303
304 // React.Props<T> is now deprecated, which means that the `children`
305 // property is not available on `P` by default, even though you can
306 // always pass children as variadic arguments to `createElement`.
307 // In the future, if we can define its call signature conditionally
308 // on the existence of `children` in `P`, then we should remove this.
309 readonly props: Readonly<{ children?: ReactNode }> & Readonly<P>;
310 state: Readonly<S>;
311 /**
312 * @deprecated
313 * https://reactjs.org/docs/legacy-context.html
314 */
315 context: any;
316 /**
317 * @deprecated
318 * https://reactjs.org/docs/refs-and-the-dom.html#legacy-api-string-refs
319 */
320 refs: {
321 [key: string]: ReactInstance
322 };
323 }
324
325 class PureComponent<P = {}, S = {}, SS = any> extends Component<P, S, SS> { }
326
327 interface ClassicComponent<P = {}, S = {}> extends Component<P, S> {
328 replaceState(nextState: S, callback?: () => void): void;
329 isMounted(): boolean;
330 getInitialState?(): S;
331 }
332
333 interface ChildContextProvider<CC> {
334 getChildContext(): CC;
335 }
336
337 //
338 // Class Interfaces
339 // ----------------------------------------------------------------------
340
341 type SFC<P = {}> = StatelessComponent<P>;
342 interface StatelessComponent<P = {}> {
343 (props: P & { children?: ReactNode }, context?: any): ReactElement<any> | null;
344 propTypes?: ValidationMap<P>;
345 contextTypes?: ValidationMap<any>;
346 defaultProps?: Partial<P>;
347 displayName?: string;
348 }
349
350 interface RefForwardingComponent<T, P = {}> {
351 (props: P & { children?: ReactNode }, ref?: Ref<T>): ReactElement<any> | null;
352 propTypes?: ValidationMap<P>;
353 contextTypes?: ValidationMap<any>;
354 defaultProps?: Partial<P>;
355 displayName?: string;
356 }
357
358 interface ComponentClass<P = {}, S = ComponentState> extends StaticLifecycle<P, S> {
359 new (props: P, context?: any): Component<P, S>;
360 propTypes?: ValidationMap<P>;
361 contextTypes?: ValidationMap<any>;
362 childContextTypes?: ValidationMap<any>;
363 defaultProps?: Partial<P>;
364 displayName?: string;
365 }
366
367 interface ClassicComponentClass<P = {}> extends ComponentClass<P> {
368 new (props: P, context?: any): ClassicComponent<P, ComponentState>;
369 getDefaultProps?(): P;
370 }
371
372 /**
373 * We use an intersection type to infer multiple type parameters from
374 * a single argument, which is useful for many top-level API defs.
375 * See https://github.com/Microsoft/TypeScript/issues/7234 for more info.
376 */
377 type ClassType<P, T extends Component<P, ComponentState>, C extends ComponentClass<P>> =
378 C &
379 (new (props: P, context?: any) => T) &
380 (new (props: P, context?: any) => { props: P });
381
382 //
383 // Component Specs and Lifecycle
384 // ----------------------------------------------------------------------
385
386 // This should actually be something like `Lifecycle<P, S> | DeprecatedLifecycle<P, S>`,
387 // as React will _not_ call the deprecated lifecycle methods if any of the new lifecycle
388 // methods are present.
389 interface ComponentLifecycle<P, S, SS = any> extends NewLifecycle<P, S, SS>, DeprecatedLifecycle<P, S> {
390 /**
391 * Called immediately after a component is mounted. Setting state here will trigger re-rendering.
392 */
393 componentDidMount?(): void;
394 /**
395 * Called to determine whether the change in props and state should trigger a re-render.
396 *
397 * `Component` always returns true.
398 * `PureComponent` implements a shallow comparison on props and state and returns true if any
399 * props or states have changed.
400 *
401 * If false is returned, `Component#render`, `componentWillUpdate`
402 * and `componentDidUpdate` will not be called.
403 */
404 shouldComponentUpdate?(nextProps: Readonly<P>, nextState: Readonly<S>, nextContext: any): boolean;
405 /**
406 * Called immediately before a component is destroyed. Perform any necessary cleanup in this method, such as
407 * cancelled network requests, or cleaning up any DOM elements created in `componentDidMount`.
408 */
409 componentWillUnmount?(): void;
410 /**
411 * Catches exceptions generated in descendant components. Unhandled exceptions will cause
412 * the entire component tree to unmount.
413 */
414 componentDidCatch?(error: Error, errorInfo: ErrorInfo): void;
415 }
416
417 // Unfortunately, we have no way of declaring that the component constructor must implement this
418 interface StaticLifecycle<P, S> {
419 getDerivedStateFromProps?: GetDerivedStateFromProps<P, S>;
420 }
421
422 type GetDerivedStateFromProps<P, S> =
423 /**
424 * Returns an update to a component's state based on its new props and old state.
425 *
426 * Note: its presence prevents any of the deprecated lifecycle methods from being invoked
427 */
428 (nextProps: Readonly<P>, prevState: S) => Partial<S> | null;
429
430 // This should be "infer SS" but can't use it yet
431 interface NewLifecycle<P, S, SS> {
432 /**
433 * Runs before React applies the result of `render` to the document, and
434 * returns an object to be given to componentDidUpdate. Useful for saving
435 * things such as scroll position before `render` causes changes to it.
436 *
437 * Note: the presence of getSnapshotBeforeUpdate prevents any of the deprecated
438 * lifecycle events from running.
439 */
440 getSnapshotBeforeUpdate?(prevProps: Readonly<P>, prevState: Readonly<S>): SS | null;
441 /**
442 * Called immediately after updating occurs. Not called for the initial render.
443 *
444 * The snapshot is only present if getSnapshotBeforeUpdate is present and returns non-null.
445 */
446 componentDidUpdate?(prevProps: Readonly<P>, prevState: Readonly<S>, snapshot?: SS): void;
447 }
448
449 interface DeprecatedLifecycle<P, S> {
450 /**
451 * Called immediately before mounting occurs, and before `Component#render`.
452 * Avoid introducing any side-effects or subscriptions in this method.
453 *
454 * Note: the presence of getSnapshotBeforeUpdate or getDerivedStateFromProps
455 * prevents this from being invoked.
456 *
457 * @deprecated 16.3, use componentDidMount or the constructor instead; will stop working in React 17
458 * @see https://reactjs.org/blog/2018/03/27/update-on-async-rendering.html#initializing-state
459 * @see https://reactjs.org/blog/2018/03/27/update-on-async-rendering.html#gradual-migration-path
460 */
461 componentWillMount?(): void;
462 /**
463 * Called immediately before mounting occurs, and before `Component#render`.
464 * Avoid introducing any side-effects or subscriptions in this method.
465 *
466 * This method will not stop working in React 17.
467 *
468 * Note: the presence of getSnapshotBeforeUpdate or getDerivedStateFromProps
469 * prevents this from being invoked.
470 *
471 * @deprecated 16.3, use componentDidMount or the constructor instead
472 * @see https://reactjs.org/blog/2018/03/27/update-on-async-rendering.html#initializing-state
473 * @see https://reactjs.org/blog/2018/03/27/update-on-async-rendering.html#gradual-migration-path
474 */
475 UNSAFE_componentWillMount?(): void;
476 /**
477 * Called when the component may be receiving new props.
478 * React may call this even if props have not changed, so be sure to compare new and existing
479 * props if you only want to handle changes.
480 *
481 * Calling `Component#setState` generally does not trigger this method.
482 *
483 * Note: the presence of getSnapshotBeforeUpdate or getDerivedStateFromProps
484 * prevents this from being invoked.
485 *
486 * @deprecated 16.3, use static getDerivedStateFromProps instead; will stop working in React 17
487 * @see https://reactjs.org/blog/2018/03/27/update-on-async-rendering.html#updating-state-based-on-props
488 * @see https://reactjs.org/blog/2018/03/27/update-on-async-rendering.html#gradual-migration-path
489 */
490 componentWillReceiveProps?(nextProps: Readonly<P>, nextContext: any): void;
491 /**
492 * Called when the component may be receiving new props.
493 * React may call this even if props have not changed, so be sure to compare new and existing
494 * props if you only want to handle changes.
495 *
496 * Calling `Component#setState` generally does not trigger this method.
497 *
498 * This method will not stop working in React 17.
499 *
500 * Note: the presence of getSnapshotBeforeUpdate or getDerivedStateFromProps
501 * prevents this from being invoked.
502 *
503 * @deprecated 16.3, use static getDerivedStateFromProps instead
504 * @see https://reactjs.org/blog/2018/03/27/update-on-async-rendering.html#updating-state-based-on-props
505 * @see https://reactjs.org/blog/2018/03/27/update-on-async-rendering.html#gradual-migration-path
506 */
507 UNSAFE_componentWillReceiveProps?(nextProps: Readonly<P>, nextContext: any): void;
508 /**
509 * Called immediately before rendering when new props or state is received. Not called for the initial render.
510 *
511 * Note: You cannot call `Component#setState` here.
512 *
513 * Note: the presence of getSnapshotBeforeUpdate or getDerivedStateFromProps
514 * prevents this from being invoked.
515 *
516 * @deprecated 16.3, use getSnapshotBeforeUpdate instead; will stop working in React 17
517 * @see https://reactjs.org/blog/2018/03/27/update-on-async-rendering.html#reading-dom-properties-before-an-update
518 * @see https://reactjs.org/blog/2018/03/27/update-on-async-rendering.html#gradual-migration-path
519 */
520 componentWillUpdate?(nextProps: Readonly<P>, nextState: Readonly<S>, nextContext: any): void;
521 /**
522 * Called immediately before rendering when new props or state is received. Not called for the initial render.
523 *
524 * Note: You cannot call `Component#setState` here.
525 *
526 * This method will not stop working in React 17.
527 *
528 * Note: the presence of getSnapshotBeforeUpdate or getDerivedStateFromProps
529 * prevents this from being invoked.
530 *
531 * @deprecated 16.3, use getSnapshotBeforeUpdate instead
532 * @see https://reactjs.org/blog/2018/03/27/update-on-async-rendering.html#reading-dom-properties-before-an-update
533 * @see https://reactjs.org/blog/2018/03/27/update-on-async-rendering.html#gradual-migration-path
534 */
535 UNSAFE_componentWillUpdate?(nextProps: Readonly<P>, nextState: Readonly<S>, nextContext: any): void;
536 }
537
538 interface Mixin<P, S> extends ComponentLifecycle<P, S> {
539 mixins?: Array<Mixin<P, S>>;
540 statics?: {
541 [key: string]: any;
542 };
543
544 displayName?: string;
545 propTypes?: ValidationMap<any>;
546 contextTypes?: ValidationMap<any>;
547 childContextTypes?: ValidationMap<any>;
548
549 getDefaultProps?(): P;
550 getInitialState?(): S;
551 }
552
553 interface ComponentSpec<P, S> extends Mixin<P, S> {
554 render(): ReactNode;
555
556 [propertyName: string]: any;
557 }
558
559 function createRef<T>(): RefObject<T>;
560
561 function forwardRef<T, P = {}>(Component: RefForwardingComponent<T, P>): ComponentType<P & ClassAttributes<T>>;
562
563 //
564 // Event System
565 // ----------------------------------------------------------------------
566
567 interface SyntheticEvent<T = Element> {
568 bubbles: boolean;
569 /**
570 * A reference to the element on which the event listener is registered.
571 */
572 currentTarget: EventTarget & T;
573 cancelable: boolean;
574 defaultPrevented: boolean;
575 eventPhase: number;
576 isTrusted: boolean;
577 nativeEvent: Event;
578 preventDefault(): void;
579 isDefaultPrevented(): boolean;
580 stopPropagation(): void;
581 isPropagationStopped(): boolean;
582 persist(): void;
583 // If you thought this should be `EventTarget & T`, see https://github.com/DefinitelyTyped/DefinitelyTyped/pull/12239
584 /**
585 * A reference to the element from which the event was originally dispatched.
586 * This might be a child element to the element on which the event listener is registered.
587 *
588 * @see currentTarget
589 */
590 target: EventTarget;
591 timeStamp: number;
592 type: string;
593 }
594
595 interface ClipboardEvent<T = Element> extends SyntheticEvent<T> {
596 clipboardData: DataTransfer;
597 nativeEvent: NativeClipboardEvent;
598 }
599
600 interface CompositionEvent<T = Element> extends SyntheticEvent<T> {
601 data: string;
602 nativeEvent: NativeCompositionEvent;
603 }
604
605 interface DragEvent<T = Element> extends MouseEvent<T> {
606 dataTransfer: DataTransfer;
607 nativeEvent: NativeDragEvent;
608 }
609
610 interface PointerEvent<T = Element> extends MouseEvent<T> {
611 pointerId: number;
612 pressure: number;
613 tiltX: number;
614 tiltY: number;
615 width: number;
616 height: number;
617 pointerType: 'mouse' | 'pen' | 'touch';
618 isPrimary: boolean;
619 nativeEvent: NativePointerEvent;
620 }
621
622 interface FocusEvent<T = Element> extends SyntheticEvent<T> {
623 nativeEvent: NativeFocusEvent;
624 relatedTarget: EventTarget;
625 target: EventTarget & T;
626 }
627
628 // tslint:disable-next-line:no-empty-interface
629 interface FormEvent<T = Element> extends SyntheticEvent<T> {
630 }
631
632 interface InvalidEvent<T = Element> extends SyntheticEvent<T> {
633 target: EventTarget & T;
634 }
635
636 interface ChangeEvent<T = Element> extends SyntheticEvent<T> {
637 target: EventTarget & T;
638 }
639
640 interface KeyboardEvent<T = Element> extends SyntheticEvent<T> {
641 altKey: boolean;
642 charCode: number;
643 ctrlKey: boolean;
644 /**
645 * 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.
646 */
647 getModifierState(key: string): boolean;
648 /**
649 * See the [DOM Level 3 Events spec](https://www.w3.org/TR/uievents-key/#named-key-attribute-values). for possible values
650 */
651 key: string;
652 keyCode: number;
653 locale: string;
654 location: number;
655 metaKey: boolean;
656 nativeEvent: NativeKeyboardEvent;
657 repeat: boolean;
658 shiftKey: boolean;
659 which: number;
660 }
661
662 interface MouseEvent<T = Element> extends SyntheticEvent<T> {
663 altKey: boolean;
664 button: number;
665 buttons: number;
666 clientX: number;
667 clientY: number;
668 ctrlKey: boolean;
669 /**
670 * 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.
671 */
672 getModifierState(key: string): boolean;
673 metaKey: boolean;
674 nativeEvent: NativeMouseEvent;
675 pageX: number;
676 pageY: number;
677 relatedTarget: EventTarget;
678 screenX: number;
679 screenY: number;
680 shiftKey: boolean;
681 }
682
683 interface TouchEvent<T = Element> extends SyntheticEvent<T> {
684 altKey: boolean;
685 changedTouches: TouchList;
686 ctrlKey: boolean;
687 /**
688 * 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.
689 */
690 getModifierState(key: string): boolean;
691 metaKey: boolean;
692 nativeEvent: NativeTouchEvent;
693 shiftKey: boolean;
694 targetTouches: TouchList;
695 touches: TouchList;
696 }
697
698 interface UIEvent<T = Element> extends SyntheticEvent<T> {
699 detail: number;
700 nativeEvent: NativeUIEvent;
701 view: AbstractView;
702 }
703
704 interface WheelEvent<T = Element> extends MouseEvent<T> {
705 deltaMode: number;
706 deltaX: number;
707 deltaY: number;
708 deltaZ: number;
709 nativeEvent: NativeWheelEvent;
710 }
711
712 interface AnimationEvent<T = Element> extends SyntheticEvent<T> {
713 animationName: string;
714 elapsedTime: number;
715 nativeEvent: NativeAnimationEvent;
716 pseudoElement: string;
717 }
718
719 interface TransitionEvent<T = Element> extends SyntheticEvent<T> {
720 elapsedTime: number;
721 nativeEvent: NativeTransitionEvent;
722 propertyName: string;
723 pseudoElement: string;
724 }
725
726 //
727 // Event Handler Types
728 // ----------------------------------------------------------------------
729
730 type EventHandler<E extends SyntheticEvent<any>> = { bivarianceHack(event: E): void }["bivarianceHack"];
731
732 type ReactEventHandler<T = Element> = EventHandler<SyntheticEvent<T>>;
733
734 type ClipboardEventHandler<T = Element> = EventHandler<ClipboardEvent<T>>;
735 type CompositionEventHandler<T = Element> = EventHandler<CompositionEvent<T>>;
736 type DragEventHandler<T = Element> = EventHandler<DragEvent<T>>;
737 type FocusEventHandler<T = Element> = EventHandler<FocusEvent<T>>;
738 type FormEventHandler<T = Element> = EventHandler<FormEvent<T>>;
739 type ChangeEventHandler<T = Element> = EventHandler<ChangeEvent<T>>;
740 type KeyboardEventHandler<T = Element> = EventHandler<KeyboardEvent<T>>;
741 type MouseEventHandler<T = Element> = EventHandler<MouseEvent<T>>;
742 type TouchEventHandler<T = Element> = EventHandler<TouchEvent<T>>;
743 type PointerEventHandler<T = Element> = EventHandler<PointerEvent<T>>;
744 type UIEventHandler<T = Element> = EventHandler<UIEvent<T>>;
745 type WheelEventHandler<T = Element> = EventHandler<WheelEvent<T>>;
746 type AnimationEventHandler<T = Element> = EventHandler<AnimationEvent<T>>;
747 type TransitionEventHandler<T = Element> = EventHandler<TransitionEvent<T>>;
748
749 //
750 // Props / DOM Attributes
751 // ----------------------------------------------------------------------
752
753 /**
754 * @deprecated. This was used to allow clients to pass `ref` and `key`
755 * to `createElement`, which is no longer necessary due to intersection
756 * types. If you need to declare a props object before passing it to
757 * `createElement` or a factory, use `ClassAttributes<T>`:
758 *
759 * ```ts
760 * var b: Button | null;
761 * var props: ButtonProps & ClassAttributes<Button> = {
762 * ref: b => button = b, // ok!
763 * label: "I'm a Button"
764 * };
765 * ```
766 */
767 interface Props<T> {
768 children?: ReactNode;
769 key?: Key;
770 ref?: Ref<T>;
771 }
772
773 interface HTMLProps<T> extends AllHTMLAttributes<T>, ClassAttributes<T> {
774 }
775
776 type DetailedHTMLProps<E extends HTMLAttributes<T>, T> = ClassAttributes<T> & E;
777
778 interface SVGProps<T> extends SVGAttributes<T>, ClassAttributes<T> {
779 }
780
781 interface DOMAttributes<T> {
782 children?: ReactNode;
783 dangerouslySetInnerHTML?: {
784 __html: string;
785 };
786
787 // Clipboard Events
788 onCopy?: ClipboardEventHandler<T>;
789 onCopyCapture?: ClipboardEventHandler<T>;
790 onCut?: ClipboardEventHandler<T>;
791 onCutCapture?: ClipboardEventHandler<T>;
792 onPaste?: ClipboardEventHandler<T>;
793 onPasteCapture?: ClipboardEventHandler<T>;
794
795 // Composition Events
796 onCompositionEnd?: CompositionEventHandler<T>;
797 onCompositionEndCapture?: CompositionEventHandler<T>;
798 onCompositionStart?: CompositionEventHandler<T>;
799 onCompositionStartCapture?: CompositionEventHandler<T>;
800 onCompositionUpdate?: CompositionEventHandler<T>;
801 onCompositionUpdateCapture?: CompositionEventHandler<T>;
802
803 // Focus Events
804 onFocus?: FocusEventHandler<T>;
805 onFocusCapture?: FocusEventHandler<T>;
806 onBlur?: FocusEventHandler<T>;
807 onBlurCapture?: FocusEventHandler<T>;
808
809 // Form Events
810 onChange?: FormEventHandler<T>;
811 onChangeCapture?: FormEventHandler<T>;
812 onInput?: FormEventHandler<T>;
813 onInputCapture?: FormEventHandler<T>;
814 onReset?: FormEventHandler<T>;
815 onResetCapture?: FormEventHandler<T>;
816 onSubmit?: FormEventHandler<T>;
817 onSubmitCapture?: FormEventHandler<T>;
818 onInvalid?: FormEventHandler<T>;
819 onInvalidCapture?: FormEventHandler<T>;
820
821 // Image Events
822 onLoad?: ReactEventHandler<T>;
823 onLoadCapture?: ReactEventHandler<T>;
824 onError?: ReactEventHandler<T>; // also a Media Event
825 onErrorCapture?: ReactEventHandler<T>; // also a Media Event
826
827 // Keyboard Events
828 onKeyDown?: KeyboardEventHandler<T>;
829 onKeyDownCapture?: KeyboardEventHandler<T>;
830 onKeyPress?: KeyboardEventHandler<T>;
831 onKeyPressCapture?: KeyboardEventHandler<T>;
832 onKeyUp?: KeyboardEventHandler<T>;
833 onKeyUpCapture?: KeyboardEventHandler<T>;
834
835 // Media Events
836 onAbort?: ReactEventHandler<T>;
837 onAbortCapture?: ReactEventHandler<T>;
838 onCanPlay?: ReactEventHandler<T>;
839 onCanPlayCapture?: ReactEventHandler<T>;
840 onCanPlayThrough?: ReactEventHandler<T>;
841 onCanPlayThroughCapture?: ReactEventHandler<T>;
842 onDurationChange?: ReactEventHandler<T>;
843 onDurationChangeCapture?: ReactEventHandler<T>;
844 onEmptied?: ReactEventHandler<T>;
845 onEmptiedCapture?: ReactEventHandler<T>;
846 onEncrypted?: ReactEventHandler<T>;
847 onEncryptedCapture?: ReactEventHandler<T>;
848 onEnded?: ReactEventHandler<T>;
849 onEndedCapture?: ReactEventHandler<T>;
850 onLoadedData?: ReactEventHandler<T>;
851 onLoadedDataCapture?: ReactEventHandler<T>;
852 onLoadedMetadata?: ReactEventHandler<T>;
853 onLoadedMetadataCapture?: ReactEventHandler<T>;
854 onLoadStart?: ReactEventHandler<T>;
855 onLoadStartCapture?: ReactEventHandler<T>;
856 onPause?: ReactEventHandler<T>;
857 onPauseCapture?: ReactEventHandler<T>;
858 onPlay?: ReactEventHandler<T>;
859 onPlayCapture?: ReactEventHandler<T>;
860 onPlaying?: ReactEventHandler<T>;
861 onPlayingCapture?: ReactEventHandler<T>;
862 onProgress?: ReactEventHandler<T>;
863 onProgressCapture?: ReactEventHandler<T>;
864 onRateChange?: ReactEventHandler<T>;
865 onRateChangeCapture?: ReactEventHandler<T>;
866 onSeeked?: ReactEventHandler<T>;
867 onSeekedCapture?: ReactEventHandler<T>;
868 onSeeking?: ReactEventHandler<T>;
869 onSeekingCapture?: ReactEventHandler<T>;
870 onStalled?: ReactEventHandler<T>;
871 onStalledCapture?: ReactEventHandler<T>;
872 onSuspend?: ReactEventHandler<T>;
873 onSuspendCapture?: ReactEventHandler<T>;
874 onTimeUpdate?: ReactEventHandler<T>;
875 onTimeUpdateCapture?: ReactEventHandler<T>;
876 onVolumeChange?: ReactEventHandler<T>;
877 onVolumeChangeCapture?: ReactEventHandler<T>;
878 onWaiting?: ReactEventHandler<T>;
879 onWaitingCapture?: ReactEventHandler<T>;
880
881 // MouseEvents
882 onClick?: MouseEventHandler<T>;
883 onClickCapture?: MouseEventHandler<T>;
884 onContextMenu?: MouseEventHandler<T>;
885 onContextMenuCapture?: MouseEventHandler<T>;
886 onDoubleClick?: MouseEventHandler<T>;
887 onDoubleClickCapture?: MouseEventHandler<T>;
888 onDrag?: DragEventHandler<T>;
889 onDragCapture?: DragEventHandler<T>;
890 onDragEnd?: DragEventHandler<T>;
891 onDragEndCapture?: DragEventHandler<T>;
892 onDragEnter?: DragEventHandler<T>;
893 onDragEnterCapture?: DragEventHandler<T>;
894 onDragExit?: DragEventHandler<T>;
895 onDragExitCapture?: DragEventHandler<T>;
896 onDragLeave?: DragEventHandler<T>;
897 onDragLeaveCapture?: DragEventHandler<T>;
898 onDragOver?: DragEventHandler<T>;
899 onDragOverCapture?: DragEventHandler<T>;
900 onDragStart?: DragEventHandler<T>;
901 onDragStartCapture?: DragEventHandler<T>;
902 onDrop?: DragEventHandler<T>;
903 onDropCapture?: DragEventHandler<T>;
904 onMouseDown?: MouseEventHandler<T>;
905 onMouseDownCapture?: MouseEventHandler<T>;
906 onMouseEnter?: MouseEventHandler<T>;
907 onMouseLeave?: MouseEventHandler<T>;
908 onMouseMove?: MouseEventHandler<T>;
909 onMouseMoveCapture?: MouseEventHandler<T>;
910 onMouseOut?: MouseEventHandler<T>;
911 onMouseOutCapture?: MouseEventHandler<T>;
912 onMouseOver?: MouseEventHandler<T>;
913 onMouseOverCapture?: MouseEventHandler<T>;
914 onMouseUp?: MouseEventHandler<T>;
915 onMouseUpCapture?: MouseEventHandler<T>;
916
917 // Selection Events
918 onSelect?: ReactEventHandler<T>;
919 onSelectCapture?: ReactEventHandler<T>;
920
921 // Touch Events
922 onTouchCancel?: TouchEventHandler<T>;
923 onTouchCancelCapture?: TouchEventHandler<T>;
924 onTouchEnd?: TouchEventHandler<T>;
925 onTouchEndCapture?: TouchEventHandler<T>;
926 onTouchMove?: TouchEventHandler<T>;
927 onTouchMoveCapture?: TouchEventHandler<T>;
928 onTouchStart?: TouchEventHandler<T>;
929 onTouchStartCapture?: TouchEventHandler<T>;
930
931 // Pointer Events
932 onPointerDown?: PointerEventHandler<T>;
933 onPointerDownCapture?: PointerEventHandler<T>;
934 onPointerMove?: PointerEventHandler<T>;
935 onPointerMoveCapture?: PointerEventHandler<T>;
936 onPointerUp?: PointerEventHandler<T>;
937 onPointerUpCapture?: PointerEventHandler<T>;
938 onPointerCancel?: PointerEventHandler<T>;
939 onPointerCancelCapture?: PointerEventHandler<T>;
940 onPointerEnter?: PointerEventHandler<T>;
941 onPointerEnterCapture?: PointerEventHandler<T>;
942 onPointerLeave?: PointerEventHandler<T>;
943 onPointerLeaveCapture?: PointerEventHandler<T>;
944 onPointerOver?: PointerEventHandler<T>;
945 onPointerOverCapture?: PointerEventHandler<T>;
946 onPointerOut?: PointerEventHandler<T>;
947 onPointerOutCapture?: PointerEventHandler<T>;
948 onGotPointerCapture?: PointerEventHandler<T>;
949 onGotPointerCaptureCapture?: PointerEventHandler<T>;
950 onLostPointerCapture?: PointerEventHandler<T>;
951 onLostPointerCaptureCapture?: PointerEventHandler<T>;
952
953 // UI Events
954 onScroll?: UIEventHandler<T>;
955 onScrollCapture?: UIEventHandler<T>;
956
957 // Wheel Events
958 onWheel?: WheelEventHandler<T>;
959 onWheelCapture?: WheelEventHandler<T>;
960
961 // Animation Events
962 onAnimationStart?: AnimationEventHandler<T>;
963 onAnimationStartCapture?: AnimationEventHandler<T>;
964 onAnimationEnd?: AnimationEventHandler<T>;
965 onAnimationEndCapture?: AnimationEventHandler<T>;
966 onAnimationIteration?: AnimationEventHandler<T>;
967 onAnimationIterationCapture?: AnimationEventHandler<T>;
968
969 // Transition Events
970 onTransitionEnd?: TransitionEventHandler<T>;
971 onTransitionEndCapture?: TransitionEventHandler<T>;
972 }
973
974 export interface CSSProperties extends CSS.Properties<string | number> {
975 /**
976 * The index signature was removed to enable closed typing for style
977 * using CSSType. You're able to use type assertion or module augmentation
978 * to add properties or an index signature of your own.
979 *
980 * For examples and more information, visit:
981 * https://github.com/frenic/csstype#what-should-i-do-when-i-get-type-errors
982 */
983 }
984
985 interface HTMLAttributes<T> extends DOMAttributes<T> {
986 // React-specific Attributes
987 defaultChecked?: boolean;
988 defaultValue?: string | string[];
989 suppressContentEditableWarning?: boolean;
990 suppressHydrationWarning?: boolean;
991
992 // Standard HTML Attributes
993 accessKey?: string;
994 className?: string;
995 contentEditable?: boolean;
996 contextMenu?: string;
997 dir?: string;
998 draggable?: boolean;
999 hidden?: boolean;
1000 id?: string;
1001 lang?: string;
1002 placeholder?: string;
1003 slot?: string;
1004 spellCheck?: boolean;
1005 style?: CSSProperties;
1006 tabIndex?: number;
1007 title?: string;
1008
1009 // Unknown
1010 inputMode?: string;
1011 is?: string;
1012 radioGroup?: string; // <command>, <menuitem>
1013
1014 // WAI-ARIA
1015 role?: string;
1016
1017 // RDFa Attributes
1018 about?: string;
1019 datatype?: string;
1020 inlist?: any;
1021 prefix?: string;
1022 property?: string;
1023 resource?: string;
1024 typeof?: string;
1025 vocab?: string;
1026
1027 // Non-standard Attributes
1028 autoCapitalize?: string;
1029 autoCorrect?: string;
1030 autoSave?: string;
1031 color?: string;
1032 itemProp?: string;
1033 itemScope?: boolean;
1034 itemType?: string;
1035 itemID?: string;
1036 itemRef?: string;
1037 results?: number;
1038 security?: string;
1039 unselectable?: 'on' | 'off';
1040 }
1041
1042 // All the WAI-ARIA 1.1 attributes from https://www.w3.org/TR/wai-aria-1.1/
1043 interface HTMLAttributes<T> extends DOMAttributes<T> {
1044 /** Identifies the currently active element when DOM focus is on a composite widget, textbox, group, or application. */
1045 'aria-activedescendant'?: string;
1046 /** 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. */
1047 'aria-atomic'?: boolean | 'false' | 'true';
1048 /**
1049 * 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
1050 * presented if they are made.
1051 */
1052 'aria-autocomplete'?: 'none' | 'inline' | 'list' | 'both';
1053 /** 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. */
1054 'aria-busy'?: boolean | 'false' | 'true';
1055 /**
1056 * Indicates the current "checked" state of checkboxes, radio buttons, and other widgets.
1057 * @see aria-pressed @see aria-selected.
1058 */
1059 'aria-checked'?: boolean | 'false' | 'mixed' | 'true';
1060 /**
1061 * Defines the total number of columns in a table, grid, or treegrid.
1062 * @see aria-colindex.
1063 */
1064 'aria-colcount'?: number;
1065 /**
1066 * Defines an element's column index or position with respect to the total number of columns within a table, grid, or treegrid.
1067 * @see aria-colcount @see aria-colspan.
1068 */
1069 'aria-colindex'?: number;
1070 /**
1071 * Defines the number of columns spanned by a cell or gridcell within a table, grid, or treegrid.
1072 * @see aria-colindex @see aria-rowspan.
1073 */
1074 'aria-colspan'?: number;
1075 /**
1076 * Identifies the element (or elements) whose contents or presence are controlled by the current element.
1077 * @see aria-owns.
1078 */
1079 'aria-controls'?: string;
1080 /** Indicates the element that represents the current item within a container or set of related elements. */
1081 'aria-current'?: boolean | 'false' | 'true' | 'page' | 'step' | 'location' | 'date' | 'time';
1082 /**
1083 * Identifies the element (or elements) that describes the object.
1084 * @see aria-labelledby
1085 */
1086 'aria-describedby'?: string;
1087 /**
1088 * Identifies the element that provides a detailed, extended description for the object.
1089 * @see aria-describedby.
1090 */
1091 'aria-details'?: string;
1092 /**
1093 * Indicates that the element is perceivable but disabled, so it is not editable or otherwise operable.
1094 * @see aria-hidden @see aria-readonly.
1095 */
1096 'aria-disabled'?: boolean | 'false' | 'true';
1097 /**
1098 * Indicates what functions can be performed when a dragged object is released on the drop target.
1099 * @deprecated in ARIA 1.1
1100 */
1101 'aria-dropeffect'?: 'none' | 'copy' | 'execute' | 'link' | 'move' | 'popup';
1102 /**
1103 * Identifies the element that provides an error message for the object.
1104 * @see aria-invalid @see aria-describedby.
1105 */
1106 'aria-errormessage'?: string;
1107 /** Indicates whether the element, or another grouping element it controls, is currently expanded or collapsed. */
1108 'aria-expanded'?: boolean | 'false' | 'true';
1109 /**
1110 * Identifies the next element (or elements) in an alternate reading order of content which, at the user's discretion,
1111 * allows assistive technology to override the general default of reading in document source order.
1112 */
1113 'aria-flowto'?: string;
1114 /**
1115 * Indicates an element's "grabbed" state in a drag-and-drop operation.
1116 * @deprecated in ARIA 1.1
1117 */
1118 'aria-grabbed'?: boolean | 'false' | 'true';
1119 /** Indicates the availability and type of interactive popup element, such as menu or dialog, that can be triggered by an element. */
1120 'aria-haspopup'?: boolean | 'false' | 'true' | 'menu' | 'listbox' | 'tree' | 'grid' | 'dialog';
1121 /**
1122 * Indicates whether the element is exposed to an accessibility API.
1123 * @see aria-disabled.
1124 */
1125 'aria-hidden'?: boolean | 'false' | 'true';
1126 /**
1127 * Indicates the entered value does not conform to the format expected by the application.
1128 * @see aria-errormessage.
1129 */
1130 'aria-invalid'?: boolean | 'false' | 'true' | 'grammar' | 'spelling';
1131 /** Indicates keyboard shortcuts that an author has implemented to activate or give focus to an element. */
1132 'aria-keyshortcuts'?: string;
1133 /**
1134 * Defines a string value that labels the current element.
1135 * @see aria-labelledby.
1136 */
1137 'aria-label'?: string;
1138 /**
1139 * Identifies the element (or elements) that labels the current element.
1140 * @see aria-describedby.
1141 */
1142 'aria-labelledby'?: string;
1143 /** Defines the hierarchical level of an element within a structure. */
1144 'aria-level'?: number;
1145 /** 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. */
1146 'aria-live'?: 'off' | 'assertive' | 'polite';
1147 /** Indicates whether an element is modal when displayed. */
1148 'aria-modal'?: boolean | 'false' | 'true';
1149 /** Indicates whether a text box accepts multiple lines of input or only a single line. */
1150 'aria-multiline'?: boolean | 'false' | 'true';
1151 /** Indicates that the user may select more than one item from the current selectable descendants. */
1152 'aria-multiselectable'?: boolean | 'false' | 'true';
1153 /** Indicates whether the element's orientation is horizontal, vertical, or unknown/ambiguous. */
1154 'aria-orientation'?: 'horizontal' | 'vertical';
1155 /**
1156 * Identifies an element (or elements) in order to define a visual, functional, or contextual parent/child relationship
1157 * between DOM elements where the DOM hierarchy cannot be used to represent the relationship.
1158 * @see aria-controls.
1159 */
1160 'aria-owns'?: string;
1161 /**
1162 * Defines a short hint (a word or short phrase) intended to aid the user with data entry when the control has no value.
1163 * A hint could be a sample value or a brief description of the expected format.
1164 */
1165 'aria-placeholder'?: string;
1166 /**
1167 * 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.
1168 * @see aria-setsize.
1169 */
1170 'aria-posinset'?: number;
1171 /**
1172 * Indicates the current "pressed" state of toggle buttons.
1173 * @see aria-checked @see aria-selected.
1174 */
1175 'aria-pressed'?: boolean | 'false' | 'mixed' | 'true';
1176 /**
1177 * Indicates that the element is not editable, but is otherwise operable.
1178 * @see aria-disabled.
1179 */
1180 'aria-readonly'?: boolean | 'false' | 'true';
1181 /**
1182 * Indicates what notifications the user agent will trigger when the accessibility tree within a live region is modified.
1183 * @see aria-atomic.
1184 */
1185 'aria-relevant'?: 'additions' | 'additions text' | 'all' | 'removals' | 'text';
1186 /** Indicates that user input is required on the element before a form may be submitted. */
1187 'aria-required'?: boolean | 'false' | 'true';
1188 /** Defines a human-readable, author-localized description for the role of an element. */
1189 'aria-roledescription'?: string;
1190 /**
1191 * Defines the total number of rows in a table, grid, or treegrid.
1192 * @see aria-rowindex.
1193 */
1194 'aria-rowcount'?: number;
1195 /**
1196 * Defines an element's row index or position with respect to the total number of rows within a table, grid, or treegrid.
1197 * @see aria-rowcount @see aria-rowspan.
1198 */
1199 'aria-rowindex'?: number;
1200 /**
1201 * Defines the number of rows spanned by a cell or gridcell within a table, grid, or treegrid.
1202 * @see aria-rowindex @see aria-colspan.
1203 */
1204 'aria-rowspan'?: number;
1205 /**
1206 * Indicates the current "selected" state of various widgets.
1207 * @see aria-checked @see aria-pressed.
1208 */
1209 'aria-selected'?: boolean | 'false' | 'true';
1210 /**
1211 * 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.
1212 * @see aria-posinset.
1213 */
1214 'aria-setsize'?: number;
1215 /** Indicates if items in a table or grid are sorted in ascending or descending order. */
1216 'aria-sort'?: 'none' | 'ascending' | 'descending' | 'other';
1217 /** Defines the maximum allowed value for a range widget. */
1218 'aria-valuemax'?: number;
1219 /** Defines the minimum allowed value for a range widget. */
1220 'aria-valuemin'?: number;
1221 /**
1222 * Defines the current value for a range widget.
1223 * @see aria-valuetext.
1224 */
1225 'aria-valuenow'?: number;
1226 /** Defines the human readable text alternative of aria-valuenow for a range widget. */
1227 'aria-valuetext'?: string;
1228 }
1229
1230 interface AllHTMLAttributes<T> extends HTMLAttributes<T> {
1231 // Standard HTML Attributes
1232 accept?: string;
1233 acceptCharset?: string;
1234 action?: string;
1235 allowFullScreen?: boolean;
1236 allowTransparency?: boolean;
1237 alt?: string;
1238 as?: string;
1239 async?: boolean;
1240 autoComplete?: string;
1241 autoFocus?: boolean;
1242 autoPlay?: boolean;
1243 capture?: boolean | string;
1244 cellPadding?: number | string;
1245 cellSpacing?: number | string;
1246 charSet?: string;
1247 challenge?: string;
1248 checked?: boolean;
1249 cite?: string;
1250 classID?: string;
1251 cols?: number;
1252 colSpan?: number;
1253 content?: string;
1254 controls?: boolean;
1255 coords?: string;
1256 crossOrigin?: string;
1257 data?: string;
1258 dateTime?: string;
1259 default?: boolean;
1260 defer?: boolean;
1261 disabled?: boolean;
1262 download?: any;
1263 encType?: string;
1264 form?: string;
1265 formAction?: string;
1266 formEncType?: string;
1267 formMethod?: string;
1268 formNoValidate?: boolean;
1269 formTarget?: string;
1270 frameBorder?: number | string;
1271 headers?: string;
1272 height?: number | string;
1273 high?: number;
1274 href?: string;
1275 hrefLang?: string;
1276 htmlFor?: string;
1277 httpEquiv?: string;
1278 integrity?: string;
1279 keyParams?: string;
1280 keyType?: string;
1281 kind?: string;
1282 label?: string;
1283 list?: string;
1284 loop?: boolean;
1285 low?: number;
1286 manifest?: string;
1287 marginHeight?: number;
1288 marginWidth?: number;
1289 max?: number | string;
1290 maxLength?: number;
1291 media?: string;
1292 mediaGroup?: string;
1293 method?: string;
1294 min?: number | string;
1295 minLength?: number;
1296 multiple?: boolean;
1297 muted?: boolean;
1298 name?: string;
1299 nonce?: string;
1300 noValidate?: boolean;
1301 open?: boolean;
1302 optimum?: number;
1303 pattern?: string;
1304 placeholder?: string;
1305 playsInline?: boolean;
1306 poster?: string;
1307 preload?: string;
1308 readOnly?: boolean;
1309 rel?: string;
1310 required?: boolean;
1311 reversed?: boolean;
1312 rows?: number;
1313 rowSpan?: number;
1314 sandbox?: string;
1315 scope?: string;
1316 scoped?: boolean;
1317 scrolling?: string;
1318 seamless?: boolean;
1319 selected?: boolean;
1320 shape?: string;
1321 size?: number;
1322 sizes?: string;
1323 span?: number;
1324 src?: string;
1325 srcDoc?: string;
1326 srcLang?: string;
1327 srcSet?: string;
1328 start?: number;
1329 step?: number | string;
1330 summary?: string;
1331 target?: string;
1332 type?: string;
1333 useMap?: string;
1334 value?: string | string[] | number;
1335 width?: number | string;
1336 wmode?: string;
1337 wrap?: string;
1338 }
1339
1340 interface AnchorHTMLAttributes<T> extends HTMLAttributes<T> {
1341 download?: any;
1342 href?: string;
1343 hrefLang?: string;
1344 media?: string;
1345 rel?: string;
1346 target?: string;
1347 type?: string;
1348 }
1349
1350 // tslint:disable-next-line:no-empty-interface
1351 interface AudioHTMLAttributes<T> extends MediaHTMLAttributes<T> {}
1352
1353 interface AreaHTMLAttributes<T> extends HTMLAttributes<T> {
1354 alt?: string;
1355 coords?: string;
1356 download?: any;
1357 href?: string;
1358 hrefLang?: string;
1359 media?: string;
1360 rel?: string;
1361 shape?: string;
1362 target?: string;
1363 }
1364
1365 interface BaseHTMLAttributes<T> extends HTMLAttributes<T> {
1366 href?: string;
1367 target?: string;
1368 }
1369
1370 interface BlockquoteHTMLAttributes<T> extends HTMLAttributes<T> {
1371 cite?: string;
1372 }
1373
1374 interface ButtonHTMLAttributes<T> extends HTMLAttributes<T> {
1375 autoFocus?: boolean;
1376 disabled?: boolean;
1377 form?: string;
1378 formAction?: string;
1379 formEncType?: string;
1380 formMethod?: string;
1381 formNoValidate?: boolean;
1382 formTarget?: string;
1383 name?: string;
1384 type?: string;
1385 value?: string | string[] | number;
1386 }
1387
1388 interface CanvasHTMLAttributes<T> extends HTMLAttributes<T> {
1389 height?: number | string;
1390 width?: number | string;
1391 }
1392
1393 interface ColHTMLAttributes<T> extends HTMLAttributes<T> {
1394 span?: number;
1395 width?: number | string;
1396 }
1397
1398 interface ColgroupHTMLAttributes<T> extends HTMLAttributes<T> {
1399 span?: number;
1400 }
1401
1402 interface DetailsHTMLAttributes<T> extends HTMLAttributes<T> {
1403 open?: boolean;
1404 }
1405
1406 interface DelHTMLAttributes<T> extends HTMLAttributes<T> {
1407 cite?: string;
1408 dateTime?: string;
1409 }
1410
1411 interface DialogHTMLAttributes<T> extends HTMLAttributes<T> {
1412 open?: boolean;
1413 }
1414
1415 interface EmbedHTMLAttributes<T> extends HTMLAttributes<T> {
1416 height?: number | string;
1417 src?: string;
1418 type?: string;
1419 width?: number | string;
1420 }
1421
1422 interface FieldsetHTMLAttributes<T> extends HTMLAttributes<T> {
1423 disabled?: boolean;
1424 form?: string;
1425 name?: string;
1426 }
1427
1428 interface FormHTMLAttributes<T> extends HTMLAttributes<T> {
1429 acceptCharset?: string;
1430 action?: string;
1431 autoComplete?: string;
1432 encType?: string;
1433 method?: string;
1434 name?: string;
1435 noValidate?: boolean;
1436 target?: string;
1437 }
1438
1439 interface HtmlHTMLAttributes<T> extends HTMLAttributes<T> {
1440 manifest?: string;
1441 }
1442
1443 interface IframeHTMLAttributes<T> extends HTMLAttributes<T> {
1444 allow?: string;
1445 allowFullScreen?: boolean;
1446 allowTransparency?: boolean;
1447 frameBorder?: number | string;
1448 height?: number | string;
1449 marginHeight?: number;
1450 marginWidth?: number;
1451 name?: string;
1452 sandbox?: string;
1453 scrolling?: string;
1454 seamless?: boolean;
1455 src?: string;
1456 srcDoc?: string;
1457 width?: number | string;
1458 }
1459
1460 interface ImgHTMLAttributes<T> extends HTMLAttributes<T> {
1461 alt?: string;
1462 crossOrigin?: "anonymous" | "use-credentials" | "";
1463 decoding?: "async" | "auto" | "sync";
1464 height?: number | string;
1465 sizes?: string;
1466 src?: string;
1467 srcSet?: string;
1468 useMap?: string;
1469 width?: number | string;
1470 }
1471
1472 interface InsHTMLAttributes<T> extends HTMLAttributes<T> {
1473 cite?: string;
1474 dateTime?: string;
1475 }
1476
1477 interface InputHTMLAttributes<T> extends HTMLAttributes<T> {
1478 accept?: string;
1479 alt?: string;
1480 autoComplete?: string;
1481 autoFocus?: boolean;
1482 capture?: boolean | string; // https://www.w3.org/TR/html-media-capture/#the-capture-attribute
1483 checked?: boolean;
1484 crossOrigin?: string;
1485 disabled?: boolean;
1486 form?: string;
1487 formAction?: string;
1488 formEncType?: string;
1489 formMethod?: string;
1490 formNoValidate?: boolean;
1491 formTarget?: string;
1492 height?: number | string;
1493 list?: string;
1494 max?: number | string;
1495 maxLength?: number;
1496 min?: number | string;
1497 minLength?: number;
1498 multiple?: boolean;
1499 name?: string;
1500 pattern?: string;
1501 placeholder?: string;
1502 readOnly?: boolean;
1503 required?: boolean;
1504 size?: number;
1505 src?: string;
1506 step?: number | string;
1507 type?: string;
1508 value?: string | string[] | number;
1509 width?: number | string;
1510
1511 onChange?: ChangeEventHandler<T>;
1512 }
1513
1514 interface KeygenHTMLAttributes<T> extends HTMLAttributes<T> {
1515 autoFocus?: boolean;
1516 challenge?: string;
1517 disabled?: boolean;
1518 form?: string;
1519 keyType?: string;
1520 keyParams?: string;
1521 name?: string;
1522 }
1523
1524 interface LabelHTMLAttributes<T> extends HTMLAttributes<T> {
1525 form?: string;
1526 htmlFor?: string;
1527 }
1528
1529 interface LiHTMLAttributes<T> extends HTMLAttributes<T> {
1530 value?: string | string[] | number;
1531 }
1532
1533 interface LinkHTMLAttributes<T> extends HTMLAttributes<T> {
1534 as?: string;
1535 crossOrigin?: string;
1536 href?: string;
1537 hrefLang?: string;
1538 integrity?: string;
1539 media?: string;
1540 rel?: string;
1541 sizes?: string;
1542 type?: string;
1543 }
1544
1545 interface MapHTMLAttributes<T> extends HTMLAttributes<T> {
1546 name?: string;
1547 }
1548
1549 interface MenuHTMLAttributes<T> extends HTMLAttributes<T> {
1550 type?: string;
1551 }
1552
1553 interface MediaHTMLAttributes<T> extends HTMLAttributes<T> {
1554 autoPlay?: boolean;
1555 controls?: boolean;
1556 controlsList?: string;
1557 crossOrigin?: string;
1558 loop?: boolean;
1559 mediaGroup?: string;
1560 muted?: boolean;
1561 playsinline?: boolean;
1562 preload?: string;
1563 src?: string;
1564 }
1565
1566 interface MetaHTMLAttributes<T> extends HTMLAttributes<T> {
1567 charSet?: string;
1568 content?: string;
1569 httpEquiv?: string;
1570 name?: string;
1571 }
1572
1573 interface MeterHTMLAttributes<T> extends HTMLAttributes<T> {
1574 form?: string;
1575 high?: number;
1576 low?: number;
1577 max?: number | string;
1578 min?: number | string;
1579 optimum?: number;
1580 value?: string | string[] | number;
1581 }
1582
1583 interface QuoteHTMLAttributes<T> extends HTMLAttributes<T> {
1584 cite?: string;
1585 }
1586
1587 interface ObjectHTMLAttributes<T> extends HTMLAttributes<T> {
1588 classID?: string;
1589 data?: string;
1590 form?: string;
1591 height?: number | string;
1592 name?: string;
1593 type?: string;
1594 useMap?: string;
1595 width?: number | string;
1596 wmode?: string;
1597 }
1598
1599 interface OlHTMLAttributes<T> extends HTMLAttributes<T> {
1600 reversed?: boolean;
1601 start?: number;
1602 type?: '1' | 'a' | 'A' | 'i' | 'I';
1603 }
1604
1605 interface OptgroupHTMLAttributes<T> extends HTMLAttributes<T> {
1606 disabled?: boolean;
1607 label?: string;
1608 }
1609
1610 interface OptionHTMLAttributes<T> extends HTMLAttributes<T> {
1611 disabled?: boolean;
1612 label?: string;
1613 selected?: boolean;
1614 value?: string | string[] | number;
1615 }
1616
1617 interface OutputHTMLAttributes<T> extends HTMLAttributes<T> {
1618 form?: string;
1619 htmlFor?: string;
1620 name?: string;
1621 }
1622
1623 interface ParamHTMLAttributes<T> extends HTMLAttributes<T> {
1624 name?: string;
1625 value?: string | string[] | number;
1626 }
1627
1628 interface ProgressHTMLAttributes<T> extends HTMLAttributes<T> {
1629 max?: number | string;
1630 value?: string | string[] | number;
1631 }
1632
1633 interface ScriptHTMLAttributes<T> extends HTMLAttributes<T> {
1634 async?: boolean;
1635 charSet?: string;
1636 crossOrigin?: string;
1637 defer?: boolean;
1638 integrity?: string;
1639 noModule?: boolean;
1640 nonce?: string;
1641 src?: string;
1642 type?: string;
1643 }
1644
1645 interface SelectHTMLAttributes<T> extends HTMLAttributes<T> {
1646 autoComplete?: string;
1647 autoFocus?: boolean;
1648 disabled?: boolean;
1649 form?: string;
1650 multiple?: boolean;
1651 name?: string;
1652 required?: boolean;
1653 size?: number;
1654 value?: string | string[] | number;
1655 onChange?: ChangeEventHandler<T>;
1656 }
1657
1658 interface SourceHTMLAttributes<T> extends HTMLAttributes<T> {
1659 media?: string;
1660 sizes?: string;
1661 src?: string;
1662 srcSet?: string;
1663 type?: string;
1664 }
1665
1666 interface StyleHTMLAttributes<T> extends HTMLAttributes<T> {
1667 media?: string;
1668 nonce?: string;
1669 scoped?: boolean;
1670 type?: string;
1671 }
1672
1673 interface TableHTMLAttributes<T> extends HTMLAttributes<T> {
1674 cellPadding?: number | string;
1675 cellSpacing?: number | string;
1676 summary?: string;
1677 }
1678
1679 interface TextareaHTMLAttributes<T> extends HTMLAttributes<T> {
1680 autoComplete?: string;
1681 autoFocus?: boolean;
1682 cols?: number;
1683 dirName?: string;
1684 disabled?: boolean;
1685 form?: string;
1686 maxLength?: number;
1687 minLength?: number;
1688 name?: string;
1689 placeholder?: string;
1690 readOnly?: boolean;
1691 required?: boolean;
1692 rows?: number;
1693 value?: string | string[] | number;
1694 wrap?: string;
1695
1696 onChange?: ChangeEventHandler<T>;
1697 }
1698
1699 interface TdHTMLAttributes<T> extends HTMLAttributes<T> {
1700 colSpan?: number;
1701 headers?: string;
1702 rowSpan?: number;
1703 scope?: string;
1704 }
1705
1706 interface ThHTMLAttributes<T> extends HTMLAttributes<T> {
1707 colSpan?: number;
1708 headers?: string;
1709 rowSpan?: number;
1710 scope?: string;
1711 }
1712
1713 interface TimeHTMLAttributes<T> extends HTMLAttributes<T> {
1714 dateTime?: string;
1715 }
1716
1717 interface TrackHTMLAttributes<T> extends HTMLAttributes<T> {
1718 default?: boolean;
1719 kind?: string;
1720 label?: string;
1721 src?: string;
1722 srcLang?: string;
1723 }
1724
1725 interface VideoHTMLAttributes<T> extends MediaHTMLAttributes<T> {
1726 height?: number | string;
1727 playsInline?: boolean;
1728 poster?: string;
1729 width?: number | string;
1730 }
1731
1732 // this list is "complete" in that it contains every SVG attribute
1733 // that React supports, but the types can be improved.
1734 // Full list here: https://facebook.github.io/react/docs/dom-elements.html
1735 //
1736 // The three broad type categories are (in order of restrictiveness):
1737 // - "number | string"
1738 // - "string"
1739 // - union of string literals
1740 interface SVGAttributes<T> extends DOMAttributes<T> {
1741 // Attributes which also defined in HTMLAttributes
1742 // See comment in SVGDOMPropertyConfig.js
1743 className?: string;
1744 color?: string;
1745 height?: number | string;
1746 id?: string;
1747 lang?: string;
1748 max?: number | string;
1749 media?: string;
1750 method?: string;
1751 min?: number | string;
1752 name?: string;
1753 style?: CSSProperties;
1754 target?: string;
1755 type?: string;
1756 width?: number | string;
1757
1758 // Other HTML properties supported by SVG elements in browsers
1759 role?: string;
1760 tabIndex?: number;
1761
1762 // SVG Specific attributes
1763 accentHeight?: number | string;
1764 accumulate?: "none" | "sum";
1765 additive?: "replace" | "sum";
1766 alignmentBaseline?: "auto" | "baseline" | "before-edge" | "text-before-edge" | "middle" | "central" | "after-edge" |
1767 "text-after-edge" | "ideographic" | "alphabetic" | "hanging" | "mathematical" | "inherit";
1768 allowReorder?: "no" | "yes";
1769 alphabetic?: number | string;
1770 amplitude?: number | string;
1771 arabicForm?: "initial" | "medial" | "terminal" | "isolated";
1772 ascent?: number | string;
1773 attributeName?: string;
1774 attributeType?: string;
1775 autoReverse?: number | string;
1776 azimuth?: number | string;
1777 baseFrequency?: number | string;
1778 baselineShift?: number | string;
1779 baseProfile?: number | string;
1780 bbox?: number | string;
1781 begin?: number | string;
1782 bias?: number | string;
1783 by?: number | string;
1784 calcMode?: number | string;
1785 capHeight?: number | string;
1786 clip?: number | string;
1787 clipPath?: string;
1788 clipPathUnits?: number | string;
1789 clipRule?: number | string;
1790 colorInterpolation?: number | string;
1791 colorInterpolationFilters?: "auto" | "sRGB" | "linearRGB" | "inherit";
1792 colorProfile?: number | string;
1793 colorRendering?: number | string;
1794 contentScriptType?: number | string;
1795 contentStyleType?: number | string;
1796 cursor?: number | string;
1797 cx?: number | string;
1798 cy?: number | string;
1799 d?: string;
1800 decelerate?: number | string;
1801 descent?: number | string;
1802 diffuseConstant?: number | string;
1803 direction?: number | string;
1804 display?: number | string;
1805 divisor?: number | string;
1806 dominantBaseline?: number | string;
1807 dur?: number | string;
1808 dx?: number | string;
1809 dy?: number | string;
1810 edgeMode?: number | string;
1811 elevation?: number | string;
1812 enableBackground?: number | string;
1813 end?: number | string;
1814 exponent?: number | string;
1815 externalResourcesRequired?: number | string;
1816 fill?: string;
1817 fillOpacity?: number | string;
1818 fillRule?: "nonzero" | "evenodd" | "inherit";
1819 filter?: string;
1820 filterRes?: number | string;
1821 filterUnits?: number | string;
1822 floodColor?: number | string;
1823 floodOpacity?: number | string;
1824 focusable?: number | string;
1825 fontFamily?: string;
1826 fontSize?: number | string;
1827 fontSizeAdjust?: number | string;
1828 fontStretch?: number | string;
1829 fontStyle?: number | string;
1830 fontVariant?: number | string;
1831 fontWeight?: number | string;
1832 format?: number | string;
1833 from?: number | string;
1834 fx?: number | string;
1835 fy?: number | string;
1836 g1?: number | string;
1837 g2?: number | string;
1838 glyphName?: number | string;
1839 glyphOrientationHorizontal?: number | string;
1840 glyphOrientationVertical?: number | string;
1841 glyphRef?: number | string;
1842 gradientTransform?: string;
1843 gradientUnits?: string;
1844 hanging?: number | string;
1845 horizAdvX?: number | string;
1846 horizOriginX?: number | string;
1847 href?: string;
1848 ideographic?: number | string;
1849 imageRendering?: number | string;
1850 in2?: number | string;
1851 in?: string;
1852 intercept?: number | string;
1853 k1?: number | string;
1854 k2?: number | string;
1855 k3?: number | string;
1856 k4?: number | string;
1857 k?: number | string;
1858 kernelMatrix?: number | string;
1859 kernelUnitLength?: number | string;
1860 kerning?: number | string;
1861 keyPoints?: number | string;
1862 keySplines?: number | string;
1863 keyTimes?: number | string;
1864 lengthAdjust?: number | string;
1865 letterSpacing?: number | string;
1866 lightingColor?: number | string;
1867 limitingConeAngle?: number | string;
1868 local?: number | string;
1869 markerEnd?: string;
1870 markerHeight?: number | string;
1871 markerMid?: string;
1872 markerStart?: string;
1873 markerUnits?: number | string;
1874 markerWidth?: number | string;
1875 mask?: string;
1876 maskContentUnits?: number | string;
1877 maskUnits?: number | string;
1878 mathematical?: number | string;
1879 mode?: number | string;
1880 numOctaves?: number | string;
1881 offset?: number | string;
1882 opacity?: number | string;
1883 operator?: number | string;
1884 order?: number | string;
1885 orient?: number | string;
1886 orientation?: number | string;
1887 origin?: number | string;
1888 overflow?: number | string;
1889 overlinePosition?: number | string;
1890 overlineThickness?: number | string;
1891 paintOrder?: number | string;
1892 panose1?: number | string;
1893 pathLength?: number | string;
1894 patternContentUnits?: string;
1895 patternTransform?: number | string;
1896 patternUnits?: string;
1897 pointerEvents?: number | string;
1898 points?: string;
1899 pointsAtX?: number | string;
1900 pointsAtY?: number | string;
1901 pointsAtZ?: number | string;
1902 preserveAlpha?: number | string;
1903 preserveAspectRatio?: string;
1904 primitiveUnits?: number | string;
1905 r?: number | string;
1906 radius?: number | string;
1907 refX?: number | string;
1908 refY?: number | string;
1909 renderingIntent?: number | string;
1910 repeatCount?: number | string;
1911 repeatDur?: number | string;
1912 requiredExtensions?: number | string;
1913 requiredFeatures?: number | string;
1914 restart?: number | string;
1915 result?: string;
1916 rotate?: number | string;
1917 rx?: number | string;
1918 ry?: number | string;
1919 scale?: number | string;
1920 seed?: number | string;
1921 shapeRendering?: number | string;
1922 slope?: number | string;
1923 spacing?: number | string;
1924 specularConstant?: number | string;
1925 specularExponent?: number | string;
1926 speed?: number | string;
1927 spreadMethod?: string;
1928 startOffset?: number | string;
1929 stdDeviation?: number | string;
1930 stemh?: number | string;
1931 stemv?: number | string;
1932 stitchTiles?: number | string;
1933 stopColor?: string;
1934 stopOpacity?: number | string;
1935 strikethroughPosition?: number | string;
1936 strikethroughThickness?: number | string;
1937 string?: number | string;
1938 stroke?: string;
1939 strokeDasharray?: string | number;
1940 strokeDashoffset?: string | number;
1941 strokeLinecap?: "butt" | "round" | "square" | "inherit";
1942 strokeLinejoin?: "miter" | "round" | "bevel" | "inherit";
1943 strokeMiterlimit?: number | string;
1944 strokeOpacity?: number | string;
1945 strokeWidth?: number | string;
1946 surfaceScale?: number | string;
1947 systemLanguage?: number | string;
1948 tableValues?: number | string;
1949 targetX?: number | string;
1950 targetY?: number | string;
1951 textAnchor?: string;
1952 textDecoration?: number | string;
1953 textLength?: number | string;
1954 textRendering?: number | string;
1955 to?: number | string;
1956 transform?: string;
1957 u1?: number | string;
1958 u2?: number | string;
1959 underlinePosition?: number | string;
1960 underlineThickness?: number | string;
1961 unicode?: number | string;
1962 unicodeBidi?: number | string;
1963 unicodeRange?: number | string;
1964 unitsPerEm?: number | string;
1965 vAlphabetic?: number | string;
1966 values?: string;
1967 vectorEffect?: number | string;
1968 version?: string;
1969 vertAdvY?: number | string;
1970 vertOriginX?: number | string;
1971 vertOriginY?: number | string;
1972 vHanging?: number | string;
1973 vIdeographic?: number | string;
1974 viewBox?: string;
1975 viewTarget?: number | string;
1976 visibility?: number | string;
1977 vMathematical?: number | string;
1978 widths?: number | string;
1979 wordSpacing?: number | string;
1980 writingMode?: number | string;
1981 x1?: number | string;
1982 x2?: number | string;
1983 x?: number | string;
1984 xChannelSelector?: string;
1985 xHeight?: number | string;
1986 xlinkActuate?: string;
1987 xlinkArcrole?: string;
1988 xlinkHref?: string;
1989 xlinkRole?: string;
1990 xlinkShow?: string;
1991 xlinkTitle?: string;
1992 xlinkType?: string;
1993 xmlBase?: string;
1994 xmlLang?: string;
1995 xmlns?: string;
1996 xmlnsXlink?: string;
1997 xmlSpace?: string;
1998 y1?: number | string;
1999 y2?: number | string;
2000 y?: number | string;
2001 yChannelSelector?: string;
2002 z?: number | string;
2003 zoomAndPan?: string;
2004 }
2005
2006 interface WebViewHTMLAttributes<T> extends HTMLAttributes<T> {
2007 allowFullScreen?: boolean;
2008 allowpopups?: boolean;
2009 autoFocus?: boolean;
2010 autosize?: boolean;
2011 blinkfeatures?: string;
2012 disableblinkfeatures?: string;
2013 disableguestresize?: boolean;
2014 disablewebsecurity?: boolean;
2015 guestinstance?: string;
2016 httpreferrer?: string;
2017 nodeintegration?: boolean;
2018 partition?: string;
2019 plugins?: boolean;
2020 preload?: string;
2021 src?: string;
2022 useragent?: string;
2023 webpreferences?: string;
2024 }
2025
2026 //
2027 // React.DOM
2028 // ----------------------------------------------------------------------
2029
2030 interface ReactHTML {
2031 a: DetailedHTMLFactory<AnchorHTMLAttributes<HTMLAnchorElement>, HTMLAnchorElement>;
2032 abbr: DetailedHTMLFactory<HTMLAttributes<HTMLElement>, HTMLElement>;
2033 address: DetailedHTMLFactory<HTMLAttributes<HTMLElement>, HTMLElement>;
2034 area: DetailedHTMLFactory<AreaHTMLAttributes<HTMLAreaElement>, HTMLAreaElement>;
2035 article: DetailedHTMLFactory<HTMLAttributes<HTMLElement>, HTMLElement>;
2036 aside: DetailedHTMLFactory<HTMLAttributes<HTMLElement>, HTMLElement>;
2037 audio: DetailedHTMLFactory<AudioHTMLAttributes<HTMLAudioElement>, HTMLAudioElement>;
2038 b: DetailedHTMLFactory<HTMLAttributes<HTMLElement>, HTMLElement>;
2039 base: DetailedHTMLFactory<BaseHTMLAttributes<HTMLBaseElement>, HTMLBaseElement>;
2040 bdi: DetailedHTMLFactory<HTMLAttributes<HTMLElement>, HTMLElement>;
2041 bdo: DetailedHTMLFactory<HTMLAttributes<HTMLElement>, HTMLElement>;
2042 big: DetailedHTMLFactory<HTMLAttributes<HTMLElement>, HTMLElement>;
2043 blockquote: DetailedHTMLFactory<BlockquoteHTMLAttributes<HTMLElement>, HTMLElement>;
2044 body: DetailedHTMLFactory<HTMLAttributes<HTMLBodyElement>, HTMLBodyElement>;
2045 br: DetailedHTMLFactory<HTMLAttributes<HTMLBRElement>, HTMLBRElement>;
2046 button: DetailedHTMLFactory<ButtonHTMLAttributes<HTMLButtonElement>, HTMLButtonElement>;
2047 canvas: DetailedHTMLFactory<CanvasHTMLAttributes<HTMLCanvasElement>, HTMLCanvasElement>;
2048 caption: DetailedHTMLFactory<HTMLAttributes<HTMLElement>, HTMLElement>;
2049 cite: DetailedHTMLFactory<HTMLAttributes<HTMLElement>, HTMLElement>;
2050 code: DetailedHTMLFactory<HTMLAttributes<HTMLElement>, HTMLElement>;
2051 col: DetailedHTMLFactory<ColHTMLAttributes<HTMLTableColElement>, HTMLTableColElement>;
2052 colgroup: DetailedHTMLFactory<ColgroupHTMLAttributes<HTMLTableColElement>, HTMLTableColElement>;
2053 data: DetailedHTMLFactory<HTMLAttributes<HTMLElement>, HTMLElement>;
2054 datalist: DetailedHTMLFactory<HTMLAttributes<HTMLDataListElement>, HTMLDataListElement>;
2055 dd: DetailedHTMLFactory<HTMLAttributes<HTMLElement>, HTMLElement>;
2056 del: DetailedHTMLFactory<DelHTMLAttributes<HTMLElement>, HTMLElement>;
2057 details: DetailedHTMLFactory<DetailsHTMLAttributes<HTMLElement>, HTMLElement>;
2058 dfn: DetailedHTMLFactory<HTMLAttributes<HTMLElement>, HTMLElement>;
2059 dialog: DetailedHTMLFactory<DialogHTMLAttributes<HTMLDialogElement>, HTMLDialogElement>;
2060 div: DetailedHTMLFactory<HTMLAttributes<HTMLDivElement>, HTMLDivElement>;
2061 dl: DetailedHTMLFactory<HTMLAttributes<HTMLDListElement>, HTMLDListElement>;
2062 dt: DetailedHTMLFactory<HTMLAttributes<HTMLElement>, HTMLElement>;
2063 em: DetailedHTMLFactory<HTMLAttributes<HTMLElement>, HTMLElement>;
2064 embed: DetailedHTMLFactory<EmbedHTMLAttributes<HTMLEmbedElement>, HTMLEmbedElement>;
2065 fieldset: DetailedHTMLFactory<FieldsetHTMLAttributes<HTMLFieldSetElement>, HTMLFieldSetElement>;
2066 figcaption: DetailedHTMLFactory<HTMLAttributes<HTMLElement>, HTMLElement>;
2067 figure: DetailedHTMLFactory<HTMLAttributes<HTMLElement>, HTMLElement>;
2068 footer: DetailedHTMLFactory<HTMLAttributes<HTMLElement>, HTMLElement>;
2069 form: DetailedHTMLFactory<FormHTMLAttributes<HTMLFormElement>, HTMLFormElement>;
2070 h1: DetailedHTMLFactory<HTMLAttributes<HTMLHeadingElement>, HTMLHeadingElement>;
2071 h2: DetailedHTMLFactory<HTMLAttributes<HTMLHeadingElement>, HTMLHeadingElement>;
2072 h3: DetailedHTMLFactory<HTMLAttributes<HTMLHeadingElement>, HTMLHeadingElement>;
2073 h4: DetailedHTMLFactory<HTMLAttributes<HTMLHeadingElement>, HTMLHeadingElement>;
2074 h5: DetailedHTMLFactory<HTMLAttributes<HTMLHeadingElement>, HTMLHeadingElement>;
2075 h6: DetailedHTMLFactory<HTMLAttributes<HTMLHeadingElement>, HTMLHeadingElement>;
2076 head: DetailedHTMLFactory<HTMLAttributes<HTMLElement>, HTMLHeadElement>;
2077 header: DetailedHTMLFactory<HTMLAttributes<HTMLElement>, HTMLElement>;
2078 hgroup: DetailedHTMLFactory<HTMLAttributes<HTMLElement>, HTMLElement>;
2079 hr: DetailedHTMLFactory<HTMLAttributes<HTMLHRElement>, HTMLHRElement>;
2080 html: DetailedHTMLFactory<HtmlHTMLAttributes<HTMLHtmlElement>, HTMLHtmlElement>;
2081 i: DetailedHTMLFactory<HTMLAttributes<HTMLElement>, HTMLElement>;
2082 iframe: DetailedHTMLFactory<IframeHTMLAttributes<HTMLIFrameElement>, HTMLIFrameElement>;
2083 img: DetailedHTMLFactory<ImgHTMLAttributes<HTMLImageElement>, HTMLImageElement>;
2084 input: DetailedHTMLFactory<InputHTMLAttributes<HTMLInputElement>, HTMLInputElement>;
2085 ins: DetailedHTMLFactory<InsHTMLAttributes<HTMLModElement>, HTMLModElement>;
2086 kbd: DetailedHTMLFactory<HTMLAttributes<HTMLElement>, HTMLElement>;
2087 keygen: DetailedHTMLFactory<KeygenHTMLAttributes<HTMLElement>, HTMLElement>;
2088 label: DetailedHTMLFactory<LabelHTMLAttributes<HTMLLabelElement>, HTMLLabelElement>;
2089 legend: DetailedHTMLFactory<HTMLAttributes<HTMLLegendElement>, HTMLLegendElement>;
2090 li: DetailedHTMLFactory<LiHTMLAttributes<HTMLLIElement>, HTMLLIElement>;
2091 link: DetailedHTMLFactory<LinkHTMLAttributes<HTMLLinkElement>, HTMLLinkElement>;
2092 main: DetailedHTMLFactory<HTMLAttributes<HTMLElement>, HTMLElement>;
2093 map: DetailedHTMLFactory<MapHTMLAttributes<HTMLMapElement>, HTMLMapElement>;
2094 mark: DetailedHTMLFactory<HTMLAttributes<HTMLElement>, HTMLElement>;
2095 menu: DetailedHTMLFactory<MenuHTMLAttributes<HTMLElement>, HTMLElement>;
2096 menuitem: DetailedHTMLFactory<HTMLAttributes<HTMLElement>, HTMLElement>;
2097 meta: DetailedHTMLFactory<MetaHTMLAttributes<HTMLMetaElement>, HTMLMetaElement>;
2098 meter: DetailedHTMLFactory<MeterHTMLAttributes<HTMLElement>, HTMLElement>;
2099 nav: DetailedHTMLFactory<HTMLAttributes<HTMLElement>, HTMLElement>;
2100 noscript: DetailedHTMLFactory<HTMLAttributes<HTMLElement>, HTMLElement>;
2101 object: DetailedHTMLFactory<ObjectHTMLAttributes<HTMLObjectElement>, HTMLObjectElement>;
2102 ol: DetailedHTMLFactory<OlHTMLAttributes<HTMLOListElement>, HTMLOListElement>;
2103 optgroup: DetailedHTMLFactory<OptgroupHTMLAttributes<HTMLOptGroupElement>, HTMLOptGroupElement>;
2104 option: DetailedHTMLFactory<OptionHTMLAttributes<HTMLOptionElement>, HTMLOptionElement>;
2105 output: DetailedHTMLFactory<OutputHTMLAttributes<HTMLElement>, HTMLElement>;
2106 p: DetailedHTMLFactory<HTMLAttributes<HTMLParagraphElement>, HTMLParagraphElement>;
2107 param: DetailedHTMLFactory<ParamHTMLAttributes<HTMLParamElement>, HTMLParamElement>;
2108 picture: DetailedHTMLFactory<HTMLAttributes<HTMLElement>, HTMLElement>;
2109 pre: DetailedHTMLFactory<HTMLAttributes<HTMLPreElement>, HTMLPreElement>;
2110 progress: DetailedHTMLFactory<ProgressHTMLAttributes<HTMLProgressElement>, HTMLProgressElement>;
2111 q: DetailedHTMLFactory<QuoteHTMLAttributes<HTMLQuoteElement>, HTMLQuoteElement>;
2112 rp: DetailedHTMLFactory<HTMLAttributes<HTMLElement>, HTMLElement>;
2113 rt: DetailedHTMLFactory<HTMLAttributes<HTMLElement>, HTMLElement>;
2114 ruby: DetailedHTMLFactory<HTMLAttributes<HTMLElement>, HTMLElement>;
2115 s: DetailedHTMLFactory<HTMLAttributes<HTMLElement>, HTMLElement>;
2116 samp: DetailedHTMLFactory<HTMLAttributes<HTMLElement>, HTMLElement>;
2117 script: DetailedHTMLFactory<ScriptHTMLAttributes<HTMLScriptElement>, HTMLScriptElement>;
2118 section: DetailedHTMLFactory<HTMLAttributes<HTMLElement>, HTMLElement>;
2119 select: DetailedHTMLFactory<SelectHTMLAttributes<HTMLSelectElement>, HTMLSelectElement>;
2120 small: DetailedHTMLFactory<HTMLAttributes<HTMLElement>, HTMLElement>;
2121 source: DetailedHTMLFactory<SourceHTMLAttributes<HTMLSourceElement>, HTMLSourceElement>;
2122 span: DetailedHTMLFactory<HTMLAttributes<HTMLSpanElement>, HTMLSpanElement>;
2123 strong: DetailedHTMLFactory<HTMLAttributes<HTMLElement>, HTMLElement>;
2124 style: DetailedHTMLFactory<StyleHTMLAttributes<HTMLStyleElement>, HTMLStyleElement>;
2125 sub: DetailedHTMLFactory<HTMLAttributes<HTMLElement>, HTMLElement>;
2126 summary: DetailedHTMLFactory<HTMLAttributes<HTMLElement>, HTMLElement>;
2127 sup: DetailedHTMLFactory<HTMLAttributes<HTMLElement>, HTMLElement>;
2128 table: DetailedHTMLFactory<TableHTMLAttributes<HTMLTableElement>, HTMLTableElement>;
2129 tbody: DetailedHTMLFactory<HTMLAttributes<HTMLTableSectionElement>, HTMLTableSectionElement>;
2130 td: DetailedHTMLFactory<TdHTMLAttributes<HTMLTableDataCellElement>, HTMLTableDataCellElement>;
2131 textarea: DetailedHTMLFactory<TextareaHTMLAttributes<HTMLTextAreaElement>, HTMLTextAreaElement>;
2132 tfoot: DetailedHTMLFactory<HTMLAttributes<HTMLTableSectionElement>, HTMLTableSectionElement>;
2133 th: DetailedHTMLFactory<ThHTMLAttributes<HTMLTableHeaderCellElement>, HTMLTableHeaderCellElement>;
2134 thead: DetailedHTMLFactory<HTMLAttributes<HTMLTableSectionElement>, HTMLTableSectionElement>;
2135 time: DetailedHTMLFactory<TimeHTMLAttributes<HTMLElement>, HTMLElement>;
2136 title: DetailedHTMLFactory<HTMLAttributes<HTMLTitleElement>, HTMLTitleElement>;
2137 tr: DetailedHTMLFactory<HTMLAttributes<HTMLTableRowElement>, HTMLTableRowElement>;
2138 track: DetailedHTMLFactory<TrackHTMLAttributes<HTMLTrackElement>, HTMLTrackElement>;
2139 u: DetailedHTMLFactory<HTMLAttributes<HTMLElement>, HTMLElement>;
2140 ul: DetailedHTMLFactory<HTMLAttributes<HTMLUListElement>, HTMLUListElement>;
2141 "var": DetailedHTMLFactory<HTMLAttributes<HTMLElement>, HTMLElement>;
2142 video: DetailedHTMLFactory<VideoHTMLAttributes<HTMLVideoElement>, HTMLVideoElement>;
2143 wbr: DetailedHTMLFactory<HTMLAttributes<HTMLElement>, HTMLElement>;
2144 webview: DetailedHTMLFactory<WebViewHTMLAttributes<HTMLWebViewElement>, HTMLWebViewElement>;
2145 }
2146
2147 interface ReactSVG {
2148 animate: SVGFactory;
2149 circle: SVGFactory;
2150 clipPath: SVGFactory;
2151 defs: SVGFactory;
2152 desc: SVGFactory;
2153 ellipse: SVGFactory;
2154 feBlend: SVGFactory;
2155 feColorMatrix: SVGFactory;
2156 feComponentTransfer: SVGFactory;
2157 feComposite: SVGFactory;
2158 feConvolveMatrix: SVGFactory;
2159 feDiffuseLighting: SVGFactory;
2160 feDisplacementMap: SVGFactory;
2161 feDistantLight: SVGFactory;
2162 feDropShadow: SVGFactory;
2163 feFlood: SVGFactory;
2164 feFuncA: SVGFactory;
2165 feFuncB: SVGFactory;
2166 feFuncG: SVGFactory;
2167 feFuncR: SVGFactory;
2168 feGaussianBlur: SVGFactory;
2169 feImage: SVGFactory;
2170 feMerge: SVGFactory;
2171 feMergeNode: SVGFactory;
2172 feMorphology: SVGFactory;
2173 feOffset: SVGFactory;
2174 fePointLight: SVGFactory;
2175 feSpecularLighting: SVGFactory;
2176 feSpotLight: SVGFactory;
2177 feTile: SVGFactory;
2178 feTurbulence: SVGFactory;
2179 filter: SVGFactory;
2180 foreignObject: SVGFactory;
2181 g: SVGFactory;
2182 image: SVGFactory;
2183 line: SVGFactory;
2184 linearGradient: SVGFactory;
2185 marker: SVGFactory;
2186 mask: SVGFactory;
2187 metadata: SVGFactory;
2188 path: SVGFactory;
2189 pattern: SVGFactory;
2190 polygon: SVGFactory;
2191 polyline: SVGFactory;
2192 radialGradient: SVGFactory;
2193 rect: SVGFactory;
2194 stop: SVGFactory;
2195 svg: SVGFactory;
2196 switch: SVGFactory;
2197 symbol: SVGFactory;
2198 text: SVGFactory;
2199 textPath: SVGFactory;
2200 tspan: SVGFactory;
2201 use: SVGFactory;
2202 view: SVGFactory;
2203 }
2204
2205 interface ReactDOM extends ReactHTML, ReactSVG { }
2206
2207 //
2208 // React.PropTypes
2209 // ----------------------------------------------------------------------
2210
2211 type Validator<T> = PropTypes.Validator<T>;
2212
2213 type Requireable<T> = PropTypes.Requireable<T>;
2214
2215 type ValidationMap<T> = PropTypes.ValidationMap<T>;
2216
2217 interface ReactPropTypes {
2218 any: typeof PropTypes.any;
2219 array: typeof PropTypes.array;
2220 bool: typeof PropTypes.bool;
2221 func: typeof PropTypes.func;
2222 number: typeof PropTypes.number;
2223 object: typeof PropTypes.object;
2224 string: typeof PropTypes.string;
2225 node: typeof PropTypes.node;
2226 element: typeof PropTypes.element;
2227 instanceOf: typeof PropTypes.instanceOf;
2228 oneOf: typeof PropTypes.oneOf;
2229 oneOfType: typeof PropTypes.oneOfType;
2230 arrayOf: typeof PropTypes.arrayOf;
2231 objectOf: typeof PropTypes.objectOf;
2232 shape: typeof PropTypes.shape;
2233 exact: typeof PropTypes.exact;
2234 }
2235
2236 //
2237 // React.Children
2238 // ----------------------------------------------------------------------
2239
2240 interface ReactChildren {
2241 map<T>(children: ReactNode, fn: (child: ReactChild, index: number) => T): T[];
2242 forEach(children: ReactNode, fn: (child: ReactChild, index: number) => void): void;
2243 count(children: ReactNode): number;
2244 only(children: ReactNode): ReactElement<any>;
2245 toArray(children: ReactNode): ReactChild[];
2246 }
2247
2248 //
2249 // Browser Interfaces
2250 // https://github.com/nikeee/2048-typescript/blob/master/2048/js/touch.d.ts
2251 // ----------------------------------------------------------------------
2252
2253 interface AbstractView {
2254 styleMedia: StyleMedia;
2255 document: Document;
2256 }
2257
2258 interface Touch {
2259 identifier: number;
2260 target: EventTarget;
2261 screenX: number;
2262 screenY: number;
2263 clientX: number;
2264 clientY: number;
2265 pageX: number;
2266 pageY: number;
2267 }
2268
2269 interface TouchList {
2270 [index: number]: Touch;
2271 length: number;
2272 item(index: number): Touch;
2273 identifiedTouch(identifier: number): Touch;
2274 }
2275
2276 //
2277 // Error Interfaces
2278 // ----------------------------------------------------------------------
2279 interface ErrorInfo {
2280 /**
2281 * Captures which component contained the exception, and its ancestors.
2282 */
2283 componentStack: string;
2284 }
2285}
2286
2287// Declared props take priority over inferred props
2288// If declared props have indexed properties, ignore inferred props entirely as keyof gets widened
2289type MergePropTypes<P, T> = P & Pick<T, Exclude<keyof T, keyof P>>;
2290
2291// Any prop that has a default prop becomes optional, but its type is unchanged
2292// Undeclared default props are augmented into the resulting allowable attributes
2293// If declared props have indexed properties, ignore default props entirely as keyof gets widened
2294// Wrap in an outer-level conditional type to allow distribution over props that are unions
2295type Defaultize<P, D> = P extends any
2296 ? string extends keyof P ? P :
2297 & Pick<P, Exclude<keyof P, keyof D>>
2298 & Partial<Pick<P, Extract<keyof P, keyof D>>>
2299 & Partial<Pick<D, Exclude<keyof D, keyof P>>>
2300 : never;
2301
2302declare global {
2303 namespace JSX {
2304 // tslint:disable-next-line:no-empty-interface
2305 interface Element extends React.ReactElement<any> { }
2306 interface ElementClass extends React.Component<any> {
2307 render(): React.ReactNode;
2308 }
2309 interface ElementAttributesProperty { props: {}; }
2310 interface ElementChildrenAttribute { children: {}; }
2311
2312 type LibraryManagedAttributes<C, P> = C extends { propTypes: infer T; defaultProps: infer D; }
2313 ? Defaultize<MergePropTypes<P, PropTypes.InferProps<T>>, D>
2314 : C extends { propTypes: infer T; }
2315 ? MergePropTypes<P, PropTypes.InferProps<T>>
2316 : C extends { defaultProps: infer D; }
2317 ? Defaultize<P, D>
2318 : P;
2319
2320 // tslint:disable-next-line:no-empty-interface
2321 interface IntrinsicAttributes extends React.Attributes { }
2322 // tslint:disable-next-line:no-empty-interface
2323 interface IntrinsicClassAttributes<T> extends React.ClassAttributes<T> { }
2324
2325 interface IntrinsicElements {
2326 // HTML
2327 a: React.DetailedHTMLProps<React.AnchorHTMLAttributes<HTMLAnchorElement>, HTMLAnchorElement>;
2328 abbr: React.DetailedHTMLProps<React.HTMLAttributes<HTMLElement>, HTMLElement>;
2329 address: React.DetailedHTMLProps<React.HTMLAttributes<HTMLElement>, HTMLElement>;
2330 area: React.DetailedHTMLProps<React.AreaHTMLAttributes<HTMLAreaElement>, HTMLAreaElement>;
2331 article: React.DetailedHTMLProps<React.HTMLAttributes<HTMLElement>, HTMLElement>;
2332 aside: React.DetailedHTMLProps<React.HTMLAttributes<HTMLElement>, HTMLElement>;
2333 audio: React.DetailedHTMLProps<React.AudioHTMLAttributes<HTMLAudioElement>, HTMLAudioElement>;
2334 b: React.DetailedHTMLProps<React.HTMLAttributes<HTMLElement>, HTMLElement>;
2335 base: React.DetailedHTMLProps<React.BaseHTMLAttributes<HTMLBaseElement>, HTMLBaseElement>;
2336 bdi: React.DetailedHTMLProps<React.HTMLAttributes<HTMLElement>, HTMLElement>;
2337 bdo: React.DetailedHTMLProps<React.HTMLAttributes<HTMLElement>, HTMLElement>;
2338 big: React.DetailedHTMLProps<React.HTMLAttributes<HTMLElement>, HTMLElement>;
2339 blockquote: React.DetailedHTMLProps<React.BlockquoteHTMLAttributes<HTMLElement>, HTMLElement>;
2340 body: React.DetailedHTMLProps<React.HTMLAttributes<HTMLBodyElement>, HTMLBodyElement>;
2341 br: React.DetailedHTMLProps<React.HTMLAttributes<HTMLBRElement>, HTMLBRElement>;
2342 button: React.DetailedHTMLProps<React.ButtonHTMLAttributes<HTMLButtonElement>, HTMLButtonElement>;
2343 canvas: React.DetailedHTMLProps<React.CanvasHTMLAttributes<HTMLCanvasElement>, HTMLCanvasElement>;
2344 caption: React.DetailedHTMLProps<React.HTMLAttributes<HTMLElement>, HTMLElement>;
2345 cite: React.DetailedHTMLProps<React.HTMLAttributes<HTMLElement>, HTMLElement>;
2346 code: React.DetailedHTMLProps<React.HTMLAttributes<HTMLElement>, HTMLElement>;
2347 col: React.DetailedHTMLProps<React.ColHTMLAttributes<HTMLTableColElement>, HTMLTableColElement>;
2348 colgroup: React.DetailedHTMLProps<React.ColgroupHTMLAttributes<HTMLTableColElement>, HTMLTableColElement>;
2349 data: React.DetailedHTMLProps<React.HTMLAttributes<HTMLElement>, HTMLElement>;
2350 datalist: React.DetailedHTMLProps<React.HTMLAttributes<HTMLDataListElement>, HTMLDataListElement>;
2351 dd: React.DetailedHTMLProps<React.HTMLAttributes<HTMLElement>, HTMLElement>;
2352 del: React.DetailedHTMLProps<React.DelHTMLAttributes<HTMLElement>, HTMLElement>;
2353 details: React.DetailedHTMLProps<React.DetailsHTMLAttributes<HTMLElement>, HTMLElement>;
2354 dfn: React.DetailedHTMLProps<React.HTMLAttributes<HTMLElement>, HTMLElement>;
2355 dialog: React.DetailedHTMLProps<React.DialogHTMLAttributes<HTMLDialogElement>, HTMLDialogElement>;
2356 div: React.DetailedHTMLProps<React.HTMLAttributes<HTMLDivElement>, HTMLDivElement>;
2357 dl: React.DetailedHTMLProps<React.HTMLAttributes<HTMLDListElement>, HTMLDListElement>;
2358 dt: React.DetailedHTMLProps<React.HTMLAttributes<HTMLElement>, HTMLElement>;
2359 em: React.DetailedHTMLProps<React.HTMLAttributes<HTMLElement>, HTMLElement>;
2360 embed: React.DetailedHTMLProps<React.EmbedHTMLAttributes<HTMLEmbedElement>, HTMLEmbedElement>;
2361 fieldset: React.DetailedHTMLProps<React.FieldsetHTMLAttributes<HTMLFieldSetElement>, HTMLFieldSetElement>;
2362 figcaption: React.DetailedHTMLProps<React.HTMLAttributes<HTMLElement>, HTMLElement>;
2363 figure: React.DetailedHTMLProps<React.HTMLAttributes<HTMLElement>, HTMLElement>;
2364 footer: React.DetailedHTMLProps<React.HTMLAttributes<HTMLElement>, HTMLElement>;
2365 form: React.DetailedHTMLProps<React.FormHTMLAttributes<HTMLFormElement>, HTMLFormElement>;
2366 h1: React.DetailedHTMLProps<React.HTMLAttributes<HTMLHeadingElement>, HTMLHeadingElement>;
2367 h2: React.DetailedHTMLProps<React.HTMLAttributes<HTMLHeadingElement>, HTMLHeadingElement>;
2368 h3: React.DetailedHTMLProps<React.HTMLAttributes<HTMLHeadingElement>, HTMLHeadingElement>;
2369 h4: React.DetailedHTMLProps<React.HTMLAttributes<HTMLHeadingElement>, HTMLHeadingElement>;
2370 h5: React.DetailedHTMLProps<React.HTMLAttributes<HTMLHeadingElement>, HTMLHeadingElement>;
2371 h6: React.DetailedHTMLProps<React.HTMLAttributes<HTMLHeadingElement>, HTMLHeadingElement>;
2372 head: React.DetailedHTMLProps<React.HTMLAttributes<HTMLHeadElement>, HTMLHeadElement>;
2373 header: React.DetailedHTMLProps<React.HTMLAttributes<HTMLElement>, HTMLElement>;
2374 hgroup: React.DetailedHTMLProps<React.HTMLAttributes<HTMLElement>, HTMLElement>;
2375 hr: React.DetailedHTMLProps<React.HTMLAttributes<HTMLHRElement>, HTMLHRElement>;
2376 html: React.DetailedHTMLProps<React.HtmlHTMLAttributes<HTMLHtmlElement>, HTMLHtmlElement>;
2377 i: React.DetailedHTMLProps<React.HTMLAttributes<HTMLElement>, HTMLElement>;
2378 iframe: React.DetailedHTMLProps<React.IframeHTMLAttributes<HTMLIFrameElement>, HTMLIFrameElement>;
2379 img: React.DetailedHTMLProps<React.ImgHTMLAttributes<HTMLImageElement>, HTMLImageElement>;
2380 input: React.DetailedHTMLProps<React.InputHTMLAttributes<HTMLInputElement>, HTMLInputElement>;
2381 ins: React.DetailedHTMLProps<React.InsHTMLAttributes<HTMLModElement>, HTMLModElement>;
2382 kbd: React.DetailedHTMLProps<React.HTMLAttributes<HTMLElement>, HTMLElement>;
2383 keygen: React.DetailedHTMLProps<React.KeygenHTMLAttributes<HTMLElement>, HTMLElement>;
2384 label: React.DetailedHTMLProps<React.LabelHTMLAttributes<HTMLLabelElement>, HTMLLabelElement>;
2385 legend: React.DetailedHTMLProps<React.HTMLAttributes<HTMLLegendElement>, HTMLLegendElement>;
2386 li: React.DetailedHTMLProps<React.LiHTMLAttributes<HTMLLIElement>, HTMLLIElement>;
2387 link: React.DetailedHTMLProps<React.LinkHTMLAttributes<HTMLLinkElement>, HTMLLinkElement>;
2388 main: React.DetailedHTMLProps<React.HTMLAttributes<HTMLElement>, HTMLElement>;
2389 map: React.DetailedHTMLProps<React.MapHTMLAttributes<HTMLMapElement>, HTMLMapElement>;
2390 mark: React.DetailedHTMLProps<React.HTMLAttributes<HTMLElement>, HTMLElement>;
2391 menu: React.DetailedHTMLProps<React.MenuHTMLAttributes<HTMLElement>, HTMLElement>;
2392 menuitem: React.DetailedHTMLProps<React.HTMLAttributes<HTMLElement>, HTMLElement>;
2393 meta: React.DetailedHTMLProps<React.MetaHTMLAttributes<HTMLMetaElement>, HTMLMetaElement>;
2394 meter: React.DetailedHTMLProps<React.MeterHTMLAttributes<HTMLElement>, HTMLElement>;
2395 nav: React.DetailedHTMLProps<React.HTMLAttributes<HTMLElement>, HTMLElement>;
2396 noindex: React.DetailedHTMLProps<React.HTMLAttributes<HTMLElement>, HTMLElement>;
2397 noscript: React.DetailedHTMLProps<React.HTMLAttributes<HTMLElement>, HTMLElement>;
2398 object: React.DetailedHTMLProps<React.ObjectHTMLAttributes<HTMLObjectElement>, HTMLObjectElement>;
2399 ol: React.DetailedHTMLProps<React.OlHTMLAttributes<HTMLOListElement>, HTMLOListElement>;
2400 optgroup: React.DetailedHTMLProps<React.OptgroupHTMLAttributes<HTMLOptGroupElement>, HTMLOptGroupElement>;
2401 option: React.DetailedHTMLProps<React.OptionHTMLAttributes<HTMLOptionElement>, HTMLOptionElement>;
2402 output: React.DetailedHTMLProps<React.OutputHTMLAttributes<HTMLElement>, HTMLElement>;
2403 p: React.DetailedHTMLProps<React.HTMLAttributes<HTMLParagraphElement>, HTMLParagraphElement>;
2404 param: React.DetailedHTMLProps<React.ParamHTMLAttributes<HTMLParamElement>, HTMLParamElement>;
2405 picture: React.DetailedHTMLProps<React.HTMLAttributes<HTMLElement>, HTMLElement>;
2406 pre: React.DetailedHTMLProps<React.HTMLAttributes<HTMLPreElement>, HTMLPreElement>;
2407 progress: React.DetailedHTMLProps<React.ProgressHTMLAttributes<HTMLProgressElement>, HTMLProgressElement>;
2408 q: React.DetailedHTMLProps<React.QuoteHTMLAttributes<HTMLQuoteElement>, HTMLQuoteElement>;
2409 rp: React.DetailedHTMLProps<React.HTMLAttributes<HTMLElement>, HTMLElement>;
2410 rt: React.DetailedHTMLProps<React.HTMLAttributes<HTMLElement>, HTMLElement>;
2411 ruby: React.DetailedHTMLProps<React.HTMLAttributes<HTMLElement>, HTMLElement>;
2412 s: React.DetailedHTMLProps<React.HTMLAttributes<HTMLElement>, HTMLElement>;
2413 samp: React.DetailedHTMLProps<React.HTMLAttributes<HTMLElement>, HTMLElement>;
2414 script: React.DetailedHTMLProps<React.ScriptHTMLAttributes<HTMLScriptElement>, HTMLScriptElement>;
2415 section: React.DetailedHTMLProps<React.HTMLAttributes<HTMLElement>, HTMLElement>;
2416 select: React.DetailedHTMLProps<React.SelectHTMLAttributes<HTMLSelectElement>, HTMLSelectElement>;
2417 small: React.DetailedHTMLProps<React.HTMLAttributes<HTMLElement>, HTMLElement>;
2418 source: React.DetailedHTMLProps<React.SourceHTMLAttributes<HTMLSourceElement>, HTMLSourceElement>;
2419 span: React.DetailedHTMLProps<React.HTMLAttributes<HTMLSpanElement>, HTMLSpanElement>;
2420 strong: React.DetailedHTMLProps<React.HTMLAttributes<HTMLElement>, HTMLElement>;
2421 style: React.DetailedHTMLProps<React.StyleHTMLAttributes<HTMLStyleElement>, HTMLStyleElement>;
2422 sub: React.DetailedHTMLProps<React.HTMLAttributes<HTMLElement>, HTMLElement>;
2423 summary: React.DetailedHTMLProps<React.HTMLAttributes<HTMLElement>, HTMLElement>;
2424 sup: React.DetailedHTMLProps<React.HTMLAttributes<HTMLElement>, HTMLElement>;
2425 table: React.DetailedHTMLProps<React.TableHTMLAttributes<HTMLTableElement>, HTMLTableElement>;
2426 tbody: React.DetailedHTMLProps<React.HTMLAttributes<HTMLTableSectionElement>, HTMLTableSectionElement>;
2427 td: React.DetailedHTMLProps<React.TdHTMLAttributes<HTMLTableDataCellElement>, HTMLTableDataCellElement>;
2428 textarea: React.DetailedHTMLProps<React.TextareaHTMLAttributes<HTMLTextAreaElement>, HTMLTextAreaElement>;
2429 tfoot: React.DetailedHTMLProps<React.HTMLAttributes<HTMLTableSectionElement>, HTMLTableSectionElement>;
2430 th: React.DetailedHTMLProps<React.ThHTMLAttributes<HTMLTableHeaderCellElement>, HTMLTableHeaderCellElement>;
2431 thead: React.DetailedHTMLProps<React.HTMLAttributes<HTMLTableSectionElement>, HTMLTableSectionElement>;
2432 time: React.DetailedHTMLProps<React.TimeHTMLAttributes<HTMLElement>, HTMLElement>;
2433 title: React.DetailedHTMLProps<React.HTMLAttributes<HTMLTitleElement>, HTMLTitleElement>;
2434 tr: React.DetailedHTMLProps<React.HTMLAttributes<HTMLTableRowElement>, HTMLTableRowElement>;
2435 track: React.DetailedHTMLProps<React.TrackHTMLAttributes<HTMLTrackElement>, HTMLTrackElement>;
2436 u: React.DetailedHTMLProps<React.HTMLAttributes<HTMLElement>, HTMLElement>;
2437 ul: React.DetailedHTMLProps<React.HTMLAttributes<HTMLUListElement>, HTMLUListElement>;
2438 "var": React.DetailedHTMLProps<React.HTMLAttributes<HTMLElement>, HTMLElement>;
2439 video: React.DetailedHTMLProps<React.VideoHTMLAttributes<HTMLVideoElement>, HTMLVideoElement>;
2440 wbr: React.DetailedHTMLProps<React.HTMLAttributes<HTMLElement>, HTMLElement>;
2441 webview: React.DetailedHTMLProps<React.WebViewHTMLAttributes<HTMLWebViewElement>, HTMLWebViewElement>;
2442
2443 // SVG
2444 svg: React.SVGProps<SVGSVGElement>;
2445
2446 animate: React.SVGProps<SVGElement>; // TODO: It is SVGAnimateElement but is not in TypeScript's lib.dom.d.ts for now.
2447 animateTransform: React.SVGProps<SVGElement>; // TODO: It is SVGAnimateTransformElement but is not in TypeScript's lib.dom.d.ts for now.
2448 circle: React.SVGProps<SVGCircleElement>;
2449 clipPath: React.SVGProps<SVGClipPathElement>;
2450 defs: React.SVGProps<SVGDefsElement>;
2451 desc: React.SVGProps<SVGDescElement>;
2452 ellipse: React.SVGProps<SVGEllipseElement>;
2453 feBlend: React.SVGProps<SVGFEBlendElement>;
2454 feColorMatrix: React.SVGProps<SVGFEColorMatrixElement>;
2455 feComponentTransfer: React.SVGProps<SVGFEComponentTransferElement>;
2456 feComposite: React.SVGProps<SVGFECompositeElement>;
2457 feConvolveMatrix: React.SVGProps<SVGFEConvolveMatrixElement>;
2458 feDiffuseLighting: React.SVGProps<SVGFEDiffuseLightingElement>;
2459 feDisplacementMap: React.SVGProps<SVGFEDisplacementMapElement>;
2460 feDistantLight: React.SVGProps<SVGFEDistantLightElement>;
2461 feFlood: React.SVGProps<SVGFEFloodElement>;
2462 feFuncA: React.SVGProps<SVGFEFuncAElement>;
2463 feFuncB: React.SVGProps<SVGFEFuncBElement>;
2464 feFuncG: React.SVGProps<SVGFEFuncGElement>;
2465 feFuncR: React.SVGProps<SVGFEFuncRElement>;
2466 feGaussianBlur: React.SVGProps<SVGFEGaussianBlurElement>;
2467 feImage: React.SVGProps<SVGFEImageElement>;
2468 feMerge: React.SVGProps<SVGFEMergeElement>;
2469 feMergeNode: React.SVGProps<SVGFEMergeNodeElement>;
2470 feMorphology: React.SVGProps<SVGFEMorphologyElement>;
2471 feOffset: React.SVGProps<SVGFEOffsetElement>;
2472 fePointLight: React.SVGProps<SVGFEPointLightElement>;
2473 feSpecularLighting: React.SVGProps<SVGFESpecularLightingElement>;
2474 feSpotLight: React.SVGProps<SVGFESpotLightElement>;
2475 feTile: React.SVGProps<SVGFETileElement>;
2476 feTurbulence: React.SVGProps<SVGFETurbulenceElement>;
2477 filter: React.SVGProps<SVGFilterElement>;
2478 foreignObject: React.SVGProps<SVGForeignObjectElement>;
2479 g: React.SVGProps<SVGGElement>;
2480 image: React.SVGProps<SVGImageElement>;
2481 line: React.SVGProps<SVGLineElement>;
2482 linearGradient: React.SVGProps<SVGLinearGradientElement>;
2483 marker: React.SVGProps<SVGMarkerElement>;
2484 mask: React.SVGProps<SVGMaskElement>;
2485 metadata: React.SVGProps<SVGMetadataElement>;
2486 path: React.SVGProps<SVGPathElement>;
2487 pattern: React.SVGProps<SVGPatternElement>;
2488 polygon: React.SVGProps<SVGPolygonElement>;
2489 polyline: React.SVGProps<SVGPolylineElement>;
2490 radialGradient: React.SVGProps<SVGRadialGradientElement>;
2491 rect: React.SVGProps<SVGRectElement>;
2492 stop: React.SVGProps<SVGStopElement>;
2493 switch: React.SVGProps<SVGSwitchElement>;
2494 symbol: React.SVGProps<SVGSymbolElement>;
2495 text: React.SVGProps<SVGTextElement>;
2496 textPath: React.SVGProps<SVGTextPathElement>;
2497 tspan: React.SVGProps<SVGTSpanElement>;
2498 use: React.SVGProps<SVGUseElement>;
2499 view: React.SVGProps<SVGViewElement>;
2500 }
2501 }
2502}
2503
\No newline at end of file