UNPKG

139 kBTypeScriptView Raw
1// Type definitions for React 17.0
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// Dovydas Navickas <https://github.com/DovydasNavickas>
12// Josh Rutherford <https://github.com/theruther4d>
13// Guilherme Hübner <https://github.com/guilhermehubner>
14// Ferdy Budhidharma <https://github.com/ferdaber>
15// Johann Rakotoharisoa <https://github.com/jrakotoharisoa>
16// Olivier Pascal <https://github.com/pascaloliv>
17// Martin Hochel <https://github.com/hotell>
18// Frank Li <https://github.com/franklixuefei>
19// Jessica Franco <https://github.com/Jessidhia>
20// Saransh Kataria <https://github.com/saranshkataria>
21// Kanitkorn Sujautra <https://github.com/lukyth>
22// Sebastian Silbermann <https://github.com/eps1lon>
23// Kyle Scully <https://github.com/zieka>
24// Cong Zhang <https://github.com/dancerphil>
25// Dimitri Mitropoulos <https://github.com/dimitropoulos>
26// JongChan Choi <https://github.com/disjukr>
27// Victor Magalhães <https://github.com/vhfmag>
28// Dale Tan <https://github.com/hellatan>
29// Priyanshu Rav <https://github.com/priyanshurav>
30// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
31// TypeScript Version: 2.8
32
33// NOTE: Users of the upcoming React 18 release should add a reference
34// to 'react/next' in their project. See next.d.ts's top comment
35// for reference and documentation on how exactly to do it.
36
37// NOTE: Users of the `experimental` builds of React should add a reference
38// to 'react/experimental' in their project. See experimental.d.ts's top comment
39// for reference and documentation on how exactly to do it.
40
41/// <reference path="global.d.ts" />
42
43import * as CSS from 'csstype';
44import * as PropTypes from 'prop-types';
45import { Interaction as SchedulerInteraction } from 'scheduler/tracing';
46
47type NativeAnimationEvent = AnimationEvent;
48type NativeClipboardEvent = ClipboardEvent;
49type NativeCompositionEvent = CompositionEvent;
50type NativeDragEvent = DragEvent;
51type NativeFocusEvent = FocusEvent;
52type NativeKeyboardEvent = KeyboardEvent;
53type NativeMouseEvent = MouseEvent;
54type NativeTouchEvent = TouchEvent;
55type NativePointerEvent = PointerEvent;
56type NativeTransitionEvent = TransitionEvent;
57type NativeUIEvent = UIEvent;
58type NativeWheelEvent = WheelEvent;
59type Booleanish = boolean | 'true' | 'false';
60
61declare const UNDEFINED_VOID_ONLY: unique symbol;
62// Destructors are only allowed to return void.
63type Destructor = () => void | { [UNDEFINED_VOID_ONLY]: never };
64
65// tslint:disable-next-line:export-just-namespace
66export = React;
67export as namespace React;
68
69declare namespace React {
70 //
71 // React Elements
72 // ----------------------------------------------------------------------
73
74 type ElementType<P = any> =
75 {
76 [K in keyof JSX.IntrinsicElements]: P extends JSX.IntrinsicElements[K] ? K : never
77 }[keyof JSX.IntrinsicElements] |
78 ComponentType<P>;
79 /**
80 * @deprecated Please use `ElementType`
81 */
82 type ReactType<P = any> = ElementType<P>;
83 type ComponentType<P = {}> = ComponentClass<P> | FunctionComponent<P>;
84
85 type JSXElementConstructor<P> =
86 | ((props: P) => ReactElement<any, any> | null)
87 | (new (props: P) => Component<P, any>);
88
89 interface RefObject<T> {
90 readonly current: T | null;
91 }
92 type RefCallback<T> = { bivarianceHack(instance: T | null): void }["bivarianceHack"];
93 type Ref<T> = RefCallback<T> | RefObject<T> | null;
94 type LegacyRef<T> = string | Ref<T>;
95 /**
96 * Gets the instance type for a React element. The instance will be different for various component types:
97 *
98 * - React class components will be the class instance. So if you had `class Foo extends React.Component<{}> {}`
99 * and used `React.ElementRef<typeof Foo>` then the type would be the instance of `Foo`.
100 * - React stateless functional components do not have a backing instance and so `React.ElementRef<typeof Bar>`
101 * (when `Bar` is `function Bar() {}`) will give you the `undefined` type.
102 * - JSX intrinsics like `div` will give you their DOM instance. For `React.ElementRef<'div'>` that would be
103 * `HTMLDivElement`. For `React.ElementRef<'input'>` that would be `HTMLInputElement`.
104 * - React stateless functional components that forward a `ref` will give you the `ElementRef` of the forwarded
105 * to component.
106 *
107 * `C` must be the type _of_ a React component so you need to use typeof as in React.ElementRef<typeof MyComponent>.
108 *
109 * @todo In Flow, this works a little different with forwarded refs and the `AbstractComponent` that
110 * `React.forwardRef()` returns.
111 */
112 type ElementRef<
113 C extends
114 | ForwardRefExoticComponent<any>
115 | { new (props: any): Component<any> }
116 | ((props: any, context?: any) => ReactElement | null)
117 | keyof JSX.IntrinsicElements
118 > =
119 // need to check first if `ref` is a valid prop for ts@3.0
120 // otherwise it will infer `{}` instead of `never`
121 "ref" extends keyof ComponentPropsWithRef<C>
122 ? NonNullable<ComponentPropsWithRef<C>["ref"]> extends Ref<
123 infer Instance
124 >
125 ? Instance
126 : never
127 : never;
128
129 type ComponentState = any;
130
131 type Key = string | number;
132
133 /**
134 * @internal You shouldn't need to use this type since you never see these attributes
135 * inside your component or have to validate them.
136 */
137 interface Attributes {
138 key?: Key | null;
139 }
140 interface RefAttributes<T> extends Attributes {
141 ref?: Ref<T>;
142 }
143 interface ClassAttributes<T> extends Attributes {
144 ref?: LegacyRef<T>;
145 }
146
147 interface ReactElement<P = any, T extends string | JSXElementConstructor<any> = string | JSXElementConstructor<any>> {
148 type: T;
149 props: P;
150 key: Key | null;
151 }
152
153 interface ReactComponentElement<
154 T extends keyof JSX.IntrinsicElements | JSXElementConstructor<any>,
155 P = Pick<ComponentProps<T>, Exclude<keyof ComponentProps<T>, 'key' | 'ref'>>
156 > extends ReactElement<P, Exclude<T, number>> { }
157
158 /**
159 * @deprecated Please use `FunctionComponentElement`
160 */
161 type SFCElement<P> = FunctionComponentElement<P>;
162
163 interface FunctionComponentElement<P> extends ReactElement<P, FunctionComponent<P>> {
164 ref?: 'ref' extends keyof P ? P extends { ref?: infer R } ? R : never : never;
165 }
166
167 type CElement<P, T extends Component<P, ComponentState>> = ComponentElement<P, T>;
168 interface ComponentElement<P, T extends Component<P, ComponentState>> extends ReactElement<P, ComponentClass<P>> {
169 ref?: LegacyRef<T>;
170 }
171
172 type ClassicElement<P> = CElement<P, ClassicComponent<P, ComponentState>>;
173
174 // string fallback for custom web-components
175 interface DOMElement<P extends HTMLAttributes<T> | SVGAttributes<T>, T extends Element> extends ReactElement<P, string> {
176 ref: LegacyRef<T>;
177 }
178
179 // ReactHTML for ReactHTMLElement
180 interface ReactHTMLElement<T extends HTMLElement> extends DetailedReactHTMLElement<AllHTMLAttributes<T>, T> { }
181
182 interface DetailedReactHTMLElement<P extends HTMLAttributes<T>, T extends HTMLElement> extends DOMElement<P, T> {
183 type: keyof ReactHTML;
184 }
185
186 // ReactSVG for ReactSVGElement
187 interface ReactSVGElement extends DOMElement<SVGAttributes<SVGElement>, SVGElement> {
188 type: keyof ReactSVG;
189 }
190
191 interface ReactPortal extends ReactElement {
192 key: Key | null;
193 children: ReactNode;
194 }
195
196 //
197 // Factories
198 // ----------------------------------------------------------------------
199
200 type Factory<P> = (props?: Attributes & P, ...children: ReactNode[]) => ReactElement<P>;
201
202 /**
203 * @deprecated Please use `FunctionComponentFactory`
204 */
205 type SFCFactory<P> = FunctionComponentFactory<P>;
206
207 type FunctionComponentFactory<P> = (props?: Attributes & P, ...children: ReactNode[]) => FunctionComponentElement<P>;
208
209 type ComponentFactory<P, T extends Component<P, ComponentState>> =
210 (props?: ClassAttributes<T> & P, ...children: ReactNode[]) => CElement<P, T>;
211
212 type CFactory<P, T extends Component<P, ComponentState>> = ComponentFactory<P, T>;
213 type ClassicFactory<P> = CFactory<P, ClassicComponent<P, ComponentState>>;
214
215 type DOMFactory<P extends DOMAttributes<T>, T extends Element> =
216 (props?: ClassAttributes<T> & P | null, ...children: ReactNode[]) => DOMElement<P, T>;
217
218 interface HTMLFactory<T extends HTMLElement> extends DetailedHTMLFactory<AllHTMLAttributes<T>, T> {}
219
220 interface DetailedHTMLFactory<P extends HTMLAttributes<T>, T extends HTMLElement> extends DOMFactory<P, T> {
221 (props?: ClassAttributes<T> & P | null, ...children: ReactNode[]): DetailedReactHTMLElement<P, T>;
222 }
223
224 interface SVGFactory extends DOMFactory<SVGAttributes<SVGElement>, SVGElement> {
225 (props?: ClassAttributes<SVGElement> & SVGAttributes<SVGElement> | null, ...children: ReactNode[]): ReactSVGElement;
226 }
227
228 //
229 // React Nodes
230 // http://facebook.github.io/react/docs/glossary.html
231 // ----------------------------------------------------------------------
232
233 type ReactText = string | number;
234 type ReactChild = ReactElement | ReactText;
235
236 interface ReactNodeArray extends Array<ReactNode> {}
237 type ReactFragment = {} | ReactNodeArray;
238 type ReactNode = ReactChild | ReactFragment | ReactPortal | boolean | null | undefined;
239
240 //
241 // Top Level API
242 // ----------------------------------------------------------------------
243
244 // DOM Elements
245 function createFactory<T extends HTMLElement>(
246 type: keyof ReactHTML): HTMLFactory<T>;
247 function createFactory(
248 type: keyof ReactSVG): SVGFactory;
249 function createFactory<P extends DOMAttributes<T>, T extends Element>(
250 type: string): DOMFactory<P, T>;
251
252 // Custom components
253 function createFactory<P>(type: FunctionComponent<P>): FunctionComponentFactory<P>;
254 function createFactory<P>(
255 type: ClassType<P, ClassicComponent<P, ComponentState>, ClassicComponentClass<P>>): CFactory<P, ClassicComponent<P, ComponentState>>;
256 function createFactory<P, T extends Component<P, ComponentState>, C extends ComponentClass<P>>(
257 type: ClassType<P, T, C>): CFactory<P, T>;
258 function createFactory<P>(type: ComponentClass<P>): Factory<P>;
259
260 // DOM Elements
261 // TODO: generalize this to everything in `keyof ReactHTML`, not just "input"
262 function createElement(
263 type: "input",
264 props?: InputHTMLAttributes<HTMLInputElement> & ClassAttributes<HTMLInputElement> | null,
265 ...children: ReactNode[]): DetailedReactHTMLElement<InputHTMLAttributes<HTMLInputElement>, HTMLInputElement>;
266 function createElement<P extends HTMLAttributes<T>, T extends HTMLElement>(
267 type: keyof ReactHTML,
268 props?: ClassAttributes<T> & P | null,
269 ...children: ReactNode[]): DetailedReactHTMLElement<P, T>;
270 function createElement<P extends SVGAttributes<T>, T extends SVGElement>(
271 type: keyof ReactSVG,
272 props?: ClassAttributes<T> & P | null,
273 ...children: ReactNode[]): ReactSVGElement;
274 function createElement<P extends DOMAttributes<T>, T extends Element>(
275 type: string,
276 props?: ClassAttributes<T> & P | null,
277 ...children: ReactNode[]): DOMElement<P, T>;
278
279 // Custom components
280
281 function createElement<P extends {}>(
282 type: FunctionComponent<P>,
283 props?: Attributes & P | null,
284 ...children: ReactNode[]): FunctionComponentElement<P>;
285 function createElement<P extends {}>(
286 type: ClassType<P, ClassicComponent<P, ComponentState>, ClassicComponentClass<P>>,
287 props?: ClassAttributes<ClassicComponent<P, ComponentState>> & P | null,
288 ...children: ReactNode[]): CElement<P, ClassicComponent<P, ComponentState>>;
289 function createElement<P extends {}, T extends Component<P, ComponentState>, C extends ComponentClass<P>>(
290 type: ClassType<P, T, C>,
291 props?: ClassAttributes<T> & P | null,
292 ...children: ReactNode[]): CElement<P, T>;
293 function createElement<P extends {}>(
294 type: FunctionComponent<P> | ComponentClass<P> | string,
295 props?: Attributes & P | null,
296 ...children: ReactNode[]): ReactElement<P>;
297
298 // DOM Elements
299 // ReactHTMLElement
300 function cloneElement<P extends HTMLAttributes<T>, T extends HTMLElement>(
301 element: DetailedReactHTMLElement<P, T>,
302 props?: P,
303 ...children: ReactNode[]): DetailedReactHTMLElement<P, T>;
304 // ReactHTMLElement, less specific
305 function cloneElement<P extends HTMLAttributes<T>, T extends HTMLElement>(
306 element: ReactHTMLElement<T>,
307 props?: P,
308 ...children: ReactNode[]): ReactHTMLElement<T>;
309 // SVGElement
310 function cloneElement<P extends SVGAttributes<T>, T extends SVGElement>(
311 element: ReactSVGElement,
312 props?: P,
313 ...children: ReactNode[]): ReactSVGElement;
314 // DOM Element (has to be the last, because type checking stops at first overload that fits)
315 function cloneElement<P extends DOMAttributes<T>, T extends Element>(
316 element: DOMElement<P, T>,
317 props?: DOMAttributes<T> & P,
318 ...children: ReactNode[]): DOMElement<P, T>;
319
320 // Custom components
321 function cloneElement<P>(
322 element: FunctionComponentElement<P>,
323 props?: Partial<P> & Attributes,
324 ...children: ReactNode[]): FunctionComponentElement<P>;
325 function cloneElement<P, T extends Component<P, ComponentState>>(
326 element: CElement<P, T>,
327 props?: Partial<P> & ClassAttributes<T>,
328 ...children: ReactNode[]): CElement<P, T>;
329 function cloneElement<P>(
330 element: ReactElement<P>,
331 props?: Partial<P> & Attributes,
332 ...children: ReactNode[]): ReactElement<P>;
333
334 // Context via RenderProps
335 interface ProviderProps<T> {
336 value: T;
337 children?: ReactNode;
338 }
339
340 interface ConsumerProps<T> {
341 children: (value: T) => ReactNode;
342 }
343
344 // TODO: similar to how Fragment is actually a symbol, the values returned from createContext,
345 // forwardRef and memo are actually objects that are treated specially by the renderer; see:
346 // https://github.com/facebook/react/blob/v16.6.0/packages/react/src/ReactContext.js#L35-L48
347 // https://github.com/facebook/react/blob/v16.6.0/packages/react/src/forwardRef.js#L42-L45
348 // https://github.com/facebook/react/blob/v16.6.0/packages/react/src/memo.js#L27-L31
349 // However, we have no way of telling the JSX parser that it's a JSX element type or its props other than
350 // by pretending to be a normal component.
351 //
352 // We don't just use ComponentType or SFC types because you are not supposed to attach statics to this
353 // object, but rather to the original function.
354 interface ExoticComponent<P = {}> {
355 /**
356 * **NOTE**: Exotic components are not callable.
357 */
358 (props: P): (ReactElement|null);
359 readonly $$typeof: symbol;
360 }
361
362 interface NamedExoticComponent<P = {}> extends ExoticComponent<P> {
363 displayName?: string;
364 }
365
366 interface ProviderExoticComponent<P> extends ExoticComponent<P> {
367 propTypes?: WeakValidationMap<P>;
368 }
369
370 type ContextType<C extends Context<any>> = C extends Context<infer T> ? T : never;
371
372 // NOTE: only the Context object itself can get a displayName
373 // https://github.com/facebook/react-devtools/blob/e0b854e4c/backend/attachRendererFiber.js#L310-L325
374 type Provider<T> = ProviderExoticComponent<ProviderProps<T>>;
375 type Consumer<T> = ExoticComponent<ConsumerProps<T>>;
376 interface Context<T> {
377 Provider: Provider<T>;
378 Consumer: Consumer<T>;
379 displayName?: string;
380 }
381 function createContext<T>(
382 // If you thought this should be optional, see
383 // https://github.com/DefinitelyTyped/DefinitelyTyped/pull/24509#issuecomment-382213106
384 defaultValue: T,
385 ): Context<T>;
386
387 function isValidElement<P>(object: {} | null | undefined): object is ReactElement<P>;
388
389 const Children: ReactChildren;
390 const Fragment: ExoticComponent<{ children?: ReactNode }>;
391 const StrictMode: ExoticComponent<{ children?: ReactNode }>;
392
393 interface SuspenseProps {
394 children?: ReactNode;
395
396 /** A fallback react tree to show when a Suspense child (like React.lazy) suspends */
397 fallback: NonNullable<ReactNode>|null;
398 }
399 /**
400 * This feature is not yet available for server-side rendering.
401 * Suspense support will be added in a later release.
402 */
403 const Suspense: ExoticComponent<SuspenseProps>;
404 const version: string;
405
406 /**
407 * {@link https://reactjs.org/docs/profiler.html#onrender-callback Profiler API}
408 */
409 type ProfilerOnRenderCallback = (
410 id: string,
411 phase: "mount" | "update",
412 actualDuration: number,
413 baseDuration: number,
414 startTime: number,
415 commitTime: number,
416 interactions: Set<SchedulerInteraction>,
417 ) => void;
418 interface ProfilerProps {
419 children?: ReactNode;
420 id: string;
421 onRender: ProfilerOnRenderCallback;
422 }
423
424 const Profiler: ExoticComponent<ProfilerProps>;
425
426 //
427 // Component API
428 // ----------------------------------------------------------------------
429
430 type ReactInstance = Component<any> | Element;
431
432 // Base component for plain JS classes
433 interface Component<P = {}, S = {}, SS = any> extends ComponentLifecycle<P, S, SS> { }
434 class Component<P, S> {
435 // tslint won't let me format the sample code in a way that vscode likes it :(
436 /**
437 * If set, `this.context` will be set at runtime to the current value of the given Context.
438 *
439 * Usage:
440 *
441 * ```ts
442 * type MyContext = number
443 * const Ctx = React.createContext<MyContext>(0)
444 *
445 * class Foo extends React.Component {
446 * static contextType = Ctx
447 * context!: React.ContextType<typeof Ctx>
448 * render () {
449 * return <>My context's value: {this.context}</>;
450 * }
451 * }
452 * ```
453 *
454 * @see https://reactjs.org/docs/context.html#classcontexttype
455 */
456 static contextType?: Context<any>;
457
458 /**
459 * If using the new style context, re-declare this in your class to be the
460 * `React.ContextType` of your `static contextType`.
461 * Should be used with type annotation or static contextType.
462 *
463 * ```ts
464 * static contextType = MyContext
465 * // For TS pre-3.7:
466 * context!: React.ContextType<typeof MyContext>
467 * // For TS 3.7 and above:
468 * declare context: React.ContextType<typeof MyContext>
469 * ```
470 *
471 * @see https://reactjs.org/docs/context.html
472 */
473 // TODO (TypeScript 3.0): unknown
474 context: any;
475
476 constructor(props: Readonly<P> | P);
477 /**
478 * @deprecated
479 * @see https://reactjs.org/docs/legacy-context.html
480 */
481 constructor(props: P, context: any);
482
483 // We MUST keep setState() as a unified signature because it allows proper checking of the method return type.
484 // See: https://github.com/DefinitelyTyped/DefinitelyTyped/issues/18365#issuecomment-351013257
485 // Also, the ` | S` allows intellisense to not be dumbisense
486 setState<K extends keyof S>(
487 state: ((prevState: Readonly<S>, props: Readonly<P>) => (Pick<S, K> | S | null)) | (Pick<S, K> | S | null),
488 callback?: () => void
489 ): void;
490
491 forceUpdate(callback?: () => void): void;
492 render(): ReactNode;
493
494 // React.Props<T> is now deprecated, which means that the `children`
495 // property is not available on `P` by default, even though you can
496 // always pass children as variadic arguments to `createElement`.
497 // In the future, if we can define its call signature conditionally
498 // on the existence of `children` in `P`, then we should remove this.
499 readonly props: Readonly<P> & Readonly<{ children?: ReactNode }>;
500 state: Readonly<S>;
501 /**
502 * @deprecated
503 * https://reactjs.org/docs/refs-and-the-dom.html#legacy-api-string-refs
504 */
505 refs: {
506 [key: string]: ReactInstance
507 };
508 }
509
510 class PureComponent<P = {}, S = {}, SS = any> extends Component<P, S, SS> { }
511
512 interface ClassicComponent<P = {}, S = {}> extends Component<P, S> {
513 replaceState(nextState: S, callback?: () => void): void;
514 isMounted(): boolean;
515 getInitialState?(): S;
516 }
517
518 interface ChildContextProvider<CC> {
519 getChildContext(): CC;
520 }
521
522 //
523 // Class Interfaces
524 // ----------------------------------------------------------------------
525
526 /**
527 * @deprecated as of recent React versions, function components can no
528 * longer be considered 'stateless'. Please use `FunctionComponent` instead.
529 *
530 * @see [React Hooks](https://reactjs.org/docs/hooks-intro.html)
531 */
532 type SFC<P = {}> = FunctionComponent<P>;
533
534 /**
535 * @deprecated as of recent React versions, function components can no
536 * longer be considered 'stateless'. Please use `FunctionComponent` instead.
537 *
538 * @see [React Hooks](https://reactjs.org/docs/hooks-intro.html)
539 */
540 type StatelessComponent<P = {}> = FunctionComponent<P>;
541
542 type FC<P = {}> = FunctionComponent<P>;
543
544 interface FunctionComponent<P = {}> {
545 (props: PropsWithChildren<P>, context?: any): ReactElement<any, any> | null;
546 propTypes?: WeakValidationMap<P>;
547 contextTypes?: ValidationMap<any>;
548 defaultProps?: Partial<P>;
549 displayName?: string;
550 }
551
552 type VFC<P = {}> = VoidFunctionComponent<P>;
553
554 interface VoidFunctionComponent<P = {}> {
555 (props: P, context?: any): ReactElement<any, any> | null;
556 propTypes?: WeakValidationMap<P>;
557 contextTypes?: ValidationMap<any>;
558 defaultProps?: Partial<P>;
559 displayName?: string;
560 }
561
562 type ForwardedRef<T> = ((instance: T | null) => void) | MutableRefObject<T | null> | null;
563
564 interface ForwardRefRenderFunction<T, P = {}> {
565 (props: PropsWithChildren<P>, ref: ForwardedRef<T>): ReactElement | null;
566 displayName?: string;
567 // explicit rejected with `never` required due to
568 // https://github.com/microsoft/TypeScript/issues/36826
569 /**
570 * defaultProps are not supported on render functions
571 */
572 defaultProps?: never;
573 /**
574 * propTypes are not supported on render functions
575 */
576 propTypes?: never;
577 }
578
579 /**
580 * @deprecated Use ForwardRefRenderFunction. forwardRef doesn't accept a
581 * "real" component.
582 */
583 interface RefForwardingComponent <T, P = {}> extends ForwardRefRenderFunction<T, P> {}
584
585 interface ComponentClass<P = {}, S = ComponentState> extends StaticLifecycle<P, S> {
586 new (props: P, context?: any): Component<P, S>;
587 propTypes?: WeakValidationMap<P>;
588 contextType?: Context<any>;
589 contextTypes?: ValidationMap<any>;
590 childContextTypes?: ValidationMap<any>;
591 defaultProps?: Partial<P>;
592 displayName?: string;
593 }
594
595 interface ClassicComponentClass<P = {}> extends ComponentClass<P> {
596 new (props: P, context?: any): ClassicComponent<P, ComponentState>;
597 getDefaultProps?(): P;
598 }
599
600 /**
601 * We use an intersection type to infer multiple type parameters from
602 * a single argument, which is useful for many top-level API defs.
603 * See https://github.com/Microsoft/TypeScript/issues/7234 for more info.
604 */
605 type ClassType<P, T extends Component<P, ComponentState>, C extends ComponentClass<P>> =
606 C &
607 (new (props: P, context?: any) => T);
608
609 //
610 // Component Specs and Lifecycle
611 // ----------------------------------------------------------------------
612
613 // This should actually be something like `Lifecycle<P, S> | DeprecatedLifecycle<P, S>`,
614 // as React will _not_ call the deprecated lifecycle methods if any of the new lifecycle
615 // methods are present.
616 interface ComponentLifecycle<P, S, SS = any> extends NewLifecycle<P, S, SS>, DeprecatedLifecycle<P, S> {
617 /**
618 * Called immediately after a component is mounted. Setting state here will trigger re-rendering.
619 */
620 componentDidMount?(): void;
621 /**
622 * Called to determine whether the change in props and state should trigger a re-render.
623 *
624 * `Component` always returns true.
625 * `PureComponent` implements a shallow comparison on props and state and returns true if any
626 * props or states have changed.
627 *
628 * If false is returned, `Component#render`, `componentWillUpdate`
629 * and `componentDidUpdate` will not be called.
630 */
631 shouldComponentUpdate?(nextProps: Readonly<P>, nextState: Readonly<S>, nextContext: any): boolean;
632 /**
633 * Called immediately before a component is destroyed. Perform any necessary cleanup in this method, such as
634 * cancelled network requests, or cleaning up any DOM elements created in `componentDidMount`.
635 */
636 componentWillUnmount?(): void;
637 /**
638 * Catches exceptions generated in descendant components. Unhandled exceptions will cause
639 * the entire component tree to unmount.
640 */
641 componentDidCatch?(error: Error, errorInfo: ErrorInfo): void;
642 }
643
644 // Unfortunately, we have no way of declaring that the component constructor must implement this
645 interface StaticLifecycle<P, S> {
646 getDerivedStateFromProps?: GetDerivedStateFromProps<P, S>;
647 getDerivedStateFromError?: GetDerivedStateFromError<P, S>;
648 }
649
650 type GetDerivedStateFromProps<P, S> =
651 /**
652 * Returns an update to a component's state based on its new props and old state.
653 *
654 * Note: its presence prevents any of the deprecated lifecycle methods from being invoked
655 */
656 (nextProps: Readonly<P>, prevState: S) => Partial<S> | null;
657
658 type GetDerivedStateFromError<P, S> =
659 /**
660 * This lifecycle is invoked after an error has been thrown by a descendant component.
661 * It receives the error that was thrown as a parameter and should return a value to update state.
662 *
663 * Note: its presence prevents any of the deprecated lifecycle methods from being invoked
664 */
665 (error: any) => Partial<S> | null;
666
667 // This should be "infer SS" but can't use it yet
668 interface NewLifecycle<P, S, SS> {
669 /**
670 * Runs before React applies the result of `render` to the document, and
671 * returns an object to be given to componentDidUpdate. Useful for saving
672 * things such as scroll position before `render` causes changes to it.
673 *
674 * Note: the presence of getSnapshotBeforeUpdate prevents any of the deprecated
675 * lifecycle events from running.
676 */
677 getSnapshotBeforeUpdate?(prevProps: Readonly<P>, prevState: Readonly<S>): SS | null;
678 /**
679 * Called immediately after updating occurs. Not called for the initial render.
680 *
681 * The snapshot is only present if getSnapshotBeforeUpdate is present and returns non-null.
682 */
683 componentDidUpdate?(prevProps: Readonly<P>, prevState: Readonly<S>, snapshot?: SS): void;
684 }
685
686 interface DeprecatedLifecycle<P, S> {
687 /**
688 * Called immediately before mounting occurs, and before `Component#render`.
689 * Avoid introducing any side-effects or subscriptions in this method.
690 *
691 * Note: the presence of getSnapshotBeforeUpdate or getDerivedStateFromProps
692 * prevents this from being invoked.
693 *
694 * @deprecated 16.3, use componentDidMount or the constructor instead; will stop working in React 17
695 * @see https://reactjs.org/blog/2018/03/27/update-on-async-rendering.html#initializing-state
696 * @see https://reactjs.org/blog/2018/03/27/update-on-async-rendering.html#gradual-migration-path
697 */
698 componentWillMount?(): void;
699 /**
700 * Called immediately before mounting occurs, and before `Component#render`.
701 * Avoid introducing any side-effects or subscriptions in this method.
702 *
703 * This method will not stop working in React 17.
704 *
705 * Note: the presence of getSnapshotBeforeUpdate or getDerivedStateFromProps
706 * prevents this from being invoked.
707 *
708 * @deprecated 16.3, use componentDidMount or the constructor instead
709 * @see https://reactjs.org/blog/2018/03/27/update-on-async-rendering.html#initializing-state
710 * @see https://reactjs.org/blog/2018/03/27/update-on-async-rendering.html#gradual-migration-path
711 */
712 UNSAFE_componentWillMount?(): void;
713 /**
714 * Called when the component may be receiving new props.
715 * React may call this even if props have not changed, so be sure to compare new and existing
716 * props if you only want to handle changes.
717 *
718 * Calling `Component#setState` generally does not trigger this method.
719 *
720 * Note: the presence of getSnapshotBeforeUpdate or getDerivedStateFromProps
721 * prevents this from being invoked.
722 *
723 * @deprecated 16.3, use static getDerivedStateFromProps instead; will stop working in React 17
724 * @see https://reactjs.org/blog/2018/03/27/update-on-async-rendering.html#updating-state-based-on-props
725 * @see https://reactjs.org/blog/2018/03/27/update-on-async-rendering.html#gradual-migration-path
726 */
727 componentWillReceiveProps?(nextProps: Readonly<P>, nextContext: any): void;
728 /**
729 * Called when the component may be receiving new props.
730 * React may call this even if props have not changed, so be sure to compare new and existing
731 * props if you only want to handle changes.
732 *
733 * Calling `Component#setState` generally does not trigger this method.
734 *
735 * This method will not stop working in React 17.
736 *
737 * Note: the presence of getSnapshotBeforeUpdate or getDerivedStateFromProps
738 * prevents this from being invoked.
739 *
740 * @deprecated 16.3, use static getDerivedStateFromProps instead
741 * @see https://reactjs.org/blog/2018/03/27/update-on-async-rendering.html#updating-state-based-on-props
742 * @see https://reactjs.org/blog/2018/03/27/update-on-async-rendering.html#gradual-migration-path
743 */
744 UNSAFE_componentWillReceiveProps?(nextProps: Readonly<P>, nextContext: any): void;
745 /**
746 * Called immediately before rendering when new props or state is received. Not called for the initial render.
747 *
748 * Note: You cannot call `Component#setState` here.
749 *
750 * Note: the presence of getSnapshotBeforeUpdate or getDerivedStateFromProps
751 * prevents this from being invoked.
752 *
753 * @deprecated 16.3, use getSnapshotBeforeUpdate instead; will stop working in React 17
754 * @see https://reactjs.org/blog/2018/03/27/update-on-async-rendering.html#reading-dom-properties-before-an-update
755 * @see https://reactjs.org/blog/2018/03/27/update-on-async-rendering.html#gradual-migration-path
756 */
757 componentWillUpdate?(nextProps: Readonly<P>, nextState: Readonly<S>, nextContext: any): void;
758 /**
759 * Called immediately before rendering when new props or state is received. Not called for the initial render.
760 *
761 * Note: You cannot call `Component#setState` here.
762 *
763 * This method will not stop working in React 17.
764 *
765 * Note: the presence of getSnapshotBeforeUpdate or getDerivedStateFromProps
766 * prevents this from being invoked.
767 *
768 * @deprecated 16.3, use getSnapshotBeforeUpdate instead
769 * @see https://reactjs.org/blog/2018/03/27/update-on-async-rendering.html#reading-dom-properties-before-an-update
770 * @see https://reactjs.org/blog/2018/03/27/update-on-async-rendering.html#gradual-migration-path
771 */
772 UNSAFE_componentWillUpdate?(nextProps: Readonly<P>, nextState: Readonly<S>, nextContext: any): void;
773 }
774
775 interface Mixin<P, S> extends ComponentLifecycle<P, S> {
776 mixins?: Array<Mixin<P, S>>;
777 statics?: {
778 [key: string]: any;
779 };
780
781 displayName?: string;
782 propTypes?: ValidationMap<any>;
783 contextTypes?: ValidationMap<any>;
784 childContextTypes?: ValidationMap<any>;
785
786 getDefaultProps?(): P;
787 getInitialState?(): S;
788 }
789
790 interface ComponentSpec<P, S> extends Mixin<P, S> {
791 render(): ReactNode;
792
793 [propertyName: string]: any;
794 }
795
796 function createRef<T>(): RefObject<T>;
797
798 // will show `ForwardRef(${Component.displayName || Component.name})` in devtools by default,
799 // but can be given its own specific name
800 interface ForwardRefExoticComponent<P> extends NamedExoticComponent<P> {
801 defaultProps?: Partial<P>;
802 propTypes?: WeakValidationMap<P>;
803 }
804
805 function forwardRef<T, P = {}>(render: ForwardRefRenderFunction<T, P>): ForwardRefExoticComponent<PropsWithoutRef<P> & RefAttributes<T>>;
806
807 /** Ensures that the props do not include ref at all */
808 type PropsWithoutRef<P> =
809 // Just Pick would be sufficient for this, but I'm trying to avoid unnecessary mapping over union types
810 // https://github.com/Microsoft/TypeScript/issues/28339
811 'ref' extends keyof P
812 ? Pick<P, Exclude<keyof P, 'ref'>>
813 : P;
814 /** Ensures that the props do not include string ref, which cannot be forwarded */
815 type PropsWithRef<P> =
816 // Just "P extends { ref?: infer R }" looks sufficient, but R will infer as {} if P is {}.
817 'ref' extends keyof P
818 ? P extends { ref?: infer R }
819 ? string extends R
820 ? PropsWithoutRef<P> & { ref?: Exclude<R, string> }
821 : P
822 : P
823 : P;
824
825 type PropsWithChildren<P> = P & { children?: ReactNode };
826
827 /**
828 * NOTE: prefer ComponentPropsWithRef, if the ref is forwarded,
829 * or ComponentPropsWithoutRef when refs are not supported.
830 */
831 type ComponentProps<T extends keyof JSX.IntrinsicElements | JSXElementConstructor<any>> =
832 T extends JSXElementConstructor<infer P>
833 ? P
834 : T extends keyof JSX.IntrinsicElements
835 ? JSX.IntrinsicElements[T]
836 : {};
837 type ComponentPropsWithRef<T extends ElementType> =
838 T extends ComponentClass<infer P>
839 ? PropsWithoutRef<P> & RefAttributes<InstanceType<T>>
840 : PropsWithRef<ComponentProps<T>>;
841 type ComponentPropsWithoutRef<T extends ElementType> =
842 PropsWithoutRef<ComponentProps<T>>;
843
844 // will show `Memo(${Component.displayName || Component.name})` in devtools by default,
845 // but can be given its own specific name
846 type MemoExoticComponent<T extends ComponentType<any>> = NamedExoticComponent<ComponentPropsWithRef<T>> & {
847 readonly type: T;
848 };
849
850 function memo<P extends object>(
851 Component: SFC<P>,
852 propsAreEqual?: (prevProps: Readonly<PropsWithChildren<P>>, nextProps: Readonly<PropsWithChildren<P>>) => boolean
853 ): NamedExoticComponent<P>;
854 function memo<T extends ComponentType<any>>(
855 Component: T,
856 propsAreEqual?: (prevProps: Readonly<ComponentProps<T>>, nextProps: Readonly<ComponentProps<T>>) => boolean
857 ): MemoExoticComponent<T>;
858
859 type LazyExoticComponent<T extends ComponentType<any>> = ExoticComponent<ComponentPropsWithRef<T>> & {
860 readonly _result: T;
861 };
862
863 function lazy<T extends ComponentType<any>>(
864 factory: () => Promise<{ default: T }>
865 ): LazyExoticComponent<T>;
866
867 //
868 // React Hooks
869 // ----------------------------------------------------------------------
870
871 // based on the code in https://github.com/facebook/react/pull/13968
872
873 // Unlike the class component setState, the updates are not allowed to be partial
874 type SetStateAction<S> = S | ((prevState: S) => S);
875 // this technically does accept a second argument, but it's already under a deprecation warning
876 // and it's not even released so probably better to not define it.
877 type Dispatch<A> = (value: A) => void;
878 // Since action _can_ be undefined, dispatch may be called without any parameters.
879 type DispatchWithoutAction = () => void;
880 // Unlike redux, the actions _can_ be anything
881 type Reducer<S, A> = (prevState: S, action: A) => S;
882 // If useReducer accepts a reducer without action, dispatch may be called without any parameters.
883 type ReducerWithoutAction<S> = (prevState: S) => S;
884 // types used to try and prevent the compiler from reducing S
885 // to a supertype common with the second argument to useReducer()
886 type ReducerState<R extends Reducer<any, any>> = R extends Reducer<infer S, any> ? S : never;
887 type ReducerAction<R extends Reducer<any, any>> = R extends Reducer<any, infer A> ? A : never;
888 // The identity check is done with the SameValue algorithm (Object.is), which is stricter than ===
889 type ReducerStateWithoutAction<R extends ReducerWithoutAction<any>> =
890 R extends ReducerWithoutAction<infer S> ? S : never;
891 // TODO (TypeScript 3.0): ReadonlyArray<unknown>
892 type DependencyList = ReadonlyArray<any>;
893
894 // NOTE: callbacks are _only_ allowed to return either void, or a destructor.
895 type EffectCallback = () => (void | Destructor);
896
897 interface MutableRefObject<T> {
898 current: T;
899 }
900
901 // This will technically work if you give a Consumer<T> or Provider<T> but it's deprecated and warns
902 /**
903 * Accepts a context object (the value returned from `React.createContext`) and returns the current
904 * context value, as given by the nearest context provider for the given context.
905 *
906 * @version 16.8.0
907 * @see https://reactjs.org/docs/hooks-reference.html#usecontext
908 */
909 function useContext<T>(context: Context<T>/*, (not public API) observedBits?: number|boolean */): T;
910 /**
911 * Returns a stateful value, and a function to update it.
912 *
913 * @version 16.8.0
914 * @see https://reactjs.org/docs/hooks-reference.html#usestate
915 */
916 function useState<S>(initialState: S | (() => S)): [S, Dispatch<SetStateAction<S>>];
917 // convenience overload when first argument is omitted
918 /**
919 * Returns a stateful value, and a function to update it.
920 *
921 * @version 16.8.0
922 * @see https://reactjs.org/docs/hooks-reference.html#usestate
923 */
924 function useState<S = undefined>(): [S | undefined, Dispatch<SetStateAction<S | undefined>>];
925 /**
926 * An alternative to `useState`.
927 *
928 * `useReducer` is usually preferable to `useState` when you have complex state logic that involves
929 * multiple sub-values. It also lets you optimize performance for components that trigger deep
930 * updates because you can pass `dispatch` down instead of callbacks.
931 *
932 * @version 16.8.0
933 * @see https://reactjs.org/docs/hooks-reference.html#usereducer
934 */
935 // overload where dispatch could accept 0 arguments.
936 function useReducer<R extends ReducerWithoutAction<any>, I>(
937 reducer: R,
938 initializerArg: I,
939 initializer: (arg: I) => ReducerStateWithoutAction<R>
940 ): [ReducerStateWithoutAction<R>, DispatchWithoutAction];
941 /**
942 * An alternative to `useState`.
943 *
944 * `useReducer` is usually preferable to `useState` when you have complex state logic that involves
945 * multiple sub-values. It also lets you optimize performance for components that trigger deep
946 * updates because you can pass `dispatch` down instead of callbacks.
947 *
948 * @version 16.8.0
949 * @see https://reactjs.org/docs/hooks-reference.html#usereducer
950 */
951 // overload where dispatch could accept 0 arguments.
952 function useReducer<R extends ReducerWithoutAction<any>>(
953 reducer: R,
954 initializerArg: ReducerStateWithoutAction<R>,
955 initializer?: undefined
956 ): [ReducerStateWithoutAction<R>, DispatchWithoutAction];
957 /**
958 * An alternative to `useState`.
959 *
960 * `useReducer` is usually preferable to `useState` when you have complex state logic that involves
961 * multiple sub-values. It also lets you optimize performance for components that trigger deep
962 * updates because you can pass `dispatch` down instead of callbacks.
963 *
964 * @version 16.8.0
965 * @see https://reactjs.org/docs/hooks-reference.html#usereducer
966 */
967 // overload where "I" may be a subset of ReducerState<R>; used to provide autocompletion.
968 // If "I" matches ReducerState<R> exactly then the last overload will allow initializer to be omitted.
969 // the last overload effectively behaves as if the identity function (x => x) is the initializer.
970 function useReducer<R extends Reducer<any, any>, I>(
971 reducer: R,
972 initializerArg: I & ReducerState<R>,
973 initializer: (arg: I & ReducerState<R>) => ReducerState<R>
974 ): [ReducerState<R>, Dispatch<ReducerAction<R>>];
975 /**
976 * An alternative to `useState`.
977 *
978 * `useReducer` is usually preferable to `useState` when you have complex state logic that involves
979 * multiple sub-values. It also lets you optimize performance for components that trigger deep
980 * updates because you can pass `dispatch` down instead of callbacks.
981 *
982 * @version 16.8.0
983 * @see https://reactjs.org/docs/hooks-reference.html#usereducer
984 */
985 // overload for free "I"; all goes as long as initializer converts it into "ReducerState<R>".
986 function useReducer<R extends Reducer<any, any>, I>(
987 reducer: R,
988 initializerArg: I,
989 initializer: (arg: I) => ReducerState<R>
990 ): [ReducerState<R>, Dispatch<ReducerAction<R>>];
991 /**
992 * An alternative to `useState`.
993 *
994 * `useReducer` is usually preferable to `useState` when you have complex state logic that involves
995 * multiple sub-values. It also lets you optimize performance for components that trigger deep
996 * updates because you can pass `dispatch` down instead of callbacks.
997 *
998 * @version 16.8.0
999 * @see https://reactjs.org/docs/hooks-reference.html#usereducer
1000 */
1001
1002 // I'm not sure if I keep this 2-ary or if I make it (2,3)-ary; it's currently (2,3)-ary.
1003 // The Flow types do have an overload for 3-ary invocation with undefined initializer.
1004
1005 // NOTE: without the ReducerState indirection, TypeScript would reduce S to be the most common
1006 // supertype between the reducer's return type and the initialState (or the initializer's return type),
1007 // which would prevent autocompletion from ever working.
1008
1009 // TODO: double-check if this weird overload logic is necessary. It is possible it's either a bug
1010 // in older versions, or a regression in newer versions of the typescript completion service.
1011 function useReducer<R extends Reducer<any, any>>(
1012 reducer: R,
1013 initialState: ReducerState<R>,
1014 initializer?: undefined
1015 ): [ReducerState<R>, Dispatch<ReducerAction<R>>];
1016 /**
1017 * `useRef` returns a mutable ref object whose `.current` property is initialized to the passed argument
1018 * (`initialValue`). The returned object will persist for the full lifetime of the component.
1019 *
1020 * Note that `useRef()` is useful for more than the `ref` attribute. It’s handy for keeping any mutable
1021 * value around similar to how you’d use instance fields in classes.
1022 *
1023 * @version 16.8.0
1024 * @see https://reactjs.org/docs/hooks-reference.html#useref
1025 */
1026 function useRef<T>(initialValue: T): MutableRefObject<T>;
1027 // convenience overload for refs given as a ref prop as they typically start with a null value
1028 /**
1029 * `useRef` returns a mutable ref object whose `.current` property is initialized to the passed argument
1030 * (`initialValue`). The returned object will persist for the full lifetime of the component.
1031 *
1032 * Note that `useRef()` is useful for more than the `ref` attribute. It’s handy for keeping any mutable
1033 * value around similar to how you’d use instance fields in classes.
1034 *
1035 * Usage note: if you need the result of useRef to be directly mutable, include `| null` in the type
1036 * of the generic argument.
1037 *
1038 * @version 16.8.0
1039 * @see https://reactjs.org/docs/hooks-reference.html#useref
1040 */
1041 function useRef<T>(initialValue: T|null): RefObject<T>;
1042 // convenience overload for potentially undefined initialValue / call with 0 arguments
1043 // has a default to stop it from defaulting to {} instead
1044 /**
1045 * `useRef` returns a mutable ref object whose `.current` property is initialized to the passed argument
1046 * (`initialValue`). The returned object will persist for the full lifetime of the component.
1047 *
1048 * Note that `useRef()` is useful for more than the `ref` attribute. It’s handy for keeping any mutable
1049 * value around similar to how you’d use instance fields in classes.
1050 *
1051 * @version 16.8.0
1052 * @see https://reactjs.org/docs/hooks-reference.html#useref
1053 */
1054 function useRef<T = undefined>(): MutableRefObject<T | undefined>;
1055 /**
1056 * The signature is identical to `useEffect`, but it fires synchronously after all DOM mutations.
1057 * Use this to read layout from the DOM and synchronously re-render. Updates scheduled inside
1058 * `useLayoutEffect` will be flushed synchronously, before the browser has a chance to paint.
1059 *
1060 * Prefer the standard `useEffect` when possible to avoid blocking visual updates.
1061 *
1062 * If you’re migrating code from a class component, `useLayoutEffect` fires in the same phase as
1063 * `componentDidMount` and `componentDidUpdate`.
1064 *
1065 * @version 16.8.0
1066 * @see https://reactjs.org/docs/hooks-reference.html#uselayouteffect
1067 */
1068 function useLayoutEffect(effect: EffectCallback, deps?: DependencyList): void;
1069 /**
1070 * Accepts a function that contains imperative, possibly effectful code.
1071 *
1072 * @param effect Imperative function that can return a cleanup function
1073 * @param deps If present, effect will only activate if the values in the list change.
1074 *
1075 * @version 16.8.0
1076 * @see https://reactjs.org/docs/hooks-reference.html#useeffect
1077 */
1078 function useEffect(effect: EffectCallback, deps?: DependencyList): void;
1079 // NOTE: this does not accept strings, but this will have to be fixed by removing strings from type Ref<T>
1080 /**
1081 * `useImperativeHandle` customizes the instance value that is exposed to parent components when using
1082 * `ref`. As always, imperative code using refs should be avoided in most cases.
1083 *
1084 * `useImperativeHandle` should be used with `React.forwardRef`.
1085 *
1086 * @version 16.8.0
1087 * @see https://reactjs.org/docs/hooks-reference.html#useimperativehandle
1088 */
1089 function useImperativeHandle<T, R extends T>(ref: Ref<T>|undefined, init: () => R, deps?: DependencyList): void;
1090 // I made 'inputs' required here and in useMemo as there's no point to memoizing without the memoization key
1091 // useCallback(X) is identical to just using X, useMemo(() => Y) is identical to just using Y.
1092 /**
1093 * `useCallback` will return a memoized version of the callback that only changes if one of the `inputs`
1094 * has changed.
1095 *
1096 * @version 16.8.0
1097 * @see https://reactjs.org/docs/hooks-reference.html#usecallback
1098 */
1099 // TODO (TypeScript 3.0): <T extends (...args: never[]) => unknown>
1100 function useCallback<T extends (...args: any[]) => any>(callback: T, deps: DependencyList): T;
1101 /**
1102 * `useMemo` will only recompute the memoized value when one of the `deps` has changed.
1103 *
1104 * Usage note: if calling `useMemo` with a referentially stable function, also give it as the input in
1105 * the second argument.
1106 *
1107 * ```ts
1108 * function expensive () { ... }
1109 *
1110 * function Component () {
1111 * const expensiveResult = useMemo(expensive, [expensive])
1112 * return ...
1113 * }
1114 * ```
1115 *
1116 * @version 16.8.0
1117 * @see https://reactjs.org/docs/hooks-reference.html#usememo
1118 */
1119 // allow undefined, but don't make it optional as that is very likely a mistake
1120 function useMemo<T>(factory: () => T, deps: DependencyList | undefined): T;
1121 /**
1122 * `useDebugValue` can be used to display a label for custom hooks in React DevTools.
1123 *
1124 * NOTE: We don’t recommend adding debug values to every custom hook.
1125 * It’s most valuable for custom hooks that are part of shared libraries.
1126 *
1127 * @version 16.8.0
1128 * @see https://reactjs.org/docs/hooks-reference.html#usedebugvalue
1129 */
1130 // the name of the custom hook is itself derived from the function name at runtime:
1131 // it's just the function name without the "use" prefix.
1132 function useDebugValue<T>(value: T, format?: (value: T) => any): void;
1133
1134 //
1135 // Event System
1136 // ----------------------------------------------------------------------
1137 // TODO: change any to unknown when moving to TS v3
1138 interface BaseSyntheticEvent<E = object, C = any, T = any> {
1139 nativeEvent: E;
1140 currentTarget: C;
1141 target: T;
1142 bubbles: boolean;
1143 cancelable: boolean;
1144 defaultPrevented: boolean;
1145 eventPhase: number;
1146 isTrusted: boolean;
1147 preventDefault(): void;
1148 isDefaultPrevented(): boolean;
1149 stopPropagation(): void;
1150 isPropagationStopped(): boolean;
1151 persist(): void;
1152 timeStamp: number;
1153 type: string;
1154 }
1155
1156 /**
1157 * currentTarget - a reference to the element on which the event listener is registered.
1158 *
1159 * target - a reference to the element from which the event was originally dispatched.
1160 * This might be a child element to the element on which the event listener is registered.
1161 * If you thought this should be `EventTarget & T`, see https://github.com/DefinitelyTyped/DefinitelyTyped/issues/11508#issuecomment-256045682
1162 */
1163 interface SyntheticEvent<T = Element, E = Event> extends BaseSyntheticEvent<E, EventTarget & T, EventTarget> {}
1164
1165 interface ClipboardEvent<T = Element> extends SyntheticEvent<T, NativeClipboardEvent> {
1166 clipboardData: DataTransfer;
1167 }
1168
1169 interface CompositionEvent<T = Element> extends SyntheticEvent<T, NativeCompositionEvent> {
1170 data: string;
1171 }
1172
1173 interface DragEvent<T = Element> extends MouseEvent<T, NativeDragEvent> {
1174 dataTransfer: DataTransfer;
1175 }
1176
1177 interface PointerEvent<T = Element> extends MouseEvent<T, NativePointerEvent> {
1178 pointerId: number;
1179 pressure: number;
1180 tangentialPressure: number;
1181 tiltX: number;
1182 tiltY: number;
1183 twist: number;
1184 width: number;
1185 height: number;
1186 pointerType: 'mouse' | 'pen' | 'touch';
1187 isPrimary: boolean;
1188 }
1189
1190 interface FocusEvent<T = Element> extends SyntheticEvent<T, NativeFocusEvent> {
1191 relatedTarget: EventTarget | null;
1192 target: EventTarget & T;
1193 }
1194
1195 interface FormEvent<T = Element> extends SyntheticEvent<T> {
1196 }
1197
1198 interface InvalidEvent<T = Element> extends SyntheticEvent<T> {
1199 target: EventTarget & T;
1200 }
1201
1202 interface ChangeEvent<T = Element> extends SyntheticEvent<T> {
1203 target: EventTarget & T;
1204 }
1205
1206 interface KeyboardEvent<T = Element> extends SyntheticEvent<T, NativeKeyboardEvent> {
1207 altKey: boolean;
1208 /** @deprecated */
1209 charCode: number;
1210 ctrlKey: boolean;
1211 code: string;
1212 /**
1213 * 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.
1214 */
1215 getModifierState(key: string): boolean;
1216 /**
1217 * See the [DOM Level 3 Events spec](https://www.w3.org/TR/uievents-key/#named-key-attribute-values). for possible values
1218 */
1219 key: string;
1220 /** @deprecated */
1221 keyCode: number;
1222 locale: string;
1223 location: number;
1224 metaKey: boolean;
1225 repeat: boolean;
1226 shiftKey: boolean;
1227 /** @deprecated */
1228 which: number;
1229 }
1230
1231 interface MouseEvent<T = Element, E = NativeMouseEvent> extends UIEvent<T, E> {
1232 altKey: boolean;
1233 button: number;
1234 buttons: number;
1235 clientX: number;
1236 clientY: number;
1237 ctrlKey: boolean;
1238 /**
1239 * 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.
1240 */
1241 getModifierState(key: string): boolean;
1242 metaKey: boolean;
1243 movementX: number;
1244 movementY: number;
1245 pageX: number;
1246 pageY: number;
1247 relatedTarget: EventTarget | null;
1248 screenX: number;
1249 screenY: number;
1250 shiftKey: boolean;
1251 }
1252
1253 interface TouchEvent<T = Element> extends UIEvent<T, NativeTouchEvent> {
1254 altKey: boolean;
1255 changedTouches: TouchList;
1256 ctrlKey: boolean;
1257 /**
1258 * 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.
1259 */
1260 getModifierState(key: string): boolean;
1261 metaKey: boolean;
1262 shiftKey: boolean;
1263 targetTouches: TouchList;
1264 touches: TouchList;
1265 }
1266
1267 interface UIEvent<T = Element, E = NativeUIEvent> extends SyntheticEvent<T, E> {
1268 detail: number;
1269 view: AbstractView;
1270 }
1271
1272 interface WheelEvent<T = Element> extends MouseEvent<T, NativeWheelEvent> {
1273 deltaMode: number;
1274 deltaX: number;
1275 deltaY: number;
1276 deltaZ: number;
1277 }
1278
1279 interface AnimationEvent<T = Element> extends SyntheticEvent<T, NativeAnimationEvent> {
1280 animationName: string;
1281 elapsedTime: number;
1282 pseudoElement: string;
1283 }
1284
1285 interface TransitionEvent<T = Element> extends SyntheticEvent<T, NativeTransitionEvent> {
1286 elapsedTime: number;
1287 propertyName: string;
1288 pseudoElement: string;
1289 }
1290
1291 //
1292 // Event Handler Types
1293 // ----------------------------------------------------------------------
1294
1295 type EventHandler<E extends SyntheticEvent<any>> = { bivarianceHack(event: E): void }["bivarianceHack"];
1296
1297 type ReactEventHandler<T = Element> = EventHandler<SyntheticEvent<T>>;
1298
1299 type ClipboardEventHandler<T = Element> = EventHandler<ClipboardEvent<T>>;
1300 type CompositionEventHandler<T = Element> = EventHandler<CompositionEvent<T>>;
1301 type DragEventHandler<T = Element> = EventHandler<DragEvent<T>>;
1302 type FocusEventHandler<T = Element> = EventHandler<FocusEvent<T>>;
1303 type FormEventHandler<T = Element> = EventHandler<FormEvent<T>>;
1304 type ChangeEventHandler<T = Element> = EventHandler<ChangeEvent<T>>;
1305 type KeyboardEventHandler<T = Element> = EventHandler<KeyboardEvent<T>>;
1306 type MouseEventHandler<T = Element> = EventHandler<MouseEvent<T>>;
1307 type TouchEventHandler<T = Element> = EventHandler<TouchEvent<T>>;
1308 type PointerEventHandler<T = Element> = EventHandler<PointerEvent<T>>;
1309 type UIEventHandler<T = Element> = EventHandler<UIEvent<T>>;
1310 type WheelEventHandler<T = Element> = EventHandler<WheelEvent<T>>;
1311 type AnimationEventHandler<T = Element> = EventHandler<AnimationEvent<T>>;
1312 type TransitionEventHandler<T = Element> = EventHandler<TransitionEvent<T>>;
1313
1314 //
1315 // Props / DOM Attributes
1316 // ----------------------------------------------------------------------
1317
1318 /**
1319 * @deprecated. This was used to allow clients to pass `ref` and `key`
1320 * to `createElement`, which is no longer necessary due to intersection
1321 * types. If you need to declare a props object before passing it to
1322 * `createElement` or a factory, use `ClassAttributes<T>`:
1323 *
1324 * ```ts
1325 * var b: Button | null;
1326 * var props: ButtonProps & ClassAttributes<Button> = {
1327 * ref: b => button = b, // ok!
1328 * label: "I'm a Button"
1329 * };
1330 * ```
1331 */
1332 interface Props<T> {
1333 children?: ReactNode;
1334 key?: Key;
1335 ref?: LegacyRef<T>;
1336 }
1337
1338 interface HTMLProps<T> extends AllHTMLAttributes<T>, ClassAttributes<T> {
1339 }
1340
1341 type DetailedHTMLProps<E extends HTMLAttributes<T>, T> = ClassAttributes<T> & E;
1342
1343 interface SVGProps<T> extends SVGAttributes<T>, ClassAttributes<T> {
1344 }
1345
1346 interface DOMAttributes<T> {
1347 children?: ReactNode;
1348 dangerouslySetInnerHTML?: {
1349 __html: string;
1350 };
1351
1352 // Clipboard Events
1353 onCopy?: ClipboardEventHandler<T>;
1354 onCopyCapture?: ClipboardEventHandler<T>;
1355 onCut?: ClipboardEventHandler<T>;
1356 onCutCapture?: ClipboardEventHandler<T>;
1357 onPaste?: ClipboardEventHandler<T>;
1358 onPasteCapture?: ClipboardEventHandler<T>;
1359
1360 // Composition Events
1361 onCompositionEnd?: CompositionEventHandler<T>;
1362 onCompositionEndCapture?: CompositionEventHandler<T>;
1363 onCompositionStart?: CompositionEventHandler<T>;
1364 onCompositionStartCapture?: CompositionEventHandler<T>;
1365 onCompositionUpdate?: CompositionEventHandler<T>;
1366 onCompositionUpdateCapture?: CompositionEventHandler<T>;
1367
1368 // Focus Events
1369 onFocus?: FocusEventHandler<T>;
1370 onFocusCapture?: FocusEventHandler<T>;
1371 onBlur?: FocusEventHandler<T>;
1372 onBlurCapture?: FocusEventHandler<T>;
1373
1374 // Form Events
1375 onChange?: FormEventHandler<T>;
1376 onChangeCapture?: FormEventHandler<T>;
1377 onBeforeInput?: FormEventHandler<T>;
1378 onBeforeInputCapture?: FormEventHandler<T>;
1379 onInput?: FormEventHandler<T>;
1380 onInputCapture?: FormEventHandler<T>;
1381 onReset?: FormEventHandler<T>;
1382 onResetCapture?: FormEventHandler<T>;
1383 onSubmit?: FormEventHandler<T>;
1384 onSubmitCapture?: FormEventHandler<T>;
1385 onInvalid?: FormEventHandler<T>;
1386 onInvalidCapture?: FormEventHandler<T>;
1387
1388 // Image Events
1389 onLoad?: ReactEventHandler<T>;
1390 onLoadCapture?: ReactEventHandler<T>;
1391 onError?: ReactEventHandler<T>; // also a Media Event
1392 onErrorCapture?: ReactEventHandler<T>; // also a Media Event
1393
1394 // Keyboard Events
1395 onKeyDown?: KeyboardEventHandler<T>;
1396 onKeyDownCapture?: KeyboardEventHandler<T>;
1397 onKeyPress?: KeyboardEventHandler<T>;
1398 onKeyPressCapture?: KeyboardEventHandler<T>;
1399 onKeyUp?: KeyboardEventHandler<T>;
1400 onKeyUpCapture?: KeyboardEventHandler<T>;
1401
1402 // Media Events
1403 onAbort?: ReactEventHandler<T>;
1404 onAbortCapture?: ReactEventHandler<T>;
1405 onCanPlay?: ReactEventHandler<T>;
1406 onCanPlayCapture?: ReactEventHandler<T>;
1407 onCanPlayThrough?: ReactEventHandler<T>;
1408 onCanPlayThroughCapture?: ReactEventHandler<T>;
1409 onDurationChange?: ReactEventHandler<T>;
1410 onDurationChangeCapture?: ReactEventHandler<T>;
1411 onEmptied?: ReactEventHandler<T>;
1412 onEmptiedCapture?: ReactEventHandler<T>;
1413 onEncrypted?: ReactEventHandler<T>;
1414 onEncryptedCapture?: ReactEventHandler<T>;
1415 onEnded?: ReactEventHandler<T>;
1416 onEndedCapture?: ReactEventHandler<T>;
1417 onLoadedData?: ReactEventHandler<T>;
1418 onLoadedDataCapture?: ReactEventHandler<T>;
1419 onLoadedMetadata?: ReactEventHandler<T>;
1420 onLoadedMetadataCapture?: ReactEventHandler<T>;
1421 onLoadStart?: ReactEventHandler<T>;
1422 onLoadStartCapture?: ReactEventHandler<T>;
1423 onPause?: ReactEventHandler<T>;
1424 onPauseCapture?: ReactEventHandler<T>;
1425 onPlay?: ReactEventHandler<T>;
1426 onPlayCapture?: ReactEventHandler<T>;
1427 onPlaying?: ReactEventHandler<T>;
1428 onPlayingCapture?: ReactEventHandler<T>;
1429 onProgress?: ReactEventHandler<T>;
1430 onProgressCapture?: ReactEventHandler<T>;
1431 onRateChange?: ReactEventHandler<T>;
1432 onRateChangeCapture?: ReactEventHandler<T>;
1433 onSeeked?: ReactEventHandler<T>;
1434 onSeekedCapture?: ReactEventHandler<T>;
1435 onSeeking?: ReactEventHandler<T>;
1436 onSeekingCapture?: ReactEventHandler<T>;
1437 onStalled?: ReactEventHandler<T>;
1438 onStalledCapture?: ReactEventHandler<T>;
1439 onSuspend?: ReactEventHandler<T>;
1440 onSuspendCapture?: ReactEventHandler<T>;
1441 onTimeUpdate?: ReactEventHandler<T>;
1442 onTimeUpdateCapture?: ReactEventHandler<T>;
1443 onVolumeChange?: ReactEventHandler<T>;
1444 onVolumeChangeCapture?: ReactEventHandler<T>;
1445 onWaiting?: ReactEventHandler<T>;
1446 onWaitingCapture?: ReactEventHandler<T>;
1447
1448 // MouseEvents
1449 onAuxClick?: MouseEventHandler<T>;
1450 onAuxClickCapture?: MouseEventHandler<T>;
1451 onClick?: MouseEventHandler<T>;
1452 onClickCapture?: MouseEventHandler<T>;
1453 onContextMenu?: MouseEventHandler<T>;
1454 onContextMenuCapture?: MouseEventHandler<T>;
1455 onDoubleClick?: MouseEventHandler<T>;
1456 onDoubleClickCapture?: MouseEventHandler<T>;
1457 onDrag?: DragEventHandler<T>;
1458 onDragCapture?: DragEventHandler<T>;
1459 onDragEnd?: DragEventHandler<T>;
1460 onDragEndCapture?: DragEventHandler<T>;
1461 onDragEnter?: DragEventHandler<T>;
1462 onDragEnterCapture?: DragEventHandler<T>;
1463 onDragExit?: DragEventHandler<T>;
1464 onDragExitCapture?: DragEventHandler<T>;
1465 onDragLeave?: DragEventHandler<T>;
1466 onDragLeaveCapture?: DragEventHandler<T>;
1467 onDragOver?: DragEventHandler<T>;
1468 onDragOverCapture?: DragEventHandler<T>;
1469 onDragStart?: DragEventHandler<T>;
1470 onDragStartCapture?: DragEventHandler<T>;
1471 onDrop?: DragEventHandler<T>;
1472 onDropCapture?: DragEventHandler<T>;
1473 onMouseDown?: MouseEventHandler<T>;
1474 onMouseDownCapture?: MouseEventHandler<T>;
1475 onMouseEnter?: MouseEventHandler<T>;
1476 onMouseLeave?: MouseEventHandler<T>;
1477 onMouseMove?: MouseEventHandler<T>;
1478 onMouseMoveCapture?: MouseEventHandler<T>;
1479 onMouseOut?: MouseEventHandler<T>;
1480 onMouseOutCapture?: MouseEventHandler<T>;
1481 onMouseOver?: MouseEventHandler<T>;
1482 onMouseOverCapture?: MouseEventHandler<T>;
1483 onMouseUp?: MouseEventHandler<T>;
1484 onMouseUpCapture?: MouseEventHandler<T>;
1485
1486 // Selection Events
1487 onSelect?: ReactEventHandler<T>;
1488 onSelectCapture?: ReactEventHandler<T>;
1489
1490 // Touch Events
1491 onTouchCancel?: TouchEventHandler<T>;
1492 onTouchCancelCapture?: TouchEventHandler<T>;
1493 onTouchEnd?: TouchEventHandler<T>;
1494 onTouchEndCapture?: TouchEventHandler<T>;
1495 onTouchMove?: TouchEventHandler<T>;
1496 onTouchMoveCapture?: TouchEventHandler<T>;
1497 onTouchStart?: TouchEventHandler<T>;
1498 onTouchStartCapture?: TouchEventHandler<T>;
1499
1500 // Pointer Events
1501 onPointerDown?: PointerEventHandler<T>;
1502 onPointerDownCapture?: PointerEventHandler<T>;
1503 onPointerMove?: PointerEventHandler<T>;
1504 onPointerMoveCapture?: PointerEventHandler<T>;
1505 onPointerUp?: PointerEventHandler<T>;
1506 onPointerUpCapture?: PointerEventHandler<T>;
1507 onPointerCancel?: PointerEventHandler<T>;
1508 onPointerCancelCapture?: PointerEventHandler<T>;
1509 onPointerEnter?: PointerEventHandler<T>;
1510 onPointerEnterCapture?: PointerEventHandler<T>;
1511 onPointerLeave?: PointerEventHandler<T>;
1512 onPointerLeaveCapture?: PointerEventHandler<T>;
1513 onPointerOver?: PointerEventHandler<T>;
1514 onPointerOverCapture?: PointerEventHandler<T>;
1515 onPointerOut?: PointerEventHandler<T>;
1516 onPointerOutCapture?: PointerEventHandler<T>;
1517 onGotPointerCapture?: PointerEventHandler<T>;
1518 onGotPointerCaptureCapture?: PointerEventHandler<T>;
1519 onLostPointerCapture?: PointerEventHandler<T>;
1520 onLostPointerCaptureCapture?: PointerEventHandler<T>;
1521
1522 // UI Events
1523 onScroll?: UIEventHandler<T>;
1524 onScrollCapture?: UIEventHandler<T>;
1525
1526 // Wheel Events
1527 onWheel?: WheelEventHandler<T>;
1528 onWheelCapture?: WheelEventHandler<T>;
1529
1530 // Animation Events
1531 onAnimationStart?: AnimationEventHandler<T>;
1532 onAnimationStartCapture?: AnimationEventHandler<T>;
1533 onAnimationEnd?: AnimationEventHandler<T>;
1534 onAnimationEndCapture?: AnimationEventHandler<T>;
1535 onAnimationIteration?: AnimationEventHandler<T>;
1536 onAnimationIterationCapture?: AnimationEventHandler<T>;
1537
1538 // Transition Events
1539 onTransitionEnd?: TransitionEventHandler<T>;
1540 onTransitionEndCapture?: TransitionEventHandler<T>;
1541 }
1542
1543 export interface CSSProperties extends CSS.Properties<string | number> {
1544 /**
1545 * The index signature was removed to enable closed typing for style
1546 * using CSSType. You're able to use type assertion or module augmentation
1547 * to add properties or an index signature of your own.
1548 *
1549 * For examples and more information, visit:
1550 * https://github.com/frenic/csstype#what-should-i-do-when-i-get-type-errors
1551 */
1552 }
1553
1554 // All the WAI-ARIA 1.1 attributes from https://www.w3.org/TR/wai-aria-1.1/
1555 interface AriaAttributes {
1556 /** Identifies the currently active element when DOM focus is on a composite widget, textbox, group, or application. */
1557 'aria-activedescendant'?: string;
1558 /** 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. */
1559 'aria-atomic'?: boolean | 'false' | 'true';
1560 /**
1561 * 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
1562 * presented if they are made.
1563 */
1564 'aria-autocomplete'?: 'none' | 'inline' | 'list' | 'both';
1565 /** 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. */
1566 'aria-busy'?: boolean | 'false' | 'true';
1567 /**
1568 * Indicates the current "checked" state of checkboxes, radio buttons, and other widgets.
1569 * @see aria-pressed @see aria-selected.
1570 */
1571 'aria-checked'?: boolean | 'false' | 'mixed' | 'true';
1572 /**
1573 * Defines the total number of columns in a table, grid, or treegrid.
1574 * @see aria-colindex.
1575 */
1576 'aria-colcount'?: number;
1577 /**
1578 * Defines an element's column index or position with respect to the total number of columns within a table, grid, or treegrid.
1579 * @see aria-colcount @see aria-colspan.
1580 */
1581 'aria-colindex'?: number;
1582 /**
1583 * Defines the number of columns spanned by a cell or gridcell within a table, grid, or treegrid.
1584 * @see aria-colindex @see aria-rowspan.
1585 */
1586 'aria-colspan'?: number;
1587 /**
1588 * Identifies the element (or elements) whose contents or presence are controlled by the current element.
1589 * @see aria-owns.
1590 */
1591 'aria-controls'?: string;
1592 /** Indicates the element that represents the current item within a container or set of related elements. */
1593 'aria-current'?: boolean | 'false' | 'true' | 'page' | 'step' | 'location' | 'date' | 'time';
1594 /**
1595 * Identifies the element (or elements) that describes the object.
1596 * @see aria-labelledby
1597 */
1598 'aria-describedby'?: string;
1599 /**
1600 * Identifies the element that provides a detailed, extended description for the object.
1601 * @see aria-describedby.
1602 */
1603 'aria-details'?: string;
1604 /**
1605 * Indicates that the element is perceivable but disabled, so it is not editable or otherwise operable.
1606 * @see aria-hidden @see aria-readonly.
1607 */
1608 'aria-disabled'?: boolean | 'false' | 'true';
1609 /**
1610 * Indicates what functions can be performed when a dragged object is released on the drop target.
1611 * @deprecated in ARIA 1.1
1612 */
1613 'aria-dropeffect'?: 'none' | 'copy' | 'execute' | 'link' | 'move' | 'popup';
1614 /**
1615 * Identifies the element that provides an error message for the object.
1616 * @see aria-invalid @see aria-describedby.
1617 */
1618 'aria-errormessage'?: string;
1619 /** Indicates whether the element, or another grouping element it controls, is currently expanded or collapsed. */
1620 'aria-expanded'?: boolean | 'false' | 'true';
1621 /**
1622 * Identifies the next element (or elements) in an alternate reading order of content which, at the user's discretion,
1623 * allows assistive technology to override the general default of reading in document source order.
1624 */
1625 'aria-flowto'?: string;
1626 /**
1627 * Indicates an element's "grabbed" state in a drag-and-drop operation.
1628 * @deprecated in ARIA 1.1
1629 */
1630 'aria-grabbed'?: boolean | 'false' | 'true';
1631 /** Indicates the availability and type of interactive popup element, such as menu or dialog, that can be triggered by an element. */
1632 'aria-haspopup'?: boolean | 'false' | 'true' | 'menu' | 'listbox' | 'tree' | 'grid' | 'dialog';
1633 /**
1634 * Indicates whether the element is exposed to an accessibility API.
1635 * @see aria-disabled.
1636 */
1637 'aria-hidden'?: boolean | 'false' | 'true';
1638 /**
1639 * Indicates the entered value does not conform to the format expected by the application.
1640 * @see aria-errormessage.
1641 */
1642 'aria-invalid'?: boolean | 'false' | 'true' | 'grammar' | 'spelling';
1643 /** Indicates keyboard shortcuts that an author has implemented to activate or give focus to an element. */
1644 'aria-keyshortcuts'?: string;
1645 /**
1646 * Defines a string value that labels the current element.
1647 * @see aria-labelledby.
1648 */
1649 'aria-label'?: string;
1650 /**
1651 * Identifies the element (or elements) that labels the current element.
1652 * @see aria-describedby.
1653 */
1654 'aria-labelledby'?: string;
1655 /** Defines the hierarchical level of an element within a structure. */
1656 'aria-level'?: number;
1657 /** 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. */
1658 'aria-live'?: 'off' | 'assertive' | 'polite';
1659 /** Indicates whether an element is modal when displayed. */
1660 'aria-modal'?: boolean | 'false' | 'true';
1661 /** Indicates whether a text box accepts multiple lines of input or only a single line. */
1662 'aria-multiline'?: boolean | 'false' | 'true';
1663 /** Indicates that the user may select more than one item from the current selectable descendants. */
1664 'aria-multiselectable'?: boolean | 'false' | 'true';
1665 /** Indicates whether the element's orientation is horizontal, vertical, or unknown/ambiguous. */
1666 'aria-orientation'?: 'horizontal' | 'vertical';
1667 /**
1668 * Identifies an element (or elements) in order to define a visual, functional, or contextual parent/child relationship
1669 * between DOM elements where the DOM hierarchy cannot be used to represent the relationship.
1670 * @see aria-controls.
1671 */
1672 'aria-owns'?: string;
1673 /**
1674 * Defines a short hint (a word or short phrase) intended to aid the user with data entry when the control has no value.
1675 * A hint could be a sample value or a brief description of the expected format.
1676 */
1677 'aria-placeholder'?: string;
1678 /**
1679 * 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.
1680 * @see aria-setsize.
1681 */
1682 'aria-posinset'?: number;
1683 /**
1684 * Indicates the current "pressed" state of toggle buttons.
1685 * @see aria-checked @see aria-selected.
1686 */
1687 'aria-pressed'?: boolean | 'false' | 'mixed' | 'true';
1688 /**
1689 * Indicates that the element is not editable, but is otherwise operable.
1690 * @see aria-disabled.
1691 */
1692 'aria-readonly'?: boolean | 'false' | 'true';
1693 /**
1694 * Indicates what notifications the user agent will trigger when the accessibility tree within a live region is modified.
1695 * @see aria-atomic.
1696 */
1697 'aria-relevant'?: 'additions' | 'additions removals' | 'additions text' | 'all' | 'removals' | 'removals additions' | 'removals text' | 'text' | 'text additions' | 'text removals';
1698 /** Indicates that user input is required on the element before a form may be submitted. */
1699 'aria-required'?: boolean | 'false' | 'true';
1700 /** Defines a human-readable, author-localized description for the role of an element. */
1701 'aria-roledescription'?: string;
1702 /**
1703 * Defines the total number of rows in a table, grid, or treegrid.
1704 * @see aria-rowindex.
1705 */
1706 'aria-rowcount'?: number;
1707 /**
1708 * Defines an element's row index or position with respect to the total number of rows within a table, grid, or treegrid.
1709 * @see aria-rowcount @see aria-rowspan.
1710 */
1711 'aria-rowindex'?: number;
1712 /**
1713 * Defines the number of rows spanned by a cell or gridcell within a table, grid, or treegrid.
1714 * @see aria-rowindex @see aria-colspan.
1715 */
1716 'aria-rowspan'?: number;
1717 /**
1718 * Indicates the current "selected" state of various widgets.
1719 * @see aria-checked @see aria-pressed.
1720 */
1721 'aria-selected'?: boolean | 'false' | 'true';
1722 /**
1723 * 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.
1724 * @see aria-posinset.
1725 */
1726 'aria-setsize'?: number;
1727 /** Indicates if items in a table or grid are sorted in ascending or descending order. */
1728 'aria-sort'?: 'none' | 'ascending' | 'descending' | 'other';
1729 /** Defines the maximum allowed value for a range widget. */
1730 'aria-valuemax'?: number;
1731 /** Defines the minimum allowed value for a range widget. */
1732 'aria-valuemin'?: number;
1733 /**
1734 * Defines the current value for a range widget.
1735 * @see aria-valuetext.
1736 */
1737 'aria-valuenow'?: number;
1738 /** Defines the human readable text alternative of aria-valuenow for a range widget. */
1739 'aria-valuetext'?: string;
1740 }
1741
1742 // All the WAI-ARIA 1.1 role attribute values from https://www.w3.org/TR/wai-aria-1.1/#role_definitions
1743 type AriaRole =
1744 | 'alert'
1745 | 'alertdialog'
1746 | 'application'
1747 | 'article'
1748 | 'banner'
1749 | 'button'
1750 | 'cell'
1751 | 'checkbox'
1752 | 'columnheader'
1753 | 'combobox'
1754 | 'complementary'
1755 | 'contentinfo'
1756 | 'definition'
1757 | 'dialog'
1758 | 'directory'
1759 | 'document'
1760 | 'feed'
1761 | 'figure'
1762 | 'form'
1763 | 'grid'
1764 | 'gridcell'
1765 | 'group'
1766 | 'heading'
1767 | 'img'
1768 | 'link'
1769 | 'list'
1770 | 'listbox'
1771 | 'listitem'
1772 | 'log'
1773 | 'main'
1774 | 'marquee'
1775 | 'math'
1776 | 'menu'
1777 | 'menubar'
1778 | 'menuitem'
1779 | 'menuitemcheckbox'
1780 | 'menuitemradio'
1781 | 'navigation'
1782 | 'none'
1783 | 'note'
1784 | 'option'
1785 | 'presentation'
1786 | 'progressbar'
1787 | 'radio'
1788 | 'radiogroup'
1789 | 'region'
1790 | 'row'
1791 | 'rowgroup'
1792 | 'rowheader'
1793 | 'scrollbar'
1794 | 'search'
1795 | 'searchbox'
1796 | 'separator'
1797 | 'slider'
1798 | 'spinbutton'
1799 | 'status'
1800 | 'switch'
1801 | 'tab'
1802 | 'table'
1803 | 'tablist'
1804 | 'tabpanel'
1805 | 'term'
1806 | 'textbox'
1807 | 'timer'
1808 | 'toolbar'
1809 | 'tooltip'
1810 | 'tree'
1811 | 'treegrid'
1812 | 'treeitem'
1813 | (string & {});
1814
1815 interface HTMLAttributes<T> extends AriaAttributes, DOMAttributes<T> {
1816 // React-specific Attributes
1817 defaultChecked?: boolean;
1818 defaultValue?: string | number | ReadonlyArray<string>;
1819 suppressContentEditableWarning?: boolean;
1820 suppressHydrationWarning?: boolean;
1821
1822 // Standard HTML Attributes
1823 accessKey?: string;
1824 className?: string;
1825 contentEditable?: Booleanish | "inherit";
1826 contextMenu?: string;
1827 dir?: string;
1828 draggable?: Booleanish;
1829 hidden?: boolean;
1830 id?: string;
1831 lang?: string;
1832 placeholder?: string;
1833 slot?: string;
1834 spellCheck?: Booleanish;
1835 style?: CSSProperties;
1836 tabIndex?: number;
1837 title?: string;
1838 translate?: 'yes' | 'no';
1839
1840 // Unknown
1841 radioGroup?: string; // <command>, <menuitem>
1842
1843 // WAI-ARIA
1844 role?: AriaRole;
1845
1846 // RDFa Attributes
1847 about?: string;
1848 datatype?: string;
1849 inlist?: any;
1850 prefix?: string;
1851 property?: string;
1852 resource?: string;
1853 typeof?: string;
1854 vocab?: string;
1855
1856 // Non-standard Attributes
1857 autoCapitalize?: string;
1858 autoCorrect?: string;
1859 autoSave?: string;
1860 color?: string;
1861 itemProp?: string;
1862 itemScope?: boolean;
1863 itemType?: string;
1864 itemID?: string;
1865 itemRef?: string;
1866 results?: number;
1867 security?: string;
1868 unselectable?: 'on' | 'off';
1869
1870 // Living Standard
1871 /**
1872 * Hints at the type of data that might be entered by the user while editing the element or its contents
1873 * @see https://html.spec.whatwg.org/multipage/interaction.html#input-modalities:-the-inputmode-attribute
1874 */
1875 inputMode?: 'none' | 'text' | 'tel' | 'url' | 'email' | 'numeric' | 'decimal' | 'search';
1876 /**
1877 * Specify that a standard HTML element should behave like a defined custom built-in element
1878 * @see https://html.spec.whatwg.org/multipage/custom-elements.html#attr-is
1879 */
1880 is?: string;
1881 }
1882
1883 interface AllHTMLAttributes<T> extends HTMLAttributes<T> {
1884 // Standard HTML Attributes
1885 accept?: string;
1886 acceptCharset?: string;
1887 action?: string;
1888 allowFullScreen?: boolean;
1889 allowTransparency?: boolean;
1890 alt?: string;
1891 as?: string;
1892 async?: boolean;
1893 autoComplete?: string;
1894 autoFocus?: boolean;
1895 autoPlay?: boolean;
1896 capture?: boolean | string;
1897 cellPadding?: number | string;
1898 cellSpacing?: number | string;
1899 charSet?: string;
1900 challenge?: string;
1901 checked?: boolean;
1902 cite?: string;
1903 classID?: string;
1904 cols?: number;
1905 colSpan?: number;
1906 content?: string;
1907 controls?: boolean;
1908 coords?: string;
1909 crossOrigin?: string;
1910 data?: string;
1911 dateTime?: string;
1912 default?: boolean;
1913 defer?: boolean;
1914 disabled?: boolean;
1915 download?: any;
1916 encType?: string;
1917 form?: string;
1918 formAction?: string;
1919 formEncType?: string;
1920 formMethod?: string;
1921 formNoValidate?: boolean;
1922 formTarget?: string;
1923 frameBorder?: number | string;
1924 headers?: string;
1925 height?: number | string;
1926 high?: number;
1927 href?: string;
1928 hrefLang?: string;
1929 htmlFor?: string;
1930 httpEquiv?: string;
1931 integrity?: string;
1932 keyParams?: string;
1933 keyType?: string;
1934 kind?: string;
1935 label?: string;
1936 list?: string;
1937 loop?: boolean;
1938 low?: number;
1939 manifest?: string;
1940 marginHeight?: number;
1941 marginWidth?: number;
1942 max?: number | string;
1943 maxLength?: number;
1944 media?: string;
1945 mediaGroup?: string;
1946 method?: string;
1947 min?: number | string;
1948 minLength?: number;
1949 multiple?: boolean;
1950 muted?: boolean;
1951 name?: string;
1952 nonce?: string;
1953 noValidate?: boolean;
1954 open?: boolean;
1955 optimum?: number;
1956 pattern?: string;
1957 placeholder?: string;
1958 playsInline?: boolean;
1959 poster?: string;
1960 preload?: string;
1961 readOnly?: boolean;
1962 rel?: string;
1963 required?: boolean;
1964 reversed?: boolean;
1965 rows?: number;
1966 rowSpan?: number;
1967 sandbox?: string;
1968 scope?: string;
1969 scoped?: boolean;
1970 scrolling?: string;
1971 seamless?: boolean;
1972 selected?: boolean;
1973 shape?: string;
1974 size?: number;
1975 sizes?: string;
1976 span?: number;
1977 src?: string;
1978 srcDoc?: string;
1979 srcLang?: string;
1980 srcSet?: string;
1981 start?: number;
1982 step?: number | string;
1983 summary?: string;
1984 target?: string;
1985 type?: string;
1986 useMap?: string;
1987 value?: string | ReadonlyArray<string> | number;
1988 width?: number | string;
1989 wmode?: string;
1990 wrap?: string;
1991 }
1992
1993 type HTMLAttributeReferrerPolicy =
1994 | ''
1995 | 'no-referrer'
1996 | 'no-referrer-when-downgrade'
1997 | 'origin'
1998 | 'origin-when-cross-origin'
1999 | 'same-origin'
2000 | 'strict-origin'
2001 | 'strict-origin-when-cross-origin'
2002 | 'unsafe-url';
2003
2004 interface AnchorHTMLAttributes<T> extends HTMLAttributes<T> {
2005 download?: any;
2006 href?: string;
2007 hrefLang?: string;
2008 media?: string;
2009 ping?: string;
2010 rel?: string;
2011 target?: string;
2012 type?: string;
2013 referrerPolicy?: HTMLAttributeReferrerPolicy;
2014 }
2015
2016 interface AudioHTMLAttributes<T> extends MediaHTMLAttributes<T> {}
2017
2018 interface AreaHTMLAttributes<T> extends HTMLAttributes<T> {
2019 alt?: string;
2020 coords?: string;
2021 download?: any;
2022 href?: string;
2023 hrefLang?: string;
2024 media?: string;
2025 referrerPolicy?: HTMLAttributeReferrerPolicy;
2026 rel?: string;
2027 shape?: string;
2028 target?: string;
2029 }
2030
2031 interface BaseHTMLAttributes<T> extends HTMLAttributes<T> {
2032 href?: string;
2033 target?: string;
2034 }
2035
2036 interface BlockquoteHTMLAttributes<T> extends HTMLAttributes<T> {
2037 cite?: string;
2038 }
2039
2040 interface ButtonHTMLAttributes<T> extends HTMLAttributes<T> {
2041 autoFocus?: boolean;
2042 disabled?: boolean;
2043 form?: string;
2044 formAction?: string;
2045 formEncType?: string;
2046 formMethod?: string;
2047 formNoValidate?: boolean;
2048 formTarget?: string;
2049 name?: string;
2050 type?: 'submit' | 'reset' | 'button';
2051 value?: string | ReadonlyArray<string> | number;
2052 }
2053
2054 interface CanvasHTMLAttributes<T> extends HTMLAttributes<T> {
2055 height?: number | string;
2056 width?: number | string;
2057 }
2058
2059 interface ColHTMLAttributes<T> extends HTMLAttributes<T> {
2060 span?: number;
2061 width?: number | string;
2062 }
2063
2064 interface ColgroupHTMLAttributes<T> extends HTMLAttributes<T> {
2065 span?: number;
2066 }
2067
2068 interface DataHTMLAttributes<T> extends HTMLAttributes<T> {
2069 value?: string | ReadonlyArray<string> | number;
2070 }
2071
2072 interface DetailsHTMLAttributes<T> extends HTMLAttributes<T> {
2073 open?: boolean;
2074 onToggle?: ReactEventHandler<T>;
2075 }
2076
2077 interface DelHTMLAttributes<T> extends HTMLAttributes<T> {
2078 cite?: string;
2079 dateTime?: string;
2080 }
2081
2082 interface DialogHTMLAttributes<T> extends HTMLAttributes<T> {
2083 open?: boolean;
2084 }
2085
2086 interface EmbedHTMLAttributes<T> extends HTMLAttributes<T> {
2087 height?: number | string;
2088 src?: string;
2089 type?: string;
2090 width?: number | string;
2091 }
2092
2093 interface FieldsetHTMLAttributes<T> extends HTMLAttributes<T> {
2094 disabled?: boolean;
2095 form?: string;
2096 name?: string;
2097 }
2098
2099 interface FormHTMLAttributes<T> extends HTMLAttributes<T> {
2100 acceptCharset?: string;
2101 action?: string;
2102 autoComplete?: string;
2103 encType?: string;
2104 method?: string;
2105 name?: string;
2106 noValidate?: boolean;
2107 target?: string;
2108 }
2109
2110 interface HtmlHTMLAttributes<T> extends HTMLAttributes<T> {
2111 manifest?: string;
2112 }
2113
2114 interface IframeHTMLAttributes<T> extends HTMLAttributes<T> {
2115 allow?: string;
2116 allowFullScreen?: boolean;
2117 allowTransparency?: boolean;
2118 /** @deprecated */
2119 frameBorder?: number | string;
2120 height?: number | string;
2121 loading?: "eager" | "lazy";
2122 /** @deprecated */
2123 marginHeight?: number;
2124 /** @deprecated */
2125 marginWidth?: number;
2126 name?: string;
2127 referrerPolicy?: HTMLAttributeReferrerPolicy;
2128 sandbox?: string;
2129 /** @deprecated */
2130 scrolling?: string;
2131 seamless?: boolean;
2132 src?: string;
2133 srcDoc?: string;
2134 width?: number | string;
2135 }
2136
2137 interface ImgHTMLAttributes<T> extends HTMLAttributes<T> {
2138 alt?: string;
2139 crossOrigin?: "anonymous" | "use-credentials" | "";
2140 decoding?: "async" | "auto" | "sync";
2141 height?: number | string;
2142 loading?: "eager" | "lazy";
2143 referrerPolicy?: HTMLAttributeReferrerPolicy;
2144 sizes?: string;
2145 src?: string;
2146 srcSet?: string;
2147 useMap?: string;
2148 width?: number | string;
2149 }
2150
2151 interface InsHTMLAttributes<T> extends HTMLAttributes<T> {
2152 cite?: string;
2153 dateTime?: string;
2154 }
2155
2156 interface InputHTMLAttributes<T> extends HTMLAttributes<T> {
2157 accept?: string;
2158 alt?: string;
2159 autoComplete?: string;
2160 autoFocus?: boolean;
2161 capture?: boolean | string; // https://www.w3.org/TR/html-media-capture/#the-capture-attribute
2162 checked?: boolean;
2163 crossOrigin?: string;
2164 disabled?: boolean;
2165 enterKeyHint?: 'enter' | 'done' | 'go' | 'next' | 'previous' | 'search' | 'send';
2166 form?: string;
2167 formAction?: string;
2168 formEncType?: string;
2169 formMethod?: string;
2170 formNoValidate?: boolean;
2171 formTarget?: string;
2172 height?: number | string;
2173 list?: string;
2174 max?: number | string;
2175 maxLength?: number;
2176 min?: number | string;
2177 minLength?: number;
2178 multiple?: boolean;
2179 name?: string;
2180 pattern?: string;
2181 placeholder?: string;
2182 readOnly?: boolean;
2183 required?: boolean;
2184 size?: number;
2185 src?: string;
2186 step?: number | string;
2187 type?: string;
2188 value?: string | ReadonlyArray<string> | number;
2189 width?: number | string;
2190
2191 onChange?: ChangeEventHandler<T>;
2192 }
2193
2194 interface KeygenHTMLAttributes<T> extends HTMLAttributes<T> {
2195 autoFocus?: boolean;
2196 challenge?: string;
2197 disabled?: boolean;
2198 form?: string;
2199 keyType?: string;
2200 keyParams?: string;
2201 name?: string;
2202 }
2203
2204 interface LabelHTMLAttributes<T> extends HTMLAttributes<T> {
2205 form?: string;
2206 htmlFor?: string;
2207 }
2208
2209 interface LiHTMLAttributes<T> extends HTMLAttributes<T> {
2210 value?: string | ReadonlyArray<string> | number;
2211 }
2212
2213 interface LinkHTMLAttributes<T> extends HTMLAttributes<T> {
2214 as?: string;
2215 crossOrigin?: string;
2216 href?: string;
2217 hrefLang?: string;
2218 integrity?: string;
2219 media?: string;
2220 referrerPolicy?: HTMLAttributeReferrerPolicy;
2221 rel?: string;
2222 sizes?: string;
2223 type?: string;
2224 charSet?: string;
2225 }
2226
2227 interface MapHTMLAttributes<T> extends HTMLAttributes<T> {
2228 name?: string;
2229 }
2230
2231 interface MenuHTMLAttributes<T> extends HTMLAttributes<T> {
2232 type?: string;
2233 }
2234
2235 interface MediaHTMLAttributes<T> extends HTMLAttributes<T> {
2236 autoPlay?: boolean;
2237 controls?: boolean;
2238 controlsList?: string;
2239 crossOrigin?: string;
2240 loop?: boolean;
2241 mediaGroup?: string;
2242 muted?: boolean;
2243 playsInline?: boolean;
2244 preload?: string;
2245 src?: string;
2246 }
2247
2248 interface MetaHTMLAttributes<T> extends HTMLAttributes<T> {
2249 charSet?: string;
2250 content?: string;
2251 httpEquiv?: string;
2252 name?: string;
2253 }
2254
2255 interface MeterHTMLAttributes<T> extends HTMLAttributes<T> {
2256 form?: string;
2257 high?: number;
2258 low?: number;
2259 max?: number | string;
2260 min?: number | string;
2261 optimum?: number;
2262 value?: string | ReadonlyArray<string> | number;
2263 }
2264
2265 interface QuoteHTMLAttributes<T> extends HTMLAttributes<T> {
2266 cite?: string;
2267 }
2268
2269 interface ObjectHTMLAttributes<T> extends HTMLAttributes<T> {
2270 classID?: string;
2271 data?: string;
2272 form?: string;
2273 height?: number | string;
2274 name?: string;
2275 type?: string;
2276 useMap?: string;
2277 width?: number | string;
2278 wmode?: string;
2279 }
2280
2281 interface OlHTMLAttributes<T> extends HTMLAttributes<T> {
2282 reversed?: boolean;
2283 start?: number;
2284 type?: '1' | 'a' | 'A' | 'i' | 'I';
2285 }
2286
2287 interface OptgroupHTMLAttributes<T> extends HTMLAttributes<T> {
2288 disabled?: boolean;
2289 label?: string;
2290 }
2291
2292 interface OptionHTMLAttributes<T> extends HTMLAttributes<T> {
2293 disabled?: boolean;
2294 label?: string;
2295 selected?: boolean;
2296 value?: string | ReadonlyArray<string> | number;
2297 }
2298
2299 interface OutputHTMLAttributes<T> extends HTMLAttributes<T> {
2300 form?: string;
2301 htmlFor?: string;
2302 name?: string;
2303 }
2304
2305 interface ParamHTMLAttributes<T> extends HTMLAttributes<T> {
2306 name?: string;
2307 value?: string | ReadonlyArray<string> | number;
2308 }
2309
2310 interface ProgressHTMLAttributes<T> extends HTMLAttributes<T> {
2311 max?: number | string;
2312 value?: string | ReadonlyArray<string> | number;
2313 }
2314
2315 interface SlotHTMLAttributes<T> extends HTMLAttributes<T> {
2316 name?: string;
2317 }
2318
2319 interface ScriptHTMLAttributes<T> extends HTMLAttributes<T> {
2320 async?: boolean;
2321 /** @deprecated */
2322 charSet?: string;
2323 crossOrigin?: string;
2324 defer?: boolean;
2325 integrity?: string;
2326 noModule?: boolean;
2327 nonce?: string;
2328 referrerPolicy?: HTMLAttributeReferrerPolicy;
2329 src?: string;
2330 type?: string;
2331 }
2332
2333 interface SelectHTMLAttributes<T> extends HTMLAttributes<T> {
2334 autoComplete?: string;
2335 autoFocus?: boolean;
2336 disabled?: boolean;
2337 form?: string;
2338 multiple?: boolean;
2339 name?: string;
2340 required?: boolean;
2341 size?: number;
2342 value?: string | ReadonlyArray<string> | number;
2343 onChange?: ChangeEventHandler<T>;
2344 }
2345
2346 interface SourceHTMLAttributes<T> extends HTMLAttributes<T> {
2347 media?: string;
2348 sizes?: string;
2349 src?: string;
2350 srcSet?: string;
2351 type?: string;
2352 }
2353
2354 interface StyleHTMLAttributes<T> extends HTMLAttributes<T> {
2355 media?: string;
2356 nonce?: string;
2357 scoped?: boolean;
2358 type?: string;
2359 }
2360
2361 interface TableHTMLAttributes<T> extends HTMLAttributes<T> {
2362 cellPadding?: number | string;
2363 cellSpacing?: number | string;
2364 summary?: string;
2365 width?: number | string;
2366 }
2367
2368 interface TextareaHTMLAttributes<T> extends HTMLAttributes<T> {
2369 autoComplete?: string;
2370 autoFocus?: boolean;
2371 cols?: number;
2372 dirName?: string;
2373 disabled?: boolean;
2374 form?: string;
2375 maxLength?: number;
2376 minLength?: number;
2377 name?: string;
2378 placeholder?: string;
2379 readOnly?: boolean;
2380 required?: boolean;
2381 rows?: number;
2382 value?: string | ReadonlyArray<string> | number;
2383 wrap?: string;
2384
2385 onChange?: ChangeEventHandler<T>;
2386 }
2387
2388 interface TdHTMLAttributes<T> extends HTMLAttributes<T> {
2389 align?: "left" | "center" | "right" | "justify" | "char";
2390 colSpan?: number;
2391 headers?: string;
2392 rowSpan?: number;
2393 scope?: string;
2394 abbr?: string;
2395 height?: number | string;
2396 width?: number | string;
2397 valign?: "top" | "middle" | "bottom" | "baseline";
2398 }
2399
2400 interface ThHTMLAttributes<T> extends HTMLAttributes<T> {
2401 align?: "left" | "center" | "right" | "justify" | "char";
2402 colSpan?: number;
2403 headers?: string;
2404 rowSpan?: number;
2405 scope?: string;
2406 abbr?: string;
2407 }
2408
2409 interface TimeHTMLAttributes<T> extends HTMLAttributes<T> {
2410 dateTime?: string;
2411 }
2412
2413 interface TrackHTMLAttributes<T> extends HTMLAttributes<T> {
2414 default?: boolean;
2415 kind?: string;
2416 label?: string;
2417 src?: string;
2418 srcLang?: string;
2419 }
2420
2421 interface VideoHTMLAttributes<T> extends MediaHTMLAttributes<T> {
2422 height?: number | string;
2423 playsInline?: boolean;
2424 poster?: string;
2425 width?: number | string;
2426 disablePictureInPicture?: boolean;
2427 disableRemotePlayback?: boolean;
2428 }
2429
2430 // this list is "complete" in that it contains every SVG attribute
2431 // that React supports, but the types can be improved.
2432 // Full list here: https://facebook.github.io/react/docs/dom-elements.html
2433 //
2434 // The three broad type categories are (in order of restrictiveness):
2435 // - "number | string"
2436 // - "string"
2437 // - union of string literals
2438 interface SVGAttributes<T> extends AriaAttributes, DOMAttributes<T> {
2439 // Attributes which also defined in HTMLAttributes
2440 // See comment in SVGDOMPropertyConfig.js
2441 className?: string;
2442 color?: string;
2443 height?: number | string;
2444 id?: string;
2445 lang?: string;
2446 max?: number | string;
2447 media?: string;
2448 method?: string;
2449 min?: number | string;
2450 name?: string;
2451 style?: CSSProperties;
2452 target?: string;
2453 type?: string;
2454 width?: number | string;
2455
2456 // Other HTML properties supported by SVG elements in browsers
2457 role?: AriaRole;
2458 tabIndex?: number;
2459 crossOrigin?: "anonymous" | "use-credentials" | "";
2460
2461 // SVG Specific attributes
2462 accentHeight?: number | string;
2463 accumulate?: "none" | "sum";
2464 additive?: "replace" | "sum";
2465 alignmentBaseline?: "auto" | "baseline" | "before-edge" | "text-before-edge" | "middle" | "central" | "after-edge" |
2466 "text-after-edge" | "ideographic" | "alphabetic" | "hanging" | "mathematical" | "inherit";
2467 allowReorder?: "no" | "yes";
2468 alphabetic?: number | string;
2469 amplitude?: number | string;
2470 arabicForm?: "initial" | "medial" | "terminal" | "isolated";
2471 ascent?: number | string;
2472 attributeName?: string;
2473 attributeType?: string;
2474 autoReverse?: Booleanish;
2475 azimuth?: number | string;
2476 baseFrequency?: number | string;
2477 baselineShift?: number | string;
2478 baseProfile?: number | string;
2479 bbox?: number | string;
2480 begin?: number | string;
2481 bias?: number | string;
2482 by?: number | string;
2483 calcMode?: number | string;
2484 capHeight?: number | string;
2485 clip?: number | string;
2486 clipPath?: string;
2487 clipPathUnits?: number | string;
2488 clipRule?: number | string;
2489 colorInterpolation?: number | string;
2490 colorInterpolationFilters?: "auto" | "sRGB" | "linearRGB" | "inherit";
2491 colorProfile?: number | string;
2492 colorRendering?: number | string;
2493 contentScriptType?: number | string;
2494 contentStyleType?: number | string;
2495 cursor?: number | string;
2496 cx?: number | string;
2497 cy?: number | string;
2498 d?: string;
2499 decelerate?: number | string;
2500 descent?: number | string;
2501 diffuseConstant?: number | string;
2502 direction?: number | string;
2503 display?: number | string;
2504 divisor?: number | string;
2505 dominantBaseline?: number | string;
2506 dur?: number | string;
2507 dx?: number | string;
2508 dy?: number | string;
2509 edgeMode?: number | string;
2510 elevation?: number | string;
2511 enableBackground?: number | string;
2512 end?: number | string;
2513 exponent?: number | string;
2514 externalResourcesRequired?: Booleanish;
2515 fill?: string;
2516 fillOpacity?: number | string;
2517 fillRule?: "nonzero" | "evenodd" | "inherit";
2518 filter?: string;
2519 filterRes?: number | string;
2520 filterUnits?: number | string;
2521 floodColor?: number | string;
2522 floodOpacity?: number | string;
2523 focusable?: Booleanish | "auto";
2524 fontFamily?: string;
2525 fontSize?: number | string;
2526 fontSizeAdjust?: number | string;
2527 fontStretch?: number | string;
2528 fontStyle?: number | string;
2529 fontVariant?: number | string;
2530 fontWeight?: number | string;
2531 format?: number | string;
2532 from?: number | string;
2533 fx?: number | string;
2534 fy?: number | string;
2535 g1?: number | string;
2536 g2?: number | string;
2537 glyphName?: number | string;
2538 glyphOrientationHorizontal?: number | string;
2539 glyphOrientationVertical?: number | string;
2540 glyphRef?: number | string;
2541 gradientTransform?: string;
2542 gradientUnits?: string;
2543 hanging?: number | string;
2544 horizAdvX?: number | string;
2545 horizOriginX?: number | string;
2546 href?: string;
2547 ideographic?: number | string;
2548 imageRendering?: number | string;
2549 in2?: number | string;
2550 in?: string;
2551 intercept?: number | string;
2552 k1?: number | string;
2553 k2?: number | string;
2554 k3?: number | string;
2555 k4?: number | string;
2556 k?: number | string;
2557 kernelMatrix?: number | string;
2558 kernelUnitLength?: number | string;
2559 kerning?: number | string;
2560 keyPoints?: number | string;
2561 keySplines?: number | string;
2562 keyTimes?: number | string;
2563 lengthAdjust?: number | string;
2564 letterSpacing?: number | string;
2565 lightingColor?: number | string;
2566 limitingConeAngle?: number | string;
2567 local?: number | string;
2568 markerEnd?: string;
2569 markerHeight?: number | string;
2570 markerMid?: string;
2571 markerStart?: string;
2572 markerUnits?: number | string;
2573 markerWidth?: number | string;
2574 mask?: string;
2575 maskContentUnits?: number | string;
2576 maskUnits?: number | string;
2577 mathematical?: number | string;
2578 mode?: number | string;
2579 numOctaves?: number | string;
2580 offset?: number | string;
2581 opacity?: number | string;
2582 operator?: number | string;
2583 order?: number | string;
2584 orient?: number | string;
2585 orientation?: number | string;
2586 origin?: number | string;
2587 overflow?: number | string;
2588 overlinePosition?: number | string;
2589 overlineThickness?: number | string;
2590 paintOrder?: number | string;
2591 panose1?: number | string;
2592 path?: string;
2593 pathLength?: number | string;
2594 patternContentUnits?: string;
2595 patternTransform?: number | string;
2596 patternUnits?: string;
2597 pointerEvents?: number | string;
2598 points?: string;
2599 pointsAtX?: number | string;
2600 pointsAtY?: number | string;
2601 pointsAtZ?: number | string;
2602 preserveAlpha?: Booleanish;
2603 preserveAspectRatio?: string;
2604 primitiveUnits?: number | string;
2605 r?: number | string;
2606 radius?: number | string;
2607 refX?: number | string;
2608 refY?: number | string;
2609 renderingIntent?: number | string;
2610 repeatCount?: number | string;
2611 repeatDur?: number | string;
2612 requiredExtensions?: number | string;
2613 requiredFeatures?: number | string;
2614 restart?: number | string;
2615 result?: string;
2616 rotate?: number | string;
2617 rx?: number | string;
2618 ry?: number | string;
2619 scale?: number | string;
2620 seed?: number | string;
2621 shapeRendering?: number | string;
2622 slope?: number | string;
2623 spacing?: number | string;
2624 specularConstant?: number | string;
2625 specularExponent?: number | string;
2626 speed?: number | string;
2627 spreadMethod?: string;
2628 startOffset?: number | string;
2629 stdDeviation?: number | string;
2630 stemh?: number | string;
2631 stemv?: number | string;
2632 stitchTiles?: number | string;
2633 stopColor?: string;
2634 stopOpacity?: number | string;
2635 strikethroughPosition?: number | string;
2636 strikethroughThickness?: number | string;
2637 string?: number | string;
2638 stroke?: string;
2639 strokeDasharray?: string | number;
2640 strokeDashoffset?: string | number;
2641 strokeLinecap?: "butt" | "round" | "square" | "inherit";
2642 strokeLinejoin?: "miter" | "round" | "bevel" | "inherit";
2643 strokeMiterlimit?: number | string;
2644 strokeOpacity?: number | string;
2645 strokeWidth?: number | string;
2646 surfaceScale?: number | string;
2647 systemLanguage?: number | string;
2648 tableValues?: number | string;
2649 targetX?: number | string;
2650 targetY?: number | string;
2651 textAnchor?: string;
2652 textDecoration?: number | string;
2653 textLength?: number | string;
2654 textRendering?: number | string;
2655 to?: number | string;
2656 transform?: string;
2657 u1?: number | string;
2658 u2?: number | string;
2659 underlinePosition?: number | string;
2660 underlineThickness?: number | string;
2661 unicode?: number | string;
2662 unicodeBidi?: number | string;
2663 unicodeRange?: number | string;
2664 unitsPerEm?: number | string;
2665 vAlphabetic?: number | string;
2666 values?: string;
2667 vectorEffect?: number | string;
2668 version?: string;
2669 vertAdvY?: number | string;
2670 vertOriginX?: number | string;
2671 vertOriginY?: number | string;
2672 vHanging?: number | string;
2673 vIdeographic?: number | string;
2674 viewBox?: string;
2675 viewTarget?: number | string;
2676 visibility?: number | string;
2677 vMathematical?: number | string;
2678 widths?: number | string;
2679 wordSpacing?: number | string;
2680 writingMode?: number | string;
2681 x1?: number | string;
2682 x2?: number | string;
2683 x?: number | string;
2684 xChannelSelector?: string;
2685 xHeight?: number | string;
2686 xlinkActuate?: string;
2687 xlinkArcrole?: string;
2688 xlinkHref?: string;
2689 xlinkRole?: string;
2690 xlinkShow?: string;
2691 xlinkTitle?: string;
2692 xlinkType?: string;
2693 xmlBase?: string;
2694 xmlLang?: string;
2695 xmlns?: string;
2696 xmlnsXlink?: string;
2697 xmlSpace?: string;
2698 y1?: number | string;
2699 y2?: number | string;
2700 y?: number | string;
2701 yChannelSelector?: string;
2702 z?: number | string;
2703 zoomAndPan?: string;
2704 }
2705
2706 interface WebViewHTMLAttributes<T> extends HTMLAttributes<T> {
2707 allowFullScreen?: boolean;
2708 allowpopups?: boolean;
2709 autoFocus?: boolean;
2710 autosize?: boolean;
2711 blinkfeatures?: string;
2712 disableblinkfeatures?: string;
2713 disableguestresize?: boolean;
2714 disablewebsecurity?: boolean;
2715 guestinstance?: string;
2716 httpreferrer?: string;
2717 nodeintegration?: boolean;
2718 partition?: string;
2719 plugins?: boolean;
2720 preload?: string;
2721 src?: string;
2722 useragent?: string;
2723 webpreferences?: string;
2724 }
2725
2726 //
2727 // React.DOM
2728 // ----------------------------------------------------------------------
2729
2730 interface ReactHTML {
2731 a: DetailedHTMLFactory<AnchorHTMLAttributes<HTMLAnchorElement>, HTMLAnchorElement>;
2732 abbr: DetailedHTMLFactory<HTMLAttributes<HTMLElement>, HTMLElement>;
2733 address: DetailedHTMLFactory<HTMLAttributes<HTMLElement>, HTMLElement>;
2734 area: DetailedHTMLFactory<AreaHTMLAttributes<HTMLAreaElement>, HTMLAreaElement>;
2735 article: DetailedHTMLFactory<HTMLAttributes<HTMLElement>, HTMLElement>;
2736 aside: DetailedHTMLFactory<HTMLAttributes<HTMLElement>, HTMLElement>;
2737 audio: DetailedHTMLFactory<AudioHTMLAttributes<HTMLAudioElement>, HTMLAudioElement>;
2738 b: DetailedHTMLFactory<HTMLAttributes<HTMLElement>, HTMLElement>;
2739 base: DetailedHTMLFactory<BaseHTMLAttributes<HTMLBaseElement>, HTMLBaseElement>;
2740 bdi: DetailedHTMLFactory<HTMLAttributes<HTMLElement>, HTMLElement>;
2741 bdo: DetailedHTMLFactory<HTMLAttributes<HTMLElement>, HTMLElement>;
2742 big: DetailedHTMLFactory<HTMLAttributes<HTMLElement>, HTMLElement>;
2743 blockquote: DetailedHTMLFactory<BlockquoteHTMLAttributes<HTMLElement>, HTMLElement>;
2744 body: DetailedHTMLFactory<HTMLAttributes<HTMLBodyElement>, HTMLBodyElement>;
2745 br: DetailedHTMLFactory<HTMLAttributes<HTMLBRElement>, HTMLBRElement>;
2746 button: DetailedHTMLFactory<ButtonHTMLAttributes<HTMLButtonElement>, HTMLButtonElement>;
2747 canvas: DetailedHTMLFactory<CanvasHTMLAttributes<HTMLCanvasElement>, HTMLCanvasElement>;
2748 caption: DetailedHTMLFactory<HTMLAttributes<HTMLElement>, HTMLElement>;
2749 cite: DetailedHTMLFactory<HTMLAttributes<HTMLElement>, HTMLElement>;
2750 code: DetailedHTMLFactory<HTMLAttributes<HTMLElement>, HTMLElement>;
2751 col: DetailedHTMLFactory<ColHTMLAttributes<HTMLTableColElement>, HTMLTableColElement>;
2752 colgroup: DetailedHTMLFactory<ColgroupHTMLAttributes<HTMLTableColElement>, HTMLTableColElement>;
2753 data: DetailedHTMLFactory<DataHTMLAttributes<HTMLDataElement>, HTMLDataElement>;
2754 datalist: DetailedHTMLFactory<HTMLAttributes<HTMLDataListElement>, HTMLDataListElement>;
2755 dd: DetailedHTMLFactory<HTMLAttributes<HTMLElement>, HTMLElement>;
2756 del: DetailedHTMLFactory<DelHTMLAttributes<HTMLElement>, HTMLElement>;
2757 details: DetailedHTMLFactory<DetailsHTMLAttributes<HTMLElement>, HTMLElement>;
2758 dfn: DetailedHTMLFactory<HTMLAttributes<HTMLElement>, HTMLElement>;
2759 dialog: DetailedHTMLFactory<DialogHTMLAttributes<HTMLDialogElement>, HTMLDialogElement>;
2760 div: DetailedHTMLFactory<HTMLAttributes<HTMLDivElement>, HTMLDivElement>;
2761 dl: DetailedHTMLFactory<HTMLAttributes<HTMLDListElement>, HTMLDListElement>;
2762 dt: DetailedHTMLFactory<HTMLAttributes<HTMLElement>, HTMLElement>;
2763 em: DetailedHTMLFactory<HTMLAttributes<HTMLElement>, HTMLElement>;
2764 embed: DetailedHTMLFactory<EmbedHTMLAttributes<HTMLEmbedElement>, HTMLEmbedElement>;
2765 fieldset: DetailedHTMLFactory<FieldsetHTMLAttributes<HTMLFieldSetElement>, HTMLFieldSetElement>;
2766 figcaption: DetailedHTMLFactory<HTMLAttributes<HTMLElement>, HTMLElement>;
2767 figure: DetailedHTMLFactory<HTMLAttributes<HTMLElement>, HTMLElement>;
2768 footer: DetailedHTMLFactory<HTMLAttributes<HTMLElement>, HTMLElement>;
2769 form: DetailedHTMLFactory<FormHTMLAttributes<HTMLFormElement>, HTMLFormElement>;
2770 h1: DetailedHTMLFactory<HTMLAttributes<HTMLHeadingElement>, HTMLHeadingElement>;
2771 h2: DetailedHTMLFactory<HTMLAttributes<HTMLHeadingElement>, HTMLHeadingElement>;
2772 h3: DetailedHTMLFactory<HTMLAttributes<HTMLHeadingElement>, HTMLHeadingElement>;
2773 h4: DetailedHTMLFactory<HTMLAttributes<HTMLHeadingElement>, HTMLHeadingElement>;
2774 h5: DetailedHTMLFactory<HTMLAttributes<HTMLHeadingElement>, HTMLHeadingElement>;
2775 h6: DetailedHTMLFactory<HTMLAttributes<HTMLHeadingElement>, HTMLHeadingElement>;
2776 head: DetailedHTMLFactory<HTMLAttributes<HTMLElement>, HTMLHeadElement>;
2777 header: DetailedHTMLFactory<HTMLAttributes<HTMLElement>, HTMLElement>;
2778 hgroup: DetailedHTMLFactory<HTMLAttributes<HTMLElement>, HTMLElement>;
2779 hr: DetailedHTMLFactory<HTMLAttributes<HTMLHRElement>, HTMLHRElement>;
2780 html: DetailedHTMLFactory<HtmlHTMLAttributes<HTMLHtmlElement>, HTMLHtmlElement>;
2781 i: DetailedHTMLFactory<HTMLAttributes<HTMLElement>, HTMLElement>;
2782 iframe: DetailedHTMLFactory<IframeHTMLAttributes<HTMLIFrameElement>, HTMLIFrameElement>;
2783 img: DetailedHTMLFactory<ImgHTMLAttributes<HTMLImageElement>, HTMLImageElement>;
2784 input: DetailedHTMLFactory<InputHTMLAttributes<HTMLInputElement>, HTMLInputElement>;
2785 ins: DetailedHTMLFactory<InsHTMLAttributes<HTMLModElement>, HTMLModElement>;
2786 kbd: DetailedHTMLFactory<HTMLAttributes<HTMLElement>, HTMLElement>;
2787 keygen: DetailedHTMLFactory<KeygenHTMLAttributes<HTMLElement>, HTMLElement>;
2788 label: DetailedHTMLFactory<LabelHTMLAttributes<HTMLLabelElement>, HTMLLabelElement>;
2789 legend: DetailedHTMLFactory<HTMLAttributes<HTMLLegendElement>, HTMLLegendElement>;
2790 li: DetailedHTMLFactory<LiHTMLAttributes<HTMLLIElement>, HTMLLIElement>;
2791 link: DetailedHTMLFactory<LinkHTMLAttributes<HTMLLinkElement>, HTMLLinkElement>;
2792 main: DetailedHTMLFactory<HTMLAttributes<HTMLElement>, HTMLElement>;
2793 map: DetailedHTMLFactory<MapHTMLAttributes<HTMLMapElement>, HTMLMapElement>;
2794 mark: DetailedHTMLFactory<HTMLAttributes<HTMLElement>, HTMLElement>;
2795 menu: DetailedHTMLFactory<MenuHTMLAttributes<HTMLElement>, HTMLElement>;
2796 menuitem: DetailedHTMLFactory<HTMLAttributes<HTMLElement>, HTMLElement>;
2797 meta: DetailedHTMLFactory<MetaHTMLAttributes<HTMLMetaElement>, HTMLMetaElement>;
2798 meter: DetailedHTMLFactory<MeterHTMLAttributes<HTMLElement>, HTMLElement>;
2799 nav: DetailedHTMLFactory<HTMLAttributes<HTMLElement>, HTMLElement>;
2800 noscript: DetailedHTMLFactory<HTMLAttributes<HTMLElement>, HTMLElement>;
2801 object: DetailedHTMLFactory<ObjectHTMLAttributes<HTMLObjectElement>, HTMLObjectElement>;
2802 ol: DetailedHTMLFactory<OlHTMLAttributes<HTMLOListElement>, HTMLOListElement>;
2803 optgroup: DetailedHTMLFactory<OptgroupHTMLAttributes<HTMLOptGroupElement>, HTMLOptGroupElement>;
2804 option: DetailedHTMLFactory<OptionHTMLAttributes<HTMLOptionElement>, HTMLOptionElement>;
2805 output: DetailedHTMLFactory<OutputHTMLAttributes<HTMLElement>, HTMLElement>;
2806 p: DetailedHTMLFactory<HTMLAttributes<HTMLParagraphElement>, HTMLParagraphElement>;
2807 param: DetailedHTMLFactory<ParamHTMLAttributes<HTMLParamElement>, HTMLParamElement>;
2808 picture: DetailedHTMLFactory<HTMLAttributes<HTMLElement>, HTMLElement>;
2809 pre: DetailedHTMLFactory<HTMLAttributes<HTMLPreElement>, HTMLPreElement>;
2810 progress: DetailedHTMLFactory<ProgressHTMLAttributes<HTMLProgressElement>, HTMLProgressElement>;
2811 q: DetailedHTMLFactory<QuoteHTMLAttributes<HTMLQuoteElement>, HTMLQuoteElement>;
2812 rp: DetailedHTMLFactory<HTMLAttributes<HTMLElement>, HTMLElement>;
2813 rt: DetailedHTMLFactory<HTMLAttributes<HTMLElement>, HTMLElement>;
2814 ruby: DetailedHTMLFactory<HTMLAttributes<HTMLElement>, HTMLElement>;
2815 s: DetailedHTMLFactory<HTMLAttributes<HTMLElement>, HTMLElement>;
2816 samp: DetailedHTMLFactory<HTMLAttributes<HTMLElement>, HTMLElement>;
2817 slot: DetailedHTMLFactory<SlotHTMLAttributes<HTMLSlotElement>, HTMLSlotElement>;
2818 script: DetailedHTMLFactory<ScriptHTMLAttributes<HTMLScriptElement>, HTMLScriptElement>;
2819 section: DetailedHTMLFactory<HTMLAttributes<HTMLElement>, HTMLElement>;
2820 select: DetailedHTMLFactory<SelectHTMLAttributes<HTMLSelectElement>, HTMLSelectElement>;
2821 small: DetailedHTMLFactory<HTMLAttributes<HTMLElement>, HTMLElement>;
2822 source: DetailedHTMLFactory<SourceHTMLAttributes<HTMLSourceElement>, HTMLSourceElement>;
2823 span: DetailedHTMLFactory<HTMLAttributes<HTMLSpanElement>, HTMLSpanElement>;
2824 strong: DetailedHTMLFactory<HTMLAttributes<HTMLElement>, HTMLElement>;
2825 style: DetailedHTMLFactory<StyleHTMLAttributes<HTMLStyleElement>, HTMLStyleElement>;
2826 sub: DetailedHTMLFactory<HTMLAttributes<HTMLElement>, HTMLElement>;
2827 summary: DetailedHTMLFactory<HTMLAttributes<HTMLElement>, HTMLElement>;
2828 sup: DetailedHTMLFactory<HTMLAttributes<HTMLElement>, HTMLElement>;
2829 table: DetailedHTMLFactory<TableHTMLAttributes<HTMLTableElement>, HTMLTableElement>;
2830 template: DetailedHTMLFactory<HTMLAttributes<HTMLTemplateElement>, HTMLTemplateElement>;
2831 tbody: DetailedHTMLFactory<HTMLAttributes<HTMLTableSectionElement>, HTMLTableSectionElement>;
2832 td: DetailedHTMLFactory<TdHTMLAttributes<HTMLTableDataCellElement>, HTMLTableDataCellElement>;
2833 textarea: DetailedHTMLFactory<TextareaHTMLAttributes<HTMLTextAreaElement>, HTMLTextAreaElement>;
2834 tfoot: DetailedHTMLFactory<HTMLAttributes<HTMLTableSectionElement>, HTMLTableSectionElement>;
2835 th: DetailedHTMLFactory<ThHTMLAttributes<HTMLTableHeaderCellElement>, HTMLTableHeaderCellElement>;
2836 thead: DetailedHTMLFactory<HTMLAttributes<HTMLTableSectionElement>, HTMLTableSectionElement>;
2837 time: DetailedHTMLFactory<TimeHTMLAttributes<HTMLElement>, HTMLElement>;
2838 title: DetailedHTMLFactory<HTMLAttributes<HTMLTitleElement>, HTMLTitleElement>;
2839 tr: DetailedHTMLFactory<HTMLAttributes<HTMLTableRowElement>, HTMLTableRowElement>;
2840 track: DetailedHTMLFactory<TrackHTMLAttributes<HTMLTrackElement>, HTMLTrackElement>;
2841 u: DetailedHTMLFactory<HTMLAttributes<HTMLElement>, HTMLElement>;
2842 ul: DetailedHTMLFactory<HTMLAttributes<HTMLUListElement>, HTMLUListElement>;
2843 "var": DetailedHTMLFactory<HTMLAttributes<HTMLElement>, HTMLElement>;
2844 video: DetailedHTMLFactory<VideoHTMLAttributes<HTMLVideoElement>, HTMLVideoElement>;
2845 wbr: DetailedHTMLFactory<HTMLAttributes<HTMLElement>, HTMLElement>;
2846 webview: DetailedHTMLFactory<WebViewHTMLAttributes<HTMLWebViewElement>, HTMLWebViewElement>;
2847 }
2848
2849 interface ReactSVG {
2850 animate: SVGFactory;
2851 circle: SVGFactory;
2852 clipPath: SVGFactory;
2853 defs: SVGFactory;
2854 desc: SVGFactory;
2855 ellipse: SVGFactory;
2856 feBlend: SVGFactory;
2857 feColorMatrix: SVGFactory;
2858 feComponentTransfer: SVGFactory;
2859 feComposite: SVGFactory;
2860 feConvolveMatrix: SVGFactory;
2861 feDiffuseLighting: SVGFactory;
2862 feDisplacementMap: SVGFactory;
2863 feDistantLight: SVGFactory;
2864 feDropShadow: SVGFactory;
2865 feFlood: SVGFactory;
2866 feFuncA: SVGFactory;
2867 feFuncB: SVGFactory;
2868 feFuncG: SVGFactory;
2869 feFuncR: SVGFactory;
2870 feGaussianBlur: SVGFactory;
2871 feImage: SVGFactory;
2872 feMerge: SVGFactory;
2873 feMergeNode: SVGFactory;
2874 feMorphology: SVGFactory;
2875 feOffset: SVGFactory;
2876 fePointLight: SVGFactory;
2877 feSpecularLighting: SVGFactory;
2878 feSpotLight: SVGFactory;
2879 feTile: SVGFactory;
2880 feTurbulence: SVGFactory;
2881 filter: SVGFactory;
2882 foreignObject: SVGFactory;
2883 g: SVGFactory;
2884 image: SVGFactory;
2885 line: SVGFactory;
2886 linearGradient: SVGFactory;
2887 marker: SVGFactory;
2888 mask: SVGFactory;
2889 metadata: SVGFactory;
2890 path: SVGFactory;
2891 pattern: SVGFactory;
2892 polygon: SVGFactory;
2893 polyline: SVGFactory;
2894 radialGradient: SVGFactory;
2895 rect: SVGFactory;
2896 stop: SVGFactory;
2897 svg: SVGFactory;
2898 switch: SVGFactory;
2899 symbol: SVGFactory;
2900 text: SVGFactory;
2901 textPath: SVGFactory;
2902 tspan: SVGFactory;
2903 use: SVGFactory;
2904 view: SVGFactory;
2905 }
2906
2907 interface ReactDOM extends ReactHTML, ReactSVG { }
2908
2909 //
2910 // React.PropTypes
2911 // ----------------------------------------------------------------------
2912
2913 type Validator<T> = PropTypes.Validator<T>;
2914
2915 type Requireable<T> = PropTypes.Requireable<T>;
2916
2917 type ValidationMap<T> = PropTypes.ValidationMap<T>;
2918
2919 type WeakValidationMap<T> = {
2920 [K in keyof T]?: null extends T[K]
2921 ? Validator<T[K] | null | undefined>
2922 : undefined extends T[K]
2923 ? Validator<T[K] | null | undefined>
2924 : Validator<T[K]>
2925 };
2926
2927 interface ReactPropTypes {
2928 any: typeof PropTypes.any;
2929 array: typeof PropTypes.array;
2930 bool: typeof PropTypes.bool;
2931 func: typeof PropTypes.func;
2932 number: typeof PropTypes.number;
2933 object: typeof PropTypes.object;
2934 string: typeof PropTypes.string;
2935 node: typeof PropTypes.node;
2936 element: typeof PropTypes.element;
2937 instanceOf: typeof PropTypes.instanceOf;
2938 oneOf: typeof PropTypes.oneOf;
2939 oneOfType: typeof PropTypes.oneOfType;
2940 arrayOf: typeof PropTypes.arrayOf;
2941 objectOf: typeof PropTypes.objectOf;
2942 shape: typeof PropTypes.shape;
2943 exact: typeof PropTypes.exact;
2944 }
2945
2946 //
2947 // React.Children
2948 // ----------------------------------------------------------------------
2949
2950 interface ReactChildren {
2951 map<T, C>(children: C | C[], fn: (child: C, index: number) => T):
2952 C extends null | undefined ? C : Array<Exclude<T, boolean | null | undefined>>;
2953 forEach<C>(children: C | C[], fn: (child: C, index: number) => void): void;
2954 count(children: any): number;
2955 only<C>(children: C): C extends any[] ? never : C;
2956 toArray(children: ReactNode | ReactNode[]): Array<Exclude<ReactNode, boolean | null | undefined>>;
2957 }
2958
2959 //
2960 // Browser Interfaces
2961 // https://github.com/nikeee/2048-typescript/blob/master/2048/js/touch.d.ts
2962 // ----------------------------------------------------------------------
2963
2964 interface AbstractView {
2965 styleMedia: StyleMedia;
2966 document: Document;
2967 }
2968
2969 interface Touch {
2970 identifier: number;
2971 target: EventTarget;
2972 screenX: number;
2973 screenY: number;
2974 clientX: number;
2975 clientY: number;
2976 pageX: number;
2977 pageY: number;
2978 }
2979
2980 interface TouchList {
2981 [index: number]: Touch;
2982 length: number;
2983 item(index: number): Touch;
2984 identifiedTouch(identifier: number): Touch;
2985 }
2986
2987 //
2988 // Error Interfaces
2989 // ----------------------------------------------------------------------
2990 interface ErrorInfo {
2991 /**
2992 * Captures which component contained the exception, and its ancestors.
2993 */
2994 componentStack: string;
2995 }
2996}
2997
2998// naked 'any' type in a conditional type will short circuit and union both the then/else branches
2999// so boolean is only resolved for T = any
3000type IsExactlyAny<T> = boolean extends (T extends never ? true : false) ? true : false;
3001
3002type ExactlyAnyPropertyKeys<T> = { [K in keyof T]: IsExactlyAny<T[K]> extends true ? K : never }[keyof T];
3003type NotExactlyAnyPropertyKeys<T> = Exclude<keyof T, ExactlyAnyPropertyKeys<T>>;
3004
3005// Try to resolve ill-defined props like for JS users: props can be any, or sometimes objects with properties of type any
3006type MergePropTypes<P, T> =
3007 // Distribute over P in case it is a union type
3008 P extends any
3009 // If props is type any, use propTypes definitions
3010 ? IsExactlyAny<P> extends true ? T :
3011 // If declared props have indexed properties, ignore inferred props entirely as keyof gets widened
3012 string extends keyof P ? P :
3013 // Prefer declared types which are not exactly any
3014 & Pick<P, NotExactlyAnyPropertyKeys<P>>
3015 // For props which are exactly any, use the type inferred from propTypes if present
3016 & Pick<T, Exclude<keyof T, NotExactlyAnyPropertyKeys<P>>>
3017 // Keep leftover props not specified in propTypes
3018 & Pick<P, Exclude<keyof P, keyof T>>
3019 : never;
3020
3021// Any prop that has a default prop becomes optional, but its type is unchanged
3022// Undeclared default props are augmented into the resulting allowable attributes
3023// If declared props have indexed properties, ignore default props entirely as keyof gets widened
3024// Wrap in an outer-level conditional type to allow distribution over props that are unions
3025type Defaultize<P, D> = P extends any
3026 ? string extends keyof P ? P :
3027 & Pick<P, Exclude<keyof P, keyof D>>
3028 & Partial<Pick<P, Extract<keyof P, keyof D>>>
3029 & Partial<Pick<D, Exclude<keyof D, keyof P>>>
3030 : never;
3031
3032type ReactManagedAttributes<C, P> = C extends { propTypes: infer T; defaultProps: infer D; }
3033 ? Defaultize<MergePropTypes<P, PropTypes.InferProps<T>>, D>
3034 : C extends { propTypes: infer T; }
3035 ? MergePropTypes<P, PropTypes.InferProps<T>>
3036 : C extends { defaultProps: infer D; }
3037 ? Defaultize<P, D>
3038 : P;
3039
3040declare global {
3041 namespace JSX {
3042 interface Element extends React.ReactElement<any, any> { }
3043 interface ElementClass extends React.Component<any> {
3044 render(): React.ReactNode;
3045 }
3046 interface ElementAttributesProperty { props: {}; }
3047 interface ElementChildrenAttribute { children: {}; }
3048
3049 // We can't recurse forever because `type` can't be self-referential;
3050 // let's assume it's reasonable to do a single React.lazy() around a single React.memo() / vice-versa
3051 type LibraryManagedAttributes<C, P> = C extends React.MemoExoticComponent<infer T> | React.LazyExoticComponent<infer T>
3052 ? T extends React.MemoExoticComponent<infer U> | React.LazyExoticComponent<infer U>
3053 ? ReactManagedAttributes<U, P>
3054 : ReactManagedAttributes<T, P>
3055 : ReactManagedAttributes<C, P>;
3056
3057 interface IntrinsicAttributes extends React.Attributes { }
3058 interface IntrinsicClassAttributes<T> extends React.ClassAttributes<T> { }
3059
3060 interface IntrinsicElements {
3061 // HTML
3062 a: React.DetailedHTMLProps<React.AnchorHTMLAttributes<HTMLAnchorElement>, HTMLAnchorElement>;
3063 abbr: React.DetailedHTMLProps<React.HTMLAttributes<HTMLElement>, HTMLElement>;
3064 address: React.DetailedHTMLProps<React.HTMLAttributes<HTMLElement>, HTMLElement>;
3065 area: React.DetailedHTMLProps<React.AreaHTMLAttributes<HTMLAreaElement>, HTMLAreaElement>;
3066 article: React.DetailedHTMLProps<React.HTMLAttributes<HTMLElement>, HTMLElement>;
3067 aside: React.DetailedHTMLProps<React.HTMLAttributes<HTMLElement>, HTMLElement>;
3068 audio: React.DetailedHTMLProps<React.AudioHTMLAttributes<HTMLAudioElement>, HTMLAudioElement>;
3069 b: React.DetailedHTMLProps<React.HTMLAttributes<HTMLElement>, HTMLElement>;
3070 base: React.DetailedHTMLProps<React.BaseHTMLAttributes<HTMLBaseElement>, HTMLBaseElement>;
3071 bdi: React.DetailedHTMLProps<React.HTMLAttributes<HTMLElement>, HTMLElement>;
3072 bdo: React.DetailedHTMLProps<React.HTMLAttributes<HTMLElement>, HTMLElement>;
3073 big: React.DetailedHTMLProps<React.HTMLAttributes<HTMLElement>, HTMLElement>;
3074 blockquote: React.DetailedHTMLProps<React.BlockquoteHTMLAttributes<HTMLElement>, HTMLElement>;
3075 body: React.DetailedHTMLProps<React.HTMLAttributes<HTMLBodyElement>, HTMLBodyElement>;
3076 br: React.DetailedHTMLProps<React.HTMLAttributes<HTMLBRElement>, HTMLBRElement>;
3077 button: React.DetailedHTMLProps<React.ButtonHTMLAttributes<HTMLButtonElement>, HTMLButtonElement>;
3078 canvas: React.DetailedHTMLProps<React.CanvasHTMLAttributes<HTMLCanvasElement>, HTMLCanvasElement>;
3079 caption: React.DetailedHTMLProps<React.HTMLAttributes<HTMLElement>, HTMLElement>;
3080 cite: React.DetailedHTMLProps<React.HTMLAttributes<HTMLElement>, HTMLElement>;
3081 code: React.DetailedHTMLProps<React.HTMLAttributes<HTMLElement>, HTMLElement>;
3082 col: React.DetailedHTMLProps<React.ColHTMLAttributes<HTMLTableColElement>, HTMLTableColElement>;
3083 colgroup: React.DetailedHTMLProps<React.ColgroupHTMLAttributes<HTMLTableColElement>, HTMLTableColElement>;
3084 data: React.DetailedHTMLProps<React.DataHTMLAttributes<HTMLDataElement>, HTMLDataElement>;
3085 datalist: React.DetailedHTMLProps<React.HTMLAttributes<HTMLDataListElement>, HTMLDataListElement>;
3086 dd: React.DetailedHTMLProps<React.HTMLAttributes<HTMLElement>, HTMLElement>;
3087 del: React.DetailedHTMLProps<React.DelHTMLAttributes<HTMLElement>, HTMLElement>;
3088 details: React.DetailedHTMLProps<React.DetailsHTMLAttributes<HTMLElement>, HTMLElement>;
3089 dfn: React.DetailedHTMLProps<React.HTMLAttributes<HTMLElement>, HTMLElement>;
3090 dialog: React.DetailedHTMLProps<React.DialogHTMLAttributes<HTMLDialogElement>, HTMLDialogElement>;
3091 div: React.DetailedHTMLProps<React.HTMLAttributes<HTMLDivElement>, HTMLDivElement>;
3092 dl: React.DetailedHTMLProps<React.HTMLAttributes<HTMLDListElement>, HTMLDListElement>;
3093 dt: React.DetailedHTMLProps<React.HTMLAttributes<HTMLElement>, HTMLElement>;
3094 em: React.DetailedHTMLProps<React.HTMLAttributes<HTMLElement>, HTMLElement>;
3095 embed: React.DetailedHTMLProps<React.EmbedHTMLAttributes<HTMLEmbedElement>, HTMLEmbedElement>;
3096 fieldset: React.DetailedHTMLProps<React.FieldsetHTMLAttributes<HTMLFieldSetElement>, HTMLFieldSetElement>;
3097 figcaption: React.DetailedHTMLProps<React.HTMLAttributes<HTMLElement>, HTMLElement>;
3098 figure: React.DetailedHTMLProps<React.HTMLAttributes<HTMLElement>, HTMLElement>;
3099 footer: React.DetailedHTMLProps<React.HTMLAttributes<HTMLElement>, HTMLElement>;
3100 form: React.DetailedHTMLProps<React.FormHTMLAttributes<HTMLFormElement>, HTMLFormElement>;
3101 h1: React.DetailedHTMLProps<React.HTMLAttributes<HTMLHeadingElement>, HTMLHeadingElement>;
3102 h2: React.DetailedHTMLProps<React.HTMLAttributes<HTMLHeadingElement>, HTMLHeadingElement>;
3103 h3: React.DetailedHTMLProps<React.HTMLAttributes<HTMLHeadingElement>, HTMLHeadingElement>;
3104 h4: React.DetailedHTMLProps<React.HTMLAttributes<HTMLHeadingElement>, HTMLHeadingElement>;
3105 h5: React.DetailedHTMLProps<React.HTMLAttributes<HTMLHeadingElement>, HTMLHeadingElement>;
3106 h6: React.DetailedHTMLProps<React.HTMLAttributes<HTMLHeadingElement>, HTMLHeadingElement>;
3107 head: React.DetailedHTMLProps<React.HTMLAttributes<HTMLHeadElement>, HTMLHeadElement>;
3108 header: React.DetailedHTMLProps<React.HTMLAttributes<HTMLElement>, HTMLElement>;
3109 hgroup: React.DetailedHTMLProps<React.HTMLAttributes<HTMLElement>, HTMLElement>;
3110 hr: React.DetailedHTMLProps<React.HTMLAttributes<HTMLHRElement>, HTMLHRElement>;
3111 html: React.DetailedHTMLProps<React.HtmlHTMLAttributes<HTMLHtmlElement>, HTMLHtmlElement>;
3112 i: React.DetailedHTMLProps<React.HTMLAttributes<HTMLElement>, HTMLElement>;
3113 iframe: React.DetailedHTMLProps<React.IframeHTMLAttributes<HTMLIFrameElement>, HTMLIFrameElement>;
3114 img: React.DetailedHTMLProps<React.ImgHTMLAttributes<HTMLImageElement>, HTMLImageElement>;
3115 input: React.DetailedHTMLProps<React.InputHTMLAttributes<HTMLInputElement>, HTMLInputElement>;
3116 ins: React.DetailedHTMLProps<React.InsHTMLAttributes<HTMLModElement>, HTMLModElement>;
3117 kbd: React.DetailedHTMLProps<React.HTMLAttributes<HTMLElement>, HTMLElement>;
3118 keygen: React.DetailedHTMLProps<React.KeygenHTMLAttributes<HTMLElement>, HTMLElement>;
3119 label: React.DetailedHTMLProps<React.LabelHTMLAttributes<HTMLLabelElement>, HTMLLabelElement>;
3120 legend: React.DetailedHTMLProps<React.HTMLAttributes<HTMLLegendElement>, HTMLLegendElement>;
3121 li: React.DetailedHTMLProps<React.LiHTMLAttributes<HTMLLIElement>, HTMLLIElement>;
3122 link: React.DetailedHTMLProps<React.LinkHTMLAttributes<HTMLLinkElement>, HTMLLinkElement>;
3123 main: React.DetailedHTMLProps<React.HTMLAttributes<HTMLElement>, HTMLElement>;
3124 map: React.DetailedHTMLProps<React.MapHTMLAttributes<HTMLMapElement>, HTMLMapElement>;
3125 mark: React.DetailedHTMLProps<React.HTMLAttributes<HTMLElement>, HTMLElement>;
3126 menu: React.DetailedHTMLProps<React.MenuHTMLAttributes<HTMLElement>, HTMLElement>;
3127 menuitem: React.DetailedHTMLProps<React.HTMLAttributes<HTMLElement>, HTMLElement>;
3128 meta: React.DetailedHTMLProps<React.MetaHTMLAttributes<HTMLMetaElement>, HTMLMetaElement>;
3129 meter: React.DetailedHTMLProps<React.MeterHTMLAttributes<HTMLElement>, HTMLElement>;
3130 nav: React.DetailedHTMLProps<React.HTMLAttributes<HTMLElement>, HTMLElement>;
3131 noindex: React.DetailedHTMLProps<React.HTMLAttributes<HTMLElement>, HTMLElement>;
3132 noscript: React.DetailedHTMLProps<React.HTMLAttributes<HTMLElement>, HTMLElement>;
3133 object: React.DetailedHTMLProps<React.ObjectHTMLAttributes<HTMLObjectElement>, HTMLObjectElement>;
3134 ol: React.DetailedHTMLProps<React.OlHTMLAttributes<HTMLOListElement>, HTMLOListElement>;
3135 optgroup: React.DetailedHTMLProps<React.OptgroupHTMLAttributes<HTMLOptGroupElement>, HTMLOptGroupElement>;
3136 option: React.DetailedHTMLProps<React.OptionHTMLAttributes<HTMLOptionElement>, HTMLOptionElement>;
3137 output: React.DetailedHTMLProps<React.OutputHTMLAttributes<HTMLElement>, HTMLElement>;
3138 p: React.DetailedHTMLProps<React.HTMLAttributes<HTMLParagraphElement>, HTMLParagraphElement>;
3139 param: React.DetailedHTMLProps<React.ParamHTMLAttributes<HTMLParamElement>, HTMLParamElement>;
3140 picture: React.DetailedHTMLProps<React.HTMLAttributes<HTMLElement>, HTMLElement>;
3141 pre: React.DetailedHTMLProps<React.HTMLAttributes<HTMLPreElement>, HTMLPreElement>;
3142 progress: React.DetailedHTMLProps<React.ProgressHTMLAttributes<HTMLProgressElement>, HTMLProgressElement>;
3143 q: React.DetailedHTMLProps<React.QuoteHTMLAttributes<HTMLQuoteElement>, HTMLQuoteElement>;
3144 rp: React.DetailedHTMLProps<React.HTMLAttributes<HTMLElement>, HTMLElement>;
3145 rt: React.DetailedHTMLProps<React.HTMLAttributes<HTMLElement>, HTMLElement>;
3146 ruby: React.DetailedHTMLProps<React.HTMLAttributes<HTMLElement>, HTMLElement>;
3147 s: React.DetailedHTMLProps<React.HTMLAttributes<HTMLElement>, HTMLElement>;
3148 samp: React.DetailedHTMLProps<React.HTMLAttributes<HTMLElement>, HTMLElement>;
3149 slot: React.DetailedHTMLProps<React.SlotHTMLAttributes<HTMLSlotElement>, HTMLSlotElement>;
3150 script: React.DetailedHTMLProps<React.ScriptHTMLAttributes<HTMLScriptElement>, HTMLScriptElement>;
3151 section: React.DetailedHTMLProps<React.HTMLAttributes<HTMLElement>, HTMLElement>;
3152 select: React.DetailedHTMLProps<React.SelectHTMLAttributes<HTMLSelectElement>, HTMLSelectElement>;
3153 small: React.DetailedHTMLProps<React.HTMLAttributes<HTMLElement>, HTMLElement>;
3154 source: React.DetailedHTMLProps<React.SourceHTMLAttributes<HTMLSourceElement>, HTMLSourceElement>;
3155 span: React.DetailedHTMLProps<React.HTMLAttributes<HTMLSpanElement>, HTMLSpanElement>;
3156 strong: React.DetailedHTMLProps<React.HTMLAttributes<HTMLElement>, HTMLElement>;
3157 style: React.DetailedHTMLProps<React.StyleHTMLAttributes<HTMLStyleElement>, HTMLStyleElement>;
3158 sub: React.DetailedHTMLProps<React.HTMLAttributes<HTMLElement>, HTMLElement>;
3159 summary: React.DetailedHTMLProps<React.HTMLAttributes<HTMLElement>, HTMLElement>;
3160 sup: React.DetailedHTMLProps<React.HTMLAttributes<HTMLElement>, HTMLElement>;
3161 table: React.DetailedHTMLProps<React.TableHTMLAttributes<HTMLTableElement>, HTMLTableElement>;
3162 template: React.DetailedHTMLProps<React.HTMLAttributes<HTMLTemplateElement>, HTMLTemplateElement>;
3163 tbody: React.DetailedHTMLProps<React.HTMLAttributes<HTMLTableSectionElement>, HTMLTableSectionElement>;
3164 td: React.DetailedHTMLProps<React.TdHTMLAttributes<HTMLTableDataCellElement>, HTMLTableDataCellElement>;
3165 textarea: React.DetailedHTMLProps<React.TextareaHTMLAttributes<HTMLTextAreaElement>, HTMLTextAreaElement>;
3166 tfoot: React.DetailedHTMLProps<React.HTMLAttributes<HTMLTableSectionElement>, HTMLTableSectionElement>;
3167 th: React.DetailedHTMLProps<React.ThHTMLAttributes<HTMLTableHeaderCellElement>, HTMLTableHeaderCellElement>;
3168 thead: React.DetailedHTMLProps<React.HTMLAttributes<HTMLTableSectionElement>, HTMLTableSectionElement>;
3169 time: React.DetailedHTMLProps<React.TimeHTMLAttributes<HTMLElement>, HTMLElement>;
3170 title: React.DetailedHTMLProps<React.HTMLAttributes<HTMLTitleElement>, HTMLTitleElement>;
3171 tr: React.DetailedHTMLProps<React.HTMLAttributes<HTMLTableRowElement>, HTMLTableRowElement>;
3172 track: React.DetailedHTMLProps<React.TrackHTMLAttributes<HTMLTrackElement>, HTMLTrackElement>;
3173 u: React.DetailedHTMLProps<React.HTMLAttributes<HTMLElement>, HTMLElement>;
3174 ul: React.DetailedHTMLProps<React.HTMLAttributes<HTMLUListElement>, HTMLUListElement>;
3175 "var": React.DetailedHTMLProps<React.HTMLAttributes<HTMLElement>, HTMLElement>;
3176 video: React.DetailedHTMLProps<React.VideoHTMLAttributes<HTMLVideoElement>, HTMLVideoElement>;
3177 wbr: React.DetailedHTMLProps<React.HTMLAttributes<HTMLElement>, HTMLElement>;
3178 webview: React.DetailedHTMLProps<React.WebViewHTMLAttributes<HTMLWebViewElement>, HTMLWebViewElement>;
3179
3180 // SVG
3181 svg: React.SVGProps<SVGSVGElement>;
3182
3183 animate: React.SVGProps<SVGElement>; // TODO: It is SVGAnimateElement but is not in TypeScript's lib.dom.d.ts for now.
3184 animateMotion: React.SVGProps<SVGElement>;
3185 animateTransform: React.SVGProps<SVGElement>; // TODO: It is SVGAnimateTransformElement but is not in TypeScript's lib.dom.d.ts for now.
3186 circle: React.SVGProps<SVGCircleElement>;
3187 clipPath: React.SVGProps<SVGClipPathElement>;
3188 defs: React.SVGProps<SVGDefsElement>;
3189 desc: React.SVGProps<SVGDescElement>;
3190 ellipse: React.SVGProps<SVGEllipseElement>;
3191 feBlend: React.SVGProps<SVGFEBlendElement>;
3192 feColorMatrix: React.SVGProps<SVGFEColorMatrixElement>;
3193 feComponentTransfer: React.SVGProps<SVGFEComponentTransferElement>;
3194 feComposite: React.SVGProps<SVGFECompositeElement>;
3195 feConvolveMatrix: React.SVGProps<SVGFEConvolveMatrixElement>;
3196 feDiffuseLighting: React.SVGProps<SVGFEDiffuseLightingElement>;
3197 feDisplacementMap: React.SVGProps<SVGFEDisplacementMapElement>;
3198 feDistantLight: React.SVGProps<SVGFEDistantLightElement>;
3199 feDropShadow: React.SVGProps<SVGFEDropShadowElement>;
3200 feFlood: React.SVGProps<SVGFEFloodElement>;
3201 feFuncA: React.SVGProps<SVGFEFuncAElement>;
3202 feFuncB: React.SVGProps<SVGFEFuncBElement>;
3203 feFuncG: React.SVGProps<SVGFEFuncGElement>;
3204 feFuncR: React.SVGProps<SVGFEFuncRElement>;
3205 feGaussianBlur: React.SVGProps<SVGFEGaussianBlurElement>;
3206 feImage: React.SVGProps<SVGFEImageElement>;
3207 feMerge: React.SVGProps<SVGFEMergeElement>;
3208 feMergeNode: React.SVGProps<SVGFEMergeNodeElement>;
3209 feMorphology: React.SVGProps<SVGFEMorphologyElement>;
3210 feOffset: React.SVGProps<SVGFEOffsetElement>;
3211 fePointLight: React.SVGProps<SVGFEPointLightElement>;
3212 feSpecularLighting: React.SVGProps<SVGFESpecularLightingElement>;
3213 feSpotLight: React.SVGProps<SVGFESpotLightElement>;
3214 feTile: React.SVGProps<SVGFETileElement>;
3215 feTurbulence: React.SVGProps<SVGFETurbulenceElement>;
3216 filter: React.SVGProps<SVGFilterElement>;
3217 foreignObject: React.SVGProps<SVGForeignObjectElement>;
3218 g: React.SVGProps<SVGGElement>;
3219 image: React.SVGProps<SVGImageElement>;
3220 line: React.SVGProps<SVGLineElement>;
3221 linearGradient: React.SVGProps<SVGLinearGradientElement>;
3222 marker: React.SVGProps<SVGMarkerElement>;
3223 mask: React.SVGProps<SVGMaskElement>;
3224 metadata: React.SVGProps<SVGMetadataElement>;
3225 mpath: React.SVGProps<SVGElement>;
3226 path: React.SVGProps<SVGPathElement>;
3227 pattern: React.SVGProps<SVGPatternElement>;
3228 polygon: React.SVGProps<SVGPolygonElement>;
3229 polyline: React.SVGProps<SVGPolylineElement>;
3230 radialGradient: React.SVGProps<SVGRadialGradientElement>;
3231 rect: React.SVGProps<SVGRectElement>;
3232 stop: React.SVGProps<SVGStopElement>;
3233 switch: React.SVGProps<SVGSwitchElement>;
3234 symbol: React.SVGProps<SVGSymbolElement>;
3235 text: React.SVGProps<SVGTextElement>;
3236 textPath: React.SVGProps<SVGTextPathElement>;
3237 tspan: React.SVGProps<SVGTSpanElement>;
3238 use: React.SVGProps<SVGUseElement>;
3239 view: React.SVGProps<SVGViewElement>;
3240 }
3241 }
3242}
3243
\No newline at end of file