@types/react 18.3.13 → 19.0.0

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.
@@ -0,0 +1,4530 @@
1
+ // NOTE: Users of the `experimental` builds of React should add a reference
2
+ // to 'react/experimental' in their project. See experimental.d.ts's top comment
3
+ // for reference and documentation on how exactly to do it.
4
+
5
+ /// <reference path="global.d.ts" />
6
+
7
+ import * as CSS from "csstype";
8
+ import * as PropTypes from "prop-types";
9
+
10
+ type NativeAnimationEvent = AnimationEvent;
11
+ type NativeClipboardEvent = ClipboardEvent;
12
+ type NativeCompositionEvent = CompositionEvent;
13
+ type NativeDragEvent = DragEvent;
14
+ type NativeFocusEvent = FocusEvent;
15
+ type NativeKeyboardEvent = KeyboardEvent;
16
+ type NativeMouseEvent = MouseEvent;
17
+ type NativeTouchEvent = TouchEvent;
18
+ type NativePointerEvent = PointerEvent;
19
+ type NativeTransitionEvent = TransitionEvent;
20
+ type NativeUIEvent = UIEvent;
21
+ type NativeWheelEvent = WheelEvent;
22
+
23
+ /**
24
+ * Used to represent DOM API's where users can either pass
25
+ * true or false as a boolean or as its equivalent strings.
26
+ */
27
+ type Booleanish = boolean | "true" | "false";
28
+
29
+ /**
30
+ * @see {@link https://developer.mozilla.org/en-US/docs/Web/HTML/Attributes/crossorigin MDN}
31
+ */
32
+ type CrossOrigin = "anonymous" | "use-credentials" | "" | undefined;
33
+
34
+ declare const UNDEFINED_VOID_ONLY: unique symbol;
35
+
36
+ /**
37
+ * The function returned from an effect passed to {@link React.useEffect useEffect},
38
+ * which can be used to clean up the effect when the component unmounts.
39
+ *
40
+ * @see {@link https://react.dev/reference/react/useEffect React Docs}
41
+ */
42
+ type Destructor = () => void | { [UNDEFINED_VOID_ONLY]: never };
43
+ type VoidOrUndefinedOnly = void | { [UNDEFINED_VOID_ONLY]: never };
44
+
45
+ // eslint-disable-next-line @definitelytyped/export-just-namespace
46
+ export = React;
47
+ export as namespace React;
48
+
49
+ declare namespace React {
50
+ //
51
+ // React Elements
52
+ // ----------------------------------------------------------------------
53
+
54
+ /**
55
+ * Used to retrieve the possible components which accept a given set of props.
56
+ *
57
+ * Can be passed no type parameters to get a union of all possible components
58
+ * and tags.
59
+ *
60
+ * Is a superset of {@link ComponentType}.
61
+ *
62
+ * @template P The props to match against. If not passed, defaults to any.
63
+ * @template Tag An optional tag to match against. If not passed, attempts to match against all possible tags.
64
+ *
65
+ * @example
66
+ *
67
+ * ```tsx
68
+ * // All components and tags (img, embed etc.)
69
+ * // which accept `src`
70
+ * type SrcComponents = ElementType<{ src: any }>;
71
+ * ```
72
+ *
73
+ * @example
74
+ *
75
+ * ```tsx
76
+ * // All components
77
+ * type AllComponents = ElementType;
78
+ * ```
79
+ *
80
+ * @example
81
+ *
82
+ * ```tsx
83
+ * // All custom components which match `src`, and tags which
84
+ * // match `src`, narrowed down to just `audio` and `embed`
85
+ * type SrcComponents = ElementType<{ src: any }, 'audio' | 'embed'>;
86
+ * ```
87
+ */
88
+ type ElementType<P = any, Tag extends keyof JSX.IntrinsicElements = keyof JSX.IntrinsicElements> =
89
+ | { [K in Tag]: P extends JSX.IntrinsicElements[K] ? K : never }[Tag]
90
+ | ComponentType<P>;
91
+
92
+ /**
93
+ * Represents any user-defined component, either as a function or a class.
94
+ *
95
+ * Similar to {@link JSXElementConstructor}, but with extra properties like
96
+ * {@link FunctionComponent.defaultProps defaultProps } and
97
+ * {@link ComponentClass.contextTypes contextTypes}.
98
+ *
99
+ * @template P The props the component accepts.
100
+ *
101
+ * @see {@link ComponentClass}
102
+ * @see {@link FunctionComponent}
103
+ */
104
+ type ComponentType<P = {}> = ComponentClass<P> | FunctionComponent<P>;
105
+
106
+ /**
107
+ * Represents any user-defined component, either as a function or a class.
108
+ *
109
+ * Similar to {@link ComponentType}, but without extra properties like
110
+ * {@link FunctionComponent.defaultProps defaultProps } and
111
+ * {@link ComponentClass.contextTypes contextTypes}.
112
+ *
113
+ * @template P The props the component accepts.
114
+ */
115
+ type JSXElementConstructor<P> =
116
+ | ((
117
+ props: P,
118
+ /**
119
+ * @deprecated
120
+ *
121
+ * @see {@link https://legacy.reactjs.org/docs/legacy-context.html#referencing-context-in-stateless-function-components React Docs}
122
+ */
123
+ deprecatedLegacyContext?: any,
124
+ ) => ReactElement<any, any> | null)
125
+ | (new(
126
+ props: P,
127
+ /**
128
+ * @deprecated
129
+ *
130
+ * @see {@link https://legacy.reactjs.org/docs/legacy-context.html#referencing-context-in-lifecycle-methods React Docs}
131
+ */
132
+ deprecatedLegacyContext?: any,
133
+ ) => Component<any, any>);
134
+
135
+ /**
136
+ * A readonly ref container where {@link current} cannot be mutated.
137
+ *
138
+ * Created by {@link createRef}, or {@link useRef} when passed `null`.
139
+ *
140
+ * @template T The type of the ref's value.
141
+ *
142
+ * @example
143
+ *
144
+ * ```tsx
145
+ * const ref = createRef<HTMLDivElement>();
146
+ *
147
+ * ref.current = document.createElement('div'); // Error
148
+ * ```
149
+ */
150
+ interface RefObject<T> {
151
+ /**
152
+ * The current value of the ref.
153
+ */
154
+ readonly current: T | null;
155
+ }
156
+
157
+ interface DO_NOT_USE_OR_YOU_WILL_BE_FIRED_CALLBACK_REF_RETURN_VALUES {
158
+ }
159
+ /**
160
+ * A callback fired whenever the ref's value changes.
161
+ *
162
+ * @template T The type of the ref's value.
163
+ *
164
+ * @see {@link https://react.dev/reference/react-dom/components/common#ref-callback React Docs}
165
+ *
166
+ * @example
167
+ *
168
+ * ```tsx
169
+ * <div ref={(node) => console.log(node)} />
170
+ * ```
171
+ */
172
+ type RefCallback<T> = {
173
+ bivarianceHack(
174
+ instance: T | null,
175
+ ):
176
+ | void
177
+ | DO_NOT_USE_OR_YOU_WILL_BE_FIRED_CALLBACK_REF_RETURN_VALUES[
178
+ keyof DO_NOT_USE_OR_YOU_WILL_BE_FIRED_CALLBACK_REF_RETURN_VALUES
179
+ ];
180
+ }["bivarianceHack"];
181
+
182
+ /**
183
+ * A union type of all possible shapes for React refs.
184
+ *
185
+ * @see {@link RefCallback}
186
+ * @see {@link RefObject}
187
+ */
188
+
189
+ type Ref<T> = RefCallback<T> | RefObject<T> | null;
190
+ /**
191
+ * A legacy implementation of refs where you can pass a string to a ref prop.
192
+ *
193
+ * @see {@link https://react.dev/reference/react/Component#refs React Docs}
194
+ *
195
+ * @example
196
+ *
197
+ * ```tsx
198
+ * <div ref="myRef" />
199
+ * ```
200
+ */
201
+ // TODO: Remove the string ref special case from `PropsWithRef` once we remove LegacyRef
202
+ type LegacyRef<T> = string | Ref<T>;
203
+
204
+ /**
205
+ * Retrieves the type of the 'ref' prop for a given component type or tag name.
206
+ *
207
+ * @template C The component type.
208
+ *
209
+ * @example
210
+ *
211
+ * ```tsx
212
+ * type MyComponentRef = React.ElementRef<typeof MyComponent>;
213
+ * ```
214
+ *
215
+ * @example
216
+ *
217
+ * ```tsx
218
+ * type DivRef = React.ElementRef<'div'>;
219
+ * ```
220
+ */
221
+ type ElementRef<
222
+ C extends
223
+ | ForwardRefExoticComponent<any>
224
+ | { new(props: any): Component<any> }
225
+ | ((props: any, deprecatedLegacyContext?: any) => ReactElement | null)
226
+ | keyof JSX.IntrinsicElements,
227
+ > =
228
+ // need to check first if `ref` is a valid prop for ts@3.0
229
+ // otherwise it will infer `{}` instead of `never`
230
+ "ref" extends keyof ComponentPropsWithRef<C>
231
+ ? NonNullable<ComponentPropsWithRef<C>["ref"]> extends RefAttributes<
232
+ infer Instance
233
+ >["ref"] ? Instance
234
+ : never
235
+ : never;
236
+
237
+ type ComponentState = any;
238
+
239
+ /**
240
+ * A value which uniquely identifies a node among items in an array.
241
+ *
242
+ * @see {@link https://react.dev/learn/rendering-lists#keeping-list-items-in-order-with-key React Docs}
243
+ */
244
+ type Key = string | number | bigint;
245
+
246
+ /**
247
+ * @internal The props any component can receive.
248
+ * You don't have to add this type. All components automatically accept these props.
249
+ * ```tsx
250
+ * const Component = () => <div />;
251
+ * <Component key="one" />
252
+ * ```
253
+ *
254
+ * WARNING: The implementation of a component will never have access to these attributes.
255
+ * The following example would be incorrect usage because {@link Component} would never have access to `key`:
256
+ * ```tsx
257
+ * const Component = (props: React.Attributes) => props.key;
258
+ * ```
259
+ */
260
+ interface Attributes {
261
+ key?: Key | null | undefined;
262
+ }
263
+ /**
264
+ * The props any component accepting refs can receive.
265
+ * Class components, built-in browser components (e.g. `div`) and forwardRef components can receive refs and automatically accept these props.
266
+ * ```tsx
267
+ * const Component = forwardRef(() => <div />);
268
+ * <Component ref={(current) => console.log(current)} />
269
+ * ```
270
+ *
271
+ * You only need this type if you manually author the types of props that need to be compatible with legacy refs.
272
+ * ```tsx
273
+ * interface Props extends React.RefAttributes<HTMLDivElement> {}
274
+ * declare const Component: React.FunctionComponent<Props>;
275
+ * ```
276
+ *
277
+ * Otherwise it's simpler to directly use {@link Ref} since you can safely use the
278
+ * props type to describe to props that a consumer can pass to the component
279
+ * as well as describing the props the implementation of a component "sees".
280
+ * {@link RefAttributes} is generally not safe to describe both consumer and seen props.
281
+ *
282
+ * ```tsx
283
+ * interface Props extends {
284
+ * ref?: React.Ref<HTMLDivElement> | undefined;
285
+ * }
286
+ * declare const Component: React.FunctionComponent<Props>;
287
+ * ```
288
+ *
289
+ * WARNING: The implementation of a component will not have access to the same type in versions of React supporting string refs.
290
+ * The following example would be incorrect usage because {@link Component} would never have access to a `ref` with type `string`
291
+ * ```tsx
292
+ * const Component = (props: React.RefAttributes) => props.ref;
293
+ * ```
294
+ */
295
+ interface RefAttributes<T> extends Attributes {
296
+ /**
297
+ * Allows getting a ref to the component instance.
298
+ * Once the component unmounts, React will set `ref.current` to `null`
299
+ * (or call the ref with `null` if you passed a callback ref).
300
+ *
301
+ * @see {@link https://react.dev/learn/referencing-values-with-refs#refs-and-the-dom React Docs}
302
+ */
303
+ ref?: LegacyRef<T> | undefined;
304
+ }
305
+
306
+ /**
307
+ * Represents the built-in attributes available to class components.
308
+ */
309
+ interface ClassAttributes<T> extends RefAttributes<T> {
310
+ }
311
+
312
+ /**
313
+ * Represents a JSX element.
314
+ *
315
+ * Where {@link ReactNode} represents everything that can be rendered, `ReactElement`
316
+ * only represents JSX.
317
+ *
318
+ * @template P The type of the props object
319
+ * @template T The type of the component or tag
320
+ *
321
+ * @example
322
+ *
323
+ * ```tsx
324
+ * const element: ReactElement = <div />;
325
+ * ```
326
+ */
327
+ interface ReactElement<
328
+ P = any,
329
+ T extends string | JSXElementConstructor<any> = string | JSXElementConstructor<any>,
330
+ > {
331
+ type: T;
332
+ props: P;
333
+ key: string | null;
334
+ }
335
+
336
+ /**
337
+ * @deprecated
338
+ */
339
+ interface ReactComponentElement<
340
+ T extends keyof JSX.IntrinsicElements | JSXElementConstructor<any>,
341
+ P = Pick<ComponentProps<T>, Exclude<keyof ComponentProps<T>, "key" | "ref">>,
342
+ > extends ReactElement<P, Exclude<T, number>> {}
343
+
344
+ interface FunctionComponentElement<P> extends ReactElement<P, FunctionComponent<P>> {
345
+ ref?: ("ref" extends keyof P ? P extends { ref?: infer R | undefined } ? R : never : never) | undefined;
346
+ }
347
+
348
+ type CElement<P, T extends Component<P, ComponentState>> = ComponentElement<P, T>;
349
+ interface ComponentElement<P, T extends Component<P, ComponentState>> extends ReactElement<P, ComponentClass<P>> {
350
+ ref?: LegacyRef<T> | undefined;
351
+ }
352
+
353
+ /**
354
+ * @deprecated Use {@link ComponentElement} instead.
355
+ */
356
+ type ClassicElement<P> = CElement<P, ClassicComponent<P, ComponentState>>;
357
+
358
+ // string fallback for custom web-components
359
+ interface DOMElement<P extends HTMLAttributes<T> | SVGAttributes<T>, T extends Element>
360
+ extends ReactElement<P, string>
361
+ {
362
+ ref: LegacyRef<T>;
363
+ }
364
+
365
+ // ReactHTML for ReactHTMLElement
366
+ interface ReactHTMLElement<T extends HTMLElement> extends DetailedReactHTMLElement<AllHTMLAttributes<T>, T> {}
367
+
368
+ interface DetailedReactHTMLElement<P extends HTMLAttributes<T>, T extends HTMLElement> extends DOMElement<P, T> {
369
+ type: keyof ReactHTML;
370
+ }
371
+
372
+ // ReactSVG for ReactSVGElement
373
+ interface ReactSVGElement extends DOMElement<SVGAttributes<SVGElement>, SVGElement> {
374
+ type: keyof ReactSVG;
375
+ }
376
+
377
+ interface ReactPortal extends ReactElement {
378
+ children: ReactNode;
379
+ }
380
+
381
+ //
382
+ // Factories
383
+ // ----------------------------------------------------------------------
384
+
385
+ type Factory<P> = (props?: Attributes & P, ...children: ReactNode[]) => ReactElement<P>;
386
+
387
+ /**
388
+ * @deprecated Please use `FunctionComponentFactory`
389
+ */
390
+ type SFCFactory<P> = FunctionComponentFactory<P>;
391
+
392
+ type FunctionComponentFactory<P> = (
393
+ props?: Attributes & P,
394
+ ...children: ReactNode[]
395
+ ) => FunctionComponentElement<P>;
396
+
397
+ type ComponentFactory<P, T extends Component<P, ComponentState>> = (
398
+ props?: ClassAttributes<T> & P,
399
+ ...children: ReactNode[]
400
+ ) => CElement<P, T>;
401
+
402
+ type CFactory<P, T extends Component<P, ComponentState>> = ComponentFactory<P, T>;
403
+ type ClassicFactory<P> = CFactory<P, ClassicComponent<P, ComponentState>>;
404
+
405
+ type DOMFactory<P extends DOMAttributes<T>, T extends Element> = (
406
+ props?: ClassAttributes<T> & P | null,
407
+ ...children: ReactNode[]
408
+ ) => DOMElement<P, T>;
409
+
410
+ interface HTMLFactory<T extends HTMLElement> extends DetailedHTMLFactory<AllHTMLAttributes<T>, T> {}
411
+
412
+ interface DetailedHTMLFactory<P extends HTMLAttributes<T>, T extends HTMLElement> extends DOMFactory<P, T> {
413
+ (props?: ClassAttributes<T> & P | null, ...children: ReactNode[]): DetailedReactHTMLElement<P, T>;
414
+ }
415
+
416
+ interface SVGFactory extends DOMFactory<SVGAttributes<SVGElement>, SVGElement> {
417
+ (
418
+ props?: ClassAttributes<SVGElement> & SVGAttributes<SVGElement> | null,
419
+ ...children: ReactNode[]
420
+ ): ReactSVGElement;
421
+ }
422
+
423
+ /**
424
+ * @deprecated - This type is not relevant when using React. Inline the type instead to make the intent clear.
425
+ */
426
+ type ReactText = string | number;
427
+ /**
428
+ * @deprecated - This type is not relevant when using React. Inline the type instead to make the intent clear.
429
+ */
430
+ type ReactChild = ReactElement | string | number;
431
+
432
+ /**
433
+ * @deprecated Use either `ReactNode[]` if you need an array or `Iterable<ReactNode>` if its passed to a host component.
434
+ */
435
+ interface ReactNodeArray extends ReadonlyArray<ReactNode> {}
436
+ /**
437
+ * WARNING: Not related to `React.Fragment`.
438
+ * @deprecated This type is not relevant when using React. Inline the type instead to make the intent clear.
439
+ */
440
+ type ReactFragment = Iterable<ReactNode>;
441
+
442
+ /**
443
+ * For internal usage only.
444
+ * Different release channels declare additional types of ReactNode this particular release channel accepts.
445
+ * App or library types should never augment this interface.
446
+ */
447
+ interface DO_NOT_USE_OR_YOU_WILL_BE_FIRED_EXPERIMENTAL_REACT_NODES {}
448
+
449
+ /**
450
+ * Represents all of the things React can render.
451
+ *
452
+ * Where {@link ReactElement} only represents JSX, `ReactNode` represents everything that can be rendered.
453
+ *
454
+ * @see {@link https://react-typescript-cheatsheet.netlify.app/docs/react-types/reactnode/ React TypeScript Cheatsheet}
455
+ *
456
+ * @example
457
+ *
458
+ * ```tsx
459
+ * // Typing children
460
+ * type Props = { children: ReactNode }
461
+ *
462
+ * const Component = ({ children }: Props) => <div>{children}</div>
463
+ *
464
+ * <Component>hello</Component>
465
+ * ```
466
+ *
467
+ * @example
468
+ *
469
+ * ```tsx
470
+ * // Typing a custom element
471
+ * type Props = { customElement: ReactNode }
472
+ *
473
+ * const Component = ({ customElement }: Props) => <div>{customElement}</div>
474
+ *
475
+ * <Component customElement={<div>hello</div>} />
476
+ * ```
477
+ */
478
+ // non-thenables need to be kept in sync with AwaitedReactNode
479
+ type ReactNode =
480
+ | ReactElement
481
+ | string
482
+ | number
483
+ | Iterable<ReactNode>
484
+ | ReactPortal
485
+ | boolean
486
+ | null
487
+ | undefined
488
+ | DO_NOT_USE_OR_YOU_WILL_BE_FIRED_EXPERIMENTAL_REACT_NODES[
489
+ keyof DO_NOT_USE_OR_YOU_WILL_BE_FIRED_EXPERIMENTAL_REACT_NODES
490
+ ];
491
+
492
+ //
493
+ // Top Level API
494
+ // ----------------------------------------------------------------------
495
+
496
+ // DOM Elements
497
+ /** @deprecated */
498
+ function createFactory<T extends HTMLElement>(
499
+ type: keyof ReactHTML,
500
+ ): HTMLFactory<T>;
501
+ /** @deprecated */
502
+ function createFactory(
503
+ type: keyof ReactSVG,
504
+ ): SVGFactory;
505
+ /** @deprecated */
506
+ function createFactory<P extends DOMAttributes<T>, T extends Element>(
507
+ type: string,
508
+ ): DOMFactory<P, T>;
509
+
510
+ // Custom components
511
+ /** @deprecated */
512
+ function createFactory<P>(type: FunctionComponent<P>): FunctionComponentFactory<P>;
513
+ /** @deprecated */
514
+ function createFactory<P, T extends Component<P, ComponentState>, C extends ComponentClass<P>>(
515
+ type: ClassType<P, T, C>,
516
+ ): CFactory<P, T>;
517
+ /** @deprecated */
518
+ function createFactory<P>(type: ComponentClass<P>): Factory<P>;
519
+
520
+ // DOM Elements
521
+ // TODO: generalize this to everything in `keyof ReactHTML`, not just "input"
522
+ function createElement(
523
+ type: "input",
524
+ props?: InputHTMLAttributes<HTMLInputElement> & ClassAttributes<HTMLInputElement> | null,
525
+ ...children: ReactNode[]
526
+ ): DetailedReactHTMLElement<InputHTMLAttributes<HTMLInputElement>, HTMLInputElement>;
527
+ function createElement<P extends HTMLAttributes<T>, T extends HTMLElement>(
528
+ type: keyof ReactHTML,
529
+ props?: ClassAttributes<T> & P | null,
530
+ ...children: ReactNode[]
531
+ ): DetailedReactHTMLElement<P, T>;
532
+ function createElement<P extends SVGAttributes<T>, T extends SVGElement>(
533
+ type: keyof ReactSVG,
534
+ props?: ClassAttributes<T> & P | null,
535
+ ...children: ReactNode[]
536
+ ): ReactSVGElement;
537
+ function createElement<P extends DOMAttributes<T>, T extends Element>(
538
+ type: string,
539
+ props?: ClassAttributes<T> & P | null,
540
+ ...children: ReactNode[]
541
+ ): DOMElement<P, T>;
542
+
543
+ // Custom components
544
+
545
+ function createElement<P extends {}>(
546
+ type: FunctionComponent<P>,
547
+ props?: Attributes & P | null,
548
+ ...children: ReactNode[]
549
+ ): FunctionComponentElement<P>;
550
+ function createElement<P extends {}, T extends Component<P, ComponentState>, C extends ComponentClass<P>>(
551
+ type: ClassType<P, T, C>,
552
+ props?: ClassAttributes<T> & P | null,
553
+ ...children: ReactNode[]
554
+ ): CElement<P, T>;
555
+ function createElement<P extends {}>(
556
+ type: FunctionComponent<P> | ComponentClass<P> | string,
557
+ props?: Attributes & P | null,
558
+ ...children: ReactNode[]
559
+ ): ReactElement<P>;
560
+
561
+ // DOM Elements
562
+ // ReactHTMLElement
563
+ function cloneElement<P extends HTMLAttributes<T>, T extends HTMLElement>(
564
+ element: DetailedReactHTMLElement<P, T>,
565
+ props?: P,
566
+ ...children: ReactNode[]
567
+ ): DetailedReactHTMLElement<P, T>;
568
+ // ReactHTMLElement, less specific
569
+ function cloneElement<P extends HTMLAttributes<T>, T extends HTMLElement>(
570
+ element: ReactHTMLElement<T>,
571
+ props?: P,
572
+ ...children: ReactNode[]
573
+ ): ReactHTMLElement<T>;
574
+ // SVGElement
575
+ function cloneElement<P extends SVGAttributes<T>, T extends SVGElement>(
576
+ element: ReactSVGElement,
577
+ props?: P,
578
+ ...children: ReactNode[]
579
+ ): ReactSVGElement;
580
+ // DOM Element (has to be the last, because type checking stops at first overload that fits)
581
+ function cloneElement<P extends DOMAttributes<T>, T extends Element>(
582
+ element: DOMElement<P, T>,
583
+ props?: DOMAttributes<T> & P,
584
+ ...children: ReactNode[]
585
+ ): DOMElement<P, T>;
586
+
587
+ // Custom components
588
+ function cloneElement<P>(
589
+ element: FunctionComponentElement<P>,
590
+ props?: Partial<P> & Attributes,
591
+ ...children: ReactNode[]
592
+ ): FunctionComponentElement<P>;
593
+ function cloneElement<P, T extends Component<P, ComponentState>>(
594
+ element: CElement<P, T>,
595
+ props?: Partial<P> & ClassAttributes<T>,
596
+ ...children: ReactNode[]
597
+ ): CElement<P, T>;
598
+ function cloneElement<P>(
599
+ element: ReactElement<P>,
600
+ props?: Partial<P> & Attributes,
601
+ ...children: ReactNode[]
602
+ ): ReactElement<P>;
603
+
604
+ /**
605
+ * Describes the props accepted by a Context {@link Provider}.
606
+ *
607
+ * @template T The type of the value the context provides.
608
+ */
609
+ interface ProviderProps<T> {
610
+ value: T;
611
+ children?: ReactNode | undefined;
612
+ }
613
+
614
+ /**
615
+ * Describes the props accepted by a Context {@link Consumer}.
616
+ *
617
+ * @template T The type of the value the context provides.
618
+ */
619
+ interface ConsumerProps<T> {
620
+ children: (value: T) => ReactNode;
621
+ }
622
+
623
+ /**
624
+ * An object masquerading as a component. These are created by functions
625
+ * like {@link forwardRef}, {@link memo}, and {@link createContext}.
626
+ *
627
+ * In order to make TypeScript work, we pretend that they are normal
628
+ * components.
629
+ *
630
+ * But they are, in fact, not callable - instead, they are objects which
631
+ * are treated specially by the renderer.
632
+ *
633
+ * @template P The props the component accepts.
634
+ */
635
+ interface ExoticComponent<P = {}> {
636
+ (props: P): ReactElement | null;
637
+ readonly $$typeof: symbol;
638
+ }
639
+
640
+ /**
641
+ * An {@link ExoticComponent} with a `displayName` property applied to it.
642
+ *
643
+ * @template P The props the component accepts.
644
+ */
645
+ interface NamedExoticComponent<P = {}> extends ExoticComponent<P> {
646
+ /**
647
+ * Used in debugging messages. You might want to set it
648
+ * explicitly if you want to display a different name for
649
+ * debugging purposes.
650
+ *
651
+ * @see {@link https://legacy.reactjs.org/docs/react-component.html#displayname Legacy React Docs}
652
+ */
653
+ displayName?: string | undefined;
654
+ }
655
+
656
+ /**
657
+ * An {@link ExoticComponent} with a `propTypes` property applied to it.
658
+ *
659
+ * @template P The props the component accepts.
660
+ */
661
+ interface ProviderExoticComponent<P> extends ExoticComponent<P> {
662
+ propTypes?: WeakValidationMap<P> | undefined;
663
+ }
664
+
665
+ /**
666
+ * Used to retrieve the type of a context object from a {@link Context}.
667
+ *
668
+ * @template C The context object.
669
+ *
670
+ * @example
671
+ *
672
+ * ```tsx
673
+ * import { createContext } from 'react';
674
+ *
675
+ * const MyContext = createContext({ foo: 'bar' });
676
+ *
677
+ * type ContextType = ContextType<typeof MyContext>;
678
+ * // ContextType = { foo: string }
679
+ * ```
680
+ */
681
+ type ContextType<C extends Context<any>> = C extends Context<infer T> ? T : never;
682
+
683
+ /**
684
+ * Wraps your components to specify the value of this context for all components inside.
685
+ *
686
+ * @see {@link https://react.dev/reference/react/createContext#provider React Docs}
687
+ *
688
+ * @example
689
+ *
690
+ * ```tsx
691
+ * import { createContext } from 'react';
692
+ *
693
+ * const ThemeContext = createContext('light');
694
+ *
695
+ * function App() {
696
+ * return (
697
+ * <ThemeContext.Provider value="dark">
698
+ * <Toolbar />
699
+ * </ThemeContext.Provider>
700
+ * );
701
+ * }
702
+ * ```
703
+ */
704
+ type Provider<T> = ProviderExoticComponent<ProviderProps<T>>;
705
+
706
+ /**
707
+ * The old way to read context, before {@link useContext} existed.
708
+ *
709
+ * @see {@link https://react.dev/reference/react/createContext#consumer React Docs}
710
+ *
711
+ * @example
712
+ *
713
+ * ```tsx
714
+ * import { UserContext } from './user-context';
715
+ *
716
+ * function Avatar() {
717
+ * return (
718
+ * <UserContext.Consumer>
719
+ * {user => <img src={user.profileImage} alt={user.name} />}
720
+ * </UserContext.Consumer>
721
+ * );
722
+ * }
723
+ * ```
724
+ */
725
+ type Consumer<T> = ExoticComponent<ConsumerProps<T>>;
726
+
727
+ /**
728
+ * Context lets components pass information deep down without explicitly
729
+ * passing props.
730
+ *
731
+ * Created from {@link createContext}
732
+ *
733
+ * @see {@link https://react.dev/learn/passing-data-deeply-with-context React Docs}
734
+ * @see {@link https://react-typescript-cheatsheet.netlify.app/docs/basic/getting-started/context/ React TypeScript Cheatsheet}
735
+ *
736
+ * @example
737
+ *
738
+ * ```tsx
739
+ * import { createContext } from 'react';
740
+ *
741
+ * const ThemeContext = createContext('light');
742
+ * ```
743
+ */
744
+ interface Context<T> {
745
+ Provider: Provider<T>;
746
+ Consumer: Consumer<T>;
747
+ /**
748
+ * Used in debugging messages. You might want to set it
749
+ * explicitly if you want to display a different name for
750
+ * debugging purposes.
751
+ *
752
+ * @see {@link https://legacy.reactjs.org/docs/react-component.html#displayname Legacy React Docs}
753
+ */
754
+ displayName?: string | undefined;
755
+ }
756
+
757
+ /**
758
+ * Lets you create a {@link Context} that components can provide or read.
759
+ *
760
+ * @param defaultValue The value you want the context to have when there is no matching
761
+ * {@link Provider} in the tree above the component reading the context. This is meant
762
+ * as a "last resort" fallback.
763
+ *
764
+ * @see {@link https://react.dev/reference/react/createContext#reference React Docs}
765
+ * @see {@link https://react-typescript-cheatsheet.netlify.app/docs/basic/getting-started/context/ React TypeScript Cheatsheet}
766
+ *
767
+ * @example
768
+ *
769
+ * ```tsx
770
+ * import { createContext } from 'react';
771
+ *
772
+ * const ThemeContext = createContext('light');
773
+ * ```
774
+ */
775
+ function createContext<T>(
776
+ // If you thought this should be optional, see
777
+ // https://github.com/DefinitelyTyped/DefinitelyTyped/pull/24509#issuecomment-382213106
778
+ defaultValue: T,
779
+ ): Context<T>;
780
+
781
+ function isValidElement<P>(object: {} | null | undefined): object is ReactElement<P>;
782
+
783
+ /**
784
+ * Maintainer's note: Sync with {@link ReactChildren} until {@link ReactChildren} is removed.
785
+ */
786
+ const Children: {
787
+ map<T, C>(
788
+ children: C | readonly C[],
789
+ fn: (child: C, index: number) => T,
790
+ ): C extends null | undefined ? C : Array<Exclude<T, boolean | null | undefined>>;
791
+ forEach<C>(children: C | readonly C[], fn: (child: C, index: number) => void): void;
792
+ count(children: any): number;
793
+ only<C>(children: C): C extends any[] ? never : C;
794
+ toArray(children: ReactNode | ReactNode[]): Array<Exclude<ReactNode, boolean | null | undefined>>;
795
+ };
796
+ /**
797
+ * Lets you group elements without a wrapper node.
798
+ *
799
+ * @see {@link https://react.dev/reference/react/Fragment React Docs}
800
+ *
801
+ * @example
802
+ *
803
+ * ```tsx
804
+ * import { Fragment } from 'react';
805
+ *
806
+ * <Fragment>
807
+ * <td>Hello</td>
808
+ * <td>World</td>
809
+ * </Fragment>
810
+ * ```
811
+ *
812
+ * @example
813
+ *
814
+ * ```tsx
815
+ * // Using the <></> shorthand syntax:
816
+ *
817
+ * <>
818
+ * <td>Hello</td>
819
+ * <td>World</td>
820
+ * </>
821
+ * ```
822
+ */
823
+ const Fragment: ExoticComponent<{ children?: ReactNode | undefined }>;
824
+
825
+ /**
826
+ * Lets you find common bugs in your components early during development.
827
+ *
828
+ * @see {@link https://react.dev/reference/react/StrictMode React Docs}
829
+ *
830
+ * @example
831
+ *
832
+ * ```tsx
833
+ * import { StrictMode } from 'react';
834
+ *
835
+ * <StrictMode>
836
+ * <App />
837
+ * </StrictMode>
838
+ * ```
839
+ */
840
+ const StrictMode: ExoticComponent<{ children?: ReactNode | undefined }>;
841
+
842
+ /**
843
+ * The props accepted by {@link Suspense}.
844
+ *
845
+ * @see {@link https://react.dev/reference/react/Suspense React Docs}
846
+ */
847
+ interface SuspenseProps {
848
+ children?: ReactNode | undefined;
849
+
850
+ /** A fallback react tree to show when a Suspense child (like React.lazy) suspends */
851
+ fallback?: ReactNode;
852
+
853
+ /**
854
+ * A name for this Suspense boundary for instrumentation purposes.
855
+ * The name will help identify this boundary in React DevTools.
856
+ */
857
+ name?: string | undefined;
858
+ }
859
+
860
+ /**
861
+ * Lets you display a fallback until its children have finished loading.
862
+ *
863
+ * @see {@link https://react.dev/reference/react/Suspense React Docs}
864
+ *
865
+ * @example
866
+ *
867
+ * ```tsx
868
+ * import { Suspense } from 'react';
869
+ *
870
+ * <Suspense fallback={<Loading />}>
871
+ * <ProfileDetails />
872
+ * </Suspense>
873
+ * ```
874
+ */
875
+ const Suspense: ExoticComponent<SuspenseProps>;
876
+ const version: string;
877
+
878
+ /**
879
+ * The callback passed to {@link ProfilerProps.onRender}.
880
+ *
881
+ * @see {@link https://react.dev/reference/react/Profiler#onrender-callback React Docs}
882
+ */
883
+ type ProfilerOnRenderCallback = (
884
+ /**
885
+ * The string id prop of the {@link Profiler} tree that has just committed. This lets
886
+ * you identify which part of the tree was committed if you are using multiple
887
+ * profilers.
888
+ *
889
+ * @see {@link https://react.dev/reference/react/Profiler#onrender-callback React Docs}
890
+ */
891
+ id: string,
892
+ /**
893
+ * This lets you know whether the tree has just been mounted for the first time
894
+ * or re-rendered due to a change in props, state, or hooks.
895
+ *
896
+ * @see {@link https://react.dev/reference/react/Profiler#onrender-callback React Docs}
897
+ */
898
+ phase: "mount" | "update" | "nested-update",
899
+ /**
900
+ * The number of milliseconds spent rendering the {@link Profiler} and its descendants
901
+ * for the current update. This indicates how well the subtree makes use of
902
+ * memoization (e.g. {@link memo} and {@link useMemo}). Ideally this value should decrease
903
+ * significantly after the initial mount as many of the descendants will only need to
904
+ * re-render if their specific props change.
905
+ *
906
+ * @see {@link https://react.dev/reference/react/Profiler#onrender-callback React Docs}
907
+ */
908
+ actualDuration: number,
909
+ /**
910
+ * The number of milliseconds estimating how much time it would take to re-render the entire
911
+ * {@link Profiler} subtree without any optimizations. It is calculated by summing up the most
912
+ * recent render durations of each component in the tree. This value estimates a worst-case
913
+ * cost of rendering (e.g. the initial mount or a tree with no memoization). Compare
914
+ * {@link actualDuration} against it to see if memoization is working.
915
+ *
916
+ * @see {@link https://react.dev/reference/react/Profiler#onrender-callback React Docs}
917
+ */
918
+ baseDuration: number,
919
+ /**
920
+ * A numeric timestamp for when React began rendering the current update.
921
+ *
922
+ * @see {@link https://react.dev/reference/react/Profiler#onrender-callback React Docs}
923
+ */
924
+ startTime: number,
925
+ /**
926
+ * A numeric timestamp for when React committed the current update. This value is shared
927
+ * between all profilers in a commit, enabling them to be grouped if desirable.
928
+ *
929
+ * @see {@link https://react.dev/reference/react/Profiler#onrender-callback React Docs}
930
+ */
931
+ commitTime: number,
932
+ ) => void;
933
+
934
+ /**
935
+ * The props accepted by {@link Profiler}.
936
+ *
937
+ * @see {@link https://react.dev/reference/react/Profiler React Docs}
938
+ */
939
+ interface ProfilerProps {
940
+ children?: ReactNode | undefined;
941
+ id: string;
942
+ onRender: ProfilerOnRenderCallback;
943
+ }
944
+
945
+ /**
946
+ * Lets you measure rendering performance of a React tree programmatically.
947
+ *
948
+ * @see {@link https://react.dev/reference/react/Profiler#onrender-callback React Docs}
949
+ *
950
+ * @example
951
+ *
952
+ * ```tsx
953
+ * <Profiler id="App" onRender={onRender}>
954
+ * <App />
955
+ * </Profiler>
956
+ * ```
957
+ */
958
+ const Profiler: ExoticComponent<ProfilerProps>;
959
+
960
+ //
961
+ // Component API
962
+ // ----------------------------------------------------------------------
963
+
964
+ type ReactInstance = Component<any> | Element;
965
+
966
+ // Base component for plain JS classes
967
+ interface Component<P = {}, S = {}, SS = any> extends ComponentLifecycle<P, S, SS> {}
968
+ class Component<P, S> {
969
+ /**
970
+ * If set, `this.context` will be set at runtime to the current value of the given Context.
971
+ *
972
+ * @example
973
+ *
974
+ * ```ts
975
+ * type MyContext = number
976
+ * const Ctx = React.createContext<MyContext>(0)
977
+ *
978
+ * class Foo extends React.Component {
979
+ * static contextType = Ctx
980
+ * context!: React.ContextType<typeof Ctx>
981
+ * render () {
982
+ * return <>My context's value: {this.context}</>;
983
+ * }
984
+ * }
985
+ * ```
986
+ *
987
+ * @see {@link https://react.dev/reference/react/Component#static-contexttype}
988
+ */
989
+ static contextType?: Context<any> | undefined;
990
+
991
+ /**
992
+ * If using the new style context, re-declare this in your class to be the
993
+ * `React.ContextType` of your `static contextType`.
994
+ * Should be used with type annotation or static contextType.
995
+ *
996
+ * @example
997
+ * ```ts
998
+ * static contextType = MyContext
999
+ * // For TS pre-3.7:
1000
+ * context!: React.ContextType<typeof MyContext>
1001
+ * // For TS 3.7 and above:
1002
+ * declare context: React.ContextType<typeof MyContext>
1003
+ * ```
1004
+ *
1005
+ * @see {@link https://react.dev/reference/react/Component#context React Docs}
1006
+ */
1007
+ context: unknown;
1008
+
1009
+ constructor(props: P);
1010
+ /**
1011
+ * @deprecated
1012
+ * @see {@link https://legacy.reactjs.org/docs/legacy-context.html React Docs}
1013
+ */
1014
+ constructor(props: P, context: any);
1015
+
1016
+ // We MUST keep setState() as a unified signature because it allows proper checking of the method return type.
1017
+ // See: https://github.com/DefinitelyTyped/DefinitelyTyped/issues/18365#issuecomment-351013257
1018
+ // Also, the ` | S` allows intellisense to not be dumbisense
1019
+ setState<K extends keyof S>(
1020
+ state: ((prevState: Readonly<S>, props: Readonly<P>) => Pick<S, K> | S | null) | (Pick<S, K> | S | null),
1021
+ callback?: () => void,
1022
+ ): void;
1023
+
1024
+ forceUpdate(callback?: () => void): void;
1025
+ render(): ReactNode;
1026
+
1027
+ readonly props: Readonly<P>;
1028
+ state: Readonly<S>;
1029
+ /**
1030
+ * @deprecated
1031
+ *
1032
+ * @see {@link https://legacy.reactjs.org/docs/refs-and-the-dom.html#legacy-api-string-refs Legacy React Docs}
1033
+ */
1034
+ refs: {
1035
+ [key: string]: ReactInstance;
1036
+ };
1037
+ }
1038
+
1039
+ class PureComponent<P = {}, S = {}, SS = any> extends Component<P, S, SS> {}
1040
+
1041
+ /**
1042
+ * @deprecated Use `ClassicComponent` from `create-react-class`
1043
+ *
1044
+ * @see {@link https://legacy.reactjs.org/docs/react-without-es6.html Legacy React Docs}
1045
+ * @see {@link https://www.npmjs.com/package/create-react-class `create-react-class` on npm}
1046
+ */
1047
+ interface ClassicComponent<P = {}, S = {}> extends Component<P, S> {
1048
+ replaceState(nextState: S, callback?: () => void): void;
1049
+ isMounted(): boolean;
1050
+ getInitialState?(): S;
1051
+ }
1052
+
1053
+ interface ChildContextProvider<CC> {
1054
+ getChildContext(): CC;
1055
+ }
1056
+
1057
+ //
1058
+ // Class Interfaces
1059
+ // ----------------------------------------------------------------------
1060
+
1061
+ /**
1062
+ * Represents the type of a function component. Can optionally
1063
+ * receive a type argument that represents the props the component
1064
+ * receives.
1065
+ *
1066
+ * @template P The props the component accepts.
1067
+ * @see {@link https://react-typescript-cheatsheet.netlify.app/docs/basic/getting-started/function_components React TypeScript Cheatsheet}
1068
+ * @alias for {@link FunctionComponent}
1069
+ *
1070
+ * @example
1071
+ *
1072
+ * ```tsx
1073
+ * // With props:
1074
+ * type Props = { name: string }
1075
+ *
1076
+ * const MyComponent: FC<Props> = (props) => {
1077
+ * return <div>{props.name}</div>
1078
+ * }
1079
+ * ```
1080
+ *
1081
+ * @example
1082
+ *
1083
+ * ```tsx
1084
+ * // Without props:
1085
+ * const MyComponentWithoutProps: FC = () => {
1086
+ * return <div>MyComponentWithoutProps</div>
1087
+ * }
1088
+ * ```
1089
+ */
1090
+ type FC<P = {}> = FunctionComponent<P>;
1091
+
1092
+ /**
1093
+ * Represents the type of a function component. Can optionally
1094
+ * receive a type argument that represents the props the component
1095
+ * accepts.
1096
+ *
1097
+ * @template P The props the component accepts.
1098
+ * @see {@link https://react-typescript-cheatsheet.netlify.app/docs/basic/getting-started/function_components React TypeScript Cheatsheet}
1099
+ *
1100
+ * @example
1101
+ *
1102
+ * ```tsx
1103
+ * // With props:
1104
+ * type Props = { name: string }
1105
+ *
1106
+ * const MyComponent: FunctionComponent<Props> = (props) => {
1107
+ * return <div>{props.name}</div>
1108
+ * }
1109
+ * ```
1110
+ *
1111
+ * @example
1112
+ *
1113
+ * ```tsx
1114
+ * // Without props:
1115
+ * const MyComponentWithoutProps: FunctionComponent = () => {
1116
+ * return <div>MyComponentWithoutProps</div>
1117
+ * }
1118
+ * ```
1119
+ */
1120
+ interface FunctionComponent<P = {}> {
1121
+ (
1122
+ props: P,
1123
+ /**
1124
+ * @deprecated
1125
+ *
1126
+ * @see {@link https://legacy.reactjs.org/docs/legacy-context.html#referencing-context-in-lifecycle-methods React Docs}
1127
+ */
1128
+ deprecatedLegacyContext?: any,
1129
+ ): ReactElement<any, any> | null;
1130
+ /**
1131
+ * Used to declare the types of the props accepted by the
1132
+ * component. These types will be checked during rendering
1133
+ * and in development only.
1134
+ *
1135
+ * We recommend using TypeScript instead of checking prop
1136
+ * types at runtime.
1137
+ *
1138
+ * @see {@link https://react.dev/reference/react/Component#static-proptypes React Docs}
1139
+ */
1140
+ propTypes?: WeakValidationMap<P> | undefined;
1141
+ /**
1142
+ * @deprecated
1143
+ *
1144
+ * Lets you specify which legacy context is consumed by
1145
+ * this component.
1146
+ *
1147
+ * @see {@link https://legacy.reactjs.org/docs/legacy-context.html Legacy React Docs}
1148
+ */
1149
+ contextTypes?: ValidationMap<any> | undefined;
1150
+ /**
1151
+ * Used to define default values for the props accepted by
1152
+ * the component.
1153
+ *
1154
+ * @see {@link https://react.dev/reference/react/Component#static-defaultprops React Docs}
1155
+ *
1156
+ * @example
1157
+ *
1158
+ * ```tsx
1159
+ * type Props = { name?: string }
1160
+ *
1161
+ * const MyComponent: FC<Props> = (props) => {
1162
+ * return <div>{props.name}</div>
1163
+ * }
1164
+ *
1165
+ * MyComponent.defaultProps = {
1166
+ * name: 'John Doe'
1167
+ * }
1168
+ * ```
1169
+ *
1170
+ * @deprecated Use {@link https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Operators/Destructuring_assignment#default_value|default values for destructuring assignments instead}.
1171
+ */
1172
+ defaultProps?: Partial<P> | undefined;
1173
+ /**
1174
+ * Used in debugging messages. You might want to set it
1175
+ * explicitly if you want to display a different name for
1176
+ * debugging purposes.
1177
+ *
1178
+ * @see {@link https://legacy.reactjs.org/docs/react-component.html#displayname Legacy React Docs}
1179
+ *
1180
+ * @example
1181
+ *
1182
+ * ```tsx
1183
+ *
1184
+ * const MyComponent: FC = () => {
1185
+ * return <div>Hello!</div>
1186
+ * }
1187
+ *
1188
+ * MyComponent.displayName = 'MyAwesomeComponent'
1189
+ * ```
1190
+ */
1191
+ displayName?: string | undefined;
1192
+ }
1193
+
1194
+ /**
1195
+ * @deprecated - Equivalent to {@link React.FunctionComponent}.
1196
+ *
1197
+ * @see {@link React.FunctionComponent}
1198
+ * @alias {@link VoidFunctionComponent}
1199
+ */
1200
+ type VFC<P = {}> = VoidFunctionComponent<P>;
1201
+
1202
+ /**
1203
+ * @deprecated - Equivalent to {@link React.FunctionComponent}.
1204
+ *
1205
+ * @see {@link React.FunctionComponent}
1206
+ */
1207
+ interface VoidFunctionComponent<P = {}> {
1208
+ (
1209
+ props: P,
1210
+ /**
1211
+ * @deprecated
1212
+ *
1213
+ * @see {@link https://legacy.reactjs.org/docs/legacy-context.html#referencing-context-in-lifecycle-methods React Docs}
1214
+ */
1215
+ deprecatedLegacyContext?: any,
1216
+ ): ReactElement<any, any> | null;
1217
+ propTypes?: WeakValidationMap<P> | undefined;
1218
+ contextTypes?: ValidationMap<any> | undefined;
1219
+ /**
1220
+ * @deprecated Use {@link https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Operators/Destructuring_assignment#default_value|default values for destructuring assignments instead}.
1221
+ */
1222
+ defaultProps?: Partial<P> | undefined;
1223
+ displayName?: string | undefined;
1224
+ }
1225
+
1226
+ /**
1227
+ * The type of the ref received by a {@link ForwardRefRenderFunction}.
1228
+ *
1229
+ * @see {@link ForwardRefRenderFunction}
1230
+ */
1231
+ type ForwardedRef<T> = ((instance: T | null) => void) | MutableRefObject<T | null> | null;
1232
+
1233
+ /**
1234
+ * The type of the function passed to {@link forwardRef}. This is considered different
1235
+ * to a normal {@link FunctionComponent} because it receives an additional argument,
1236
+ *
1237
+ * @param props Props passed to the component, if any.
1238
+ * @param ref A ref forwarded to the component of type {@link ForwardedRef}.
1239
+ *
1240
+ * @template T The type of the forwarded ref.
1241
+ * @template P The type of the props the component accepts.
1242
+ *
1243
+ * @see {@link https://react-typescript-cheatsheet.netlify.app/docs/basic/getting-started/forward_and_create_ref/ React TypeScript Cheatsheet}
1244
+ * @see {@link forwardRef}
1245
+ */
1246
+ interface ForwardRefRenderFunction<T, P = {}> {
1247
+ (props: P, ref: ForwardedRef<T>): ReactElement | null;
1248
+ /**
1249
+ * Used in debugging messages. You might want to set it
1250
+ * explicitly if you want to display a different name for
1251
+ * debugging purposes.
1252
+ *
1253
+ * Will show `ForwardRef(${Component.displayName || Component.name})`
1254
+ * in devtools by default, but can be given its own specific name.
1255
+ *
1256
+ * @see {@link https://legacy.reactjs.org/docs/react-component.html#displayname Legacy React Docs}
1257
+ */
1258
+ displayName?: string | undefined;
1259
+ /**
1260
+ * defaultProps are not supported on render functions passed to forwardRef.
1261
+ *
1262
+ * @see {@link https://github.com/microsoft/TypeScript/issues/36826 linked GitHub issue} for context
1263
+ * @see {@link https://react.dev/reference/react/Component#static-defaultprops React Docs}
1264
+ */
1265
+ defaultProps?: never | undefined;
1266
+ /**
1267
+ * propTypes are not supported on render functions passed to forwardRef.
1268
+ *
1269
+ * @see {@link https://github.com/microsoft/TypeScript/issues/36826 linked GitHub issue} for context
1270
+ * @see {@link https://react.dev/reference/react/Component#static-proptypes React Docs}
1271
+ */
1272
+ propTypes?: never | undefined;
1273
+ }
1274
+
1275
+ /**
1276
+ * Represents a component class in React.
1277
+ *
1278
+ * @template P The props the component accepts.
1279
+ * @template S The internal state of the component.
1280
+ */
1281
+ interface ComponentClass<P = {}, S = ComponentState> extends StaticLifecycle<P, S> {
1282
+ new(
1283
+ props: P,
1284
+ /**
1285
+ * @deprecated
1286
+ *
1287
+ * @see {@link https://legacy.reactjs.org/docs/legacy-context.html#referencing-context-in-lifecycle-methods React Docs}
1288
+ */
1289
+ deprecatedLegacyContext?: any,
1290
+ ): Component<P, S>;
1291
+ /**
1292
+ * Used to declare the types of the props accepted by the
1293
+ * component. These types will be checked during rendering
1294
+ * and in development only.
1295
+ *
1296
+ * We recommend using TypeScript instead of checking prop
1297
+ * types at runtime.
1298
+ *
1299
+ * @see {@link https://react.dev/reference/react/Component#static-proptypes React Docs}
1300
+ */
1301
+ propTypes?: WeakValidationMap<P> | undefined;
1302
+ contextType?: Context<any> | undefined;
1303
+ /**
1304
+ * @deprecated use {@link ComponentClass.contextType} instead
1305
+ *
1306
+ * Lets you specify which legacy context is consumed by
1307
+ * this component.
1308
+ *
1309
+ * @see {@link https://legacy.reactjs.org/docs/legacy-context.html Legacy React Docs}
1310
+ */
1311
+ contextTypes?: ValidationMap<any> | undefined;
1312
+ /**
1313
+ * @deprecated
1314
+ *
1315
+ * @see {@link https://legacy.reactjs.org/docs/legacy-context.html#how-to-use-context Legacy React Docs}
1316
+ */
1317
+ childContextTypes?: ValidationMap<any> | undefined;
1318
+ /**
1319
+ * Used to define default values for the props accepted by
1320
+ * the component.
1321
+ *
1322
+ * @see {@link https://react.dev/reference/react/Component#static-defaultprops React Docs}
1323
+ */
1324
+ defaultProps?: Partial<P> | undefined;
1325
+ /**
1326
+ * Used in debugging messages. You might want to set it
1327
+ * explicitly if you want to display a different name for
1328
+ * debugging purposes.
1329
+ *
1330
+ * @see {@link https://legacy.reactjs.org/docs/react-component.html#displayname Legacy React Docs}
1331
+ */
1332
+ displayName?: string | undefined;
1333
+ }
1334
+
1335
+ /**
1336
+ * @deprecated Use `ClassicComponentClass` from `create-react-class`
1337
+ *
1338
+ * @see {@link https://legacy.reactjs.org/docs/react-without-es6.html Legacy React Docs}
1339
+ * @see {@link https://www.npmjs.com/package/create-react-class `create-react-class` on npm}
1340
+ */
1341
+ interface ClassicComponentClass<P = {}> extends ComponentClass<P> {
1342
+ new(props: P, deprecatedLegacyContext?: any): ClassicComponent<P, ComponentState>;
1343
+ getDefaultProps?(): P;
1344
+ }
1345
+
1346
+ /**
1347
+ * Used in {@link createElement} and {@link createFactory} to represent
1348
+ * a class.
1349
+ *
1350
+ * An intersection type is used to infer multiple type parameters from
1351
+ * a single argument, which is useful for many top-level API defs.
1352
+ * See {@link https://github.com/Microsoft/TypeScript/issues/7234 this GitHub issue}
1353
+ * for more info.
1354
+ */
1355
+ type ClassType<P, T extends Component<P, ComponentState>, C extends ComponentClass<P>> =
1356
+ & C
1357
+ & (new(props: P, deprecatedLegacyContext?: any) => T);
1358
+
1359
+ //
1360
+ // Component Specs and Lifecycle
1361
+ // ----------------------------------------------------------------------
1362
+
1363
+ // This should actually be something like `Lifecycle<P, S> | DeprecatedLifecycle<P, S>`,
1364
+ // as React will _not_ call the deprecated lifecycle methods if any of the new lifecycle
1365
+ // methods are present.
1366
+ interface ComponentLifecycle<P, S, SS = any> extends NewLifecycle<P, S, SS>, DeprecatedLifecycle<P, S> {
1367
+ /**
1368
+ * Called immediately after a component is mounted. Setting state here will trigger re-rendering.
1369
+ */
1370
+ componentDidMount?(): void;
1371
+ /**
1372
+ * Called to determine whether the change in props and state should trigger a re-render.
1373
+ *
1374
+ * `Component` always returns true.
1375
+ * `PureComponent` implements a shallow comparison on props and state and returns true if any
1376
+ * props or states have changed.
1377
+ *
1378
+ * If false is returned, {@link Component.render}, `componentWillUpdate`
1379
+ * and `componentDidUpdate` will not be called.
1380
+ */
1381
+ shouldComponentUpdate?(nextProps: Readonly<P>, nextState: Readonly<S>, nextContext: any): boolean;
1382
+ /**
1383
+ * Called immediately before a component is destroyed. Perform any necessary cleanup in this method, such as
1384
+ * cancelled network requests, or cleaning up any DOM elements created in `componentDidMount`.
1385
+ */
1386
+ componentWillUnmount?(): void;
1387
+ /**
1388
+ * Catches exceptions generated in descendant components. Unhandled exceptions will cause
1389
+ * the entire component tree to unmount.
1390
+ */
1391
+ componentDidCatch?(error: Error, errorInfo: ErrorInfo): void;
1392
+ }
1393
+
1394
+ // Unfortunately, we have no way of declaring that the component constructor must implement this
1395
+ interface StaticLifecycle<P, S> {
1396
+ getDerivedStateFromProps?: GetDerivedStateFromProps<P, S> | undefined;
1397
+ getDerivedStateFromError?: GetDerivedStateFromError<P, S> | undefined;
1398
+ }
1399
+
1400
+ type GetDerivedStateFromProps<P, S> =
1401
+ /**
1402
+ * Returns an update to a component's state based on its new props and old state.
1403
+ *
1404
+ * Note: its presence prevents any of the deprecated lifecycle methods from being invoked
1405
+ */
1406
+ (nextProps: Readonly<P>, prevState: S) => Partial<S> | null;
1407
+
1408
+ type GetDerivedStateFromError<P, S> =
1409
+ /**
1410
+ * This lifecycle is invoked after an error has been thrown by a descendant component.
1411
+ * It receives the error that was thrown as a parameter and should return a value to update state.
1412
+ *
1413
+ * Note: its presence prevents any of the deprecated lifecycle methods from being invoked
1414
+ */
1415
+ (error: any) => Partial<S> | null;
1416
+
1417
+ // This should be "infer SS" but can't use it yet
1418
+ interface NewLifecycle<P, S, SS> {
1419
+ /**
1420
+ * Runs before React applies the result of {@link Component.render render} to the document, and
1421
+ * returns an object to be given to {@link componentDidUpdate}. Useful for saving
1422
+ * things such as scroll position before {@link Component.render render} causes changes to it.
1423
+ *
1424
+ * Note: the presence of this method prevents any of the deprecated
1425
+ * lifecycle events from running.
1426
+ */
1427
+ getSnapshotBeforeUpdate?(prevProps: Readonly<P>, prevState: Readonly<S>): SS | null;
1428
+ /**
1429
+ * Called immediately after updating occurs. Not called for the initial render.
1430
+ *
1431
+ * The snapshot is only present if {@link getSnapshotBeforeUpdate} is present and returns non-null.
1432
+ */
1433
+ componentDidUpdate?(prevProps: Readonly<P>, prevState: Readonly<S>, snapshot?: SS): void;
1434
+ }
1435
+
1436
+ interface DeprecatedLifecycle<P, S> {
1437
+ /**
1438
+ * Called immediately before mounting occurs, and before {@link Component.render}.
1439
+ * Avoid introducing any side-effects or subscriptions in this method.
1440
+ *
1441
+ * Note: the presence of {@link NewLifecycle.getSnapshotBeforeUpdate getSnapshotBeforeUpdate}
1442
+ * or {@link StaticLifecycle.getDerivedStateFromProps getDerivedStateFromProps} prevents
1443
+ * this from being invoked.
1444
+ *
1445
+ * @deprecated 16.3, use {@link ComponentLifecycle.componentDidMount componentDidMount} or the constructor instead; will stop working in React 17
1446
+ * @see {@link https://legacy.reactjs.org/blog/2018/03/27/update-on-async-rendering.html#initializing-state}
1447
+ * @see {@link https://legacy.reactjs.org/blog/2018/03/27/update-on-async-rendering.html#gradual-migration-path}
1448
+ */
1449
+ componentWillMount?(): void;
1450
+ /**
1451
+ * Called immediately before mounting occurs, and before {@link Component.render}.
1452
+ * Avoid introducing any side-effects or subscriptions in this method.
1453
+ *
1454
+ * This method will not stop working in React 17.
1455
+ *
1456
+ * Note: the presence of {@link NewLifecycle.getSnapshotBeforeUpdate getSnapshotBeforeUpdate}
1457
+ * or {@link StaticLifecycle.getDerivedStateFromProps getDerivedStateFromProps} prevents
1458
+ * this from being invoked.
1459
+ *
1460
+ * @deprecated 16.3, use {@link ComponentLifecycle.componentDidMount componentDidMount} or the constructor instead
1461
+ * @see {@link https://legacy.reactjs.org/blog/2018/03/27/update-on-async-rendering.html#initializing-state}
1462
+ * @see {@link https://legacy.reactjs.org/blog/2018/03/27/update-on-async-rendering.html#gradual-migration-path}
1463
+ */
1464
+ UNSAFE_componentWillMount?(): void;
1465
+ /**
1466
+ * Called when the component may be receiving new props.
1467
+ * React may call this even if props have not changed, so be sure to compare new and existing
1468
+ * props if you only want to handle changes.
1469
+ *
1470
+ * Calling {@link Component.setState} generally does not trigger this method.
1471
+ *
1472
+ * Note: the presence of {@link NewLifecycle.getSnapshotBeforeUpdate getSnapshotBeforeUpdate}
1473
+ * or {@link StaticLifecycle.getDerivedStateFromProps getDerivedStateFromProps} prevents
1474
+ * this from being invoked.
1475
+ *
1476
+ * @deprecated 16.3, use static {@link StaticLifecycle.getDerivedStateFromProps getDerivedStateFromProps} instead; will stop working in React 17
1477
+ * @see {@link https://legacy.reactjs.org/blog/2018/03/27/update-on-async-rendering.html#updating-state-based-on-props}
1478
+ * @see {@link https://legacy.reactjs.org/blog/2018/03/27/update-on-async-rendering.html#gradual-migration-path}
1479
+ */
1480
+ componentWillReceiveProps?(nextProps: Readonly<P>, nextContext: any): void;
1481
+ /**
1482
+ * Called when the component may be receiving new props.
1483
+ * React may call this even if props have not changed, so be sure to compare new and existing
1484
+ * props if you only want to handle changes.
1485
+ *
1486
+ * Calling {@link Component.setState} generally does not trigger this method.
1487
+ *
1488
+ * This method will not stop working in React 17.
1489
+ *
1490
+ * Note: the presence of {@link NewLifecycle.getSnapshotBeforeUpdate getSnapshotBeforeUpdate}
1491
+ * or {@link StaticLifecycle.getDerivedStateFromProps getDerivedStateFromProps} prevents
1492
+ * this from being invoked.
1493
+ *
1494
+ * @deprecated 16.3, use static {@link StaticLifecycle.getDerivedStateFromProps getDerivedStateFromProps} instead
1495
+ * @see {@link https://legacy.reactjs.org/blog/2018/03/27/update-on-async-rendering.html#updating-state-based-on-props}
1496
+ * @see {@link https://legacy.reactjs.org/blog/2018/03/27/update-on-async-rendering.html#gradual-migration-path}
1497
+ */
1498
+ UNSAFE_componentWillReceiveProps?(nextProps: Readonly<P>, nextContext: any): void;
1499
+ /**
1500
+ * Called immediately before rendering when new props or state is received. Not called for the initial render.
1501
+ *
1502
+ * Note: You cannot call {@link Component.setState} here.
1503
+ *
1504
+ * Note: the presence of {@link NewLifecycle.getSnapshotBeforeUpdate getSnapshotBeforeUpdate}
1505
+ * or {@link StaticLifecycle.getDerivedStateFromProps getDerivedStateFromProps} prevents
1506
+ * this from being invoked.
1507
+ *
1508
+ * @deprecated 16.3, use getSnapshotBeforeUpdate instead; will stop working in React 17
1509
+ * @see {@link https://legacy.reactjs.org/blog/2018/03/27/update-on-async-rendering.html#reading-dom-properties-before-an-update}
1510
+ * @see {@link https://legacy.reactjs.org/blog/2018/03/27/update-on-async-rendering.html#gradual-migration-path}
1511
+ */
1512
+ componentWillUpdate?(nextProps: Readonly<P>, nextState: Readonly<S>, nextContext: any): void;
1513
+ /**
1514
+ * Called immediately before rendering when new props or state is received. Not called for the initial render.
1515
+ *
1516
+ * Note: You cannot call {@link Component.setState} here.
1517
+ *
1518
+ * This method will not stop working in React 17.
1519
+ *
1520
+ * Note: the presence of {@link NewLifecycle.getSnapshotBeforeUpdate getSnapshotBeforeUpdate}
1521
+ * or {@link StaticLifecycle.getDerivedStateFromProps getDerivedStateFromProps} prevents
1522
+ * this from being invoked.
1523
+ *
1524
+ * @deprecated 16.3, use getSnapshotBeforeUpdate instead
1525
+ * @see {@link https://legacy.reactjs.org/blog/2018/03/27/update-on-async-rendering.html#reading-dom-properties-before-an-update}
1526
+ * @see {@link https://legacy.reactjs.org/blog/2018/03/27/update-on-async-rendering.html#gradual-migration-path}
1527
+ */
1528
+ UNSAFE_componentWillUpdate?(nextProps: Readonly<P>, nextState: Readonly<S>, nextContext: any): void;
1529
+ }
1530
+
1531
+ /**
1532
+ * @deprecated
1533
+ *
1534
+ * @see {@link https://legacy.reactjs.org/blog/2016/07/13/mixins-considered-harmful.html Mixins Considered Harmful}
1535
+ */
1536
+ interface Mixin<P, S> extends ComponentLifecycle<P, S> {
1537
+ mixins?: Array<Mixin<P, S>> | undefined;
1538
+ statics?: {
1539
+ [key: string]: any;
1540
+ } | undefined;
1541
+
1542
+ displayName?: string | undefined;
1543
+ propTypes?: ValidationMap<any> | undefined;
1544
+ contextTypes?: ValidationMap<any> | undefined;
1545
+ childContextTypes?: ValidationMap<any> | undefined;
1546
+
1547
+ getDefaultProps?(): P;
1548
+ getInitialState?(): S;
1549
+ }
1550
+
1551
+ /**
1552
+ * @deprecated
1553
+ *
1554
+ * @see {@link https://legacy.reactjs.org/blog/2016/07/13/mixins-considered-harmful.html Mixins Considered Harmful}
1555
+ */
1556
+ interface ComponentSpec<P, S> extends Mixin<P, S> {
1557
+ render(): ReactNode;
1558
+
1559
+ [propertyName: string]: any;
1560
+ }
1561
+
1562
+ function createRef<T>(): RefObject<T>;
1563
+
1564
+ /**
1565
+ * The type of the component returned from {@link forwardRef}.
1566
+ *
1567
+ * @template P The props the component accepts, if any.
1568
+ *
1569
+ * @see {@link ExoticComponent}
1570
+ */
1571
+ interface ForwardRefExoticComponent<P> extends NamedExoticComponent<P> {
1572
+ /**
1573
+ * @deprecated Use {@link https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Operators/Destructuring_assignment#default_value|default values for destructuring assignments instead}.
1574
+ */
1575
+ defaultProps?: Partial<P> | undefined;
1576
+ propTypes?: WeakValidationMap<P> | undefined;
1577
+ }
1578
+
1579
+ /**
1580
+ * Lets your component expose a DOM node to a parent component
1581
+ * using a ref.
1582
+ *
1583
+ * @see {@link https://react.dev/reference/react/forwardRef React Docs}
1584
+ * @see {@link https://react-typescript-cheatsheet.netlify.app/docs/basic/getting-started/forward_and_create_ref/ React TypeScript Cheatsheet}
1585
+ *
1586
+ * @param render See the {@link ForwardRefRenderFunction}.
1587
+ *
1588
+ * @template T The type of the DOM node.
1589
+ * @template P The props the component accepts, if any.
1590
+ *
1591
+ * @example
1592
+ *
1593
+ * ```tsx
1594
+ * interface Props {
1595
+ * children?: ReactNode;
1596
+ * type: "submit" | "button";
1597
+ * }
1598
+ *
1599
+ * export const FancyButton = forwardRef<HTMLButtonElement, Props>((props, ref) => (
1600
+ * <button ref={ref} className="MyClassName" type={props.type}>
1601
+ * {props.children}
1602
+ * </button>
1603
+ * ));
1604
+ * ```
1605
+ */
1606
+ function forwardRef<T, P = {}>(
1607
+ render: ForwardRefRenderFunction<T, PropsWithoutRef<P>>,
1608
+ ): ForwardRefExoticComponent<PropsWithoutRef<P> & RefAttributes<T>>;
1609
+
1610
+ /**
1611
+ * Omits the 'ref' attribute from the given props object.
1612
+ *
1613
+ * @template P The props object type.
1614
+ */
1615
+ type PropsWithoutRef<P> =
1616
+ // Omit would not be sufficient for this. We'd like to avoid unnecessary mapping and need a distributive conditional to support unions.
1617
+ // see: https://www.typescriptlang.org/docs/handbook/2/conditional-types.html#distributive-conditional-types
1618
+ // https://github.com/Microsoft/TypeScript/issues/28339
1619
+ P extends any ? ("ref" extends keyof P ? Omit<P, "ref"> : P) : P;
1620
+ /** Ensures that the props do not include string ref, which cannot be forwarded */
1621
+ type PropsWithRef<P> =
1622
+ // Note: String refs can be forwarded. We can't fix this bug without breaking a bunch of libraries now though.
1623
+ // Just "P extends { ref?: infer R }" looks sufficient, but R will infer as {} if P is {}.
1624
+ "ref" extends keyof P
1625
+ ? P extends { ref?: infer R | undefined }
1626
+ ? string extends R ? PropsWithoutRef<P> & { ref?: Exclude<R, string> | undefined }
1627
+ : P
1628
+ : P
1629
+ : P;
1630
+
1631
+ type PropsWithChildren<P = unknown> = P & { children?: ReactNode | undefined };
1632
+
1633
+ /**
1634
+ * Used to retrieve the props a component accepts. Can either be passed a string,
1635
+ * indicating a DOM element (e.g. 'div', 'span', etc.) or the type of a React
1636
+ * component.
1637
+ *
1638
+ * It's usually better to use {@link ComponentPropsWithRef} or {@link ComponentPropsWithoutRef}
1639
+ * instead of this type, as they let you be explicit about whether or not to include
1640
+ * the `ref` prop.
1641
+ *
1642
+ * @see {@link https://react-typescript-cheatsheet.netlify.app/docs/react-types/componentprops/ React TypeScript Cheatsheet}
1643
+ *
1644
+ * @example
1645
+ *
1646
+ * ```tsx
1647
+ * // Retrieves the props an 'input' element accepts
1648
+ * type InputProps = React.ComponentProps<'input'>;
1649
+ * ```
1650
+ *
1651
+ * @example
1652
+ *
1653
+ * ```tsx
1654
+ * const MyComponent = (props: { foo: number, bar: string }) => <div />;
1655
+ *
1656
+ * // Retrieves the props 'MyComponent' accepts
1657
+ * type MyComponentProps = React.ComponentProps<typeof MyComponent>;
1658
+ * ```
1659
+ */
1660
+ type ComponentProps<T extends keyof JSX.IntrinsicElements | JSXElementConstructor<any>> = T extends
1661
+ JSXElementConstructor<infer P> ? P
1662
+ : T extends keyof JSX.IntrinsicElements ? JSX.IntrinsicElements[T]
1663
+ : {};
1664
+
1665
+ /**
1666
+ * Used to retrieve the props a component accepts with its ref. Can either be
1667
+ * passed a string, indicating a DOM element (e.g. 'div', 'span', etc.) or the
1668
+ * type of a React component.
1669
+ *
1670
+ * @see {@link https://react-typescript-cheatsheet.netlify.app/docs/react-types/componentprops/ React TypeScript Cheatsheet}
1671
+ *
1672
+ * @example
1673
+ *
1674
+ * ```tsx
1675
+ * // Retrieves the props an 'input' element accepts
1676
+ * type InputProps = React.ComponentPropsWithRef<'input'>;
1677
+ * ```
1678
+ *
1679
+ * @example
1680
+ *
1681
+ * ```tsx
1682
+ * const MyComponent = (props: { foo: number, bar: string }) => <div />;
1683
+ *
1684
+ * // Retrieves the props 'MyComponent' accepts
1685
+ * type MyComponentPropsWithRef = React.ComponentPropsWithRef<typeof MyComponent>;
1686
+ * ```
1687
+ */
1688
+ type ComponentPropsWithRef<T extends ElementType> = T extends (new(props: infer P) => Component<any, any>)
1689
+ ? PropsWithoutRef<P> & RefAttributes<InstanceType<T>>
1690
+ : PropsWithRef<ComponentProps<T>>;
1691
+ /**
1692
+ * Used to retrieve the props a custom component accepts with its ref.
1693
+ *
1694
+ * Unlike {@link ComponentPropsWithRef}, this only works with custom
1695
+ * components, i.e. components you define yourself. This is to improve
1696
+ * type-checking performance.
1697
+ *
1698
+ * @example
1699
+ *
1700
+ * ```tsx
1701
+ * const MyComponent = (props: { foo: number, bar: string }) => <div />;
1702
+ *
1703
+ * // Retrieves the props 'MyComponent' accepts
1704
+ * type MyComponentPropsWithRef = React.CustomComponentPropsWithRef<typeof MyComponent>;
1705
+ * ```
1706
+ */
1707
+ type CustomComponentPropsWithRef<T extends ComponentType> = T extends (new(props: infer P) => Component<any, any>)
1708
+ ? (PropsWithoutRef<P> & RefAttributes<InstanceType<T>>)
1709
+ : T extends ((props: infer P, legacyContext?: any) => ReactNode) ? PropsWithRef<P>
1710
+ : never;
1711
+
1712
+ /**
1713
+ * Used to retrieve the props a component accepts without its ref. Can either be
1714
+ * passed a string, indicating a DOM element (e.g. 'div', 'span', etc.) or the
1715
+ * type of a React component.
1716
+ *
1717
+ * @see {@link https://react-typescript-cheatsheet.netlify.app/docs/react-types/componentprops/ React TypeScript Cheatsheet}
1718
+ *
1719
+ * @example
1720
+ *
1721
+ * ```tsx
1722
+ * // Retrieves the props an 'input' element accepts
1723
+ * type InputProps = React.ComponentPropsWithoutRef<'input'>;
1724
+ * ```
1725
+ *
1726
+ * @example
1727
+ *
1728
+ * ```tsx
1729
+ * const MyComponent = (props: { foo: number, bar: string }) => <div />;
1730
+ *
1731
+ * // Retrieves the props 'MyComponent' accepts
1732
+ * type MyComponentPropsWithoutRef = React.ComponentPropsWithoutRef<typeof MyComponent>;
1733
+ * ```
1734
+ */
1735
+ type ComponentPropsWithoutRef<T extends ElementType> = PropsWithoutRef<ComponentProps<T>>;
1736
+
1737
+ type ComponentRef<T extends ElementType> = T extends NamedExoticComponent<
1738
+ ComponentPropsWithoutRef<T> & RefAttributes<infer Method>
1739
+ > ? Method
1740
+ : ComponentPropsWithRef<T> extends RefAttributes<infer Method> ? Method
1741
+ : never;
1742
+
1743
+ // will show `Memo(${Component.displayName || Component.name})` in devtools by default,
1744
+ // but can be given its own specific name
1745
+ type MemoExoticComponent<T extends ComponentType<any>> = NamedExoticComponent<CustomComponentPropsWithRef<T>> & {
1746
+ readonly type: T;
1747
+ };
1748
+
1749
+ /**
1750
+ * Lets you skip re-rendering a component when its props are unchanged.
1751
+ *
1752
+ * @see {@link https://react.dev/reference/react/memo React Docs}
1753
+ *
1754
+ * @param Component The component to memoize.
1755
+ * @param propsAreEqual A function that will be used to determine if the props have changed.
1756
+ *
1757
+ * @example
1758
+ *
1759
+ * ```tsx
1760
+ * import { memo } from 'react';
1761
+ *
1762
+ * const SomeComponent = memo(function SomeComponent(props: { foo: string }) {
1763
+ * // ...
1764
+ * });
1765
+ * ```
1766
+ */
1767
+ function memo<P extends object>(
1768
+ Component: FunctionComponent<P>,
1769
+ propsAreEqual?: (prevProps: Readonly<P>, nextProps: Readonly<P>) => boolean,
1770
+ ): NamedExoticComponent<P>;
1771
+ function memo<T extends ComponentType<any>>(
1772
+ Component: T,
1773
+ propsAreEqual?: (prevProps: Readonly<ComponentProps<T>>, nextProps: Readonly<ComponentProps<T>>) => boolean,
1774
+ ): MemoExoticComponent<T>;
1775
+
1776
+ interface LazyExoticComponent<T extends ComponentType<any>>
1777
+ extends ExoticComponent<CustomComponentPropsWithRef<T>>
1778
+ {
1779
+ readonly _result: T;
1780
+ }
1781
+
1782
+ /**
1783
+ * Lets you defer loading a component’s code until it is rendered for the first time.
1784
+ *
1785
+ * @see {@link https://react.dev/reference/react/lazy React Docs}
1786
+ *
1787
+ * @param load A function that returns a `Promise` or another thenable (a `Promise`-like object with a
1788
+ * then method). React will not call `load` until the first time you attempt to render the returned
1789
+ * component. After React first calls load, it will wait for it to resolve, and then render the
1790
+ * resolved value’s `.default` as a React component. Both the returned `Promise` and the `Promise`’s
1791
+ * resolved value will be cached, so React will not call load more than once. If the `Promise` rejects,
1792
+ * React will throw the rejection reason for the nearest Error Boundary to handle.
1793
+ *
1794
+ * @example
1795
+ *
1796
+ * ```tsx
1797
+ * import { lazy } from 'react';
1798
+ *
1799
+ * const MarkdownPreview = lazy(() => import('./MarkdownPreview.js'));
1800
+ * ```
1801
+ */
1802
+ function lazy<T extends ComponentType<any>>(
1803
+ load: () => Promise<{ default: T }>,
1804
+ ): LazyExoticComponent<T>;
1805
+
1806
+ //
1807
+ // React Hooks
1808
+ // ----------------------------------------------------------------------
1809
+
1810
+ /**
1811
+ * The instruction passed to a {@link Dispatch} function in {@link useState}
1812
+ * to tell React what the next value of the {@link useState} should be.
1813
+ *
1814
+ * Often found wrapped in {@link Dispatch}.
1815
+ *
1816
+ * @template S The type of the state.
1817
+ *
1818
+ * @example
1819
+ *
1820
+ * ```tsx
1821
+ * // This return type correctly represents the type of
1822
+ * // `setCount` in the example below.
1823
+ * const useCustomState = (): Dispatch<SetStateAction<number>> => {
1824
+ * const [count, setCount] = useState(0);
1825
+ *
1826
+ * return setCount;
1827
+ * }
1828
+ * ```
1829
+ */
1830
+ type SetStateAction<S> = S | ((prevState: S) => S);
1831
+
1832
+ /**
1833
+ * A function that can be used to update the state of a {@link useState}
1834
+ * or {@link useReducer} hook.
1835
+ */
1836
+ type Dispatch<A> = (value: A) => void;
1837
+ /**
1838
+ * A {@link Dispatch} function can sometimes be called without any arguments.
1839
+ */
1840
+ type DispatchWithoutAction = () => void;
1841
+ // Unlike redux, the actions _can_ be anything
1842
+ type Reducer<S, A> = (prevState: S, action: A) => S;
1843
+ // If useReducer accepts a reducer without action, dispatch may be called without any parameters.
1844
+ type ReducerWithoutAction<S> = (prevState: S) => S;
1845
+ // types used to try and prevent the compiler from reducing S
1846
+ // to a supertype common with the second argument to useReducer()
1847
+ type ReducerState<R extends Reducer<any, any>> = R extends Reducer<infer S, any> ? S : never;
1848
+ type ReducerAction<R extends Reducer<any, any>> = R extends Reducer<any, infer A> ? A : never;
1849
+ // The identity check is done with the SameValue algorithm (Object.is), which is stricter than ===
1850
+ type ReducerStateWithoutAction<R extends ReducerWithoutAction<any>> = R extends ReducerWithoutAction<infer S> ? S
1851
+ : never;
1852
+ type DependencyList = readonly unknown[];
1853
+
1854
+ // NOTE: callbacks are _only_ allowed to return either void, or a destructor.
1855
+ type EffectCallback = () => void | Destructor;
1856
+
1857
+ interface MutableRefObject<T> {
1858
+ current: T;
1859
+ }
1860
+
1861
+ // This will technically work if you give a Consumer<T> or Provider<T> but it's deprecated and warns
1862
+ /**
1863
+ * Accepts a context object (the value returned from `React.createContext`) and returns the current
1864
+ * context value, as given by the nearest context provider for the given context.
1865
+ *
1866
+ * @version 16.8.0
1867
+ * @see {@link https://react.dev/reference/react/useContext}
1868
+ */
1869
+ function useContext<T>(context: Context<T> /*, (not public API) observedBits?: number|boolean */): T;
1870
+ /**
1871
+ * Returns a stateful value, and a function to update it.
1872
+ *
1873
+ * @version 16.8.0
1874
+ * @see {@link https://react.dev/reference/react/useState}
1875
+ */
1876
+ function useState<S>(initialState: S | (() => S)): [S, Dispatch<SetStateAction<S>>];
1877
+ // convenience overload when first argument is omitted
1878
+ /**
1879
+ * Returns a stateful value, and a function to update it.
1880
+ *
1881
+ * @version 16.8.0
1882
+ * @see {@link https://react.dev/reference/react/useState}
1883
+ */
1884
+ function useState<S = undefined>(): [S | undefined, Dispatch<SetStateAction<S | undefined>>];
1885
+ /**
1886
+ * An alternative to `useState`.
1887
+ *
1888
+ * `useReducer` is usually preferable to `useState` when you have complex state logic that involves
1889
+ * multiple sub-values. It also lets you optimize performance for components that trigger deep
1890
+ * updates because you can pass `dispatch` down instead of callbacks.
1891
+ *
1892
+ * @version 16.8.0
1893
+ * @see {@link https://react.dev/reference/react/useReducer}
1894
+ */
1895
+ // overload where dispatch could accept 0 arguments.
1896
+ function useReducer<R extends ReducerWithoutAction<any>, I>(
1897
+ reducer: R,
1898
+ initializerArg: I,
1899
+ initializer: (arg: I) => ReducerStateWithoutAction<R>,
1900
+ ): [ReducerStateWithoutAction<R>, DispatchWithoutAction];
1901
+ /**
1902
+ * An alternative to `useState`.
1903
+ *
1904
+ * `useReducer` is usually preferable to `useState` when you have complex state logic that involves
1905
+ * multiple sub-values. It also lets you optimize performance for components that trigger deep
1906
+ * updates because you can pass `dispatch` down instead of callbacks.
1907
+ *
1908
+ * @version 16.8.0
1909
+ * @see {@link https://react.dev/reference/react/useReducer}
1910
+ */
1911
+ // overload where dispatch could accept 0 arguments.
1912
+ function useReducer<R extends ReducerWithoutAction<any>>(
1913
+ reducer: R,
1914
+ initializerArg: ReducerStateWithoutAction<R>,
1915
+ initializer?: undefined,
1916
+ ): [ReducerStateWithoutAction<R>, DispatchWithoutAction];
1917
+ /**
1918
+ * An alternative to `useState`.
1919
+ *
1920
+ * `useReducer` is usually preferable to `useState` when you have complex state logic that involves
1921
+ * multiple sub-values. It also lets you optimize performance for components that trigger deep
1922
+ * updates because you can pass `dispatch` down instead of callbacks.
1923
+ *
1924
+ * @version 16.8.0
1925
+ * @see {@link https://react.dev/reference/react/useReducer}
1926
+ */
1927
+ // overload where "I" may be a subset of ReducerState<R>; used to provide autocompletion.
1928
+ // If "I" matches ReducerState<R> exactly then the last overload will allow initializer to be omitted.
1929
+ // the last overload effectively behaves as if the identity function (x => x) is the initializer.
1930
+ function useReducer<R extends Reducer<any, any>, I>(
1931
+ reducer: R,
1932
+ initializerArg: I & ReducerState<R>,
1933
+ initializer: (arg: I & ReducerState<R>) => ReducerState<R>,
1934
+ ): [ReducerState<R>, Dispatch<ReducerAction<R>>];
1935
+ /**
1936
+ * An alternative to `useState`.
1937
+ *
1938
+ * `useReducer` is usually preferable to `useState` when you have complex state logic that involves
1939
+ * multiple sub-values. It also lets you optimize performance for components that trigger deep
1940
+ * updates because you can pass `dispatch` down instead of callbacks.
1941
+ *
1942
+ * @version 16.8.0
1943
+ * @see {@link https://react.dev/reference/react/useReducer}
1944
+ */
1945
+ // overload for free "I"; all goes as long as initializer converts it into "ReducerState<R>".
1946
+ function useReducer<R extends Reducer<any, any>, I>(
1947
+ reducer: R,
1948
+ initializerArg: I,
1949
+ initializer: (arg: I) => ReducerState<R>,
1950
+ ): [ReducerState<R>, Dispatch<ReducerAction<R>>];
1951
+ /**
1952
+ * An alternative to `useState`.
1953
+ *
1954
+ * `useReducer` is usually preferable to `useState` when you have complex state logic that involves
1955
+ * multiple sub-values. It also lets you optimize performance for components that trigger deep
1956
+ * updates because you can pass `dispatch` down instead of callbacks.
1957
+ *
1958
+ * @version 16.8.0
1959
+ * @see {@link https://react.dev/reference/react/useReducer}
1960
+ */
1961
+
1962
+ // I'm not sure if I keep this 2-ary or if I make it (2,3)-ary; it's currently (2,3)-ary.
1963
+ // The Flow types do have an overload for 3-ary invocation with undefined initializer.
1964
+
1965
+ // NOTE: without the ReducerState indirection, TypeScript would reduce S to be the most common
1966
+ // supertype between the reducer's return type and the initialState (or the initializer's return type),
1967
+ // which would prevent autocompletion from ever working.
1968
+
1969
+ // TODO: double-check if this weird overload logic is necessary. It is possible it's either a bug
1970
+ // in older versions, or a regression in newer versions of the typescript completion service.
1971
+ function useReducer<R extends Reducer<any, any>>(
1972
+ reducer: R,
1973
+ initialState: ReducerState<R>,
1974
+ initializer?: undefined,
1975
+ ): [ReducerState<R>, Dispatch<ReducerAction<R>>];
1976
+ /**
1977
+ * `useRef` returns a mutable ref object whose `.current` property is initialized to the passed argument
1978
+ * (`initialValue`). The returned object will persist for the full lifetime of the component.
1979
+ *
1980
+ * Note that `useRef()` is useful for more than the `ref` attribute. It’s handy for keeping any mutable
1981
+ * value around similar to how you’d use instance fields in classes.
1982
+ *
1983
+ * @version 16.8.0
1984
+ * @see {@link https://react.dev/reference/react/useRef}
1985
+ */
1986
+ function useRef<T>(initialValue: T): MutableRefObject<T>;
1987
+ // convenience overload for refs given as a ref prop as they typically start with a null value
1988
+ /**
1989
+ * `useRef` returns a mutable ref object whose `.current` property is initialized to the passed argument
1990
+ * (`initialValue`). The returned object will persist for the full lifetime of the component.
1991
+ *
1992
+ * Note that `useRef()` is useful for more than the `ref` attribute. It’s handy for keeping any mutable
1993
+ * value around similar to how you’d use instance fields in classes.
1994
+ *
1995
+ * Usage note: if you need the result of useRef to be directly mutable, include `| null` in the type
1996
+ * of the generic argument.
1997
+ *
1998
+ * @version 16.8.0
1999
+ * @see {@link https://react.dev/reference/react/useRef}
2000
+ */
2001
+ function useRef<T>(initialValue: T | null): RefObject<T>;
2002
+ // convenience overload for potentially undefined initialValue / call with 0 arguments
2003
+ // has a default to stop it from defaulting to {} instead
2004
+ /**
2005
+ * `useRef` returns a mutable ref object whose `.current` property is initialized to the passed argument
2006
+ * (`initialValue`). The returned object will persist for the full lifetime of the component.
2007
+ *
2008
+ * Note that `useRef()` is useful for more than the `ref` attribute. It’s handy for keeping any mutable
2009
+ * value around similar to how you’d use instance fields in classes.
2010
+ *
2011
+ * @version 16.8.0
2012
+ * @see {@link https://react.dev/reference/react/useRef}
2013
+ */
2014
+ function useRef<T = undefined>(): MutableRefObject<T | undefined>;
2015
+ /**
2016
+ * The signature is identical to `useEffect`, but it fires synchronously after all DOM mutations.
2017
+ * Use this to read layout from the DOM and synchronously re-render. Updates scheduled inside
2018
+ * `useLayoutEffect` will be flushed synchronously, before the browser has a chance to paint.
2019
+ *
2020
+ * Prefer the standard `useEffect` when possible to avoid blocking visual updates.
2021
+ *
2022
+ * If you’re migrating code from a class component, `useLayoutEffect` fires in the same phase as
2023
+ * `componentDidMount` and `componentDidUpdate`.
2024
+ *
2025
+ * @version 16.8.0
2026
+ * @see {@link https://react.dev/reference/react/useLayoutEffect}
2027
+ */
2028
+ function useLayoutEffect(effect: EffectCallback, deps?: DependencyList): void;
2029
+ /**
2030
+ * Accepts a function that contains imperative, possibly effectful code.
2031
+ *
2032
+ * @param effect Imperative function that can return a cleanup function
2033
+ * @param deps If present, effect will only activate if the values in the list change.
2034
+ *
2035
+ * @version 16.8.0
2036
+ * @see {@link https://react.dev/reference/react/useEffect}
2037
+ */
2038
+ function useEffect(effect: EffectCallback, deps?: DependencyList): void;
2039
+ // NOTE: this does not accept strings, but this will have to be fixed by removing strings from type Ref<T>
2040
+ /**
2041
+ * `useImperativeHandle` customizes the instance value that is exposed to parent components when using
2042
+ * `ref`. As always, imperative code using refs should be avoided in most cases.
2043
+ *
2044
+ * `useImperativeHandle` should be used with `React.forwardRef`.
2045
+ *
2046
+ * @version 16.8.0
2047
+ * @see {@link https://react.dev/reference/react/useImperativeHandle}
2048
+ */
2049
+ function useImperativeHandle<T, R extends T>(ref: Ref<T> | undefined, init: () => R, deps?: DependencyList): void;
2050
+ // I made 'inputs' required here and in useMemo as there's no point to memoizing without the memoization key
2051
+ // useCallback(X) is identical to just using X, useMemo(() => Y) is identical to just using Y.
2052
+ /**
2053
+ * `useCallback` will return a memoized version of the callback that only changes if one of the `inputs`
2054
+ * has changed.
2055
+ *
2056
+ * @version 16.8.0
2057
+ * @see {@link https://react.dev/reference/react/useCallback}
2058
+ */
2059
+ // A specific function type would not trigger implicit any.
2060
+ // See https://github.com/DefinitelyTyped/DefinitelyTyped/issues/52873#issuecomment-845806435 for a comparison between `Function` and more specific types.
2061
+ // eslint-disable-next-line @typescript-eslint/no-unsafe-function-type
2062
+ function useCallback<T extends Function>(callback: T, deps: DependencyList): T;
2063
+ /**
2064
+ * `useMemo` will only recompute the memoized value when one of the `deps` has changed.
2065
+ *
2066
+ * @version 16.8.0
2067
+ * @see {@link https://react.dev/reference/react/useMemo}
2068
+ */
2069
+ // allow undefined, but don't make it optional as that is very likely a mistake
2070
+ function useMemo<T>(factory: () => T, deps: DependencyList): T;
2071
+ /**
2072
+ * `useDebugValue` can be used to display a label for custom hooks in React DevTools.
2073
+ *
2074
+ * NOTE: We don’t recommend adding debug values to every custom hook.
2075
+ * It’s most valuable for custom hooks that are part of shared libraries.
2076
+ *
2077
+ * @version 16.8.0
2078
+ * @see {@link https://react.dev/reference/react/useDebugValue}
2079
+ */
2080
+ // the name of the custom hook is itself derived from the function name at runtime:
2081
+ // it's just the function name without the "use" prefix.
2082
+ function useDebugValue<T>(value: T, format?: (value: T) => any): void;
2083
+
2084
+ // must be synchronous
2085
+ export type TransitionFunction = () => VoidOrUndefinedOnly;
2086
+ // strange definition to allow vscode to show documentation on the invocation
2087
+ export interface TransitionStartFunction {
2088
+ /**
2089
+ * State updates caused inside the callback are allowed to be deferred.
2090
+ *
2091
+ * **If some state update causes a component to suspend, that state update should be wrapped in a transition.**
2092
+ *
2093
+ * @param callback A _synchronous_ function which causes state updates that can be deferred.
2094
+ */
2095
+ (callback: TransitionFunction): void;
2096
+ }
2097
+
2098
+ /**
2099
+ * Returns a deferred version of the value that may “lag behind” it.
2100
+ *
2101
+ * This is commonly used to keep the interface responsive when you have something that renders immediately
2102
+ * based on user input and something that needs to wait for a data fetch.
2103
+ *
2104
+ * A good example of this is a text input.
2105
+ *
2106
+ * @param value The value that is going to be deferred
2107
+ *
2108
+ * @see {@link https://react.dev/reference/react/useDeferredValue}
2109
+ */
2110
+ export function useDeferredValue<T>(value: T): T;
2111
+
2112
+ /**
2113
+ * Allows components to avoid undesirable loading states by waiting for content to load
2114
+ * before transitioning to the next screen. It also allows components to defer slower,
2115
+ * data fetching updates until subsequent renders so that more crucial updates can be
2116
+ * rendered immediately.
2117
+ *
2118
+ * The `useTransition` hook returns two values in an array.
2119
+ *
2120
+ * The first is a boolean, React’s way of informing us whether we’re waiting for the transition to finish.
2121
+ * The second is a function that takes a callback. We can use it to tell React which state we want to defer.
2122
+ *
2123
+ * **If some state update causes a component to suspend, that state update should be wrapped in a transition.**
2124
+ *
2125
+ * @see {@link https://react.dev/reference/react/useTransition}
2126
+ */
2127
+ export function useTransition(): [boolean, TransitionStartFunction];
2128
+
2129
+ /**
2130
+ * Similar to `useTransition` but allows uses where hooks are not available.
2131
+ *
2132
+ * @param callback A _synchronous_ function which causes state updates that can be deferred.
2133
+ */
2134
+ export function startTransition(scope: TransitionFunction): void;
2135
+
2136
+ /**
2137
+ * Wrap any code rendering and triggering updates to your components into `act()` calls.
2138
+ *
2139
+ * Ensures that the behavior in your tests matches what happens in the browser
2140
+ * more closely by executing pending `useEffect`s before returning. This also
2141
+ * reduces the amount of re-renders done.
2142
+ *
2143
+ * @param callback A synchronous, void callback that will execute as a single, complete React commit.
2144
+ *
2145
+ * @see https://reactjs.org/blog/2019/02/06/react-v16.8.0.html#testing-hooks
2146
+ */
2147
+ // While act does always return Thenable, if a void function is passed, we pretend the return value is also void to not trigger dangling Promise lint rules.
2148
+ export function act(callback: () => VoidOrUndefinedOnly): void;
2149
+ export function act<T>(callback: () => T | Promise<T>): Promise<T>;
2150
+
2151
+ export function useId(): string;
2152
+
2153
+ /**
2154
+ * @param effect Imperative function that can return a cleanup function
2155
+ * @param deps If present, effect will only activate if the values in the list change.
2156
+ *
2157
+ * @see {@link https://github.com/facebook/react/pull/21913}
2158
+ */
2159
+ export function useInsertionEffect(effect: EffectCallback, deps?: DependencyList): void;
2160
+
2161
+ /**
2162
+ * @param subscribe
2163
+ * @param getSnapshot
2164
+ *
2165
+ * @see {@link https://github.com/reactwg/react-18/discussions/86}
2166
+ */
2167
+ // keep in sync with `useSyncExternalStore` from `use-sync-external-store`
2168
+ export function useSyncExternalStore<Snapshot>(
2169
+ subscribe: (onStoreChange: () => void) => () => void,
2170
+ getSnapshot: () => Snapshot,
2171
+ getServerSnapshot?: () => Snapshot,
2172
+ ): Snapshot;
2173
+
2174
+ //
2175
+ // Event System
2176
+ // ----------------------------------------------------------------------
2177
+ // TODO: change any to unknown when moving to TS v3
2178
+ interface BaseSyntheticEvent<E = object, C = any, T = any> {
2179
+ nativeEvent: E;
2180
+ currentTarget: C;
2181
+ target: T;
2182
+ bubbles: boolean;
2183
+ cancelable: boolean;
2184
+ defaultPrevented: boolean;
2185
+ eventPhase: number;
2186
+ isTrusted: boolean;
2187
+ preventDefault(): void;
2188
+ isDefaultPrevented(): boolean;
2189
+ stopPropagation(): void;
2190
+ isPropagationStopped(): boolean;
2191
+ persist(): void;
2192
+ timeStamp: number;
2193
+ type: string;
2194
+ }
2195
+
2196
+ /**
2197
+ * currentTarget - a reference to the element on which the event listener is registered.
2198
+ *
2199
+ * target - a reference to the element from which the event was originally dispatched.
2200
+ * This might be a child element to the element on which the event listener is registered.
2201
+ * If you thought this should be `EventTarget & T`, see https://github.com/DefinitelyTyped/DefinitelyTyped/issues/11508#issuecomment-256045682
2202
+ */
2203
+ interface SyntheticEvent<T = Element, E = Event> extends BaseSyntheticEvent<E, EventTarget & T, EventTarget> {}
2204
+
2205
+ interface ClipboardEvent<T = Element> extends SyntheticEvent<T, NativeClipboardEvent> {
2206
+ clipboardData: DataTransfer;
2207
+ }
2208
+
2209
+ interface CompositionEvent<T = Element> extends SyntheticEvent<T, NativeCompositionEvent> {
2210
+ data: string;
2211
+ }
2212
+
2213
+ interface DragEvent<T = Element> extends MouseEvent<T, NativeDragEvent> {
2214
+ dataTransfer: DataTransfer;
2215
+ }
2216
+
2217
+ interface PointerEvent<T = Element> extends MouseEvent<T, NativePointerEvent> {
2218
+ pointerId: number;
2219
+ pressure: number;
2220
+ tangentialPressure: number;
2221
+ tiltX: number;
2222
+ tiltY: number;
2223
+ twist: number;
2224
+ width: number;
2225
+ height: number;
2226
+ pointerType: "mouse" | "pen" | "touch";
2227
+ isPrimary: boolean;
2228
+ }
2229
+
2230
+ interface FocusEvent<Target = Element, RelatedTarget = Element> extends SyntheticEvent<Target, NativeFocusEvent> {
2231
+ relatedTarget: (EventTarget & RelatedTarget) | null;
2232
+ target: EventTarget & Target;
2233
+ }
2234
+
2235
+ interface FormEvent<T = Element> extends SyntheticEvent<T> {
2236
+ }
2237
+
2238
+ interface InvalidEvent<T = Element> extends SyntheticEvent<T> {
2239
+ target: EventTarget & T;
2240
+ }
2241
+
2242
+ interface ChangeEvent<T = Element> extends SyntheticEvent<T> {
2243
+ target: EventTarget & T;
2244
+ }
2245
+
2246
+ export type ModifierKey =
2247
+ | "Alt"
2248
+ | "AltGraph"
2249
+ | "CapsLock"
2250
+ | "Control"
2251
+ | "Fn"
2252
+ | "FnLock"
2253
+ | "Hyper"
2254
+ | "Meta"
2255
+ | "NumLock"
2256
+ | "ScrollLock"
2257
+ | "Shift"
2258
+ | "Super"
2259
+ | "Symbol"
2260
+ | "SymbolLock";
2261
+
2262
+ interface KeyboardEvent<T = Element> extends UIEvent<T, NativeKeyboardEvent> {
2263
+ altKey: boolean;
2264
+ /** @deprecated */
2265
+ charCode: number;
2266
+ ctrlKey: boolean;
2267
+ code: string;
2268
+ /**
2269
+ * 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.
2270
+ */
2271
+ getModifierState(key: ModifierKey): boolean;
2272
+ /**
2273
+ * See the [DOM Level 3 Events spec](https://www.w3.org/TR/uievents-key/#named-key-attribute-values). for possible values
2274
+ */
2275
+ key: string;
2276
+ /** @deprecated */
2277
+ keyCode: number;
2278
+ locale: string;
2279
+ location: number;
2280
+ metaKey: boolean;
2281
+ repeat: boolean;
2282
+ shiftKey: boolean;
2283
+ /** @deprecated */
2284
+ which: number;
2285
+ }
2286
+
2287
+ interface MouseEvent<T = Element, E = NativeMouseEvent> extends UIEvent<T, E> {
2288
+ altKey: boolean;
2289
+ button: number;
2290
+ buttons: number;
2291
+ clientX: number;
2292
+ clientY: number;
2293
+ ctrlKey: boolean;
2294
+ /**
2295
+ * 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.
2296
+ */
2297
+ getModifierState(key: ModifierKey): boolean;
2298
+ metaKey: boolean;
2299
+ movementX: number;
2300
+ movementY: number;
2301
+ pageX: number;
2302
+ pageY: number;
2303
+ relatedTarget: EventTarget | null;
2304
+ screenX: number;
2305
+ screenY: number;
2306
+ shiftKey: boolean;
2307
+ }
2308
+
2309
+ interface TouchEvent<T = Element> extends UIEvent<T, NativeTouchEvent> {
2310
+ altKey: boolean;
2311
+ changedTouches: TouchList;
2312
+ ctrlKey: boolean;
2313
+ /**
2314
+ * 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.
2315
+ */
2316
+ getModifierState(key: ModifierKey): boolean;
2317
+ metaKey: boolean;
2318
+ shiftKey: boolean;
2319
+ targetTouches: TouchList;
2320
+ touches: TouchList;
2321
+ }
2322
+
2323
+ interface UIEvent<T = Element, E = NativeUIEvent> extends SyntheticEvent<T, E> {
2324
+ detail: number;
2325
+ view: AbstractView;
2326
+ }
2327
+
2328
+ interface WheelEvent<T = Element> extends MouseEvent<T, NativeWheelEvent> {
2329
+ deltaMode: number;
2330
+ deltaX: number;
2331
+ deltaY: number;
2332
+ deltaZ: number;
2333
+ }
2334
+
2335
+ interface AnimationEvent<T = Element> extends SyntheticEvent<T, NativeAnimationEvent> {
2336
+ animationName: string;
2337
+ elapsedTime: number;
2338
+ pseudoElement: string;
2339
+ }
2340
+
2341
+ interface TransitionEvent<T = Element> extends SyntheticEvent<T, NativeTransitionEvent> {
2342
+ elapsedTime: number;
2343
+ propertyName: string;
2344
+ pseudoElement: string;
2345
+ }
2346
+
2347
+ //
2348
+ // Event Handler Types
2349
+ // ----------------------------------------------------------------------
2350
+
2351
+ type EventHandler<E extends SyntheticEvent<any>> = { bivarianceHack(event: E): void }["bivarianceHack"];
2352
+
2353
+ type ReactEventHandler<T = Element> = EventHandler<SyntheticEvent<T>>;
2354
+
2355
+ type ClipboardEventHandler<T = Element> = EventHandler<ClipboardEvent<T>>;
2356
+ type CompositionEventHandler<T = Element> = EventHandler<CompositionEvent<T>>;
2357
+ type DragEventHandler<T = Element> = EventHandler<DragEvent<T>>;
2358
+ type FocusEventHandler<T = Element> = EventHandler<FocusEvent<T>>;
2359
+ type FormEventHandler<T = Element> = EventHandler<FormEvent<T>>;
2360
+ type ChangeEventHandler<T = Element> = EventHandler<ChangeEvent<T>>;
2361
+ type KeyboardEventHandler<T = Element> = EventHandler<KeyboardEvent<T>>;
2362
+ type MouseEventHandler<T = Element> = EventHandler<MouseEvent<T>>;
2363
+ type TouchEventHandler<T = Element> = EventHandler<TouchEvent<T>>;
2364
+ type PointerEventHandler<T = Element> = EventHandler<PointerEvent<T>>;
2365
+ type UIEventHandler<T = Element> = EventHandler<UIEvent<T>>;
2366
+ type WheelEventHandler<T = Element> = EventHandler<WheelEvent<T>>;
2367
+ type AnimationEventHandler<T = Element> = EventHandler<AnimationEvent<T>>;
2368
+ type TransitionEventHandler<T = Element> = EventHandler<TransitionEvent<T>>;
2369
+
2370
+ //
2371
+ // Props / DOM Attributes
2372
+ // ----------------------------------------------------------------------
2373
+
2374
+ interface HTMLProps<T> extends AllHTMLAttributes<T>, ClassAttributes<T> {
2375
+ }
2376
+
2377
+ type DetailedHTMLProps<E extends HTMLAttributes<T>, T> = ClassAttributes<T> & E;
2378
+
2379
+ interface SVGProps<T> extends SVGAttributes<T>, ClassAttributes<T> {
2380
+ }
2381
+
2382
+ interface SVGLineElementAttributes<T> extends SVGProps<T> {}
2383
+ interface SVGTextElementAttributes<T> extends SVGProps<T> {}
2384
+
2385
+ interface DOMAttributes<T> {
2386
+ children?: ReactNode | undefined;
2387
+ dangerouslySetInnerHTML?: {
2388
+ // Should be InnerHTML['innerHTML'].
2389
+ // But unfortunately we're mixing renderer-specific type declarations.
2390
+ __html: string | TrustedHTML;
2391
+ } | undefined;
2392
+
2393
+ // Clipboard Events
2394
+ onCopy?: ClipboardEventHandler<T> | undefined;
2395
+ onCopyCapture?: ClipboardEventHandler<T> | undefined;
2396
+ onCut?: ClipboardEventHandler<T> | undefined;
2397
+ onCutCapture?: ClipboardEventHandler<T> | undefined;
2398
+ onPaste?: ClipboardEventHandler<T> | undefined;
2399
+ onPasteCapture?: ClipboardEventHandler<T> | undefined;
2400
+
2401
+ // Composition Events
2402
+ onCompositionEnd?: CompositionEventHandler<T> | undefined;
2403
+ onCompositionEndCapture?: CompositionEventHandler<T> | undefined;
2404
+ onCompositionStart?: CompositionEventHandler<T> | undefined;
2405
+ onCompositionStartCapture?: CompositionEventHandler<T> | undefined;
2406
+ onCompositionUpdate?: CompositionEventHandler<T> | undefined;
2407
+ onCompositionUpdateCapture?: CompositionEventHandler<T> | undefined;
2408
+
2409
+ // Focus Events
2410
+ onFocus?: FocusEventHandler<T> | undefined;
2411
+ onFocusCapture?: FocusEventHandler<T> | undefined;
2412
+ onBlur?: FocusEventHandler<T> | undefined;
2413
+ onBlurCapture?: FocusEventHandler<T> | undefined;
2414
+
2415
+ // Form Events
2416
+ onChange?: FormEventHandler<T> | undefined;
2417
+ onChangeCapture?: FormEventHandler<T> | undefined;
2418
+ onBeforeInput?: FormEventHandler<T> | undefined;
2419
+ onBeforeInputCapture?: FormEventHandler<T> | undefined;
2420
+ onInput?: FormEventHandler<T> | undefined;
2421
+ onInputCapture?: FormEventHandler<T> | undefined;
2422
+ onReset?: FormEventHandler<T> | undefined;
2423
+ onResetCapture?: FormEventHandler<T> | undefined;
2424
+ onSubmit?: FormEventHandler<T> | undefined;
2425
+ onSubmitCapture?: FormEventHandler<T> | undefined;
2426
+ onInvalid?: FormEventHandler<T> | undefined;
2427
+ onInvalidCapture?: FormEventHandler<T> | undefined;
2428
+
2429
+ // Image Events
2430
+ onLoad?: ReactEventHandler<T> | undefined;
2431
+ onLoadCapture?: ReactEventHandler<T> | undefined;
2432
+ onError?: ReactEventHandler<T> | undefined; // also a Media Event
2433
+ onErrorCapture?: ReactEventHandler<T> | undefined; // also a Media Event
2434
+
2435
+ // Keyboard Events
2436
+ onKeyDown?: KeyboardEventHandler<T> | undefined;
2437
+ onKeyDownCapture?: KeyboardEventHandler<T> | undefined;
2438
+ /** @deprecated Use `onKeyUp` or `onKeyDown` instead */
2439
+ onKeyPress?: KeyboardEventHandler<T> | undefined;
2440
+ /** @deprecated Use `onKeyUpCapture` or `onKeyDownCapture` instead */
2441
+ onKeyPressCapture?: KeyboardEventHandler<T> | undefined;
2442
+ onKeyUp?: KeyboardEventHandler<T> | undefined;
2443
+ onKeyUpCapture?: KeyboardEventHandler<T> | undefined;
2444
+
2445
+ // Media Events
2446
+ onAbort?: ReactEventHandler<T> | undefined;
2447
+ onAbortCapture?: ReactEventHandler<T> | undefined;
2448
+ onCanPlay?: ReactEventHandler<T> | undefined;
2449
+ onCanPlayCapture?: ReactEventHandler<T> | undefined;
2450
+ onCanPlayThrough?: ReactEventHandler<T> | undefined;
2451
+ onCanPlayThroughCapture?: ReactEventHandler<T> | undefined;
2452
+ onDurationChange?: ReactEventHandler<T> | undefined;
2453
+ onDurationChangeCapture?: ReactEventHandler<T> | undefined;
2454
+ onEmptied?: ReactEventHandler<T> | undefined;
2455
+ onEmptiedCapture?: ReactEventHandler<T> | undefined;
2456
+ onEncrypted?: ReactEventHandler<T> | undefined;
2457
+ onEncryptedCapture?: ReactEventHandler<T> | undefined;
2458
+ onEnded?: ReactEventHandler<T> | undefined;
2459
+ onEndedCapture?: ReactEventHandler<T> | undefined;
2460
+ onLoadedData?: ReactEventHandler<T> | undefined;
2461
+ onLoadedDataCapture?: ReactEventHandler<T> | undefined;
2462
+ onLoadedMetadata?: ReactEventHandler<T> | undefined;
2463
+ onLoadedMetadataCapture?: ReactEventHandler<T> | undefined;
2464
+ onLoadStart?: ReactEventHandler<T> | undefined;
2465
+ onLoadStartCapture?: ReactEventHandler<T> | undefined;
2466
+ onPause?: ReactEventHandler<T> | undefined;
2467
+ onPauseCapture?: ReactEventHandler<T> | undefined;
2468
+ onPlay?: ReactEventHandler<T> | undefined;
2469
+ onPlayCapture?: ReactEventHandler<T> | undefined;
2470
+ onPlaying?: ReactEventHandler<T> | undefined;
2471
+ onPlayingCapture?: ReactEventHandler<T> | undefined;
2472
+ onProgress?: ReactEventHandler<T> | undefined;
2473
+ onProgressCapture?: ReactEventHandler<T> | undefined;
2474
+ onRateChange?: ReactEventHandler<T> | undefined;
2475
+ onRateChangeCapture?: ReactEventHandler<T> | undefined;
2476
+ onResize?: ReactEventHandler<T> | undefined;
2477
+ onResizeCapture?: ReactEventHandler<T> | undefined;
2478
+ onSeeked?: ReactEventHandler<T> | undefined;
2479
+ onSeekedCapture?: ReactEventHandler<T> | undefined;
2480
+ onSeeking?: ReactEventHandler<T> | undefined;
2481
+ onSeekingCapture?: ReactEventHandler<T> | undefined;
2482
+ onStalled?: ReactEventHandler<T> | undefined;
2483
+ onStalledCapture?: ReactEventHandler<T> | undefined;
2484
+ onSuspend?: ReactEventHandler<T> | undefined;
2485
+ onSuspendCapture?: ReactEventHandler<T> | undefined;
2486
+ onTimeUpdate?: ReactEventHandler<T> | undefined;
2487
+ onTimeUpdateCapture?: ReactEventHandler<T> | undefined;
2488
+ onVolumeChange?: ReactEventHandler<T> | undefined;
2489
+ onVolumeChangeCapture?: ReactEventHandler<T> | undefined;
2490
+ onWaiting?: ReactEventHandler<T> | undefined;
2491
+ onWaitingCapture?: ReactEventHandler<T> | undefined;
2492
+
2493
+ // MouseEvents
2494
+ onAuxClick?: MouseEventHandler<T> | undefined;
2495
+ onAuxClickCapture?: MouseEventHandler<T> | undefined;
2496
+ onClick?: MouseEventHandler<T> | undefined;
2497
+ onClickCapture?: MouseEventHandler<T> | undefined;
2498
+ onContextMenu?: MouseEventHandler<T> | undefined;
2499
+ onContextMenuCapture?: MouseEventHandler<T> | undefined;
2500
+ onDoubleClick?: MouseEventHandler<T> | undefined;
2501
+ onDoubleClickCapture?: MouseEventHandler<T> | undefined;
2502
+ onDrag?: DragEventHandler<T> | undefined;
2503
+ onDragCapture?: DragEventHandler<T> | undefined;
2504
+ onDragEnd?: DragEventHandler<T> | undefined;
2505
+ onDragEndCapture?: DragEventHandler<T> | undefined;
2506
+ onDragEnter?: DragEventHandler<T> | undefined;
2507
+ onDragEnterCapture?: DragEventHandler<T> | undefined;
2508
+ onDragExit?: DragEventHandler<T> | undefined;
2509
+ onDragExitCapture?: DragEventHandler<T> | undefined;
2510
+ onDragLeave?: DragEventHandler<T> | undefined;
2511
+ onDragLeaveCapture?: DragEventHandler<T> | undefined;
2512
+ onDragOver?: DragEventHandler<T> | undefined;
2513
+ onDragOverCapture?: DragEventHandler<T> | undefined;
2514
+ onDragStart?: DragEventHandler<T> | undefined;
2515
+ onDragStartCapture?: DragEventHandler<T> | undefined;
2516
+ onDrop?: DragEventHandler<T> | undefined;
2517
+ onDropCapture?: DragEventHandler<T> | undefined;
2518
+ onMouseDown?: MouseEventHandler<T> | undefined;
2519
+ onMouseDownCapture?: MouseEventHandler<T> | undefined;
2520
+ onMouseEnter?: MouseEventHandler<T> | undefined;
2521
+ onMouseLeave?: MouseEventHandler<T> | undefined;
2522
+ onMouseMove?: MouseEventHandler<T> | undefined;
2523
+ onMouseMoveCapture?: MouseEventHandler<T> | undefined;
2524
+ onMouseOut?: MouseEventHandler<T> | undefined;
2525
+ onMouseOutCapture?: MouseEventHandler<T> | undefined;
2526
+ onMouseOver?: MouseEventHandler<T> | undefined;
2527
+ onMouseOverCapture?: MouseEventHandler<T> | undefined;
2528
+ onMouseUp?: MouseEventHandler<T> | undefined;
2529
+ onMouseUpCapture?: MouseEventHandler<T> | undefined;
2530
+
2531
+ // Selection Events
2532
+ onSelect?: ReactEventHandler<T> | undefined;
2533
+ onSelectCapture?: ReactEventHandler<T> | undefined;
2534
+
2535
+ // Touch Events
2536
+ onTouchCancel?: TouchEventHandler<T> | undefined;
2537
+ onTouchCancelCapture?: TouchEventHandler<T> | undefined;
2538
+ onTouchEnd?: TouchEventHandler<T> | undefined;
2539
+ onTouchEndCapture?: TouchEventHandler<T> | undefined;
2540
+ onTouchMove?: TouchEventHandler<T> | undefined;
2541
+ onTouchMoveCapture?: TouchEventHandler<T> | undefined;
2542
+ onTouchStart?: TouchEventHandler<T> | undefined;
2543
+ onTouchStartCapture?: TouchEventHandler<T> | undefined;
2544
+
2545
+ // Pointer Events
2546
+ onPointerDown?: PointerEventHandler<T> | undefined;
2547
+ onPointerDownCapture?: PointerEventHandler<T> | undefined;
2548
+ onPointerMove?: PointerEventHandler<T> | undefined;
2549
+ onPointerMoveCapture?: PointerEventHandler<T> | undefined;
2550
+ onPointerUp?: PointerEventHandler<T> | undefined;
2551
+ onPointerUpCapture?: PointerEventHandler<T> | undefined;
2552
+ onPointerCancel?: PointerEventHandler<T> | undefined;
2553
+ onPointerCancelCapture?: PointerEventHandler<T> | undefined;
2554
+ onPointerEnter?: PointerEventHandler<T> | undefined;
2555
+ onPointerLeave?: PointerEventHandler<T> | undefined;
2556
+ onPointerOver?: PointerEventHandler<T> | undefined;
2557
+ onPointerOverCapture?: PointerEventHandler<T> | undefined;
2558
+ onPointerOut?: PointerEventHandler<T> | undefined;
2559
+ onPointerOutCapture?: PointerEventHandler<T> | undefined;
2560
+ onGotPointerCapture?: PointerEventHandler<T> | undefined;
2561
+ onGotPointerCaptureCapture?: PointerEventHandler<T> | undefined;
2562
+ onLostPointerCapture?: PointerEventHandler<T> | undefined;
2563
+ onLostPointerCaptureCapture?: PointerEventHandler<T> | undefined;
2564
+
2565
+ // UI Events
2566
+ onScroll?: UIEventHandler<T> | undefined;
2567
+ onScrollCapture?: UIEventHandler<T> | undefined;
2568
+
2569
+ // Wheel Events
2570
+ onWheel?: WheelEventHandler<T> | undefined;
2571
+ onWheelCapture?: WheelEventHandler<T> | undefined;
2572
+
2573
+ // Animation Events
2574
+ onAnimationStart?: AnimationEventHandler<T> | undefined;
2575
+ onAnimationStartCapture?: AnimationEventHandler<T> | undefined;
2576
+ onAnimationEnd?: AnimationEventHandler<T> | undefined;
2577
+ onAnimationEndCapture?: AnimationEventHandler<T> | undefined;
2578
+ onAnimationIteration?: AnimationEventHandler<T> | undefined;
2579
+ onAnimationIterationCapture?: AnimationEventHandler<T> | undefined;
2580
+
2581
+ // Transition Events
2582
+ onTransitionEnd?: TransitionEventHandler<T> | undefined;
2583
+ onTransitionEndCapture?: TransitionEventHandler<T> | undefined;
2584
+ }
2585
+
2586
+ export interface CSSProperties extends CSS.Properties<string | number> {
2587
+ /**
2588
+ * The index signature was removed to enable closed typing for style
2589
+ * using CSSType. You're able to use type assertion or module augmentation
2590
+ * to add properties or an index signature of your own.
2591
+ *
2592
+ * For examples and more information, visit:
2593
+ * https://github.com/frenic/csstype#what-should-i-do-when-i-get-type-errors
2594
+ */
2595
+ }
2596
+
2597
+ // All the WAI-ARIA 1.1 attributes from https://www.w3.org/TR/wai-aria-1.1/
2598
+ interface AriaAttributes {
2599
+ /** Identifies the currently active element when DOM focus is on a composite widget, textbox, group, or application. */
2600
+ "aria-activedescendant"?: string | undefined;
2601
+ /** 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. */
2602
+ "aria-atomic"?: Booleanish | undefined;
2603
+ /**
2604
+ * 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
2605
+ * presented if they are made.
2606
+ */
2607
+ "aria-autocomplete"?: "none" | "inline" | "list" | "both" | undefined;
2608
+ /** 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. */
2609
+ /**
2610
+ * Defines a string value that labels the current element, which is intended to be converted into Braille.
2611
+ * @see aria-label.
2612
+ */
2613
+ "aria-braillelabel"?: string | undefined;
2614
+ /**
2615
+ * Defines a human-readable, author-localized abbreviated description for the role of an element, which is intended to be converted into Braille.
2616
+ * @see aria-roledescription.
2617
+ */
2618
+ "aria-brailleroledescription"?: string | undefined;
2619
+ "aria-busy"?: Booleanish | undefined;
2620
+ /**
2621
+ * Indicates the current "checked" state of checkboxes, radio buttons, and other widgets.
2622
+ * @see aria-pressed @see aria-selected.
2623
+ */
2624
+ "aria-checked"?: boolean | "false" | "mixed" | "true" | undefined;
2625
+ /**
2626
+ * Defines the total number of columns in a table, grid, or treegrid.
2627
+ * @see aria-colindex.
2628
+ */
2629
+ "aria-colcount"?: number | undefined;
2630
+ /**
2631
+ * Defines an element's column index or position with respect to the total number of columns within a table, grid, or treegrid.
2632
+ * @see aria-colcount @see aria-colspan.
2633
+ */
2634
+ "aria-colindex"?: number | undefined;
2635
+ /**
2636
+ * Defines a human readable text alternative of aria-colindex.
2637
+ * @see aria-rowindextext.
2638
+ */
2639
+ "aria-colindextext"?: string | undefined;
2640
+ /**
2641
+ * Defines the number of columns spanned by a cell or gridcell within a table, grid, or treegrid.
2642
+ * @see aria-colindex @see aria-rowspan.
2643
+ */
2644
+ "aria-colspan"?: number | undefined;
2645
+ /**
2646
+ * Identifies the element (or elements) whose contents or presence are controlled by the current element.
2647
+ * @see aria-owns.
2648
+ */
2649
+ "aria-controls"?: string | undefined;
2650
+ /** Indicates the element that represents the current item within a container or set of related elements. */
2651
+ "aria-current"?: boolean | "false" | "true" | "page" | "step" | "location" | "date" | "time" | undefined;
2652
+ /**
2653
+ * Identifies the element (or elements) that describes the object.
2654
+ * @see aria-labelledby
2655
+ */
2656
+ "aria-describedby"?: string | undefined;
2657
+ /**
2658
+ * Defines a string value that describes or annotates the current element.
2659
+ * @see related aria-describedby.
2660
+ */
2661
+ "aria-description"?: string | undefined;
2662
+ /**
2663
+ * Identifies the element that provides a detailed, extended description for the object.
2664
+ * @see aria-describedby.
2665
+ */
2666
+ "aria-details"?: string | undefined;
2667
+ /**
2668
+ * Indicates that the element is perceivable but disabled, so it is not editable or otherwise operable.
2669
+ * @see aria-hidden @see aria-readonly.
2670
+ */
2671
+ "aria-disabled"?: Booleanish | undefined;
2672
+ /**
2673
+ * Indicates what functions can be performed when a dragged object is released on the drop target.
2674
+ * @deprecated in ARIA 1.1
2675
+ */
2676
+ "aria-dropeffect"?: "none" | "copy" | "execute" | "link" | "move" | "popup" | undefined;
2677
+ /**
2678
+ * Identifies the element that provides an error message for the object.
2679
+ * @see aria-invalid @see aria-describedby.
2680
+ */
2681
+ "aria-errormessage"?: string | undefined;
2682
+ /** Indicates whether the element, or another grouping element it controls, is currently expanded or collapsed. */
2683
+ "aria-expanded"?: Booleanish | undefined;
2684
+ /**
2685
+ * Identifies the next element (or elements) in an alternate reading order of content which, at the user's discretion,
2686
+ * allows assistive technology to override the general default of reading in document source order.
2687
+ */
2688
+ "aria-flowto"?: string | undefined;
2689
+ /**
2690
+ * Indicates an element's "grabbed" state in a drag-and-drop operation.
2691
+ * @deprecated in ARIA 1.1
2692
+ */
2693
+ "aria-grabbed"?: Booleanish | undefined;
2694
+ /** Indicates the availability and type of interactive popup element, such as menu or dialog, that can be triggered by an element. */
2695
+ "aria-haspopup"?: boolean | "false" | "true" | "menu" | "listbox" | "tree" | "grid" | "dialog" | undefined;
2696
+ /**
2697
+ * Indicates whether the element is exposed to an accessibility API.
2698
+ * @see aria-disabled.
2699
+ */
2700
+ "aria-hidden"?: Booleanish | undefined;
2701
+ /**
2702
+ * Indicates the entered value does not conform to the format expected by the application.
2703
+ * @see aria-errormessage.
2704
+ */
2705
+ "aria-invalid"?: boolean | "false" | "true" | "grammar" | "spelling" | undefined;
2706
+ /** Indicates keyboard shortcuts that an author has implemented to activate or give focus to an element. */
2707
+ "aria-keyshortcuts"?: string | undefined;
2708
+ /**
2709
+ * Defines a string value that labels the current element.
2710
+ * @see aria-labelledby.
2711
+ */
2712
+ "aria-label"?: string | undefined;
2713
+ /**
2714
+ * Identifies the element (or elements) that labels the current element.
2715
+ * @see aria-describedby.
2716
+ */
2717
+ "aria-labelledby"?: string | undefined;
2718
+ /** Defines the hierarchical level of an element within a structure. */
2719
+ "aria-level"?: number | undefined;
2720
+ /** 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. */
2721
+ "aria-live"?: "off" | "assertive" | "polite" | undefined;
2722
+ /** Indicates whether an element is modal when displayed. */
2723
+ "aria-modal"?: Booleanish | undefined;
2724
+ /** Indicates whether a text box accepts multiple lines of input or only a single line. */
2725
+ "aria-multiline"?: Booleanish | undefined;
2726
+ /** Indicates that the user may select more than one item from the current selectable descendants. */
2727
+ "aria-multiselectable"?: Booleanish | undefined;
2728
+ /** Indicates whether the element's orientation is horizontal, vertical, or unknown/ambiguous. */
2729
+ "aria-orientation"?: "horizontal" | "vertical" | undefined;
2730
+ /**
2731
+ * Identifies an element (or elements) in order to define a visual, functional, or contextual parent/child relationship
2732
+ * between DOM elements where the DOM hierarchy cannot be used to represent the relationship.
2733
+ * @see aria-controls.
2734
+ */
2735
+ "aria-owns"?: string | undefined;
2736
+ /**
2737
+ * Defines a short hint (a word or short phrase) intended to aid the user with data entry when the control has no value.
2738
+ * A hint could be a sample value or a brief description of the expected format.
2739
+ */
2740
+ "aria-placeholder"?: string | undefined;
2741
+ /**
2742
+ * 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.
2743
+ * @see aria-setsize.
2744
+ */
2745
+ "aria-posinset"?: number | undefined;
2746
+ /**
2747
+ * Indicates the current "pressed" state of toggle buttons.
2748
+ * @see aria-checked @see aria-selected.
2749
+ */
2750
+ "aria-pressed"?: boolean | "false" | "mixed" | "true" | undefined;
2751
+ /**
2752
+ * Indicates that the element is not editable, but is otherwise operable.
2753
+ * @see aria-disabled.
2754
+ */
2755
+ "aria-readonly"?: Booleanish | undefined;
2756
+ /**
2757
+ * Indicates what notifications the user agent will trigger when the accessibility tree within a live region is modified.
2758
+ * @see aria-atomic.
2759
+ */
2760
+ "aria-relevant"?:
2761
+ | "additions"
2762
+ | "additions removals"
2763
+ | "additions text"
2764
+ | "all"
2765
+ | "removals"
2766
+ | "removals additions"
2767
+ | "removals text"
2768
+ | "text"
2769
+ | "text additions"
2770
+ | "text removals"
2771
+ | undefined;
2772
+ /** Indicates that user input is required on the element before a form may be submitted. */
2773
+ "aria-required"?: Booleanish | undefined;
2774
+ /** Defines a human-readable, author-localized description for the role of an element. */
2775
+ "aria-roledescription"?: string | undefined;
2776
+ /**
2777
+ * Defines the total number of rows in a table, grid, or treegrid.
2778
+ * @see aria-rowindex.
2779
+ */
2780
+ "aria-rowcount"?: number | undefined;
2781
+ /**
2782
+ * Defines an element's row index or position with respect to the total number of rows within a table, grid, or treegrid.
2783
+ * @see aria-rowcount @see aria-rowspan.
2784
+ */
2785
+ "aria-rowindex"?: number | undefined;
2786
+ /**
2787
+ * Defines a human readable text alternative of aria-rowindex.
2788
+ * @see aria-colindextext.
2789
+ */
2790
+ "aria-rowindextext"?: string | undefined;
2791
+ /**
2792
+ * Defines the number of rows spanned by a cell or gridcell within a table, grid, or treegrid.
2793
+ * @see aria-rowindex @see aria-colspan.
2794
+ */
2795
+ "aria-rowspan"?: number | undefined;
2796
+ /**
2797
+ * Indicates the current "selected" state of various widgets.
2798
+ * @see aria-checked @see aria-pressed.
2799
+ */
2800
+ "aria-selected"?: Booleanish | undefined;
2801
+ /**
2802
+ * 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.
2803
+ * @see aria-posinset.
2804
+ */
2805
+ "aria-setsize"?: number | undefined;
2806
+ /** Indicates if items in a table or grid are sorted in ascending or descending order. */
2807
+ "aria-sort"?: "none" | "ascending" | "descending" | "other" | undefined;
2808
+ /** Defines the maximum allowed value for a range widget. */
2809
+ "aria-valuemax"?: number | undefined;
2810
+ /** Defines the minimum allowed value for a range widget. */
2811
+ "aria-valuemin"?: number | undefined;
2812
+ /**
2813
+ * Defines the current value for a range widget.
2814
+ * @see aria-valuetext.
2815
+ */
2816
+ "aria-valuenow"?: number | undefined;
2817
+ /** Defines the human readable text alternative of aria-valuenow for a range widget. */
2818
+ "aria-valuetext"?: string | undefined;
2819
+ }
2820
+
2821
+ // All the WAI-ARIA 1.1 role attribute values from https://www.w3.org/TR/wai-aria-1.1/#role_definitions
2822
+ type AriaRole =
2823
+ | "alert"
2824
+ | "alertdialog"
2825
+ | "application"
2826
+ | "article"
2827
+ | "banner"
2828
+ | "button"
2829
+ | "cell"
2830
+ | "checkbox"
2831
+ | "columnheader"
2832
+ | "combobox"
2833
+ | "complementary"
2834
+ | "contentinfo"
2835
+ | "definition"
2836
+ | "dialog"
2837
+ | "directory"
2838
+ | "document"
2839
+ | "feed"
2840
+ | "figure"
2841
+ | "form"
2842
+ | "grid"
2843
+ | "gridcell"
2844
+ | "group"
2845
+ | "heading"
2846
+ | "img"
2847
+ | "link"
2848
+ | "list"
2849
+ | "listbox"
2850
+ | "listitem"
2851
+ | "log"
2852
+ | "main"
2853
+ | "marquee"
2854
+ | "math"
2855
+ | "menu"
2856
+ | "menubar"
2857
+ | "menuitem"
2858
+ | "menuitemcheckbox"
2859
+ | "menuitemradio"
2860
+ | "navigation"
2861
+ | "none"
2862
+ | "note"
2863
+ | "option"
2864
+ | "presentation"
2865
+ | "progressbar"
2866
+ | "radio"
2867
+ | "radiogroup"
2868
+ | "region"
2869
+ | "row"
2870
+ | "rowgroup"
2871
+ | "rowheader"
2872
+ | "scrollbar"
2873
+ | "search"
2874
+ | "searchbox"
2875
+ | "separator"
2876
+ | "slider"
2877
+ | "spinbutton"
2878
+ | "status"
2879
+ | "switch"
2880
+ | "tab"
2881
+ | "table"
2882
+ | "tablist"
2883
+ | "tabpanel"
2884
+ | "term"
2885
+ | "textbox"
2886
+ | "timer"
2887
+ | "toolbar"
2888
+ | "tooltip"
2889
+ | "tree"
2890
+ | "treegrid"
2891
+ | "treeitem"
2892
+ | (string & {});
2893
+
2894
+ interface HTMLAttributes<T> extends AriaAttributes, DOMAttributes<T> {
2895
+ // React-specific Attributes
2896
+ defaultChecked?: boolean | undefined;
2897
+ defaultValue?: string | number | readonly string[] | undefined;
2898
+ suppressContentEditableWarning?: boolean | undefined;
2899
+ suppressHydrationWarning?: boolean | undefined;
2900
+
2901
+ // Standard HTML Attributes
2902
+ accessKey?: string | undefined;
2903
+ autoCapitalize?: "off" | "none" | "on" | "sentences" | "words" | "characters" | undefined | (string & {});
2904
+ autoFocus?: boolean | undefined;
2905
+ className?: string | undefined;
2906
+ contentEditable?: Booleanish | "inherit" | "plaintext-only" | undefined;
2907
+ contextMenu?: string | undefined;
2908
+ dir?: string | undefined;
2909
+ draggable?: Booleanish | undefined;
2910
+ enterKeyHint?: "enter" | "done" | "go" | "next" | "previous" | "search" | "send" | undefined;
2911
+ hidden?: boolean | undefined;
2912
+ id?: string | undefined;
2913
+ lang?: string | undefined;
2914
+ nonce?: string | undefined;
2915
+ slot?: string | undefined;
2916
+ spellCheck?: Booleanish | undefined;
2917
+ style?: CSSProperties | undefined;
2918
+ tabIndex?: number | undefined;
2919
+ title?: string | undefined;
2920
+ translate?: "yes" | "no" | undefined;
2921
+
2922
+ // Unknown
2923
+ radioGroup?: string | undefined; // <command>, <menuitem>
2924
+
2925
+ // WAI-ARIA
2926
+ role?: AriaRole | undefined;
2927
+
2928
+ // RDFa Attributes
2929
+ about?: string | undefined;
2930
+ content?: string | undefined;
2931
+ datatype?: string | undefined;
2932
+ inlist?: any;
2933
+ prefix?: string | undefined;
2934
+ property?: string | undefined;
2935
+ rel?: string | undefined;
2936
+ resource?: string | undefined;
2937
+ rev?: string | undefined;
2938
+ typeof?: string | undefined;
2939
+ vocab?: string | undefined;
2940
+
2941
+ // Non-standard Attributes
2942
+ autoCorrect?: string | undefined;
2943
+ autoSave?: string | undefined;
2944
+ color?: string | undefined;
2945
+ itemProp?: string | undefined;
2946
+ itemScope?: boolean | undefined;
2947
+ itemType?: string | undefined;
2948
+ itemID?: string | undefined;
2949
+ itemRef?: string | undefined;
2950
+ results?: number | undefined;
2951
+ security?: string | undefined;
2952
+ unselectable?: "on" | "off" | undefined;
2953
+
2954
+ // Living Standard
2955
+ /**
2956
+ * Hints at the type of data that might be entered by the user while editing the element or its contents
2957
+ * @see {@link https://html.spec.whatwg.org/multipage/interaction.html#input-modalities:-the-inputmode-attribute}
2958
+ */
2959
+ inputMode?: "none" | "text" | "tel" | "url" | "email" | "numeric" | "decimal" | "search" | undefined;
2960
+ /**
2961
+ * Specify that a standard HTML element should behave like a defined custom built-in element
2962
+ * @see {@link https://html.spec.whatwg.org/multipage/custom-elements.html#attr-is}
2963
+ */
2964
+ is?: string | undefined;
2965
+ }
2966
+
2967
+ /**
2968
+ * For internal usage only.
2969
+ * Different release channels declare additional types of ReactNode this particular release channel accepts.
2970
+ * App or library types should never augment this interface.
2971
+ */
2972
+ interface DO_NOT_USE_OR_YOU_WILL_BE_FIRED_EXPERIMENTAL_FORM_ACTIONS {}
2973
+
2974
+ interface AllHTMLAttributes<T> extends HTMLAttributes<T> {
2975
+ // Standard HTML Attributes
2976
+ accept?: string | undefined;
2977
+ acceptCharset?: string | undefined;
2978
+ action?:
2979
+ | string
2980
+ | undefined
2981
+ | DO_NOT_USE_OR_YOU_WILL_BE_FIRED_EXPERIMENTAL_FORM_ACTIONS[
2982
+ keyof DO_NOT_USE_OR_YOU_WILL_BE_FIRED_EXPERIMENTAL_FORM_ACTIONS
2983
+ ];
2984
+ allowFullScreen?: boolean | undefined;
2985
+ allowTransparency?: boolean | undefined;
2986
+ alt?: string | undefined;
2987
+ as?: string | undefined;
2988
+ async?: boolean | undefined;
2989
+ autoComplete?: string | undefined;
2990
+ autoPlay?: boolean | undefined;
2991
+ capture?: boolean | "user" | "environment" | undefined;
2992
+ cellPadding?: number | string | undefined;
2993
+ cellSpacing?: number | string | undefined;
2994
+ charSet?: string | undefined;
2995
+ challenge?: string | undefined;
2996
+ checked?: boolean | undefined;
2997
+ cite?: string | undefined;
2998
+ classID?: string | undefined;
2999
+ cols?: number | undefined;
3000
+ colSpan?: number | undefined;
3001
+ controls?: boolean | undefined;
3002
+ coords?: string | undefined;
3003
+ crossOrigin?: CrossOrigin;
3004
+ data?: string | undefined;
3005
+ dateTime?: string | undefined;
3006
+ default?: boolean | undefined;
3007
+ defer?: boolean | undefined;
3008
+ disabled?: boolean | undefined;
3009
+ download?: any;
3010
+ encType?: string | undefined;
3011
+ form?: string | undefined;
3012
+ formAction?:
3013
+ | string
3014
+ | undefined
3015
+ | DO_NOT_USE_OR_YOU_WILL_BE_FIRED_EXPERIMENTAL_FORM_ACTIONS[
3016
+ keyof DO_NOT_USE_OR_YOU_WILL_BE_FIRED_EXPERIMENTAL_FORM_ACTIONS
3017
+ ];
3018
+ formEncType?: string | undefined;
3019
+ formMethod?: string | undefined;
3020
+ formNoValidate?: boolean | undefined;
3021
+ formTarget?: string | undefined;
3022
+ frameBorder?: number | string | undefined;
3023
+ headers?: string | undefined;
3024
+ height?: number | string | undefined;
3025
+ high?: number | undefined;
3026
+ href?: string | undefined;
3027
+ hrefLang?: string | undefined;
3028
+ htmlFor?: string | undefined;
3029
+ httpEquiv?: string | undefined;
3030
+ integrity?: string | undefined;
3031
+ keyParams?: string | undefined;
3032
+ keyType?: string | undefined;
3033
+ kind?: string | undefined;
3034
+ label?: string | undefined;
3035
+ list?: string | undefined;
3036
+ loop?: boolean | undefined;
3037
+ low?: number | undefined;
3038
+ manifest?: string | undefined;
3039
+ marginHeight?: number | undefined;
3040
+ marginWidth?: number | undefined;
3041
+ max?: number | string | undefined;
3042
+ maxLength?: number | undefined;
3043
+ media?: string | undefined;
3044
+ mediaGroup?: string | undefined;
3045
+ method?: string | undefined;
3046
+ min?: number | string | undefined;
3047
+ minLength?: number | undefined;
3048
+ multiple?: boolean | undefined;
3049
+ muted?: boolean | undefined;
3050
+ name?: string | undefined;
3051
+ noValidate?: boolean | undefined;
3052
+ open?: boolean | undefined;
3053
+ optimum?: number | undefined;
3054
+ pattern?: string | undefined;
3055
+ placeholder?: string | undefined;
3056
+ playsInline?: boolean | undefined;
3057
+ poster?: string | undefined;
3058
+ preload?: string | undefined;
3059
+ readOnly?: boolean | undefined;
3060
+ required?: boolean | undefined;
3061
+ reversed?: boolean | undefined;
3062
+ rows?: number | undefined;
3063
+ rowSpan?: number | undefined;
3064
+ sandbox?: string | undefined;
3065
+ scope?: string | undefined;
3066
+ scoped?: boolean | undefined;
3067
+ scrolling?: string | undefined;
3068
+ seamless?: boolean | undefined;
3069
+ selected?: boolean | undefined;
3070
+ shape?: string | undefined;
3071
+ size?: number | undefined;
3072
+ sizes?: string | undefined;
3073
+ span?: number | undefined;
3074
+ src?: string | undefined;
3075
+ srcDoc?: string | undefined;
3076
+ srcLang?: string | undefined;
3077
+ srcSet?: string | undefined;
3078
+ start?: number | undefined;
3079
+ step?: number | string | undefined;
3080
+ summary?: string | undefined;
3081
+ target?: string | undefined;
3082
+ type?: string | undefined;
3083
+ useMap?: string | undefined;
3084
+ value?: string | readonly string[] | number | undefined;
3085
+ width?: number | string | undefined;
3086
+ wmode?: string | undefined;
3087
+ wrap?: string | undefined;
3088
+ }
3089
+
3090
+ type HTMLAttributeReferrerPolicy =
3091
+ | ""
3092
+ | "no-referrer"
3093
+ | "no-referrer-when-downgrade"
3094
+ | "origin"
3095
+ | "origin-when-cross-origin"
3096
+ | "same-origin"
3097
+ | "strict-origin"
3098
+ | "strict-origin-when-cross-origin"
3099
+ | "unsafe-url";
3100
+
3101
+ type HTMLAttributeAnchorTarget =
3102
+ | "_self"
3103
+ | "_blank"
3104
+ | "_parent"
3105
+ | "_top"
3106
+ | (string & {});
3107
+
3108
+ interface AnchorHTMLAttributes<T> extends HTMLAttributes<T> {
3109
+ download?: any;
3110
+ href?: string | undefined;
3111
+ hrefLang?: string | undefined;
3112
+ media?: string | undefined;
3113
+ ping?: string | undefined;
3114
+ target?: HTMLAttributeAnchorTarget | undefined;
3115
+ type?: string | undefined;
3116
+ referrerPolicy?: HTMLAttributeReferrerPolicy | undefined;
3117
+ }
3118
+
3119
+ interface AudioHTMLAttributes<T> extends MediaHTMLAttributes<T> {}
3120
+
3121
+ interface AreaHTMLAttributes<T> extends HTMLAttributes<T> {
3122
+ alt?: string | undefined;
3123
+ coords?: string | undefined;
3124
+ download?: any;
3125
+ href?: string | undefined;
3126
+ hrefLang?: string | undefined;
3127
+ media?: string | undefined;
3128
+ referrerPolicy?: HTMLAttributeReferrerPolicy | undefined;
3129
+ shape?: string | undefined;
3130
+ target?: string | undefined;
3131
+ }
3132
+
3133
+ interface BaseHTMLAttributes<T> extends HTMLAttributes<T> {
3134
+ href?: string | undefined;
3135
+ target?: string | undefined;
3136
+ }
3137
+
3138
+ interface BlockquoteHTMLAttributes<T> extends HTMLAttributes<T> {
3139
+ cite?: string | undefined;
3140
+ }
3141
+
3142
+ interface ButtonHTMLAttributes<T> extends HTMLAttributes<T> {
3143
+ disabled?: boolean | undefined;
3144
+ form?: string | undefined;
3145
+ formAction?:
3146
+ | string
3147
+ | DO_NOT_USE_OR_YOU_WILL_BE_FIRED_EXPERIMENTAL_FORM_ACTIONS[
3148
+ keyof DO_NOT_USE_OR_YOU_WILL_BE_FIRED_EXPERIMENTAL_FORM_ACTIONS
3149
+ ]
3150
+ | undefined;
3151
+ formEncType?: string | undefined;
3152
+ formMethod?: string | undefined;
3153
+ formNoValidate?: boolean | undefined;
3154
+ formTarget?: string | undefined;
3155
+ name?: string | undefined;
3156
+ type?: "submit" | "reset" | "button" | undefined;
3157
+ value?: string | readonly string[] | number | undefined;
3158
+ }
3159
+
3160
+ interface CanvasHTMLAttributes<T> extends HTMLAttributes<T> {
3161
+ height?: number | string | undefined;
3162
+ width?: number | string | undefined;
3163
+ }
3164
+
3165
+ interface ColHTMLAttributes<T> extends HTMLAttributes<T> {
3166
+ span?: number | undefined;
3167
+ width?: number | string | undefined;
3168
+ }
3169
+
3170
+ interface ColgroupHTMLAttributes<T> extends HTMLAttributes<T> {
3171
+ span?: number | undefined;
3172
+ }
3173
+
3174
+ interface DataHTMLAttributes<T> extends HTMLAttributes<T> {
3175
+ value?: string | readonly string[] | number | undefined;
3176
+ }
3177
+
3178
+ interface DetailsHTMLAttributes<T> extends HTMLAttributes<T> {
3179
+ open?: boolean | undefined;
3180
+ onToggle?: ReactEventHandler<T> | undefined;
3181
+ name?: string | undefined;
3182
+ }
3183
+
3184
+ interface DelHTMLAttributes<T> extends HTMLAttributes<T> {
3185
+ cite?: string | undefined;
3186
+ dateTime?: string | undefined;
3187
+ }
3188
+
3189
+ interface DialogHTMLAttributes<T> extends HTMLAttributes<T> {
3190
+ onCancel?: ReactEventHandler<T> | undefined;
3191
+ onClose?: ReactEventHandler<T> | undefined;
3192
+ open?: boolean | undefined;
3193
+ }
3194
+
3195
+ interface EmbedHTMLAttributes<T> extends HTMLAttributes<T> {
3196
+ height?: number | string | undefined;
3197
+ src?: string | undefined;
3198
+ type?: string | undefined;
3199
+ width?: number | string | undefined;
3200
+ }
3201
+
3202
+ interface FieldsetHTMLAttributes<T> extends HTMLAttributes<T> {
3203
+ disabled?: boolean | undefined;
3204
+ form?: string | undefined;
3205
+ name?: string | undefined;
3206
+ }
3207
+
3208
+ interface FormHTMLAttributes<T> extends HTMLAttributes<T> {
3209
+ acceptCharset?: string | undefined;
3210
+ action?:
3211
+ | string
3212
+ | undefined
3213
+ | DO_NOT_USE_OR_YOU_WILL_BE_FIRED_EXPERIMENTAL_FORM_ACTIONS[
3214
+ keyof DO_NOT_USE_OR_YOU_WILL_BE_FIRED_EXPERIMENTAL_FORM_ACTIONS
3215
+ ];
3216
+ autoComplete?: string | undefined;
3217
+ encType?: string | undefined;
3218
+ method?: string | undefined;
3219
+ name?: string | undefined;
3220
+ noValidate?: boolean | undefined;
3221
+ target?: string | undefined;
3222
+ }
3223
+
3224
+ interface HtmlHTMLAttributes<T> extends HTMLAttributes<T> {
3225
+ manifest?: string | undefined;
3226
+ }
3227
+
3228
+ interface IframeHTMLAttributes<T> extends HTMLAttributes<T> {
3229
+ allow?: string | undefined;
3230
+ allowFullScreen?: boolean | undefined;
3231
+ allowTransparency?: boolean | undefined;
3232
+ /** @deprecated */
3233
+ frameBorder?: number | string | undefined;
3234
+ height?: number | string | undefined;
3235
+ loading?: "eager" | "lazy" | undefined;
3236
+ /** @deprecated */
3237
+ marginHeight?: number | undefined;
3238
+ /** @deprecated */
3239
+ marginWidth?: number | undefined;
3240
+ name?: string | undefined;
3241
+ referrerPolicy?: HTMLAttributeReferrerPolicy | undefined;
3242
+ sandbox?: string | undefined;
3243
+ /** @deprecated */
3244
+ scrolling?: string | undefined;
3245
+ seamless?: boolean | undefined;
3246
+ src?: string | undefined;
3247
+ srcDoc?: string | undefined;
3248
+ width?: number | string | undefined;
3249
+ }
3250
+
3251
+ interface ImgHTMLAttributes<T> extends HTMLAttributes<T> {
3252
+ alt?: string | undefined;
3253
+ crossOrigin?: CrossOrigin;
3254
+ decoding?: "async" | "auto" | "sync" | undefined;
3255
+ fetchPriority?: "high" | "low" | "auto";
3256
+ height?: number | string | undefined;
3257
+ loading?: "eager" | "lazy" | undefined;
3258
+ referrerPolicy?: HTMLAttributeReferrerPolicy | undefined;
3259
+ sizes?: string | undefined;
3260
+ src?: string | undefined;
3261
+ srcSet?: string | undefined;
3262
+ useMap?: string | undefined;
3263
+ width?: number | string | undefined;
3264
+ }
3265
+
3266
+ interface InsHTMLAttributes<T> extends HTMLAttributes<T> {
3267
+ cite?: string | undefined;
3268
+ dateTime?: string | undefined;
3269
+ }
3270
+
3271
+ type HTMLInputTypeAttribute =
3272
+ | "button"
3273
+ | "checkbox"
3274
+ | "color"
3275
+ | "date"
3276
+ | "datetime-local"
3277
+ | "email"
3278
+ | "file"
3279
+ | "hidden"
3280
+ | "image"
3281
+ | "month"
3282
+ | "number"
3283
+ | "password"
3284
+ | "radio"
3285
+ | "range"
3286
+ | "reset"
3287
+ | "search"
3288
+ | "submit"
3289
+ | "tel"
3290
+ | "text"
3291
+ | "time"
3292
+ | "url"
3293
+ | "week"
3294
+ | (string & {});
3295
+
3296
+ type AutoFillAddressKind = "billing" | "shipping";
3297
+ type AutoFillBase = "" | "off" | "on";
3298
+ type AutoFillContactField =
3299
+ | "email"
3300
+ | "tel"
3301
+ | "tel-area-code"
3302
+ | "tel-country-code"
3303
+ | "tel-extension"
3304
+ | "tel-local"
3305
+ | "tel-local-prefix"
3306
+ | "tel-local-suffix"
3307
+ | "tel-national";
3308
+ type AutoFillContactKind = "home" | "mobile" | "work";
3309
+ type AutoFillCredentialField = "webauthn";
3310
+ type AutoFillNormalField =
3311
+ | "additional-name"
3312
+ | "address-level1"
3313
+ | "address-level2"
3314
+ | "address-level3"
3315
+ | "address-level4"
3316
+ | "address-line1"
3317
+ | "address-line2"
3318
+ | "address-line3"
3319
+ | "bday-day"
3320
+ | "bday-month"
3321
+ | "bday-year"
3322
+ | "cc-csc"
3323
+ | "cc-exp"
3324
+ | "cc-exp-month"
3325
+ | "cc-exp-year"
3326
+ | "cc-family-name"
3327
+ | "cc-given-name"
3328
+ | "cc-name"
3329
+ | "cc-number"
3330
+ | "cc-type"
3331
+ | "country"
3332
+ | "country-name"
3333
+ | "current-password"
3334
+ | "family-name"
3335
+ | "given-name"
3336
+ | "honorific-prefix"
3337
+ | "honorific-suffix"
3338
+ | "name"
3339
+ | "new-password"
3340
+ | "one-time-code"
3341
+ | "organization"
3342
+ | "postal-code"
3343
+ | "street-address"
3344
+ | "transaction-amount"
3345
+ | "transaction-currency"
3346
+ | "username";
3347
+ type OptionalPrefixToken<T extends string> = `${T} ` | "";
3348
+ type OptionalPostfixToken<T extends string> = ` ${T}` | "";
3349
+ type AutoFillField = AutoFillNormalField | `${OptionalPrefixToken<AutoFillContactKind>}${AutoFillContactField}`;
3350
+ type AutoFillSection = `section-${string}`;
3351
+ type AutoFill =
3352
+ | AutoFillBase
3353
+ | `${OptionalPrefixToken<AutoFillSection>}${OptionalPrefixToken<
3354
+ AutoFillAddressKind
3355
+ >}${AutoFillField}${OptionalPostfixToken<AutoFillCredentialField>}`;
3356
+ type HTMLInputAutoCompleteAttribute = AutoFill | (string & {});
3357
+
3358
+ interface InputHTMLAttributes<T> extends HTMLAttributes<T> {
3359
+ accept?: string | undefined;
3360
+ alt?: string | undefined;
3361
+ autoComplete?: HTMLInputAutoCompleteAttribute | undefined;
3362
+ capture?: boolean | "user" | "environment" | undefined; // https://www.w3.org/TR/html-media-capture/#the-capture-attribute
3363
+ checked?: boolean | undefined;
3364
+ disabled?: boolean | undefined;
3365
+ form?: string | undefined;
3366
+ formAction?:
3367
+ | string
3368
+ | DO_NOT_USE_OR_YOU_WILL_BE_FIRED_EXPERIMENTAL_FORM_ACTIONS[
3369
+ keyof DO_NOT_USE_OR_YOU_WILL_BE_FIRED_EXPERIMENTAL_FORM_ACTIONS
3370
+ ]
3371
+ | undefined;
3372
+ formEncType?: string | undefined;
3373
+ formMethod?: string | undefined;
3374
+ formNoValidate?: boolean | undefined;
3375
+ formTarget?: string | undefined;
3376
+ height?: number | string | undefined;
3377
+ list?: string | undefined;
3378
+ max?: number | string | undefined;
3379
+ maxLength?: number | undefined;
3380
+ min?: number | string | undefined;
3381
+ minLength?: number | undefined;
3382
+ multiple?: boolean | undefined;
3383
+ name?: string | undefined;
3384
+ pattern?: string | undefined;
3385
+ placeholder?: string | undefined;
3386
+ readOnly?: boolean | undefined;
3387
+ required?: boolean | undefined;
3388
+ size?: number | undefined;
3389
+ src?: string | undefined;
3390
+ step?: number | string | undefined;
3391
+ type?: HTMLInputTypeAttribute | undefined;
3392
+ value?: string | readonly string[] | number | undefined;
3393
+ width?: number | string | undefined;
3394
+
3395
+ onChange?: ChangeEventHandler<T> | undefined;
3396
+ }
3397
+
3398
+ interface KeygenHTMLAttributes<T> extends HTMLAttributes<T> {
3399
+ challenge?: string | undefined;
3400
+ disabled?: boolean | undefined;
3401
+ form?: string | undefined;
3402
+ keyType?: string | undefined;
3403
+ keyParams?: string | undefined;
3404
+ name?: string | undefined;
3405
+ }
3406
+
3407
+ interface LabelHTMLAttributes<T> extends HTMLAttributes<T> {
3408
+ form?: string | undefined;
3409
+ htmlFor?: string | undefined;
3410
+ }
3411
+
3412
+ interface LiHTMLAttributes<T> extends HTMLAttributes<T> {
3413
+ value?: string | readonly string[] | number | undefined;
3414
+ }
3415
+
3416
+ interface LinkHTMLAttributes<T> extends HTMLAttributes<T> {
3417
+ as?: string | undefined;
3418
+ crossOrigin?: CrossOrigin;
3419
+ fetchPriority?: "high" | "low" | "auto";
3420
+ href?: string | undefined;
3421
+ hrefLang?: string | undefined;
3422
+ integrity?: string | undefined;
3423
+ media?: string | undefined;
3424
+ imageSrcSet?: string | undefined;
3425
+ imageSizes?: string | undefined;
3426
+ referrerPolicy?: HTMLAttributeReferrerPolicy | undefined;
3427
+ sizes?: string | undefined;
3428
+ type?: string | undefined;
3429
+ charSet?: string | undefined;
3430
+ }
3431
+
3432
+ interface MapHTMLAttributes<T> extends HTMLAttributes<T> {
3433
+ name?: string | undefined;
3434
+ }
3435
+
3436
+ interface MenuHTMLAttributes<T> extends HTMLAttributes<T> {
3437
+ type?: string | undefined;
3438
+ }
3439
+
3440
+ interface MediaHTMLAttributes<T> extends HTMLAttributes<T> {
3441
+ autoPlay?: boolean | undefined;
3442
+ controls?: boolean | undefined;
3443
+ controlsList?: string | undefined;
3444
+ crossOrigin?: CrossOrigin;
3445
+ loop?: boolean | undefined;
3446
+ mediaGroup?: string | undefined;
3447
+ muted?: boolean | undefined;
3448
+ playsInline?: boolean | undefined;
3449
+ preload?: string | undefined;
3450
+ src?: string | undefined;
3451
+ }
3452
+
3453
+ interface MetaHTMLAttributes<T> extends HTMLAttributes<T> {
3454
+ charSet?: string | undefined;
3455
+ content?: string | undefined;
3456
+ httpEquiv?: string | undefined;
3457
+ media?: string | undefined;
3458
+ name?: string | undefined;
3459
+ }
3460
+
3461
+ interface MeterHTMLAttributes<T> extends HTMLAttributes<T> {
3462
+ form?: string | undefined;
3463
+ high?: number | undefined;
3464
+ low?: number | undefined;
3465
+ max?: number | string | undefined;
3466
+ min?: number | string | undefined;
3467
+ optimum?: number | undefined;
3468
+ value?: string | readonly string[] | number | undefined;
3469
+ }
3470
+
3471
+ interface QuoteHTMLAttributes<T> extends HTMLAttributes<T> {
3472
+ cite?: string | undefined;
3473
+ }
3474
+
3475
+ interface ObjectHTMLAttributes<T> extends HTMLAttributes<T> {
3476
+ classID?: string | undefined;
3477
+ data?: string | undefined;
3478
+ form?: string | undefined;
3479
+ height?: number | string | undefined;
3480
+ name?: string | undefined;
3481
+ type?: string | undefined;
3482
+ useMap?: string | undefined;
3483
+ width?: number | string | undefined;
3484
+ wmode?: string | undefined;
3485
+ }
3486
+
3487
+ interface OlHTMLAttributes<T> extends HTMLAttributes<T> {
3488
+ reversed?: boolean | undefined;
3489
+ start?: number | undefined;
3490
+ type?: "1" | "a" | "A" | "i" | "I" | undefined;
3491
+ }
3492
+
3493
+ interface OptgroupHTMLAttributes<T> extends HTMLAttributes<T> {
3494
+ disabled?: boolean | undefined;
3495
+ label?: string | undefined;
3496
+ }
3497
+
3498
+ interface OptionHTMLAttributes<T> extends HTMLAttributes<T> {
3499
+ disabled?: boolean | undefined;
3500
+ label?: string | undefined;
3501
+ selected?: boolean | undefined;
3502
+ value?: string | readonly string[] | number | undefined;
3503
+ }
3504
+
3505
+ interface OutputHTMLAttributes<T> extends HTMLAttributes<T> {
3506
+ form?: string | undefined;
3507
+ htmlFor?: string | undefined;
3508
+ name?: string | undefined;
3509
+ }
3510
+
3511
+ interface ParamHTMLAttributes<T> extends HTMLAttributes<T> {
3512
+ name?: string | undefined;
3513
+ value?: string | readonly string[] | number | undefined;
3514
+ }
3515
+
3516
+ interface ProgressHTMLAttributes<T> extends HTMLAttributes<T> {
3517
+ max?: number | string | undefined;
3518
+ value?: string | readonly string[] | number | undefined;
3519
+ }
3520
+
3521
+ interface SlotHTMLAttributes<T> extends HTMLAttributes<T> {
3522
+ name?: string | undefined;
3523
+ }
3524
+
3525
+ interface ScriptHTMLAttributes<T> extends HTMLAttributes<T> {
3526
+ async?: boolean | undefined;
3527
+ /** @deprecated */
3528
+ charSet?: string | undefined;
3529
+ crossOrigin?: CrossOrigin;
3530
+ defer?: boolean | undefined;
3531
+ integrity?: string | undefined;
3532
+ noModule?: boolean | undefined;
3533
+ referrerPolicy?: HTMLAttributeReferrerPolicy | undefined;
3534
+ src?: string | undefined;
3535
+ type?: string | undefined;
3536
+ }
3537
+
3538
+ interface SelectHTMLAttributes<T> extends HTMLAttributes<T> {
3539
+ autoComplete?: string | undefined;
3540
+ disabled?: boolean | undefined;
3541
+ form?: string | undefined;
3542
+ multiple?: boolean | undefined;
3543
+ name?: string | undefined;
3544
+ required?: boolean | undefined;
3545
+ size?: number | undefined;
3546
+ value?: string | readonly string[] | number | undefined;
3547
+ onChange?: ChangeEventHandler<T> | undefined;
3548
+ }
3549
+
3550
+ interface SourceHTMLAttributes<T> extends HTMLAttributes<T> {
3551
+ height?: number | string | undefined;
3552
+ media?: string | undefined;
3553
+ sizes?: string | undefined;
3554
+ src?: string | undefined;
3555
+ srcSet?: string | undefined;
3556
+ type?: string | undefined;
3557
+ width?: number | string | undefined;
3558
+ }
3559
+
3560
+ interface StyleHTMLAttributes<T> extends HTMLAttributes<T> {
3561
+ media?: string | undefined;
3562
+ scoped?: boolean | undefined;
3563
+ type?: string | undefined;
3564
+ }
3565
+
3566
+ interface TableHTMLAttributes<T> extends HTMLAttributes<T> {
3567
+ align?: "left" | "center" | "right" | undefined;
3568
+ bgcolor?: string | undefined;
3569
+ border?: number | undefined;
3570
+ cellPadding?: number | string | undefined;
3571
+ cellSpacing?: number | string | undefined;
3572
+ frame?: boolean | undefined;
3573
+ rules?: "none" | "groups" | "rows" | "columns" | "all" | undefined;
3574
+ summary?: string | undefined;
3575
+ width?: number | string | undefined;
3576
+ }
3577
+
3578
+ interface TextareaHTMLAttributes<T> extends HTMLAttributes<T> {
3579
+ autoComplete?: string | undefined;
3580
+ cols?: number | undefined;
3581
+ dirName?: string | undefined;
3582
+ disabled?: boolean | undefined;
3583
+ form?: string | undefined;
3584
+ maxLength?: number | undefined;
3585
+ minLength?: number | undefined;
3586
+ name?: string | undefined;
3587
+ placeholder?: string | undefined;
3588
+ readOnly?: boolean | undefined;
3589
+ required?: boolean | undefined;
3590
+ rows?: number | undefined;
3591
+ value?: string | readonly string[] | number | undefined;
3592
+ wrap?: string | undefined;
3593
+
3594
+ onChange?: ChangeEventHandler<T> | undefined;
3595
+ }
3596
+
3597
+ interface TdHTMLAttributes<T> extends HTMLAttributes<T> {
3598
+ align?: "left" | "center" | "right" | "justify" | "char" | undefined;
3599
+ colSpan?: number | undefined;
3600
+ headers?: string | undefined;
3601
+ rowSpan?: number | undefined;
3602
+ scope?: string | undefined;
3603
+ abbr?: string | undefined;
3604
+ height?: number | string | undefined;
3605
+ width?: number | string | undefined;
3606
+ valign?: "top" | "middle" | "bottom" | "baseline" | undefined;
3607
+ }
3608
+
3609
+ interface ThHTMLAttributes<T> extends HTMLAttributes<T> {
3610
+ align?: "left" | "center" | "right" | "justify" | "char" | undefined;
3611
+ colSpan?: number | undefined;
3612
+ headers?: string | undefined;
3613
+ rowSpan?: number | undefined;
3614
+ scope?: string | undefined;
3615
+ abbr?: string | undefined;
3616
+ }
3617
+
3618
+ interface TimeHTMLAttributes<T> extends HTMLAttributes<T> {
3619
+ dateTime?: string | undefined;
3620
+ }
3621
+
3622
+ interface TrackHTMLAttributes<T> extends HTMLAttributes<T> {
3623
+ default?: boolean | undefined;
3624
+ kind?: string | undefined;
3625
+ label?: string | undefined;
3626
+ src?: string | undefined;
3627
+ srcLang?: string | undefined;
3628
+ }
3629
+
3630
+ interface VideoHTMLAttributes<T> extends MediaHTMLAttributes<T> {
3631
+ height?: number | string | undefined;
3632
+ playsInline?: boolean | undefined;
3633
+ poster?: string | undefined;
3634
+ width?: number | string | undefined;
3635
+ disablePictureInPicture?: boolean | undefined;
3636
+ disableRemotePlayback?: boolean | undefined;
3637
+ }
3638
+
3639
+ // this list is "complete" in that it contains every SVG attribute
3640
+ // that React supports, but the types can be improved.
3641
+ // Full list here: https://facebook.github.io/react/docs/dom-elements.html
3642
+ //
3643
+ // The three broad type categories are (in order of restrictiveness):
3644
+ // - "number | string"
3645
+ // - "string"
3646
+ // - union of string literals
3647
+ interface SVGAttributes<T> extends AriaAttributes, DOMAttributes<T> {
3648
+ // React-specific Attributes
3649
+ suppressHydrationWarning?: boolean | undefined;
3650
+
3651
+ // Attributes which also defined in HTMLAttributes
3652
+ // See comment in SVGDOMPropertyConfig.js
3653
+ className?: string | undefined;
3654
+ color?: string | undefined;
3655
+ height?: number | string | undefined;
3656
+ id?: string | undefined;
3657
+ lang?: string | undefined;
3658
+ max?: number | string | undefined;
3659
+ media?: string | undefined;
3660
+ method?: string | undefined;
3661
+ min?: number | string | undefined;
3662
+ name?: string | undefined;
3663
+ style?: CSSProperties | undefined;
3664
+ target?: string | undefined;
3665
+ type?: string | undefined;
3666
+ width?: number | string | undefined;
3667
+
3668
+ // Other HTML properties supported by SVG elements in browsers
3669
+ role?: AriaRole | undefined;
3670
+ tabIndex?: number | undefined;
3671
+ crossOrigin?: CrossOrigin;
3672
+
3673
+ // SVG Specific attributes
3674
+ accentHeight?: number | string | undefined;
3675
+ accumulate?: "none" | "sum" | undefined;
3676
+ additive?: "replace" | "sum" | undefined;
3677
+ alignmentBaseline?:
3678
+ | "auto"
3679
+ | "baseline"
3680
+ | "before-edge"
3681
+ | "text-before-edge"
3682
+ | "middle"
3683
+ | "central"
3684
+ | "after-edge"
3685
+ | "text-after-edge"
3686
+ | "ideographic"
3687
+ | "alphabetic"
3688
+ | "hanging"
3689
+ | "mathematical"
3690
+ | "inherit"
3691
+ | undefined;
3692
+ allowReorder?: "no" | "yes" | undefined;
3693
+ alphabetic?: number | string | undefined;
3694
+ amplitude?: number | string | undefined;
3695
+ arabicForm?: "initial" | "medial" | "terminal" | "isolated" | undefined;
3696
+ ascent?: number | string | undefined;
3697
+ attributeName?: string | undefined;
3698
+ attributeType?: string | undefined;
3699
+ autoReverse?: Booleanish | undefined;
3700
+ azimuth?: number | string | undefined;
3701
+ baseFrequency?: number | string | undefined;
3702
+ baselineShift?: number | string | undefined;
3703
+ baseProfile?: number | string | undefined;
3704
+ bbox?: number | string | undefined;
3705
+ begin?: number | string | undefined;
3706
+ bias?: number | string | undefined;
3707
+ by?: number | string | undefined;
3708
+ calcMode?: number | string | undefined;
3709
+ capHeight?: number | string | undefined;
3710
+ clip?: number | string | undefined;
3711
+ clipPath?: string | undefined;
3712
+ clipPathUnits?: number | string | undefined;
3713
+ clipRule?: number | string | undefined;
3714
+ colorInterpolation?: number | string | undefined;
3715
+ colorInterpolationFilters?: "auto" | "sRGB" | "linearRGB" | "inherit" | undefined;
3716
+ colorProfile?: number | string | undefined;
3717
+ colorRendering?: number | string | undefined;
3718
+ contentScriptType?: number | string | undefined;
3719
+ contentStyleType?: number | string | undefined;
3720
+ cursor?: number | string | undefined;
3721
+ cx?: number | string | undefined;
3722
+ cy?: number | string | undefined;
3723
+ d?: string | undefined;
3724
+ decelerate?: number | string | undefined;
3725
+ descent?: number | string | undefined;
3726
+ diffuseConstant?: number | string | undefined;
3727
+ direction?: number | string | undefined;
3728
+ display?: number | string | undefined;
3729
+ divisor?: number | string | undefined;
3730
+ dominantBaseline?: number | string | undefined;
3731
+ dur?: number | string | undefined;
3732
+ dx?: number | string | undefined;
3733
+ dy?: number | string | undefined;
3734
+ edgeMode?: number | string | undefined;
3735
+ elevation?: number | string | undefined;
3736
+ enableBackground?: number | string | undefined;
3737
+ end?: number | string | undefined;
3738
+ exponent?: number | string | undefined;
3739
+ externalResourcesRequired?: Booleanish | undefined;
3740
+ fill?: string | undefined;
3741
+ fillOpacity?: number | string | undefined;
3742
+ fillRule?: "nonzero" | "evenodd" | "inherit" | undefined;
3743
+ filter?: string | undefined;
3744
+ filterRes?: number | string | undefined;
3745
+ filterUnits?: number | string | undefined;
3746
+ floodColor?: number | string | undefined;
3747
+ floodOpacity?: number | string | undefined;
3748
+ focusable?: Booleanish | "auto" | undefined;
3749
+ fontFamily?: string | undefined;
3750
+ fontSize?: number | string | undefined;
3751
+ fontSizeAdjust?: number | string | undefined;
3752
+ fontStretch?: number | string | undefined;
3753
+ fontStyle?: number | string | undefined;
3754
+ fontVariant?: number | string | undefined;
3755
+ fontWeight?: number | string | undefined;
3756
+ format?: number | string | undefined;
3757
+ fr?: number | string | undefined;
3758
+ from?: number | string | undefined;
3759
+ fx?: number | string | undefined;
3760
+ fy?: number | string | undefined;
3761
+ g1?: number | string | undefined;
3762
+ g2?: number | string | undefined;
3763
+ glyphName?: number | string | undefined;
3764
+ glyphOrientationHorizontal?: number | string | undefined;
3765
+ glyphOrientationVertical?: number | string | undefined;
3766
+ glyphRef?: number | string | undefined;
3767
+ gradientTransform?: string | undefined;
3768
+ gradientUnits?: string | undefined;
3769
+ hanging?: number | string | undefined;
3770
+ horizAdvX?: number | string | undefined;
3771
+ horizOriginX?: number | string | undefined;
3772
+ href?: string | undefined;
3773
+ ideographic?: number | string | undefined;
3774
+ imageRendering?: number | string | undefined;
3775
+ in2?: number | string | undefined;
3776
+ in?: string | undefined;
3777
+ intercept?: number | string | undefined;
3778
+ k1?: number | string | undefined;
3779
+ k2?: number | string | undefined;
3780
+ k3?: number | string | undefined;
3781
+ k4?: number | string | undefined;
3782
+ k?: number | string | undefined;
3783
+ kernelMatrix?: number | string | undefined;
3784
+ kernelUnitLength?: number | string | undefined;
3785
+ kerning?: number | string | undefined;
3786
+ keyPoints?: number | string | undefined;
3787
+ keySplines?: number | string | undefined;
3788
+ keyTimes?: number | string | undefined;
3789
+ lengthAdjust?: number | string | undefined;
3790
+ letterSpacing?: number | string | undefined;
3791
+ lightingColor?: number | string | undefined;
3792
+ limitingConeAngle?: number | string | undefined;
3793
+ local?: number | string | undefined;
3794
+ markerEnd?: string | undefined;
3795
+ markerHeight?: number | string | undefined;
3796
+ markerMid?: string | undefined;
3797
+ markerStart?: string | undefined;
3798
+ markerUnits?: number | string | undefined;
3799
+ markerWidth?: number | string | undefined;
3800
+ mask?: string | undefined;
3801
+ maskContentUnits?: number | string | undefined;
3802
+ maskUnits?: number | string | undefined;
3803
+ mathematical?: number | string | undefined;
3804
+ mode?: number | string | undefined;
3805
+ numOctaves?: number | string | undefined;
3806
+ offset?: number | string | undefined;
3807
+ opacity?: number | string | undefined;
3808
+ operator?: number | string | undefined;
3809
+ order?: number | string | undefined;
3810
+ orient?: number | string | undefined;
3811
+ orientation?: number | string | undefined;
3812
+ origin?: number | string | undefined;
3813
+ overflow?: number | string | undefined;
3814
+ overlinePosition?: number | string | undefined;
3815
+ overlineThickness?: number | string | undefined;
3816
+ paintOrder?: number | string | undefined;
3817
+ panose1?: number | string | undefined;
3818
+ path?: string | undefined;
3819
+ pathLength?: number | string | undefined;
3820
+ patternContentUnits?: string | undefined;
3821
+ patternTransform?: number | string | undefined;
3822
+ patternUnits?: string | undefined;
3823
+ pointerEvents?: number | string | undefined;
3824
+ points?: string | undefined;
3825
+ pointsAtX?: number | string | undefined;
3826
+ pointsAtY?: number | string | undefined;
3827
+ pointsAtZ?: number | string | undefined;
3828
+ preserveAlpha?: Booleanish | undefined;
3829
+ preserveAspectRatio?: string | undefined;
3830
+ primitiveUnits?: number | string | undefined;
3831
+ r?: number | string | undefined;
3832
+ radius?: number | string | undefined;
3833
+ refX?: number | string | undefined;
3834
+ refY?: number | string | undefined;
3835
+ renderingIntent?: number | string | undefined;
3836
+ repeatCount?: number | string | undefined;
3837
+ repeatDur?: number | string | undefined;
3838
+ requiredExtensions?: number | string | undefined;
3839
+ requiredFeatures?: number | string | undefined;
3840
+ restart?: number | string | undefined;
3841
+ result?: string | undefined;
3842
+ rotate?: number | string | undefined;
3843
+ rx?: number | string | undefined;
3844
+ ry?: number | string | undefined;
3845
+ scale?: number | string | undefined;
3846
+ seed?: number | string | undefined;
3847
+ shapeRendering?: number | string | undefined;
3848
+ slope?: number | string | undefined;
3849
+ spacing?: number | string | undefined;
3850
+ specularConstant?: number | string | undefined;
3851
+ specularExponent?: number | string | undefined;
3852
+ speed?: number | string | undefined;
3853
+ spreadMethod?: string | undefined;
3854
+ startOffset?: number | string | undefined;
3855
+ stdDeviation?: number | string | undefined;
3856
+ stemh?: number | string | undefined;
3857
+ stemv?: number | string | undefined;
3858
+ stitchTiles?: number | string | undefined;
3859
+ stopColor?: string | undefined;
3860
+ stopOpacity?: number | string | undefined;
3861
+ strikethroughPosition?: number | string | undefined;
3862
+ strikethroughThickness?: number | string | undefined;
3863
+ string?: number | string | undefined;
3864
+ stroke?: string | undefined;
3865
+ strokeDasharray?: string | number | undefined;
3866
+ strokeDashoffset?: string | number | undefined;
3867
+ strokeLinecap?: "butt" | "round" | "square" | "inherit" | undefined;
3868
+ strokeLinejoin?: "miter" | "round" | "bevel" | "inherit" | undefined;
3869
+ strokeMiterlimit?: number | string | undefined;
3870
+ strokeOpacity?: number | string | undefined;
3871
+ strokeWidth?: number | string | undefined;
3872
+ surfaceScale?: number | string | undefined;
3873
+ systemLanguage?: number | string | undefined;
3874
+ tableValues?: number | string | undefined;
3875
+ targetX?: number | string | undefined;
3876
+ targetY?: number | string | undefined;
3877
+ textAnchor?: string | undefined;
3878
+ textDecoration?: number | string | undefined;
3879
+ textLength?: number | string | undefined;
3880
+ textRendering?: number | string | undefined;
3881
+ to?: number | string | undefined;
3882
+ transform?: string | undefined;
3883
+ u1?: number | string | undefined;
3884
+ u2?: number | string | undefined;
3885
+ underlinePosition?: number | string | undefined;
3886
+ underlineThickness?: number | string | undefined;
3887
+ unicode?: number | string | undefined;
3888
+ unicodeBidi?: number | string | undefined;
3889
+ unicodeRange?: number | string | undefined;
3890
+ unitsPerEm?: number | string | undefined;
3891
+ vAlphabetic?: number | string | undefined;
3892
+ values?: string | undefined;
3893
+ vectorEffect?: number | string | undefined;
3894
+ version?: string | undefined;
3895
+ vertAdvY?: number | string | undefined;
3896
+ vertOriginX?: number | string | undefined;
3897
+ vertOriginY?: number | string | undefined;
3898
+ vHanging?: number | string | undefined;
3899
+ vIdeographic?: number | string | undefined;
3900
+ viewBox?: string | undefined;
3901
+ viewTarget?: number | string | undefined;
3902
+ visibility?: number | string | undefined;
3903
+ vMathematical?: number | string | undefined;
3904
+ widths?: number | string | undefined;
3905
+ wordSpacing?: number | string | undefined;
3906
+ writingMode?: number | string | undefined;
3907
+ x1?: number | string | undefined;
3908
+ x2?: number | string | undefined;
3909
+ x?: number | string | undefined;
3910
+ xChannelSelector?: string | undefined;
3911
+ xHeight?: number | string | undefined;
3912
+ xlinkActuate?: string | undefined;
3913
+ xlinkArcrole?: string | undefined;
3914
+ xlinkHref?: string | undefined;
3915
+ xlinkRole?: string | undefined;
3916
+ xlinkShow?: string | undefined;
3917
+ xlinkTitle?: string | undefined;
3918
+ xlinkType?: string | undefined;
3919
+ xmlBase?: string | undefined;
3920
+ xmlLang?: string | undefined;
3921
+ xmlns?: string | undefined;
3922
+ xmlnsXlink?: string | undefined;
3923
+ xmlSpace?: string | undefined;
3924
+ y1?: number | string | undefined;
3925
+ y2?: number | string | undefined;
3926
+ y?: number | string | undefined;
3927
+ yChannelSelector?: string | undefined;
3928
+ z?: number | string | undefined;
3929
+ zoomAndPan?: string | undefined;
3930
+ }
3931
+
3932
+ interface WebViewHTMLAttributes<T> extends HTMLAttributes<T> {
3933
+ allowFullScreen?: boolean | undefined;
3934
+ allowpopups?: boolean | undefined;
3935
+ autosize?: boolean | undefined;
3936
+ blinkfeatures?: string | undefined;
3937
+ disableblinkfeatures?: string | undefined;
3938
+ disableguestresize?: boolean | undefined;
3939
+ disablewebsecurity?: boolean | undefined;
3940
+ guestinstance?: string | undefined;
3941
+ httpreferrer?: string | undefined;
3942
+ nodeintegration?: boolean | undefined;
3943
+ partition?: string | undefined;
3944
+ plugins?: boolean | undefined;
3945
+ preload?: string | undefined;
3946
+ src?: string | undefined;
3947
+ useragent?: string | undefined;
3948
+ webpreferences?: string | undefined;
3949
+ }
3950
+
3951
+ //
3952
+ // React.DOM
3953
+ // ----------------------------------------------------------------------
3954
+
3955
+ interface ReactHTML {
3956
+ a: DetailedHTMLFactory<AnchorHTMLAttributes<HTMLAnchorElement>, HTMLAnchorElement>;
3957
+ abbr: DetailedHTMLFactory<HTMLAttributes<HTMLElement>, HTMLElement>;
3958
+ address: DetailedHTMLFactory<HTMLAttributes<HTMLElement>, HTMLElement>;
3959
+ area: DetailedHTMLFactory<AreaHTMLAttributes<HTMLAreaElement>, HTMLAreaElement>;
3960
+ article: DetailedHTMLFactory<HTMLAttributes<HTMLElement>, HTMLElement>;
3961
+ aside: DetailedHTMLFactory<HTMLAttributes<HTMLElement>, HTMLElement>;
3962
+ audio: DetailedHTMLFactory<AudioHTMLAttributes<HTMLAudioElement>, HTMLAudioElement>;
3963
+ b: DetailedHTMLFactory<HTMLAttributes<HTMLElement>, HTMLElement>;
3964
+ base: DetailedHTMLFactory<BaseHTMLAttributes<HTMLBaseElement>, HTMLBaseElement>;
3965
+ bdi: DetailedHTMLFactory<HTMLAttributes<HTMLElement>, HTMLElement>;
3966
+ bdo: DetailedHTMLFactory<HTMLAttributes<HTMLElement>, HTMLElement>;
3967
+ big: DetailedHTMLFactory<HTMLAttributes<HTMLElement>, HTMLElement>;
3968
+ blockquote: DetailedHTMLFactory<BlockquoteHTMLAttributes<HTMLQuoteElement>, HTMLQuoteElement>;
3969
+ body: DetailedHTMLFactory<HTMLAttributes<HTMLBodyElement>, HTMLBodyElement>;
3970
+ br: DetailedHTMLFactory<HTMLAttributes<HTMLBRElement>, HTMLBRElement>;
3971
+ button: DetailedHTMLFactory<ButtonHTMLAttributes<HTMLButtonElement>, HTMLButtonElement>;
3972
+ canvas: DetailedHTMLFactory<CanvasHTMLAttributes<HTMLCanvasElement>, HTMLCanvasElement>;
3973
+ caption: DetailedHTMLFactory<HTMLAttributes<HTMLElement>, HTMLElement>;
3974
+ center: DetailedHTMLFactory<HTMLAttributes<HTMLElement>, HTMLElement>;
3975
+ cite: DetailedHTMLFactory<HTMLAttributes<HTMLElement>, HTMLElement>;
3976
+ code: DetailedHTMLFactory<HTMLAttributes<HTMLElement>, HTMLElement>;
3977
+ col: DetailedHTMLFactory<ColHTMLAttributes<HTMLTableColElement>, HTMLTableColElement>;
3978
+ colgroup: DetailedHTMLFactory<ColgroupHTMLAttributes<HTMLTableColElement>, HTMLTableColElement>;
3979
+ data: DetailedHTMLFactory<DataHTMLAttributes<HTMLDataElement>, HTMLDataElement>;
3980
+ datalist: DetailedHTMLFactory<HTMLAttributes<HTMLDataListElement>, HTMLDataListElement>;
3981
+ dd: DetailedHTMLFactory<HTMLAttributes<HTMLElement>, HTMLElement>;
3982
+ del: DetailedHTMLFactory<DelHTMLAttributes<HTMLModElement>, HTMLModElement>;
3983
+ details: DetailedHTMLFactory<DetailsHTMLAttributes<HTMLDetailsElement>, HTMLDetailsElement>;
3984
+ dfn: DetailedHTMLFactory<HTMLAttributes<HTMLElement>, HTMLElement>;
3985
+ dialog: DetailedHTMLFactory<DialogHTMLAttributes<HTMLDialogElement>, HTMLDialogElement>;
3986
+ div: DetailedHTMLFactory<HTMLAttributes<HTMLDivElement>, HTMLDivElement>;
3987
+ dl: DetailedHTMLFactory<HTMLAttributes<HTMLDListElement>, HTMLDListElement>;
3988
+ dt: DetailedHTMLFactory<HTMLAttributes<HTMLElement>, HTMLElement>;
3989
+ em: DetailedHTMLFactory<HTMLAttributes<HTMLElement>, HTMLElement>;
3990
+ embed: DetailedHTMLFactory<EmbedHTMLAttributes<HTMLEmbedElement>, HTMLEmbedElement>;
3991
+ fieldset: DetailedHTMLFactory<FieldsetHTMLAttributes<HTMLFieldSetElement>, HTMLFieldSetElement>;
3992
+ figcaption: DetailedHTMLFactory<HTMLAttributes<HTMLElement>, HTMLElement>;
3993
+ figure: DetailedHTMLFactory<HTMLAttributes<HTMLElement>, HTMLElement>;
3994
+ footer: DetailedHTMLFactory<HTMLAttributes<HTMLElement>, HTMLElement>;
3995
+ form: DetailedHTMLFactory<FormHTMLAttributes<HTMLFormElement>, HTMLFormElement>;
3996
+ h1: DetailedHTMLFactory<HTMLAttributes<HTMLHeadingElement>, HTMLHeadingElement>;
3997
+ h2: DetailedHTMLFactory<HTMLAttributes<HTMLHeadingElement>, HTMLHeadingElement>;
3998
+ h3: DetailedHTMLFactory<HTMLAttributes<HTMLHeadingElement>, HTMLHeadingElement>;
3999
+ h4: DetailedHTMLFactory<HTMLAttributes<HTMLHeadingElement>, HTMLHeadingElement>;
4000
+ h5: DetailedHTMLFactory<HTMLAttributes<HTMLHeadingElement>, HTMLHeadingElement>;
4001
+ h6: DetailedHTMLFactory<HTMLAttributes<HTMLHeadingElement>, HTMLHeadingElement>;
4002
+ head: DetailedHTMLFactory<HTMLAttributes<HTMLElement>, HTMLHeadElement>;
4003
+ header: DetailedHTMLFactory<HTMLAttributes<HTMLElement>, HTMLElement>;
4004
+ hgroup: DetailedHTMLFactory<HTMLAttributes<HTMLElement>, HTMLElement>;
4005
+ hr: DetailedHTMLFactory<HTMLAttributes<HTMLHRElement>, HTMLHRElement>;
4006
+ html: DetailedHTMLFactory<HtmlHTMLAttributes<HTMLHtmlElement>, HTMLHtmlElement>;
4007
+ i: DetailedHTMLFactory<HTMLAttributes<HTMLElement>, HTMLElement>;
4008
+ iframe: DetailedHTMLFactory<IframeHTMLAttributes<HTMLIFrameElement>, HTMLIFrameElement>;
4009
+ img: DetailedHTMLFactory<ImgHTMLAttributes<HTMLImageElement>, HTMLImageElement>;
4010
+ input: DetailedHTMLFactory<InputHTMLAttributes<HTMLInputElement>, HTMLInputElement>;
4011
+ ins: DetailedHTMLFactory<InsHTMLAttributes<HTMLModElement>, HTMLModElement>;
4012
+ kbd: DetailedHTMLFactory<HTMLAttributes<HTMLElement>, HTMLElement>;
4013
+ keygen: DetailedHTMLFactory<KeygenHTMLAttributes<HTMLElement>, HTMLElement>;
4014
+ label: DetailedHTMLFactory<LabelHTMLAttributes<HTMLLabelElement>, HTMLLabelElement>;
4015
+ legend: DetailedHTMLFactory<HTMLAttributes<HTMLLegendElement>, HTMLLegendElement>;
4016
+ li: DetailedHTMLFactory<LiHTMLAttributes<HTMLLIElement>, HTMLLIElement>;
4017
+ link: DetailedHTMLFactory<LinkHTMLAttributes<HTMLLinkElement>, HTMLLinkElement>;
4018
+ main: DetailedHTMLFactory<HTMLAttributes<HTMLElement>, HTMLElement>;
4019
+ map: DetailedHTMLFactory<MapHTMLAttributes<HTMLMapElement>, HTMLMapElement>;
4020
+ mark: DetailedHTMLFactory<HTMLAttributes<HTMLElement>, HTMLElement>;
4021
+ menu: DetailedHTMLFactory<MenuHTMLAttributes<HTMLElement>, HTMLElement>;
4022
+ menuitem: DetailedHTMLFactory<HTMLAttributes<HTMLElement>, HTMLElement>;
4023
+ meta: DetailedHTMLFactory<MetaHTMLAttributes<HTMLMetaElement>, HTMLMetaElement>;
4024
+ meter: DetailedHTMLFactory<MeterHTMLAttributes<HTMLMeterElement>, HTMLMeterElement>;
4025
+ nav: DetailedHTMLFactory<HTMLAttributes<HTMLElement>, HTMLElement>;
4026
+ noscript: DetailedHTMLFactory<HTMLAttributes<HTMLElement>, HTMLElement>;
4027
+ object: DetailedHTMLFactory<ObjectHTMLAttributes<HTMLObjectElement>, HTMLObjectElement>;
4028
+ ol: DetailedHTMLFactory<OlHTMLAttributes<HTMLOListElement>, HTMLOListElement>;
4029
+ optgroup: DetailedHTMLFactory<OptgroupHTMLAttributes<HTMLOptGroupElement>, HTMLOptGroupElement>;
4030
+ option: DetailedHTMLFactory<OptionHTMLAttributes<HTMLOptionElement>, HTMLOptionElement>;
4031
+ output: DetailedHTMLFactory<OutputHTMLAttributes<HTMLOutputElement>, HTMLOutputElement>;
4032
+ p: DetailedHTMLFactory<HTMLAttributes<HTMLParagraphElement>, HTMLParagraphElement>;
4033
+ param: DetailedHTMLFactory<ParamHTMLAttributes<HTMLParamElement>, HTMLParamElement>;
4034
+ picture: DetailedHTMLFactory<HTMLAttributes<HTMLElement>, HTMLElement>;
4035
+ pre: DetailedHTMLFactory<HTMLAttributes<HTMLPreElement>, HTMLPreElement>;
4036
+ progress: DetailedHTMLFactory<ProgressHTMLAttributes<HTMLProgressElement>, HTMLProgressElement>;
4037
+ q: DetailedHTMLFactory<QuoteHTMLAttributes<HTMLQuoteElement>, HTMLQuoteElement>;
4038
+ rp: DetailedHTMLFactory<HTMLAttributes<HTMLElement>, HTMLElement>;
4039
+ rt: DetailedHTMLFactory<HTMLAttributes<HTMLElement>, HTMLElement>;
4040
+ ruby: DetailedHTMLFactory<HTMLAttributes<HTMLElement>, HTMLElement>;
4041
+ s: DetailedHTMLFactory<HTMLAttributes<HTMLElement>, HTMLElement>;
4042
+ samp: DetailedHTMLFactory<HTMLAttributes<HTMLElement>, HTMLElement>;
4043
+ search: DetailedHTMLFactory<HTMLAttributes<HTMLElement>, HTMLElement>;
4044
+ slot: DetailedHTMLFactory<SlotHTMLAttributes<HTMLSlotElement>, HTMLSlotElement>;
4045
+ script: DetailedHTMLFactory<ScriptHTMLAttributes<HTMLScriptElement>, HTMLScriptElement>;
4046
+ section: DetailedHTMLFactory<HTMLAttributes<HTMLElement>, HTMLElement>;
4047
+ select: DetailedHTMLFactory<SelectHTMLAttributes<HTMLSelectElement>, HTMLSelectElement>;
4048
+ small: DetailedHTMLFactory<HTMLAttributes<HTMLElement>, HTMLElement>;
4049
+ source: DetailedHTMLFactory<SourceHTMLAttributes<HTMLSourceElement>, HTMLSourceElement>;
4050
+ span: DetailedHTMLFactory<HTMLAttributes<HTMLSpanElement>, HTMLSpanElement>;
4051
+ strong: DetailedHTMLFactory<HTMLAttributes<HTMLElement>, HTMLElement>;
4052
+ style: DetailedHTMLFactory<StyleHTMLAttributes<HTMLStyleElement>, HTMLStyleElement>;
4053
+ sub: DetailedHTMLFactory<HTMLAttributes<HTMLElement>, HTMLElement>;
4054
+ summary: DetailedHTMLFactory<HTMLAttributes<HTMLElement>, HTMLElement>;
4055
+ sup: DetailedHTMLFactory<HTMLAttributes<HTMLElement>, HTMLElement>;
4056
+ table: DetailedHTMLFactory<TableHTMLAttributes<HTMLTableElement>, HTMLTableElement>;
4057
+ template: DetailedHTMLFactory<HTMLAttributes<HTMLTemplateElement>, HTMLTemplateElement>;
4058
+ tbody: DetailedHTMLFactory<HTMLAttributes<HTMLTableSectionElement>, HTMLTableSectionElement>;
4059
+ td: DetailedHTMLFactory<TdHTMLAttributes<HTMLTableDataCellElement>, HTMLTableDataCellElement>;
4060
+ textarea: DetailedHTMLFactory<TextareaHTMLAttributes<HTMLTextAreaElement>, HTMLTextAreaElement>;
4061
+ tfoot: DetailedHTMLFactory<HTMLAttributes<HTMLTableSectionElement>, HTMLTableSectionElement>;
4062
+ th: DetailedHTMLFactory<ThHTMLAttributes<HTMLTableHeaderCellElement>, HTMLTableHeaderCellElement>;
4063
+ thead: DetailedHTMLFactory<HTMLAttributes<HTMLTableSectionElement>, HTMLTableSectionElement>;
4064
+ time: DetailedHTMLFactory<TimeHTMLAttributes<HTMLTimeElement>, HTMLTimeElement>;
4065
+ title: DetailedHTMLFactory<HTMLAttributes<HTMLTitleElement>, HTMLTitleElement>;
4066
+ tr: DetailedHTMLFactory<HTMLAttributes<HTMLTableRowElement>, HTMLTableRowElement>;
4067
+ track: DetailedHTMLFactory<TrackHTMLAttributes<HTMLTrackElement>, HTMLTrackElement>;
4068
+ u: DetailedHTMLFactory<HTMLAttributes<HTMLElement>, HTMLElement>;
4069
+ ul: DetailedHTMLFactory<HTMLAttributes<HTMLUListElement>, HTMLUListElement>;
4070
+ "var": DetailedHTMLFactory<HTMLAttributes<HTMLElement>, HTMLElement>;
4071
+ video: DetailedHTMLFactory<VideoHTMLAttributes<HTMLVideoElement>, HTMLVideoElement>;
4072
+ wbr: DetailedHTMLFactory<HTMLAttributes<HTMLElement>, HTMLElement>;
4073
+ webview: DetailedHTMLFactory<WebViewHTMLAttributes<HTMLWebViewElement>, HTMLWebViewElement>;
4074
+ }
4075
+
4076
+ interface ReactSVG {
4077
+ animate: SVGFactory;
4078
+ circle: SVGFactory;
4079
+ clipPath: SVGFactory;
4080
+ defs: SVGFactory;
4081
+ desc: SVGFactory;
4082
+ ellipse: SVGFactory;
4083
+ feBlend: SVGFactory;
4084
+ feColorMatrix: SVGFactory;
4085
+ feComponentTransfer: SVGFactory;
4086
+ feComposite: SVGFactory;
4087
+ feConvolveMatrix: SVGFactory;
4088
+ feDiffuseLighting: SVGFactory;
4089
+ feDisplacementMap: SVGFactory;
4090
+ feDistantLight: SVGFactory;
4091
+ feDropShadow: SVGFactory;
4092
+ feFlood: SVGFactory;
4093
+ feFuncA: SVGFactory;
4094
+ feFuncB: SVGFactory;
4095
+ feFuncG: SVGFactory;
4096
+ feFuncR: SVGFactory;
4097
+ feGaussianBlur: SVGFactory;
4098
+ feImage: SVGFactory;
4099
+ feMerge: SVGFactory;
4100
+ feMergeNode: SVGFactory;
4101
+ feMorphology: SVGFactory;
4102
+ feOffset: SVGFactory;
4103
+ fePointLight: SVGFactory;
4104
+ feSpecularLighting: SVGFactory;
4105
+ feSpotLight: SVGFactory;
4106
+ feTile: SVGFactory;
4107
+ feTurbulence: SVGFactory;
4108
+ filter: SVGFactory;
4109
+ foreignObject: SVGFactory;
4110
+ g: SVGFactory;
4111
+ image: SVGFactory;
4112
+ line: SVGFactory;
4113
+ linearGradient: SVGFactory;
4114
+ marker: SVGFactory;
4115
+ mask: SVGFactory;
4116
+ metadata: SVGFactory;
4117
+ path: SVGFactory;
4118
+ pattern: SVGFactory;
4119
+ polygon: SVGFactory;
4120
+ polyline: SVGFactory;
4121
+ radialGradient: SVGFactory;
4122
+ rect: SVGFactory;
4123
+ stop: SVGFactory;
4124
+ svg: SVGFactory;
4125
+ switch: SVGFactory;
4126
+ symbol: SVGFactory;
4127
+ text: SVGFactory;
4128
+ textPath: SVGFactory;
4129
+ tspan: SVGFactory;
4130
+ use: SVGFactory;
4131
+ view: SVGFactory;
4132
+ }
4133
+
4134
+ interface ReactDOM extends ReactHTML, ReactSVG {}
4135
+
4136
+ //
4137
+ // React.PropTypes
4138
+ // ----------------------------------------------------------------------
4139
+
4140
+ /**
4141
+ * @deprecated Use `Validator` from the ´prop-types` instead.
4142
+ */
4143
+ type Validator<T> = PropTypes.Validator<T>;
4144
+
4145
+ /**
4146
+ * @deprecated Use `Requireable` from the ´prop-types` instead.
4147
+ */
4148
+ type Requireable<T> = PropTypes.Requireable<T>;
4149
+
4150
+ /**
4151
+ * @deprecated Use `ValidationMap` from the ´prop-types` instead.
4152
+ */
4153
+ type ValidationMap<T> = PropTypes.ValidationMap<T>;
4154
+
4155
+ /**
4156
+ * @deprecated Use `WeakValidationMap` from the ´prop-types` instead.
4157
+ */
4158
+ type WeakValidationMap<T> = {
4159
+ [K in keyof T]?: null extends T[K] ? Validator<T[K] | null | undefined>
4160
+ : undefined extends T[K] ? Validator<T[K] | null | undefined>
4161
+ : Validator<T[K]>;
4162
+ };
4163
+
4164
+ /**
4165
+ * @deprecated Use `PropTypes.*` where `PropTypes` comes from `import * as PropTypes from 'prop-types'` instead.
4166
+ */
4167
+ interface ReactPropTypes {
4168
+ any: typeof PropTypes.any;
4169
+ array: typeof PropTypes.array;
4170
+ bool: typeof PropTypes.bool;
4171
+ func: typeof PropTypes.func;
4172
+ number: typeof PropTypes.number;
4173
+ object: typeof PropTypes.object;
4174
+ string: typeof PropTypes.string;
4175
+ node: typeof PropTypes.node;
4176
+ element: typeof PropTypes.element;
4177
+ instanceOf: typeof PropTypes.instanceOf;
4178
+ oneOf: typeof PropTypes.oneOf;
4179
+ oneOfType: typeof PropTypes.oneOfType;
4180
+ arrayOf: typeof PropTypes.arrayOf;
4181
+ objectOf: typeof PropTypes.objectOf;
4182
+ shape: typeof PropTypes.shape;
4183
+ exact: typeof PropTypes.exact;
4184
+ }
4185
+
4186
+ //
4187
+ // React.Children
4188
+ // ----------------------------------------------------------------------
4189
+
4190
+ /**
4191
+ * @deprecated - Use `typeof React.Children` instead.
4192
+ */
4193
+ // Sync with type of `const Children`.
4194
+ interface ReactChildren {
4195
+ map<T, C>(
4196
+ children: C | readonly C[],
4197
+ fn: (child: C, index: number) => T,
4198
+ ): C extends null | undefined ? C : Array<Exclude<T, boolean | null | undefined>>;
4199
+ forEach<C>(children: C | readonly C[], fn: (child: C, index: number) => void): void;
4200
+ count(children: any): number;
4201
+ only<C>(children: C): C extends any[] ? never : C;
4202
+ toArray(children: ReactNode | ReactNode[]): Array<Exclude<ReactNode, boolean | null | undefined>>;
4203
+ }
4204
+
4205
+ //
4206
+ // Browser Interfaces
4207
+ // https://github.com/nikeee/2048-typescript/blob/master/2048/js/touch.d.ts
4208
+ // ----------------------------------------------------------------------
4209
+
4210
+ interface AbstractView {
4211
+ styleMedia: StyleMedia;
4212
+ document: Document;
4213
+ }
4214
+
4215
+ interface Touch {
4216
+ identifier: number;
4217
+ target: EventTarget;
4218
+ screenX: number;
4219
+ screenY: number;
4220
+ clientX: number;
4221
+ clientY: number;
4222
+ pageX: number;
4223
+ pageY: number;
4224
+ }
4225
+
4226
+ interface TouchList {
4227
+ [index: number]: Touch;
4228
+ length: number;
4229
+ item(index: number): Touch;
4230
+ identifiedTouch(identifier: number): Touch;
4231
+ }
4232
+
4233
+ //
4234
+ // Error Interfaces
4235
+ // ----------------------------------------------------------------------
4236
+ interface ErrorInfo {
4237
+ /**
4238
+ * Captures which component contained the exception, and its ancestors.
4239
+ */
4240
+ componentStack?: string | null;
4241
+ digest?: string | null;
4242
+ }
4243
+
4244
+ // Keep in sync with JSX namespace in ./jsx-runtime.d.ts and ./jsx-dev-runtime.d.ts
4245
+ namespace JSX {
4246
+ interface Element extends GlobalJSXElement {}
4247
+ interface ElementClass extends GlobalJSXElementClass {}
4248
+ interface ElementAttributesProperty extends GlobalJSXElementAttributesProperty {}
4249
+ interface ElementChildrenAttribute extends GlobalJSXElementChildrenAttribute {}
4250
+
4251
+ type LibraryManagedAttributes<C, P> = GlobalJSXLibraryManagedAttributes<C, P>;
4252
+
4253
+ interface IntrinsicAttributes extends GlobalJSXIntrinsicAttributes {}
4254
+ interface IntrinsicClassAttributes<T> extends GlobalJSXIntrinsicClassAttributes<T> {}
4255
+ interface IntrinsicElements extends GlobalJSXIntrinsicElements {}
4256
+ }
4257
+ }
4258
+
4259
+ // naked 'any' type in a conditional type will short circuit and union both the then/else branches
4260
+ // so boolean is only resolved for T = any
4261
+ type IsExactlyAny<T> = boolean extends (T extends never ? true : false) ? true : false;
4262
+
4263
+ type ExactlyAnyPropertyKeys<T> = { [K in keyof T]: IsExactlyAny<T[K]> extends true ? K : never }[keyof T];
4264
+ type NotExactlyAnyPropertyKeys<T> = Exclude<keyof T, ExactlyAnyPropertyKeys<T>>;
4265
+
4266
+ // Try to resolve ill-defined props like for JS users: props can be any, or sometimes objects with properties of type any
4267
+ type MergePropTypes<P, T> =
4268
+ // Distribute over P in case it is a union type
4269
+ P extends any
4270
+ // If props is type any, use propTypes definitions
4271
+ ? IsExactlyAny<P> extends true ? T
4272
+ // If declared props have indexed properties, ignore inferred props entirely as keyof gets widened
4273
+ : string extends keyof P ? P
4274
+ // Prefer declared types which are not exactly any
4275
+ :
4276
+ & Pick<P, NotExactlyAnyPropertyKeys<P>>
4277
+ // For props which are exactly any, use the type inferred from propTypes if present
4278
+ & Pick<T, Exclude<keyof T, NotExactlyAnyPropertyKeys<P>>>
4279
+ // Keep leftover props not specified in propTypes
4280
+ & Pick<P, Exclude<keyof P, keyof T>>
4281
+ : never;
4282
+
4283
+ type InexactPartial<T> = { [K in keyof T]?: T[K] | undefined };
4284
+
4285
+ // Any prop that has a default prop becomes optional, but its type is unchanged
4286
+ // Undeclared default props are augmented into the resulting allowable attributes
4287
+ // If declared props have indexed properties, ignore default props entirely as keyof gets widened
4288
+ // Wrap in an outer-level conditional type to allow distribution over props that are unions
4289
+ type Defaultize<P, D> = P extends any ? string extends keyof P ? P
4290
+ :
4291
+ & Pick<P, Exclude<keyof P, keyof D>>
4292
+ & InexactPartial<Pick<P, Extract<keyof P, keyof D>>>
4293
+ & InexactPartial<Pick<D, Exclude<keyof D, keyof P>>>
4294
+ : never;
4295
+
4296
+ type ReactManagedAttributes<C, P> = C extends { propTypes: infer T; defaultProps: infer D }
4297
+ ? Defaultize<MergePropTypes<P, PropTypes.InferProps<T>>, D>
4298
+ : C extends { propTypes: infer T } ? MergePropTypes<P, PropTypes.InferProps<T>>
4299
+ : C extends { defaultProps: infer D } ? Defaultize<P, D>
4300
+ : P;
4301
+
4302
+ declare global {
4303
+ /**
4304
+ * @deprecated Use `React.JSX` instead of the global `JSX` namespace.
4305
+ */
4306
+ namespace JSX {
4307
+ interface Element extends React.ReactElement<any, any> {}
4308
+ interface ElementClass extends React.Component<any> {
4309
+ render(): React.ReactNode;
4310
+ }
4311
+ interface ElementAttributesProperty {
4312
+ props: {};
4313
+ }
4314
+ interface ElementChildrenAttribute {
4315
+ children: {};
4316
+ }
4317
+
4318
+ // We can't recurse forever because `type` can't be self-referential;
4319
+ // let's assume it's reasonable to do a single React.lazy() around a single React.memo() / vice-versa
4320
+ type LibraryManagedAttributes<C, P> = C extends
4321
+ React.MemoExoticComponent<infer T> | React.LazyExoticComponent<infer T>
4322
+ ? T extends React.MemoExoticComponent<infer U> | React.LazyExoticComponent<infer U>
4323
+ ? ReactManagedAttributes<U, P>
4324
+ : ReactManagedAttributes<T, P>
4325
+ : ReactManagedAttributes<C, P>;
4326
+
4327
+ interface IntrinsicAttributes extends React.Attributes {}
4328
+ interface IntrinsicClassAttributes<T> extends React.ClassAttributes<T> {}
4329
+
4330
+ interface IntrinsicElements {
4331
+ // HTML
4332
+ a: React.DetailedHTMLProps<React.AnchorHTMLAttributes<HTMLAnchorElement>, HTMLAnchorElement>;
4333
+ abbr: React.DetailedHTMLProps<React.HTMLAttributes<HTMLElement>, HTMLElement>;
4334
+ address: React.DetailedHTMLProps<React.HTMLAttributes<HTMLElement>, HTMLElement>;
4335
+ area: React.DetailedHTMLProps<React.AreaHTMLAttributes<HTMLAreaElement>, HTMLAreaElement>;
4336
+ article: React.DetailedHTMLProps<React.HTMLAttributes<HTMLElement>, HTMLElement>;
4337
+ aside: React.DetailedHTMLProps<React.HTMLAttributes<HTMLElement>, HTMLElement>;
4338
+ audio: React.DetailedHTMLProps<React.AudioHTMLAttributes<HTMLAudioElement>, HTMLAudioElement>;
4339
+ b: React.DetailedHTMLProps<React.HTMLAttributes<HTMLElement>, HTMLElement>;
4340
+ base: React.DetailedHTMLProps<React.BaseHTMLAttributes<HTMLBaseElement>, HTMLBaseElement>;
4341
+ bdi: React.DetailedHTMLProps<React.HTMLAttributes<HTMLElement>, HTMLElement>;
4342
+ bdo: React.DetailedHTMLProps<React.HTMLAttributes<HTMLElement>, HTMLElement>;
4343
+ big: React.DetailedHTMLProps<React.HTMLAttributes<HTMLElement>, HTMLElement>;
4344
+ blockquote: React.DetailedHTMLProps<React.BlockquoteHTMLAttributes<HTMLQuoteElement>, HTMLQuoteElement>;
4345
+ body: React.DetailedHTMLProps<React.HTMLAttributes<HTMLBodyElement>, HTMLBodyElement>;
4346
+ br: React.DetailedHTMLProps<React.HTMLAttributes<HTMLBRElement>, HTMLBRElement>;
4347
+ button: React.DetailedHTMLProps<React.ButtonHTMLAttributes<HTMLButtonElement>, HTMLButtonElement>;
4348
+ canvas: React.DetailedHTMLProps<React.CanvasHTMLAttributes<HTMLCanvasElement>, HTMLCanvasElement>;
4349
+ caption: React.DetailedHTMLProps<React.HTMLAttributes<HTMLElement>, HTMLElement>;
4350
+ center: React.DetailedHTMLProps<React.HTMLAttributes<HTMLElement>, HTMLElement>;
4351
+ cite: React.DetailedHTMLProps<React.HTMLAttributes<HTMLElement>, HTMLElement>;
4352
+ code: React.DetailedHTMLProps<React.HTMLAttributes<HTMLElement>, HTMLElement>;
4353
+ col: React.DetailedHTMLProps<React.ColHTMLAttributes<HTMLTableColElement>, HTMLTableColElement>;
4354
+ colgroup: React.DetailedHTMLProps<React.ColgroupHTMLAttributes<HTMLTableColElement>, HTMLTableColElement>;
4355
+ data: React.DetailedHTMLProps<React.DataHTMLAttributes<HTMLDataElement>, HTMLDataElement>;
4356
+ datalist: React.DetailedHTMLProps<React.HTMLAttributes<HTMLDataListElement>, HTMLDataListElement>;
4357
+ dd: React.DetailedHTMLProps<React.HTMLAttributes<HTMLElement>, HTMLElement>;
4358
+ del: React.DetailedHTMLProps<React.DelHTMLAttributes<HTMLModElement>, HTMLModElement>;
4359
+ details: React.DetailedHTMLProps<React.DetailsHTMLAttributes<HTMLDetailsElement>, HTMLDetailsElement>;
4360
+ dfn: React.DetailedHTMLProps<React.HTMLAttributes<HTMLElement>, HTMLElement>;
4361
+ dialog: React.DetailedHTMLProps<React.DialogHTMLAttributes<HTMLDialogElement>, HTMLDialogElement>;
4362
+ div: React.DetailedHTMLProps<React.HTMLAttributes<HTMLDivElement>, HTMLDivElement>;
4363
+ dl: React.DetailedHTMLProps<React.HTMLAttributes<HTMLDListElement>, HTMLDListElement>;
4364
+ dt: React.DetailedHTMLProps<React.HTMLAttributes<HTMLElement>, HTMLElement>;
4365
+ em: React.DetailedHTMLProps<React.HTMLAttributes<HTMLElement>, HTMLElement>;
4366
+ embed: React.DetailedHTMLProps<React.EmbedHTMLAttributes<HTMLEmbedElement>, HTMLEmbedElement>;
4367
+ fieldset: React.DetailedHTMLProps<React.FieldsetHTMLAttributes<HTMLFieldSetElement>, HTMLFieldSetElement>;
4368
+ figcaption: React.DetailedHTMLProps<React.HTMLAttributes<HTMLElement>, HTMLElement>;
4369
+ figure: React.DetailedHTMLProps<React.HTMLAttributes<HTMLElement>, HTMLElement>;
4370
+ footer: React.DetailedHTMLProps<React.HTMLAttributes<HTMLElement>, HTMLElement>;
4371
+ form: React.DetailedHTMLProps<React.FormHTMLAttributes<HTMLFormElement>, HTMLFormElement>;
4372
+ h1: React.DetailedHTMLProps<React.HTMLAttributes<HTMLHeadingElement>, HTMLHeadingElement>;
4373
+ h2: React.DetailedHTMLProps<React.HTMLAttributes<HTMLHeadingElement>, HTMLHeadingElement>;
4374
+ h3: React.DetailedHTMLProps<React.HTMLAttributes<HTMLHeadingElement>, HTMLHeadingElement>;
4375
+ h4: React.DetailedHTMLProps<React.HTMLAttributes<HTMLHeadingElement>, HTMLHeadingElement>;
4376
+ h5: React.DetailedHTMLProps<React.HTMLAttributes<HTMLHeadingElement>, HTMLHeadingElement>;
4377
+ h6: React.DetailedHTMLProps<React.HTMLAttributes<HTMLHeadingElement>, HTMLHeadingElement>;
4378
+ head: React.DetailedHTMLProps<React.HTMLAttributes<HTMLHeadElement>, HTMLHeadElement>;
4379
+ header: React.DetailedHTMLProps<React.HTMLAttributes<HTMLElement>, HTMLElement>;
4380
+ hgroup: React.DetailedHTMLProps<React.HTMLAttributes<HTMLElement>, HTMLElement>;
4381
+ hr: React.DetailedHTMLProps<React.HTMLAttributes<HTMLHRElement>, HTMLHRElement>;
4382
+ html: React.DetailedHTMLProps<React.HtmlHTMLAttributes<HTMLHtmlElement>, HTMLHtmlElement>;
4383
+ i: React.DetailedHTMLProps<React.HTMLAttributes<HTMLElement>, HTMLElement>;
4384
+ iframe: React.DetailedHTMLProps<React.IframeHTMLAttributes<HTMLIFrameElement>, HTMLIFrameElement>;
4385
+ img: React.DetailedHTMLProps<React.ImgHTMLAttributes<HTMLImageElement>, HTMLImageElement>;
4386
+ input: React.DetailedHTMLProps<React.InputHTMLAttributes<HTMLInputElement>, HTMLInputElement>;
4387
+ ins: React.DetailedHTMLProps<React.InsHTMLAttributes<HTMLModElement>, HTMLModElement>;
4388
+ kbd: React.DetailedHTMLProps<React.HTMLAttributes<HTMLElement>, HTMLElement>;
4389
+ keygen: React.DetailedHTMLProps<React.KeygenHTMLAttributes<HTMLElement>, HTMLElement>;
4390
+ label: React.DetailedHTMLProps<React.LabelHTMLAttributes<HTMLLabelElement>, HTMLLabelElement>;
4391
+ legend: React.DetailedHTMLProps<React.HTMLAttributes<HTMLLegendElement>, HTMLLegendElement>;
4392
+ li: React.DetailedHTMLProps<React.LiHTMLAttributes<HTMLLIElement>, HTMLLIElement>;
4393
+ link: React.DetailedHTMLProps<React.LinkHTMLAttributes<HTMLLinkElement>, HTMLLinkElement>;
4394
+ main: React.DetailedHTMLProps<React.HTMLAttributes<HTMLElement>, HTMLElement>;
4395
+ map: React.DetailedHTMLProps<React.MapHTMLAttributes<HTMLMapElement>, HTMLMapElement>;
4396
+ mark: React.DetailedHTMLProps<React.HTMLAttributes<HTMLElement>, HTMLElement>;
4397
+ menu: React.DetailedHTMLProps<React.MenuHTMLAttributes<HTMLElement>, HTMLElement>;
4398
+ menuitem: React.DetailedHTMLProps<React.HTMLAttributes<HTMLElement>, HTMLElement>;
4399
+ meta: React.DetailedHTMLProps<React.MetaHTMLAttributes<HTMLMetaElement>, HTMLMetaElement>;
4400
+ meter: React.DetailedHTMLProps<React.MeterHTMLAttributes<HTMLMeterElement>, HTMLMeterElement>;
4401
+ nav: React.DetailedHTMLProps<React.HTMLAttributes<HTMLElement>, HTMLElement>;
4402
+ noindex: React.DetailedHTMLProps<React.HTMLAttributes<HTMLElement>, HTMLElement>;
4403
+ noscript: React.DetailedHTMLProps<React.HTMLAttributes<HTMLElement>, HTMLElement>;
4404
+ object: React.DetailedHTMLProps<React.ObjectHTMLAttributes<HTMLObjectElement>, HTMLObjectElement>;
4405
+ ol: React.DetailedHTMLProps<React.OlHTMLAttributes<HTMLOListElement>, HTMLOListElement>;
4406
+ optgroup: React.DetailedHTMLProps<React.OptgroupHTMLAttributes<HTMLOptGroupElement>, HTMLOptGroupElement>;
4407
+ option: React.DetailedHTMLProps<React.OptionHTMLAttributes<HTMLOptionElement>, HTMLOptionElement>;
4408
+ output: React.DetailedHTMLProps<React.OutputHTMLAttributes<HTMLOutputElement>, HTMLOutputElement>;
4409
+ p: React.DetailedHTMLProps<React.HTMLAttributes<HTMLParagraphElement>, HTMLParagraphElement>;
4410
+ param: React.DetailedHTMLProps<React.ParamHTMLAttributes<HTMLParamElement>, HTMLParamElement>;
4411
+ picture: React.DetailedHTMLProps<React.HTMLAttributes<HTMLElement>, HTMLElement>;
4412
+ pre: React.DetailedHTMLProps<React.HTMLAttributes<HTMLPreElement>, HTMLPreElement>;
4413
+ progress: React.DetailedHTMLProps<React.ProgressHTMLAttributes<HTMLProgressElement>, HTMLProgressElement>;
4414
+ q: React.DetailedHTMLProps<React.QuoteHTMLAttributes<HTMLQuoteElement>, HTMLQuoteElement>;
4415
+ rp: React.DetailedHTMLProps<React.HTMLAttributes<HTMLElement>, HTMLElement>;
4416
+ rt: React.DetailedHTMLProps<React.HTMLAttributes<HTMLElement>, HTMLElement>;
4417
+ ruby: React.DetailedHTMLProps<React.HTMLAttributes<HTMLElement>, HTMLElement>;
4418
+ s: React.DetailedHTMLProps<React.HTMLAttributes<HTMLElement>, HTMLElement>;
4419
+ samp: React.DetailedHTMLProps<React.HTMLAttributes<HTMLElement>, HTMLElement>;
4420
+ search: React.DetailedHTMLProps<React.HTMLAttributes<HTMLElement>, HTMLElement>;
4421
+ slot: React.DetailedHTMLProps<React.SlotHTMLAttributes<HTMLSlotElement>, HTMLSlotElement>;
4422
+ script: React.DetailedHTMLProps<React.ScriptHTMLAttributes<HTMLScriptElement>, HTMLScriptElement>;
4423
+ section: React.DetailedHTMLProps<React.HTMLAttributes<HTMLElement>, HTMLElement>;
4424
+ select: React.DetailedHTMLProps<React.SelectHTMLAttributes<HTMLSelectElement>, HTMLSelectElement>;
4425
+ small: React.DetailedHTMLProps<React.HTMLAttributes<HTMLElement>, HTMLElement>;
4426
+ source: React.DetailedHTMLProps<React.SourceHTMLAttributes<HTMLSourceElement>, HTMLSourceElement>;
4427
+ span: React.DetailedHTMLProps<React.HTMLAttributes<HTMLSpanElement>, HTMLSpanElement>;
4428
+ strong: React.DetailedHTMLProps<React.HTMLAttributes<HTMLElement>, HTMLElement>;
4429
+ style: React.DetailedHTMLProps<React.StyleHTMLAttributes<HTMLStyleElement>, HTMLStyleElement>;
4430
+ sub: React.DetailedHTMLProps<React.HTMLAttributes<HTMLElement>, HTMLElement>;
4431
+ summary: React.DetailedHTMLProps<React.HTMLAttributes<HTMLElement>, HTMLElement>;
4432
+ sup: React.DetailedHTMLProps<React.HTMLAttributes<HTMLElement>, HTMLElement>;
4433
+ table: React.DetailedHTMLProps<React.TableHTMLAttributes<HTMLTableElement>, HTMLTableElement>;
4434
+ template: React.DetailedHTMLProps<React.HTMLAttributes<HTMLTemplateElement>, HTMLTemplateElement>;
4435
+ tbody: React.DetailedHTMLProps<React.HTMLAttributes<HTMLTableSectionElement>, HTMLTableSectionElement>;
4436
+ td: React.DetailedHTMLProps<React.TdHTMLAttributes<HTMLTableDataCellElement>, HTMLTableDataCellElement>;
4437
+ textarea: React.DetailedHTMLProps<React.TextareaHTMLAttributes<HTMLTextAreaElement>, HTMLTextAreaElement>;
4438
+ tfoot: React.DetailedHTMLProps<React.HTMLAttributes<HTMLTableSectionElement>, HTMLTableSectionElement>;
4439
+ th: React.DetailedHTMLProps<React.ThHTMLAttributes<HTMLTableHeaderCellElement>, HTMLTableHeaderCellElement>;
4440
+ thead: React.DetailedHTMLProps<React.HTMLAttributes<HTMLTableSectionElement>, HTMLTableSectionElement>;
4441
+ time: React.DetailedHTMLProps<React.TimeHTMLAttributes<HTMLTimeElement>, HTMLTimeElement>;
4442
+ title: React.DetailedHTMLProps<React.HTMLAttributes<HTMLTitleElement>, HTMLTitleElement>;
4443
+ tr: React.DetailedHTMLProps<React.HTMLAttributes<HTMLTableRowElement>, HTMLTableRowElement>;
4444
+ track: React.DetailedHTMLProps<React.TrackHTMLAttributes<HTMLTrackElement>, HTMLTrackElement>;
4445
+ u: React.DetailedHTMLProps<React.HTMLAttributes<HTMLElement>, HTMLElement>;
4446
+ ul: React.DetailedHTMLProps<React.HTMLAttributes<HTMLUListElement>, HTMLUListElement>;
4447
+ "var": React.DetailedHTMLProps<React.HTMLAttributes<HTMLElement>, HTMLElement>;
4448
+ video: React.DetailedHTMLProps<React.VideoHTMLAttributes<HTMLVideoElement>, HTMLVideoElement>;
4449
+ wbr: React.DetailedHTMLProps<React.HTMLAttributes<HTMLElement>, HTMLElement>;
4450
+ webview: React.DetailedHTMLProps<React.WebViewHTMLAttributes<HTMLWebViewElement>, HTMLWebViewElement>;
4451
+
4452
+ // SVG
4453
+ svg: React.SVGProps<SVGSVGElement>;
4454
+
4455
+ animate: React.SVGProps<SVGElement>; // TODO: It is SVGAnimateElement but is not in TypeScript's lib.dom.d.ts for now.
4456
+ animateMotion: React.SVGProps<SVGElement>;
4457
+ animateTransform: React.SVGProps<SVGElement>; // TODO: It is SVGAnimateTransformElement but is not in TypeScript's lib.dom.d.ts for now.
4458
+ circle: React.SVGProps<SVGCircleElement>;
4459
+ clipPath: React.SVGProps<SVGClipPathElement>;
4460
+ defs: React.SVGProps<SVGDefsElement>;
4461
+ desc: React.SVGProps<SVGDescElement>;
4462
+ ellipse: React.SVGProps<SVGEllipseElement>;
4463
+ feBlend: React.SVGProps<SVGFEBlendElement>;
4464
+ feColorMatrix: React.SVGProps<SVGFEColorMatrixElement>;
4465
+ feComponentTransfer: React.SVGProps<SVGFEComponentTransferElement>;
4466
+ feComposite: React.SVGProps<SVGFECompositeElement>;
4467
+ feConvolveMatrix: React.SVGProps<SVGFEConvolveMatrixElement>;
4468
+ feDiffuseLighting: React.SVGProps<SVGFEDiffuseLightingElement>;
4469
+ feDisplacementMap: React.SVGProps<SVGFEDisplacementMapElement>;
4470
+ feDistantLight: React.SVGProps<SVGFEDistantLightElement>;
4471
+ feDropShadow: React.SVGProps<SVGFEDropShadowElement>;
4472
+ feFlood: React.SVGProps<SVGFEFloodElement>;
4473
+ feFuncA: React.SVGProps<SVGFEFuncAElement>;
4474
+ feFuncB: React.SVGProps<SVGFEFuncBElement>;
4475
+ feFuncG: React.SVGProps<SVGFEFuncGElement>;
4476
+ feFuncR: React.SVGProps<SVGFEFuncRElement>;
4477
+ feGaussianBlur: React.SVGProps<SVGFEGaussianBlurElement>;
4478
+ feImage: React.SVGProps<SVGFEImageElement>;
4479
+ feMerge: React.SVGProps<SVGFEMergeElement>;
4480
+ feMergeNode: React.SVGProps<SVGFEMergeNodeElement>;
4481
+ feMorphology: React.SVGProps<SVGFEMorphologyElement>;
4482
+ feOffset: React.SVGProps<SVGFEOffsetElement>;
4483
+ fePointLight: React.SVGProps<SVGFEPointLightElement>;
4484
+ feSpecularLighting: React.SVGProps<SVGFESpecularLightingElement>;
4485
+ feSpotLight: React.SVGProps<SVGFESpotLightElement>;
4486
+ feTile: React.SVGProps<SVGFETileElement>;
4487
+ feTurbulence: React.SVGProps<SVGFETurbulenceElement>;
4488
+ filter: React.SVGProps<SVGFilterElement>;
4489
+ foreignObject: React.SVGProps<SVGForeignObjectElement>;
4490
+ g: React.SVGProps<SVGGElement>;
4491
+ image: React.SVGProps<SVGImageElement>;
4492
+ line: React.SVGLineElementAttributes<SVGLineElement>;
4493
+ linearGradient: React.SVGProps<SVGLinearGradientElement>;
4494
+ marker: React.SVGProps<SVGMarkerElement>;
4495
+ mask: React.SVGProps<SVGMaskElement>;
4496
+ metadata: React.SVGProps<SVGMetadataElement>;
4497
+ mpath: React.SVGProps<SVGElement>;
4498
+ path: React.SVGProps<SVGPathElement>;
4499
+ pattern: React.SVGProps<SVGPatternElement>;
4500
+ polygon: React.SVGProps<SVGPolygonElement>;
4501
+ polyline: React.SVGProps<SVGPolylineElement>;
4502
+ radialGradient: React.SVGProps<SVGRadialGradientElement>;
4503
+ rect: React.SVGProps<SVGRectElement>;
4504
+ set: React.SVGProps<SVGSetElement>;
4505
+ stop: React.SVGProps<SVGStopElement>;
4506
+ switch: React.SVGProps<SVGSwitchElement>;
4507
+ symbol: React.SVGProps<SVGSymbolElement>;
4508
+ text: React.SVGTextElementAttributes<SVGTextElement>;
4509
+ textPath: React.SVGProps<SVGTextPathElement>;
4510
+ tspan: React.SVGProps<SVGTSpanElement>;
4511
+ use: React.SVGProps<SVGUseElement>;
4512
+ view: React.SVGProps<SVGViewElement>;
4513
+ }
4514
+ }
4515
+ }
4516
+
4517
+ // React.JSX needs to point to global.JSX to keep global module augmentations intact.
4518
+ // But we can't access global.JSX so we need to create these aliases instead.
4519
+ // Once the global JSX namespace will be removed we replace React.JSX with the contents of global.JSX
4520
+ interface GlobalJSXElement extends JSX.Element {}
4521
+ interface GlobalJSXElementClass extends JSX.ElementClass {}
4522
+ interface GlobalJSXElementAttributesProperty extends JSX.ElementAttributesProperty {}
4523
+ interface GlobalJSXElementChildrenAttribute extends JSX.ElementChildrenAttribute {}
4524
+
4525
+ type GlobalJSXLibraryManagedAttributes<C, P> = JSX.LibraryManagedAttributes<C, P>;
4526
+
4527
+ interface GlobalJSXIntrinsicAttributes extends JSX.IntrinsicAttributes {}
4528
+ interface GlobalJSXIntrinsicClassAttributes<T> extends JSX.IntrinsicClassAttributes<T> {}
4529
+
4530
+ interface GlobalJSXIntrinsicElements extends JSX.IntrinsicElements {}