statedrive 0.0.13 → 0.0.16

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