@types/react 16.3.13 → 16.3.17

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