@pinuts/bsr-uikit-relaunch 0.2.39 → 0.2.40
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.
- package/dist/hooks/withFieldGroup.d.ts.map +1 -1
- package/dist/index.js +1 -1
- package/dist/index.js.LICENSE.txt +2 -2
- package/node_modules/@babel/runtime/helpers/esm/objectWithoutProperties.js +2 -2
- package/node_modules/@babel/runtime/helpers/esm/objectWithoutPropertiesLoose.js +1 -1
- package/node_modules/@babel/runtime/helpers/esm/superPropGet.js +4 -4
- package/node_modules/@babel/runtime/helpers/esm/superPropSet.js +2 -2
- package/node_modules/@babel/runtime/helpers/esm/tsRewriteRelativeImportExtensions.js +6 -0
- package/node_modules/@babel/runtime/helpers/esm/wrapRegExp.js +4 -3
- package/node_modules/@babel/runtime/helpers/objectWithoutProperties.js +2 -2
- package/node_modules/@babel/runtime/helpers/objectWithoutPropertiesLoose.js +1 -1
- package/node_modules/@babel/runtime/helpers/superPropGet.js +4 -4
- package/node_modules/@babel/runtime/helpers/superPropSet.js +2 -2
- package/node_modules/@babel/runtime/helpers/tsRewriteRelativeImportExtensions.js +6 -0
- package/node_modules/@babel/runtime/helpers/wrapRegExp.js +4 -3
- package/node_modules/@babel/runtime/package.json +10 -1
- package/node_modules/@types/hoist-non-react-statics/README.md +13 -13
- package/node_modules/@types/hoist-non-react-statics/index.d.ts +12 -12
- package/node_modules/@types/hoist-non-react-statics/package.json +4 -3
- package/node_modules/@types/react/README.md +3 -3
- package/node_modules/@types/react/canary.d.ts +0 -122
- package/node_modules/@types/react/compiler-runtime.d.ts +4 -0
- package/node_modules/@types/react/experimental.d.ts +118 -4
- package/node_modules/@types/react/global.d.ts +4 -0
- package/node_modules/@types/react/index.d.ts +468 -770
- package/node_modules/@types/react/package.json +9 -9
- package/node_modules/@types/react/ts5.0/canary.d.ts +0 -122
- package/node_modules/@types/react/ts5.0/experimental.d.ts +118 -4
- package/node_modules/@types/react/ts5.0/global.d.ts +4 -0
- package/node_modules/@types/react/ts5.0/index.d.ts +464 -766
- package/node_modules/@types/react/ts5.0/v18/global.d.ts +160 -0
- package/node_modules/@types/react/ts5.0/v18/index.d.ts +4543 -0
- package/node_modules/@types/react/ts5.0/v18/jsx-dev-runtime.d.ts +45 -0
- package/node_modules/@types/react/ts5.0/v18/jsx-runtime.d.ts +36 -0
- package/node_modules/@types/react/ts5.0/v18/ts5.0/global.d.ts +160 -0
- package/node_modules/@types/react/ts5.0/v18/ts5.0/index.d.ts +4530 -0
- package/node_modules/@types/react/ts5.0/v18/ts5.0/jsx-dev-runtime.d.ts +44 -0
- package/node_modules/@types/react/ts5.0/v18/ts5.0/jsx-runtime.d.ts +35 -0
- package/node_modules/tslib/modules/index.d.ts +1 -0
- package/node_modules/tslib/modules/index.js +2 -0
- package/node_modules/tslib/package.json +1 -1
- package/node_modules/tslib/tslib.d.ts +7 -0
- package/node_modules/tslib/tslib.es6.js +24 -1
- package/node_modules/tslib/tslib.es6.mjs +24 -1
- package/node_modules/tslib/tslib.js +56 -1
- package/node_modules/{@pinuts/form-builder/node_modules/typescript → typescript}/README.md +1 -1
- package/node_modules/{@pinuts/form-builder/node_modules/typescript/lib/tsc.js → typescript/lib/_tsc.js} +4349 -2310
- package/node_modules/{@pinuts/form-builder/node_modules/typescript/lib/tsserver.js → typescript/lib/_tsserver.js} +44 -8
- package/node_modules/{@pinuts/form-builder/node_modules/typescript/lib/typingsInstaller.js → typescript/lib/_typingsInstaller.js} +2 -16
- package/node_modules/{@pinuts/form-builder/node_modules/typescript → typescript}/lib/cs/diagnosticMessages.generated.json +30 -12
- package/node_modules/{@pinuts/form-builder/node_modules/typescript → typescript}/lib/de/diagnosticMessages.generated.json +30 -12
- package/node_modules/{@pinuts/form-builder/node_modules/typescript → typescript}/lib/es/diagnosticMessages.generated.json +30 -12
- package/node_modules/{@pinuts/form-builder/node_modules/typescript → typescript}/lib/fr/diagnosticMessages.generated.json +30 -12
- package/node_modules/{@pinuts/form-builder/node_modules/typescript → typescript}/lib/it/diagnosticMessages.generated.json +30 -12
- package/node_modules/{@pinuts/form-builder/node_modules/typescript → typescript}/lib/ja/diagnosticMessages.generated.json +30 -12
- package/node_modules/{@pinuts/form-builder/node_modules/typescript → typescript}/lib/ko/diagnosticMessages.generated.json +30 -12
- package/node_modules/{@pinuts/form-builder/node_modules/typescript → typescript}/lib/lib.decorators.d.ts +13 -15
- package/node_modules/{@pinuts/form-builder/node_modules/typescript → typescript}/lib/lib.dom.d.ts +1884 -361
- package/node_modules/{@pinuts/form-builder/node_modules/typescript → typescript}/lib/lib.dom.iterable.d.ts +9 -7
- package/node_modules/{@pinuts/form-builder/node_modules/typescript → typescript}/lib/lib.es2015.core.d.ts +9 -9
- package/node_modules/{@pinuts/form-builder/node_modules/typescript → typescript}/lib/lib.es2015.iterable.d.ts +114 -36
- package/node_modules/{@pinuts/form-builder/node_modules/typescript → typescript}/lib/lib.es2015.symbol.wellknown.d.ts +10 -10
- package/node_modules/{@pinuts/form-builder/node_modules/typescript → typescript}/lib/lib.es2016.array.include.d.ts +9 -9
- package/node_modules/{@pinuts/form-builder/node_modules/typescript → typescript}/lib/lib.es2016.intl.d.ts +1 -1
- package/node_modules/typescript/lib/lib.es2017.arraybuffer.d.ts +21 -0
- package/node_modules/{@pinuts/form-builder/node_modules/typescript → typescript}/lib/lib.es2017.d.ts +3 -2
- package/node_modules/{@pinuts/form-builder/node_modules/typescript → typescript}/lib/lib.es2017.sharedmemory.d.ts +14 -14
- package/node_modules/{@pinuts/form-builder/node_modules/typescript → typescript}/lib/lib.es2017.typedarrays.d.ts +9 -9
- package/node_modules/{@pinuts/form-builder/node_modules/typescript → typescript}/lib/lib.es2020.bigint.d.ts +92 -54
- package/node_modules/{@pinuts/form-builder/node_modules/typescript → typescript}/lib/lib.es2020.intl.d.ts +36 -36
- package/node_modules/{@pinuts/form-builder/node_modules/typescript → typescript}/lib/lib.es2020.sharedmemory.d.ts +13 -11
- package/node_modules/{@pinuts/form-builder/node_modules/typescript → typescript}/lib/lib.es2020.string.d.ts +2 -0
- package/node_modules/{@pinuts/form-builder/node_modules/typescript → typescript}/lib/lib.es2021.intl.d.ts +17 -17
- package/node_modules/{@pinuts/form-builder/node_modules/typescript → typescript}/lib/lib.es2021.weakref.d.ts +2 -0
- package/node_modules/{@pinuts/form-builder/node_modules/typescript → typescript}/lib/lib.es2022.array.d.ts +11 -11
- package/node_modules/{@pinuts/form-builder/node_modules/typescript → typescript}/lib/lib.es2022.d.ts +1 -2
- package/node_modules/{@pinuts/form-builder/node_modules/typescript → typescript}/lib/lib.es2022.error.d.ts +2 -0
- package/node_modules/{@pinuts/form-builder/node_modules/typescript → typescript}/lib/lib.es2022.intl.d.ts +9 -9
- package/node_modules/{@pinuts/form-builder/node_modules/typescript → typescript}/lib/lib.es2023.array.d.ts +79 -79
- package/node_modules/typescript/lib/lib.es2024.arraybuffer.d.ts +65 -0
- package/node_modules/typescript/lib/lib.es2024.collection.d.ts +29 -0
- package/node_modules/typescript/lib/lib.es2024.d.ts +26 -0
- package/node_modules/typescript/lib/lib.es2024.full.d.ts +24 -0
- package/node_modules/{@pinuts/form-builder/node_modules/typescript/lib/lib.es2022.sharedmemory.d.ts → typescript/lib/lib.es2024.sharedmemory.d.ts} +29 -0
- package/node_modules/{@pinuts/form-builder/node_modules/typescript → typescript}/lib/lib.es5.d.ts +312 -303
- package/node_modules/{@pinuts/form-builder/node_modules/typescript → typescript}/lib/lib.esnext.array.d.ts +1 -1
- package/node_modules/{@pinuts/form-builder/node_modules/typescript → typescript}/lib/lib.esnext.collection.d.ts +1 -11
- package/node_modules/{@pinuts/form-builder/node_modules/typescript → typescript}/lib/lib.esnext.d.ts +3 -5
- package/node_modules/typescript/lib/lib.esnext.float16.d.ts +443 -0
- package/node_modules/{@pinuts/form-builder/node_modules/typescript → typescript}/lib/lib.esnext.iterator.d.ts +1 -1
- package/node_modules/typescript/lib/lib.esnext.promise.d.ts +34 -0
- package/node_modules/{@pinuts/form-builder/node_modules/typescript → typescript}/lib/lib.webworker.d.ts +571 -87
- package/node_modules/{@pinuts/form-builder/node_modules/typescript → typescript}/lib/lib.webworker.iterable.d.ts +6 -7
- package/node_modules/{@pinuts/form-builder/node_modules/typescript → typescript}/lib/pl/diagnosticMessages.generated.json +30 -12
- package/node_modules/{@pinuts/form-builder/node_modules/typescript → typescript}/lib/pt-br/diagnosticMessages.generated.json +30 -12
- package/node_modules/{@pinuts/form-builder/node_modules/typescript → typescript}/lib/ru/diagnosticMessages.generated.json +30 -12
- package/node_modules/{@pinuts/form-builder/node_modules/typescript → typescript}/lib/tr/diagnosticMessages.generated.json +30 -12
- package/node_modules/typescript/lib/tsc.js +8 -0
- package/node_modules/typescript/lib/tsserver.js +8 -0
- package/node_modules/{@pinuts/form-builder/node_modules/typescript → typescript}/lib/typesMap.json +497 -497
- package/node_modules/{@pinuts/form-builder/node_modules/typescript → typescript}/lib/typescript.d.ts +95 -24
- package/node_modules/{@pinuts/form-builder/node_modules/typescript → typescript}/lib/typescript.js +6556 -3509
- package/node_modules/typescript/lib/typingsInstaller.js +8 -0
- package/node_modules/{@pinuts/form-builder/node_modules/typescript → typescript}/lib/zh-cn/diagnosticMessages.generated.json +31 -13
- package/node_modules/{@pinuts/form-builder/node_modules/typescript → typescript}/lib/zh-tw/diagnosticMessages.generated.json +30 -12
- package/node_modules/{@pinuts/form-builder/node_modules/typescript → typescript}/package.json +27 -28
- package/package.json +3 -3
- package/node_modules/@pinuts/form-builder/node_modules/typescript/lib/cancellationToken.js +0 -90
- package/node_modules/@types/prop-types/LICENSE +0 -21
- package/node_modules/@types/prop-types/README.md +0 -15
- package/node_modules/@types/prop-types/index.d.ts +0 -114
- package/node_modules/@types/prop-types/package.json +0 -35
- /package/node_modules/{regenerator-runtime → @babel/runtime/node_modules/regenerator-runtime}/LICENSE +0 -0
- /package/node_modules/{regenerator-runtime → @babel/runtime/node_modules/regenerator-runtime}/README.md +0 -0
- /package/node_modules/{regenerator-runtime → @babel/runtime/node_modules/regenerator-runtime}/package.json +0 -0
- /package/node_modules/{regenerator-runtime → @babel/runtime/node_modules/regenerator-runtime}/path.js +0 -0
- /package/node_modules/{regenerator-runtime → @babel/runtime/node_modules/regenerator-runtime}/runtime.js +0 -0
- /package/node_modules/{@pinuts/form-builder/node_modules/typescript → typescript}/LICENSE.txt +0 -0
- /package/node_modules/{@pinuts/form-builder/node_modules/typescript → typescript}/SECURITY.md +0 -0
- /package/node_modules/{@pinuts/form-builder/node_modules/typescript → typescript}/ThirdPartyNoticeText.txt +0 -0
- /package/node_modules/{@pinuts/form-builder/node_modules/typescript → typescript}/bin/tsc +0 -0
- /package/node_modules/{@pinuts/form-builder/node_modules/typescript → typescript}/bin/tsserver +0 -0
- /package/node_modules/{@pinuts/form-builder/node_modules/typescript → typescript}/lib/lib.d.ts +0 -0
- /package/node_modules/{@pinuts/form-builder/node_modules/typescript → typescript}/lib/lib.decorators.legacy.d.ts +0 -0
- /package/node_modules/{@pinuts/form-builder/node_modules/typescript → typescript}/lib/lib.dom.asynciterable.d.ts +0 -0
- /package/node_modules/{@pinuts/form-builder/node_modules/typescript → typescript}/lib/lib.es2015.collection.d.ts +0 -0
- /package/node_modules/{@pinuts/form-builder/node_modules/typescript → typescript}/lib/lib.es2015.d.ts +0 -0
- /package/node_modules/{@pinuts/form-builder/node_modules/typescript → typescript}/lib/lib.es2015.generator.d.ts +0 -0
- /package/node_modules/{@pinuts/form-builder/node_modules/typescript → typescript}/lib/lib.es2015.promise.d.ts +0 -0
- /package/node_modules/{@pinuts/form-builder/node_modules/typescript → typescript}/lib/lib.es2015.proxy.d.ts +0 -0
- /package/node_modules/{@pinuts/form-builder/node_modules/typescript → typescript}/lib/lib.es2015.reflect.d.ts +0 -0
- /package/node_modules/{@pinuts/form-builder/node_modules/typescript → typescript}/lib/lib.es2015.symbol.d.ts +0 -0
- /package/node_modules/{@pinuts/form-builder/node_modules/typescript → typescript}/lib/lib.es2016.d.ts +0 -0
- /package/node_modules/{@pinuts/form-builder/node_modules/typescript → typescript}/lib/lib.es2016.full.d.ts +0 -0
- /package/node_modules/{@pinuts/form-builder/node_modules/typescript → typescript}/lib/lib.es2017.date.d.ts +0 -0
- /package/node_modules/{@pinuts/form-builder/node_modules/typescript → typescript}/lib/lib.es2017.full.d.ts +0 -0
- /package/node_modules/{@pinuts/form-builder/node_modules/typescript → typescript}/lib/lib.es2017.intl.d.ts +0 -0
- /package/node_modules/{@pinuts/form-builder/node_modules/typescript → typescript}/lib/lib.es2017.object.d.ts +0 -0
- /package/node_modules/{@pinuts/form-builder/node_modules/typescript → typescript}/lib/lib.es2017.string.d.ts +0 -0
- /package/node_modules/{@pinuts/form-builder/node_modules/typescript → typescript}/lib/lib.es2018.asyncgenerator.d.ts +0 -0
- /package/node_modules/{@pinuts/form-builder/node_modules/typescript → typescript}/lib/lib.es2018.asynciterable.d.ts +0 -0
- /package/node_modules/{@pinuts/form-builder/node_modules/typescript → typescript}/lib/lib.es2018.d.ts +0 -0
- /package/node_modules/{@pinuts/form-builder/node_modules/typescript → typescript}/lib/lib.es2018.full.d.ts +0 -0
- /package/node_modules/{@pinuts/form-builder/node_modules/typescript → typescript}/lib/lib.es2018.intl.d.ts +0 -0
- /package/node_modules/{@pinuts/form-builder/node_modules/typescript → typescript}/lib/lib.es2018.promise.d.ts +0 -0
- /package/node_modules/{@pinuts/form-builder/node_modules/typescript → typescript}/lib/lib.es2018.regexp.d.ts +0 -0
- /package/node_modules/{@pinuts/form-builder/node_modules/typescript → typescript}/lib/lib.es2019.array.d.ts +0 -0
- /package/node_modules/{@pinuts/form-builder/node_modules/typescript → typescript}/lib/lib.es2019.d.ts +0 -0
- /package/node_modules/{@pinuts/form-builder/node_modules/typescript → typescript}/lib/lib.es2019.full.d.ts +0 -0
- /package/node_modules/{@pinuts/form-builder/node_modules/typescript → typescript}/lib/lib.es2019.intl.d.ts +0 -0
- /package/node_modules/{@pinuts/form-builder/node_modules/typescript → typescript}/lib/lib.es2019.object.d.ts +0 -0
- /package/node_modules/{@pinuts/form-builder/node_modules/typescript → typescript}/lib/lib.es2019.string.d.ts +0 -0
- /package/node_modules/{@pinuts/form-builder/node_modules/typescript → typescript}/lib/lib.es2019.symbol.d.ts +0 -0
- /package/node_modules/{@pinuts/form-builder/node_modules/typescript → typescript}/lib/lib.es2020.d.ts +0 -0
- /package/node_modules/{@pinuts/form-builder/node_modules/typescript → typescript}/lib/lib.es2020.date.d.ts +0 -0
- /package/node_modules/{@pinuts/form-builder/node_modules/typescript → typescript}/lib/lib.es2020.full.d.ts +0 -0
- /package/node_modules/{@pinuts/form-builder/node_modules/typescript → typescript}/lib/lib.es2020.number.d.ts +0 -0
- /package/node_modules/{@pinuts/form-builder/node_modules/typescript → typescript}/lib/lib.es2020.promise.d.ts +0 -0
- /package/node_modules/{@pinuts/form-builder/node_modules/typescript → typescript}/lib/lib.es2020.symbol.wellknown.d.ts +0 -0
- /package/node_modules/{@pinuts/form-builder/node_modules/typescript → typescript}/lib/lib.es2021.d.ts +0 -0
- /package/node_modules/{@pinuts/form-builder/node_modules/typescript → typescript}/lib/lib.es2021.full.d.ts +0 -0
- /package/node_modules/{@pinuts/form-builder/node_modules/typescript → typescript}/lib/lib.es2021.promise.d.ts +0 -0
- /package/node_modules/{@pinuts/form-builder/node_modules/typescript → typescript}/lib/lib.es2021.string.d.ts +0 -0
- /package/node_modules/{@pinuts/form-builder/node_modules/typescript → typescript}/lib/lib.es2022.full.d.ts +0 -0
- /package/node_modules/{@pinuts/form-builder/node_modules/typescript → typescript}/lib/lib.es2022.object.d.ts +0 -0
- /package/node_modules/{@pinuts/form-builder/node_modules/typescript → typescript}/lib/lib.es2022.regexp.d.ts +0 -0
- /package/node_modules/{@pinuts/form-builder/node_modules/typescript → typescript}/lib/lib.es2022.string.d.ts +0 -0
- /package/node_modules/{@pinuts/form-builder/node_modules/typescript → typescript}/lib/lib.es2023.collection.d.ts +0 -0
- /package/node_modules/{@pinuts/form-builder/node_modules/typescript → typescript}/lib/lib.es2023.d.ts +0 -0
- /package/node_modules/{@pinuts/form-builder/node_modules/typescript → typescript}/lib/lib.es2023.full.d.ts +0 -0
- /package/node_modules/{@pinuts/form-builder/node_modules/typescript → typescript}/lib/lib.es2023.intl.d.ts +0 -0
- /package/node_modules/{@pinuts/form-builder/node_modules/typescript/lib/lib.esnext.object.d.ts → typescript/lib/lib.es2024.object.d.ts} +0 -0
- /package/node_modules/{@pinuts/form-builder/node_modules/typescript/lib/lib.esnext.promise.d.ts → typescript/lib/lib.es2024.promise.d.ts} +0 -0
- /package/node_modules/{@pinuts/form-builder/node_modules/typescript/lib/lib.esnext.regexp.d.ts → typescript/lib/lib.es2024.regexp.d.ts} +0 -0
- /package/node_modules/{@pinuts/form-builder/node_modules/typescript/lib/lib.esnext.string.d.ts → typescript/lib/lib.es2024.string.d.ts} +0 -0
- /package/node_modules/{@pinuts/form-builder/node_modules/typescript → typescript}/lib/lib.es6.d.ts +0 -0
- /package/node_modules/{@pinuts/form-builder/node_modules/typescript → typescript}/lib/lib.esnext.decorators.d.ts +0 -0
- /package/node_modules/{@pinuts/form-builder/node_modules/typescript → typescript}/lib/lib.esnext.disposable.d.ts +0 -0
- /package/node_modules/{@pinuts/form-builder/node_modules/typescript → typescript}/lib/lib.esnext.full.d.ts +0 -0
- /package/node_modules/{@pinuts/form-builder/node_modules/typescript → typescript}/lib/lib.esnext.intl.d.ts +0 -0
- /package/node_modules/{@pinuts/form-builder/node_modules/typescript → typescript}/lib/lib.scripthost.d.ts +0 -0
- /package/node_modules/{@pinuts/form-builder/node_modules/typescript → typescript}/lib/lib.webworker.asynciterable.d.ts +0 -0
- /package/node_modules/{@pinuts/form-builder/node_modules/typescript → typescript}/lib/lib.webworker.importscripts.d.ts +0 -0
- /package/node_modules/{@pinuts/form-builder/node_modules/typescript → typescript}/lib/tsserverlibrary.d.ts +0 -0
- /package/node_modules/{@pinuts/form-builder/node_modules/typescript → typescript}/lib/tsserverlibrary.js +0 -0
- /package/node_modules/{@pinuts/form-builder/node_modules/typescript → typescript}/lib/watchGuard.js +0 -0
|
@@ -5,7 +5,6 @@
|
|
|
5
5
|
/// <reference path="global.d.ts" />
|
|
6
6
|
|
|
7
7
|
import * as CSS from "csstype";
|
|
8
|
-
import * as PropTypes from "prop-types";
|
|
9
8
|
|
|
10
9
|
type NativeAnimationEvent = AnimationEvent;
|
|
11
10
|
type NativeClipboardEvent = ClipboardEvent;
|
|
@@ -16,6 +15,7 @@ type NativeKeyboardEvent = KeyboardEvent;
|
|
|
16
15
|
type NativeMouseEvent = MouseEvent;
|
|
17
16
|
type NativeTouchEvent = TouchEvent;
|
|
18
17
|
type NativePointerEvent = PointerEvent;
|
|
18
|
+
type NativeToggleEvent = ToggleEvent;
|
|
19
19
|
type NativeTransitionEvent = TransitionEvent;
|
|
20
20
|
type NativeUIEvent = UIEvent;
|
|
21
21
|
type NativeWheelEvent = WheelEvent;
|
|
@@ -33,6 +33,25 @@ type CrossOrigin = "anonymous" | "use-credentials" | "" | undefined;
|
|
|
33
33
|
|
|
34
34
|
declare const UNDEFINED_VOID_ONLY: unique symbol;
|
|
35
35
|
|
|
36
|
+
/**
|
|
37
|
+
* @internal Use `Awaited<ReactNode>` instead
|
|
38
|
+
*/
|
|
39
|
+
// Helper type to enable `Awaited<ReactNode>`.
|
|
40
|
+
// Must be a copy of the non-thenables of `ReactNode`.
|
|
41
|
+
type AwaitedReactNode =
|
|
42
|
+
| React.ReactElement
|
|
43
|
+
| string
|
|
44
|
+
| number
|
|
45
|
+
| bigint
|
|
46
|
+
| Iterable<React.ReactNode>
|
|
47
|
+
| React.ReactPortal
|
|
48
|
+
| boolean
|
|
49
|
+
| null
|
|
50
|
+
| undefined
|
|
51
|
+
| React.DO_NOT_USE_OR_YOU_WILL_BE_FIRED_EXPERIMENTAL_REACT_NODES[
|
|
52
|
+
keyof React.DO_NOT_USE_OR_YOU_WILL_BE_FIRED_EXPERIMENTAL_REACT_NODES
|
|
53
|
+
];
|
|
54
|
+
|
|
36
55
|
/**
|
|
37
56
|
* The function returned from an effect passed to {@link React.useEffect useEffect},
|
|
38
57
|
* which can be used to clean up the effect when the component unmounts.
|
|
@@ -93,8 +112,7 @@ declare namespace React {
|
|
|
93
112
|
* Represents any user-defined component, either as a function or a class.
|
|
94
113
|
*
|
|
95
114
|
* Similar to {@link JSXElementConstructor}, but with extra properties like
|
|
96
|
-
* {@link FunctionComponent.defaultProps defaultProps }
|
|
97
|
-
* {@link ComponentClass.contextTypes contextTypes}.
|
|
115
|
+
* {@link FunctionComponent.defaultProps defaultProps }.
|
|
98
116
|
*
|
|
99
117
|
* @template P The props the component accepts.
|
|
100
118
|
*
|
|
@@ -107,34 +125,18 @@ declare namespace React {
|
|
|
107
125
|
* Represents any user-defined component, either as a function or a class.
|
|
108
126
|
*
|
|
109
127
|
* Similar to {@link ComponentType}, but without extra properties like
|
|
110
|
-
* {@link FunctionComponent.defaultProps defaultProps }
|
|
111
|
-
* {@link ComponentClass.contextTypes contextTypes}.
|
|
128
|
+
* {@link FunctionComponent.defaultProps defaultProps }.
|
|
112
129
|
*
|
|
113
130
|
* @template P The props the component accepts.
|
|
114
131
|
*/
|
|
115
132
|
type JSXElementConstructor<P> =
|
|
116
133
|
| ((
|
|
117
134
|
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
135
|
) => ReactElement<any, any> | null)
|
|
125
|
-
|
|
126
|
-
|
|
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>);
|
|
136
|
+
// constructor signature must match React.Component
|
|
137
|
+
| (new(props: P) => Component<any, any>);
|
|
134
138
|
|
|
135
139
|
/**
|
|
136
|
-
* A readonly ref container where {@link current} cannot be mutated.
|
|
137
|
-
*
|
|
138
140
|
* Created by {@link createRef}, or {@link useRef} when passed `null`.
|
|
139
141
|
*
|
|
140
142
|
* @template T The type of the ref's value.
|
|
@@ -151,7 +153,7 @@ declare namespace React {
|
|
|
151
153
|
/**
|
|
152
154
|
* The current value of the ref.
|
|
153
155
|
*/
|
|
154
|
-
|
|
156
|
+
current: T;
|
|
155
157
|
}
|
|
156
158
|
|
|
157
159
|
interface DO_NOT_USE_OR_YOU_WILL_BE_FIRED_CALLBACK_REF_RETURN_VALUES {
|
|
@@ -174,6 +176,7 @@ declare namespace React {
|
|
|
174
176
|
instance: T | null,
|
|
175
177
|
):
|
|
176
178
|
| void
|
|
179
|
+
| (() => VoidOrUndefinedOnly)
|
|
177
180
|
| DO_NOT_USE_OR_YOU_WILL_BE_FIRED_CALLBACK_REF_RETURN_VALUES[
|
|
178
181
|
keyof DO_NOT_USE_OR_YOU_WILL_BE_FIRED_CALLBACK_REF_RETURN_VALUES
|
|
179
182
|
];
|
|
@@ -186,22 +189,15 @@ declare namespace React {
|
|
|
186
189
|
* @see {@link RefObject}
|
|
187
190
|
*/
|
|
188
191
|
|
|
189
|
-
type Ref<T> = RefCallback<T> | RefObject<T> | null;
|
|
192
|
+
type Ref<T> = RefCallback<T> | RefObject<T | null> | null;
|
|
190
193
|
/**
|
|
191
|
-
*
|
|
192
|
-
*
|
|
193
|
-
* @see {@link https://react.dev/reference/react/Component#refs React Docs}
|
|
194
|
-
*
|
|
195
|
-
* @example
|
|
196
|
-
*
|
|
197
|
-
* ```tsx
|
|
198
|
-
* <div ref="myRef" />
|
|
199
|
-
* ```
|
|
194
|
+
* @deprecated Use `Ref` instead. String refs are no longer supported.
|
|
195
|
+
* If you're typing a library with support for React versions with string refs, use `RefAttributes<T>['ref']` instead.
|
|
200
196
|
*/
|
|
201
|
-
|
|
202
|
-
type LegacyRef<T> = string | Ref<T>;
|
|
203
|
-
|
|
197
|
+
type LegacyRef<T> = Ref<T>;
|
|
204
198
|
/**
|
|
199
|
+
* @deprecated Use `ComponentRef<T>` instead
|
|
200
|
+
*
|
|
205
201
|
* Retrieves the type of the 'ref' prop for a given component type or tag name.
|
|
206
202
|
*
|
|
207
203
|
* @template C The component type.
|
|
@@ -222,17 +218,9 @@ declare namespace React {
|
|
|
222
218
|
C extends
|
|
223
219
|
| ForwardRefExoticComponent<any>
|
|
224
220
|
| { new(props: any): Component<any> }
|
|
225
|
-
| ((props: any
|
|
221
|
+
| ((props: any) => ReactElement | null)
|
|
226
222
|
| 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;
|
|
223
|
+
> = ComponentRef<C>;
|
|
236
224
|
|
|
237
225
|
type ComponentState = any;
|
|
238
226
|
|
|
@@ -300,7 +288,7 @@ declare namespace React {
|
|
|
300
288
|
*
|
|
301
289
|
* @see {@link https://react.dev/learn/referencing-values-with-refs#refs-and-the-dom React Docs}
|
|
302
290
|
*/
|
|
303
|
-
ref?:
|
|
291
|
+
ref?: Ref<T> | undefined;
|
|
304
292
|
}
|
|
305
293
|
|
|
306
294
|
/**
|
|
@@ -325,7 +313,7 @@ declare namespace React {
|
|
|
325
313
|
* ```
|
|
326
314
|
*/
|
|
327
315
|
interface ReactElement<
|
|
328
|
-
P =
|
|
316
|
+
P = unknown,
|
|
329
317
|
T extends string | JSXElementConstructor<any> = string | JSXElementConstructor<any>,
|
|
330
318
|
> {
|
|
331
319
|
type: T;
|
|
@@ -341,13 +329,28 @@ declare namespace React {
|
|
|
341
329
|
P = Pick<ComponentProps<T>, Exclude<keyof ComponentProps<T>, "key" | "ref">>,
|
|
342
330
|
> extends ReactElement<P, Exclude<T, number>> {}
|
|
343
331
|
|
|
332
|
+
/**
|
|
333
|
+
* @deprecated Use `ReactElement<P, React.FunctionComponent<P>>`
|
|
334
|
+
*/
|
|
344
335
|
interface FunctionComponentElement<P> extends ReactElement<P, FunctionComponent<P>> {
|
|
336
|
+
/**
|
|
337
|
+
* @deprecated Use `element.props.ref` instead.
|
|
338
|
+
*/
|
|
345
339
|
ref?: ("ref" extends keyof P ? P extends { ref?: infer R | undefined } ? R : never : never) | undefined;
|
|
346
340
|
}
|
|
347
341
|
|
|
342
|
+
/**
|
|
343
|
+
* @deprecated Use `ReactElement<P, React.ComponentClass<P>>`
|
|
344
|
+
*/
|
|
348
345
|
type CElement<P, T extends Component<P, ComponentState>> = ComponentElement<P, T>;
|
|
346
|
+
/**
|
|
347
|
+
* @deprecated Use `ReactElement<P, React.ComponentClass<P>>`
|
|
348
|
+
*/
|
|
349
349
|
interface ComponentElement<P, T extends Component<P, ComponentState>> extends ReactElement<P, ComponentClass<P>> {
|
|
350
|
-
|
|
350
|
+
/**
|
|
351
|
+
* @deprecated Use `element.props.ref` instead.
|
|
352
|
+
*/
|
|
353
|
+
ref?: Ref<T> | undefined;
|
|
351
354
|
}
|
|
352
355
|
|
|
353
356
|
/**
|
|
@@ -356,89 +359,34 @@ declare namespace React {
|
|
|
356
359
|
type ClassicElement<P> = CElement<P, ClassicComponent<P, ComponentState>>;
|
|
357
360
|
|
|
358
361
|
// string fallback for custom web-components
|
|
362
|
+
/**
|
|
363
|
+
* @deprecated Use `ReactElement<P, string>`
|
|
364
|
+
*/
|
|
359
365
|
interface DOMElement<P extends HTMLAttributes<T> | SVGAttributes<T>, T extends Element>
|
|
360
366
|
extends ReactElement<P, string>
|
|
361
367
|
{
|
|
362
|
-
|
|
368
|
+
/**
|
|
369
|
+
* @deprecated Use `element.props.ref` instead.
|
|
370
|
+
*/
|
|
371
|
+
ref: Ref<T>;
|
|
363
372
|
}
|
|
364
373
|
|
|
365
374
|
// ReactHTML for ReactHTMLElement
|
|
366
375
|
interface ReactHTMLElement<T extends HTMLElement> extends DetailedReactHTMLElement<AllHTMLAttributes<T>, T> {}
|
|
367
376
|
|
|
368
377
|
interface DetailedReactHTMLElement<P extends HTMLAttributes<T>, T extends HTMLElement> extends DOMElement<P, T> {
|
|
369
|
-
type:
|
|
378
|
+
type: HTMLElementType;
|
|
370
379
|
}
|
|
371
380
|
|
|
372
381
|
// ReactSVG for ReactSVGElement
|
|
373
382
|
interface ReactSVGElement extends DOMElement<SVGAttributes<SVGElement>, SVGElement> {
|
|
374
|
-
type:
|
|
383
|
+
type: SVGElementType;
|
|
375
384
|
}
|
|
376
385
|
|
|
377
386
|
interface ReactPortal extends ReactElement {
|
|
378
387
|
children: ReactNode;
|
|
379
388
|
}
|
|
380
389
|
|
|
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
390
|
/**
|
|
443
391
|
* For internal usage only.
|
|
444
392
|
* Different release channels declare additional types of ReactNode this particular release channel accepts.
|
|
@@ -480,6 +428,7 @@ declare namespace React {
|
|
|
480
428
|
| ReactElement
|
|
481
429
|
| string
|
|
482
430
|
| number
|
|
431
|
+
| bigint
|
|
483
432
|
| Iterable<ReactNode>
|
|
484
433
|
| ReactPortal
|
|
485
434
|
| boolean
|
|
@@ -487,36 +436,13 @@ declare namespace React {
|
|
|
487
436
|
| undefined
|
|
488
437
|
| DO_NOT_USE_OR_YOU_WILL_BE_FIRED_EXPERIMENTAL_REACT_NODES[
|
|
489
438
|
keyof DO_NOT_USE_OR_YOU_WILL_BE_FIRED_EXPERIMENTAL_REACT_NODES
|
|
490
|
-
]
|
|
439
|
+
]
|
|
440
|
+
| Promise<AwaitedReactNode>;
|
|
491
441
|
|
|
492
442
|
//
|
|
493
443
|
// Top Level API
|
|
494
444
|
// ----------------------------------------------------------------------
|
|
495
445
|
|
|
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
446
|
// DOM Elements
|
|
521
447
|
// TODO: generalize this to everything in `keyof ReactHTML`, not just "input"
|
|
522
448
|
function createElement(
|
|
@@ -525,12 +451,12 @@ declare namespace React {
|
|
|
525
451
|
...children: ReactNode[]
|
|
526
452
|
): DetailedReactHTMLElement<InputHTMLAttributes<HTMLInputElement>, HTMLInputElement>;
|
|
527
453
|
function createElement<P extends HTMLAttributes<T>, T extends HTMLElement>(
|
|
528
|
-
type:
|
|
454
|
+
type: HTMLElementType,
|
|
529
455
|
props?: ClassAttributes<T> & P | null,
|
|
530
456
|
...children: ReactNode[]
|
|
531
457
|
): DetailedReactHTMLElement<P, T>;
|
|
532
458
|
function createElement<P extends SVGAttributes<T>, T extends SVGElement>(
|
|
533
|
-
type:
|
|
459
|
+
type: SVGElementType,
|
|
534
460
|
props?: ClassAttributes<T> & P | null,
|
|
535
461
|
...children: ReactNode[]
|
|
536
462
|
): ReactSVGElement;
|
|
@@ -659,7 +585,6 @@ declare namespace React {
|
|
|
659
585
|
* @template P The props the component accepts.
|
|
660
586
|
*/
|
|
661
587
|
interface ProviderExoticComponent<P> extends ExoticComponent<P> {
|
|
662
|
-
propTypes?: WeakValidationMap<P> | undefined;
|
|
663
588
|
}
|
|
664
589
|
|
|
665
590
|
/**
|
|
@@ -741,7 +666,7 @@ declare namespace React {
|
|
|
741
666
|
* const ThemeContext = createContext('light');
|
|
742
667
|
* ```
|
|
743
668
|
*/
|
|
744
|
-
interface Context<T> {
|
|
669
|
+
interface Context<T> extends Provider<T> {
|
|
745
670
|
Provider: Provider<T>;
|
|
746
671
|
Consumer: Consumer<T>;
|
|
747
672
|
/**
|
|
@@ -770,6 +695,13 @@ declare namespace React {
|
|
|
770
695
|
* import { createContext } from 'react';
|
|
771
696
|
*
|
|
772
697
|
* const ThemeContext = createContext('light');
|
|
698
|
+
* function App() {
|
|
699
|
+
* return (
|
|
700
|
+
* <ThemeContext value="dark">
|
|
701
|
+
* <Toolbar />
|
|
702
|
+
* </ThemeContext>
|
|
703
|
+
* );
|
|
704
|
+
* }
|
|
773
705
|
* ```
|
|
774
706
|
*/
|
|
775
707
|
function createContext<T>(
|
|
@@ -780,9 +712,6 @@ declare namespace React {
|
|
|
780
712
|
|
|
781
713
|
function isValidElement<P>(object: {} | null | undefined): object is ReactElement<P>;
|
|
782
714
|
|
|
783
|
-
/**
|
|
784
|
-
* Maintainer's note: Sync with {@link ReactChildren} until {@link ReactChildren} is removed.
|
|
785
|
-
*/
|
|
786
715
|
const Children: {
|
|
787
716
|
map<T, C>(
|
|
788
717
|
children: C | readonly C[],
|
|
@@ -793,6 +722,10 @@ declare namespace React {
|
|
|
793
722
|
only<C>(children: C): C extends any[] ? never : C;
|
|
794
723
|
toArray(children: ReactNode | ReactNode[]): Array<Exclude<ReactNode, boolean | null | undefined>>;
|
|
795
724
|
};
|
|
725
|
+
|
|
726
|
+
export interface FragmentProps {
|
|
727
|
+
children?: React.ReactNode;
|
|
728
|
+
}
|
|
796
729
|
/**
|
|
797
730
|
* Lets you group elements without a wrapper node.
|
|
798
731
|
*
|
|
@@ -820,7 +753,7 @@ declare namespace React {
|
|
|
820
753
|
* </>
|
|
821
754
|
* ```
|
|
822
755
|
*/
|
|
823
|
-
const Fragment: ExoticComponent<
|
|
756
|
+
const Fragment: ExoticComponent<FragmentProps>;
|
|
824
757
|
|
|
825
758
|
/**
|
|
826
759
|
* Lets you find common bugs in your components early during development.
|
|
@@ -988,6 +921,12 @@ declare namespace React {
|
|
|
988
921
|
*/
|
|
989
922
|
static contextType?: Context<any> | undefined;
|
|
990
923
|
|
|
924
|
+
/**
|
|
925
|
+
* Ignored by React.
|
|
926
|
+
* @deprecated Only kept in types for backwards compatibility. Will be removed in a future major release.
|
|
927
|
+
*/
|
|
928
|
+
static propTypes?: any;
|
|
929
|
+
|
|
991
930
|
/**
|
|
992
931
|
* If using the new style context, re-declare this in your class to be the
|
|
993
932
|
* `React.ContextType` of your `static contextType`.
|
|
@@ -1006,12 +945,8 @@ declare namespace React {
|
|
|
1006
945
|
*/
|
|
1007
946
|
context: unknown;
|
|
1008
947
|
|
|
948
|
+
// Keep in sync with constructor signature of JSXElementConstructor and ComponentClass.
|
|
1009
949
|
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
950
|
|
|
1016
951
|
// We MUST keep setState() as a unified signature because it allows proper checking of the method return type.
|
|
1017
952
|
// See: https://github.com/DefinitelyTyped/DefinitelyTyped/issues/18365#issuecomment-351013257
|
|
@@ -1026,14 +961,6 @@ declare namespace React {
|
|
|
1026
961
|
|
|
1027
962
|
readonly props: Readonly<P>;
|
|
1028
963
|
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
964
|
}
|
|
1038
965
|
|
|
1039
966
|
class PureComponent<P = {}, S = {}, SS = any> extends Component<P, S, SS> {}
|
|
@@ -1050,10 +977,6 @@ declare namespace React {
|
|
|
1050
977
|
getInitialState?(): S;
|
|
1051
978
|
}
|
|
1052
979
|
|
|
1053
|
-
interface ChildContextProvider<CC> {
|
|
1054
|
-
getChildContext(): CC;
|
|
1055
|
-
}
|
|
1056
|
-
|
|
1057
980
|
//
|
|
1058
981
|
// Class Interfaces
|
|
1059
982
|
// ----------------------------------------------------------------------
|
|
@@ -1118,58 +1041,12 @@ declare namespace React {
|
|
|
1118
1041
|
* ```
|
|
1119
1042
|
*/
|
|
1120
1043
|
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;
|
|
1044
|
+
(props: P): ReactElement<any, any> | null;
|
|
1130
1045
|
/**
|
|
1131
|
-
*
|
|
1132
|
-
*
|
|
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}
|
|
1046
|
+
* Ignored by React.
|
|
1047
|
+
* @deprecated Only kept in types for backwards compatibility. Will be removed in a future major release.
|
|
1139
1048
|
*/
|
|
1140
|
-
propTypes?:
|
|
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;
|
|
1049
|
+
propTypes?: any;
|
|
1173
1050
|
/**
|
|
1174
1051
|
* Used in debugging messages. You might want to set it
|
|
1175
1052
|
* explicitly if you want to display a different name for
|
|
@@ -1191,38 +1068,6 @@ declare namespace React {
|
|
|
1191
1068
|
displayName?: string | undefined;
|
|
1192
1069
|
}
|
|
1193
1070
|
|
|
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
1071
|
/**
|
|
1227
1072
|
* The type of the ref received by a {@link ForwardRefRenderFunction}.
|
|
1228
1073
|
*
|
|
@@ -1257,19 +1102,10 @@ declare namespace React {
|
|
|
1257
1102
|
*/
|
|
1258
1103
|
displayName?: string | undefined;
|
|
1259
1104
|
/**
|
|
1260
|
-
*
|
|
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}
|
|
1105
|
+
* Ignored by React.
|
|
1106
|
+
* @deprecated Only kept in types for backwards compatibility. Will be removed in a future major release.
|
|
1271
1107
|
*/
|
|
1272
|
-
propTypes?:
|
|
1108
|
+
propTypes?: any;
|
|
1273
1109
|
}
|
|
1274
1110
|
|
|
1275
1111
|
/**
|
|
@@ -1279,48 +1115,14 @@ declare namespace React {
|
|
|
1279
1115
|
* @template S The internal state of the component.
|
|
1280
1116
|
*/
|
|
1281
1117
|
interface ComponentClass<P = {}, S = ComponentState> extends StaticLifecycle<P, S> {
|
|
1282
|
-
|
|
1283
|
-
|
|
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>;
|
|
1118
|
+
// constructor signature must match React.Component
|
|
1119
|
+
new(props: P): Component<P, S>;
|
|
1291
1120
|
/**
|
|
1292
|
-
*
|
|
1293
|
-
*
|
|
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}
|
|
1121
|
+
* Ignored by React.
|
|
1122
|
+
* @deprecated Only kept in types for backwards compatibility. Will be removed in a future major release.
|
|
1300
1123
|
*/
|
|
1301
|
-
propTypes?:
|
|
1124
|
+
propTypes?: any;
|
|
1302
1125
|
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
1126
|
defaultProps?: Partial<P> | undefined;
|
|
1325
1127
|
/**
|
|
1326
1128
|
* Used in debugging messages. You might want to set it
|
|
@@ -1339,7 +1141,7 @@ declare namespace React {
|
|
|
1339
1141
|
* @see {@link https://www.npmjs.com/package/create-react-class `create-react-class` on npm}
|
|
1340
1142
|
*/
|
|
1341
1143
|
interface ClassicComponentClass<P = {}> extends ComponentClass<P> {
|
|
1342
|
-
new(props: P
|
|
1144
|
+
new(props: P): ClassicComponent<P, ComponentState>;
|
|
1343
1145
|
getDefaultProps?(): P;
|
|
1344
1146
|
}
|
|
1345
1147
|
|
|
@@ -1354,7 +1156,7 @@ declare namespace React {
|
|
|
1354
1156
|
*/
|
|
1355
1157
|
type ClassType<P, T extends Component<P, ComponentState>, C extends ComponentClass<P>> =
|
|
1356
1158
|
& C
|
|
1357
|
-
& (new(props: P
|
|
1159
|
+
& (new(props: P) => T);
|
|
1358
1160
|
|
|
1359
1161
|
//
|
|
1360
1162
|
// Component Specs and Lifecycle
|
|
@@ -1528,38 +1330,7 @@ declare namespace React {
|
|
|
1528
1330
|
UNSAFE_componentWillUpdate?(nextProps: Readonly<P>, nextState: Readonly<S>, nextContext: any): void;
|
|
1529
1331
|
}
|
|
1530
1332
|
|
|
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>;
|
|
1333
|
+
function createRef<T>(): RefObject<T | null>;
|
|
1563
1334
|
|
|
1564
1335
|
/**
|
|
1565
1336
|
* The type of the component returned from {@link forwardRef}.
|
|
@@ -1570,10 +1341,10 @@ declare namespace React {
|
|
|
1570
1341
|
*/
|
|
1571
1342
|
interface ForwardRefExoticComponent<P> extends NamedExoticComponent<P> {
|
|
1572
1343
|
/**
|
|
1573
|
-
*
|
|
1344
|
+
* Ignored by React.
|
|
1345
|
+
* @deprecated Only kept in types for backwards compatibility. Will be removed in a future major release.
|
|
1574
1346
|
*/
|
|
1575
|
-
|
|
1576
|
-
propTypes?: WeakValidationMap<P> | undefined;
|
|
1347
|
+
propTypes?: any;
|
|
1577
1348
|
}
|
|
1578
1349
|
|
|
1579
1350
|
/**
|
|
@@ -1610,23 +1381,18 @@ declare namespace React {
|
|
|
1610
1381
|
/**
|
|
1611
1382
|
* Omits the 'ref' attribute from the given props object.
|
|
1612
1383
|
*
|
|
1613
|
-
* @template
|
|
1384
|
+
* @template Props The props object type.
|
|
1614
1385
|
*/
|
|
1615
|
-
type PropsWithoutRef<
|
|
1386
|
+
type PropsWithoutRef<Props> =
|
|
1616
1387
|
// Omit would not be sufficient for this. We'd like to avoid unnecessary mapping and need a distributive conditional to support unions.
|
|
1617
1388
|
// see: https://www.typescriptlang.org/docs/handbook/2/conditional-types.html#distributive-conditional-types
|
|
1618
1389
|
// https://github.com/Microsoft/TypeScript/issues/28339
|
|
1619
|
-
|
|
1620
|
-
/**
|
|
1621
|
-
|
|
1622
|
-
|
|
1623
|
-
|
|
1624
|
-
|
|
1625
|
-
? P extends { ref?: infer R | undefined }
|
|
1626
|
-
? string extends R ? PropsWithoutRef<P> & { ref?: Exclude<R, string> | undefined }
|
|
1627
|
-
: P
|
|
1628
|
-
: P
|
|
1629
|
-
: P;
|
|
1390
|
+
Props extends any ? ("ref" extends keyof Props ? Omit<Props, "ref"> : Props) : Props;
|
|
1391
|
+
/**
|
|
1392
|
+
* Ensures that the props do not include string ref, which cannot be forwarded
|
|
1393
|
+
* @deprecated Use `Props` directly. `PropsWithRef<Props>` is just an alias for `Props`
|
|
1394
|
+
*/
|
|
1395
|
+
type PropsWithRef<Props> = Props;
|
|
1630
1396
|
|
|
1631
1397
|
type PropsWithChildren<P = unknown> = P & { children?: ReactNode | undefined };
|
|
1632
1398
|
|
|
@@ -1658,7 +1424,7 @@ declare namespace React {
|
|
|
1658
1424
|
* ```
|
|
1659
1425
|
*/
|
|
1660
1426
|
type ComponentProps<T extends keyof JSX.IntrinsicElements | JSXElementConstructor<any>> = T extends
|
|
1661
|
-
JSXElementConstructor<infer
|
|
1427
|
+
JSXElementConstructor<infer Props> ? Props
|
|
1662
1428
|
: T extends keyof JSX.IntrinsicElements ? JSX.IntrinsicElements[T]
|
|
1663
1429
|
: {};
|
|
1664
1430
|
|
|
@@ -1685,9 +1451,11 @@ declare namespace React {
|
|
|
1685
1451
|
* type MyComponentPropsWithRef = React.ComponentPropsWithRef<typeof MyComponent>;
|
|
1686
1452
|
* ```
|
|
1687
1453
|
*/
|
|
1688
|
-
type ComponentPropsWithRef<T extends ElementType> = T extends
|
|
1689
|
-
|
|
1690
|
-
:
|
|
1454
|
+
type ComponentPropsWithRef<T extends ElementType> = T extends JSXElementConstructor<infer Props>
|
|
1455
|
+
// If it's a class i.e. newable we're dealing with a class component
|
|
1456
|
+
? T extends abstract new(args: any) => any ? PropsWithoutRef<Props> & RefAttributes<InstanceType<T>>
|
|
1457
|
+
: Props
|
|
1458
|
+
: ComponentProps<T>;
|
|
1691
1459
|
/**
|
|
1692
1460
|
* Used to retrieve the props a custom component accepts with its ref.
|
|
1693
1461
|
*
|
|
@@ -1704,9 +1472,10 @@ declare namespace React {
|
|
|
1704
1472
|
* type MyComponentPropsWithRef = React.CustomComponentPropsWithRef<typeof MyComponent>;
|
|
1705
1473
|
* ```
|
|
1706
1474
|
*/
|
|
1707
|
-
type CustomComponentPropsWithRef<T extends ComponentType> = T extends
|
|
1708
|
-
|
|
1709
|
-
|
|
1475
|
+
type CustomComponentPropsWithRef<T extends ComponentType> = T extends JSXElementConstructor<infer Props>
|
|
1476
|
+
// If it's a class i.e. newable we're dealing with a class component
|
|
1477
|
+
? T extends abstract new(args: any) => any ? PropsWithoutRef<Props> & RefAttributes<InstanceType<T>>
|
|
1478
|
+
: Props
|
|
1710
1479
|
: never;
|
|
1711
1480
|
|
|
1712
1481
|
/**
|
|
@@ -1734,10 +1503,24 @@ declare namespace React {
|
|
|
1734
1503
|
*/
|
|
1735
1504
|
type ComponentPropsWithoutRef<T extends ElementType> = PropsWithoutRef<ComponentProps<T>>;
|
|
1736
1505
|
|
|
1737
|
-
|
|
1738
|
-
|
|
1739
|
-
|
|
1740
|
-
|
|
1506
|
+
/**
|
|
1507
|
+
* Retrieves the type of the 'ref' prop for a given component type or tag name.
|
|
1508
|
+
*
|
|
1509
|
+
* @template C The component type.
|
|
1510
|
+
*
|
|
1511
|
+
* @example
|
|
1512
|
+
*
|
|
1513
|
+
* ```tsx
|
|
1514
|
+
* type MyComponentRef = React.ComponentRef<typeof MyComponent>;
|
|
1515
|
+
* ```
|
|
1516
|
+
*
|
|
1517
|
+
* @example
|
|
1518
|
+
*
|
|
1519
|
+
* ```tsx
|
|
1520
|
+
* type DivRef = React.ComponentRef<'div'>;
|
|
1521
|
+
* ```
|
|
1522
|
+
*/
|
|
1523
|
+
type ComponentRef<T extends ElementType> = ComponentPropsWithRef<T> extends RefAttributes<infer Method> ? Method
|
|
1741
1524
|
: never;
|
|
1742
1525
|
|
|
1743
1526
|
// will show `Memo(${Component.displayName || Component.name})` in devtools by default,
|
|
@@ -1838,6 +1621,11 @@ declare namespace React {
|
|
|
1838
1621
|
* A {@link Dispatch} function can sometimes be called without any arguments.
|
|
1839
1622
|
*/
|
|
1840
1623
|
type DispatchWithoutAction = () => void;
|
|
1624
|
+
// Limit the reducer to accept only 0 or 1 action arguments
|
|
1625
|
+
// eslint-disable-next-line @definitelytyped/no-single-element-tuple-type
|
|
1626
|
+
type AnyActionArg = [] | [any];
|
|
1627
|
+
// Get the dispatch type from the reducer arguments (captures optional action argument correctly)
|
|
1628
|
+
type ActionDispatch<ActionArg extends AnyActionArg> = (...args: ActionArg) => void;
|
|
1841
1629
|
// Unlike redux, the actions _can_ be anything
|
|
1842
1630
|
type Reducer<S, A> = (prevState: S, action: A) => S;
|
|
1843
1631
|
// If useReducer accepts a reducer without action, dispatch may be called without any parameters.
|
|
@@ -1845,15 +1633,14 @@ declare namespace React {
|
|
|
1845
1633
|
// types used to try and prevent the compiler from reducing S
|
|
1846
1634
|
// to a supertype common with the second argument to useReducer()
|
|
1847
1635
|
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
1636
|
type DependencyList = readonly unknown[];
|
|
1853
1637
|
|
|
1854
1638
|
// NOTE: callbacks are _only_ allowed to return either void, or a destructor.
|
|
1855
1639
|
type EffectCallback = () => void | Destructor;
|
|
1856
1640
|
|
|
1641
|
+
/**
|
|
1642
|
+
* @deprecated Use `RefObject` instead.
|
|
1643
|
+
*/
|
|
1857
1644
|
interface MutableRefObject<T> {
|
|
1858
1645
|
current: T;
|
|
1859
1646
|
}
|
|
@@ -1892,28 +1679,10 @@ declare namespace React {
|
|
|
1892
1679
|
* @version 16.8.0
|
|
1893
1680
|
* @see {@link https://react.dev/reference/react/useReducer}
|
|
1894
1681
|
*/
|
|
1895
|
-
|
|
1896
|
-
|
|
1897
|
-
|
|
1898
|
-
|
|
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];
|
|
1682
|
+
function useReducer<S, A extends AnyActionArg>(
|
|
1683
|
+
reducer: (prevState: S, ...args: A) => S,
|
|
1684
|
+
initialState: S,
|
|
1685
|
+
): [S, ActionDispatch<A>];
|
|
1917
1686
|
/**
|
|
1918
1687
|
* An alternative to `useState`.
|
|
1919
1688
|
*
|
|
@@ -1924,14 +1693,10 @@ declare namespace React {
|
|
|
1924
1693
|
* @version 16.8.0
|
|
1925
1694
|
* @see {@link https://react.dev/reference/react/useReducer}
|
|
1926
1695
|
*/
|
|
1927
|
-
|
|
1928
|
-
|
|
1929
|
-
|
|
1930
|
-
|
|
1931
|
-
reducer: R,
|
|
1932
|
-
initializerArg: I & ReducerState<R>,
|
|
1933
|
-
initializer: (arg: I & ReducerState<R>) => ReducerState<R>,
|
|
1934
|
-
): [ReducerState<R>, Dispatch<ReducerAction<R>>];
|
|
1696
|
+
function useReducer<S, A extends AnyActionArg>(
|
|
1697
|
+
reducer: (prevState: S, ...args: A) => S,
|
|
1698
|
+
initialState: S,
|
|
1699
|
+
): [S, ActionDispatch<A>];
|
|
1935
1700
|
/**
|
|
1936
1701
|
* An alternative to `useState`.
|
|
1937
1702
|
*
|
|
@@ -1942,37 +1707,11 @@ declare namespace React {
|
|
|
1942
1707
|
* @version 16.8.0
|
|
1943
1708
|
* @see {@link https://react.dev/reference/react/useReducer}
|
|
1944
1709
|
*/
|
|
1945
|
-
|
|
1946
|
-
|
|
1947
|
-
|
|
1948
|
-
|
|
1949
|
-
|
|
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>>];
|
|
1710
|
+
function useReducer<S, I, A extends AnyActionArg>(
|
|
1711
|
+
reducer: (prevState: S, ...args: A) => S,
|
|
1712
|
+
initialArg: I,
|
|
1713
|
+
init: (i: I) => S,
|
|
1714
|
+
): [S, ActionDispatch<A>];
|
|
1976
1715
|
/**
|
|
1977
1716
|
* `useRef` returns a mutable ref object whose `.current` property is initialized to the passed argument
|
|
1978
1717
|
* (`initialValue`). The returned object will persist for the full lifetime of the component.
|
|
@@ -1983,7 +1722,7 @@ declare namespace React {
|
|
|
1983
1722
|
* @version 16.8.0
|
|
1984
1723
|
* @see {@link https://react.dev/reference/react/useRef}
|
|
1985
1724
|
*/
|
|
1986
|
-
function useRef<T>(initialValue: T):
|
|
1725
|
+
function useRef<T>(initialValue: T): RefObject<T>;
|
|
1987
1726
|
// convenience overload for refs given as a ref prop as they typically start with a null value
|
|
1988
1727
|
/**
|
|
1989
1728
|
* `useRef` returns a mutable ref object whose `.current` property is initialized to the passed argument
|
|
@@ -1992,15 +1731,11 @@ declare namespace React {
|
|
|
1992
1731
|
* Note that `useRef()` is useful for more than the `ref` attribute. It’s handy for keeping any mutable
|
|
1993
1732
|
* value around similar to how you’d use instance fields in classes.
|
|
1994
1733
|
*
|
|
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
1734
|
* @version 16.8.0
|
|
1999
1735
|
* @see {@link https://react.dev/reference/react/useRef}
|
|
2000
1736
|
*/
|
|
2001
|
-
function useRef<T>(initialValue: T | null): RefObject<T>;
|
|
2002
|
-
// convenience overload for
|
|
2003
|
-
// has a default to stop it from defaulting to {} instead
|
|
1737
|
+
function useRef<T>(initialValue: T | null): RefObject<T | null>;
|
|
1738
|
+
// convenience overload for undefined initialValue
|
|
2004
1739
|
/**
|
|
2005
1740
|
* `useRef` returns a mutable ref object whose `.current` property is initialized to the passed argument
|
|
2006
1741
|
* (`initialValue`). The returned object will persist for the full lifetime of the component.
|
|
@@ -2011,7 +1746,7 @@ declare namespace React {
|
|
|
2011
1746
|
* @version 16.8.0
|
|
2012
1747
|
* @see {@link https://react.dev/reference/react/useRef}
|
|
2013
1748
|
*/
|
|
2014
|
-
function useRef<T
|
|
1749
|
+
function useRef<T>(initialValue: T | undefined): RefObject<T | undefined>;
|
|
2015
1750
|
/**
|
|
2016
1751
|
* The signature is identical to `useEffect`, but it fires synchronously after all DOM mutations.
|
|
2017
1752
|
* Use this to read layout from the DOM and synchronously re-render. Updates scheduled inside
|
|
@@ -2058,7 +1793,7 @@ declare namespace React {
|
|
|
2058
1793
|
*/
|
|
2059
1794
|
// A specific function type would not trigger implicit any.
|
|
2060
1795
|
// 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/
|
|
1796
|
+
// eslint-disable-next-line @typescript-eslint/no-unsafe-function-type
|
|
2062
1797
|
function useCallback<T extends Function>(callback: T, deps: DependencyList): T;
|
|
2063
1798
|
/**
|
|
2064
1799
|
* `useMemo` will only recompute the memoized value when one of the `deps` has changed.
|
|
@@ -2081,8 +1816,7 @@ declare namespace React {
|
|
|
2081
1816
|
// it's just the function name without the "use" prefix.
|
|
2082
1817
|
function useDebugValue<T>(value: T, format?: (value: T) => any): void;
|
|
2083
1818
|
|
|
2084
|
-
|
|
2085
|
-
export type TransitionFunction = () => VoidOrUndefinedOnly;
|
|
1819
|
+
export type TransitionFunction = () => VoidOrUndefinedOnly | Promise<VoidOrUndefinedOnly>;
|
|
2086
1820
|
// strange definition to allow vscode to show documentation on the invocation
|
|
2087
1821
|
export interface TransitionStartFunction {
|
|
2088
1822
|
/**
|
|
@@ -2090,7 +1824,7 @@ declare namespace React {
|
|
|
2090
1824
|
*
|
|
2091
1825
|
* **If some state update causes a component to suspend, that state update should be wrapped in a transition.**
|
|
2092
1826
|
*
|
|
2093
|
-
* @param callback A
|
|
1827
|
+
* @param callback A function which causes state updates that can be deferred.
|
|
2094
1828
|
*/
|
|
2095
1829
|
(callback: TransitionFunction): void;
|
|
2096
1830
|
}
|
|
@@ -2104,10 +1838,11 @@ declare namespace React {
|
|
|
2104
1838
|
* A good example of this is a text input.
|
|
2105
1839
|
*
|
|
2106
1840
|
* @param value The value that is going to be deferred
|
|
1841
|
+
* @param initialValue A value to use during the initial render of a component. If this option is omitted, `useDeferredValue` will not defer during the initial render, because there’s no previous version of `value` that it can render instead.
|
|
2107
1842
|
*
|
|
2108
1843
|
* @see {@link https://react.dev/reference/react/useDeferredValue}
|
|
2109
1844
|
*/
|
|
2110
|
-
export function useDeferredValue<T>(value: T): T;
|
|
1845
|
+
export function useDeferredValue<T>(value: T, initialValue?: T): T;
|
|
2111
1846
|
|
|
2112
1847
|
/**
|
|
2113
1848
|
* Allows components to avoid undesirable loading states by waiting for content to load
|
|
@@ -2129,7 +1864,7 @@ declare namespace React {
|
|
|
2129
1864
|
/**
|
|
2130
1865
|
* Similar to `useTransition` but allows uses where hooks are not available.
|
|
2131
1866
|
*
|
|
2132
|
-
* @param callback A
|
|
1867
|
+
* @param callback A function which causes state updates that can be deferred.
|
|
2133
1868
|
*/
|
|
2134
1869
|
export function startTransition(scope: TransitionFunction): void;
|
|
2135
1870
|
|
|
@@ -2144,6 +1879,11 @@ declare namespace React {
|
|
|
2144
1879
|
*
|
|
2145
1880
|
* @see https://reactjs.org/blog/2019/02/06/react-v16.8.0.html#testing-hooks
|
|
2146
1881
|
*/
|
|
1882
|
+
// NOTES
|
|
1883
|
+
// - the order of these signatures matters - typescript will check the signatures in source order.
|
|
1884
|
+
// If the `() => VoidOrUndefinedOnly` signature is first, it'll erroneously match a Promise returning function for users with
|
|
1885
|
+
// `strictNullChecks: false`.
|
|
1886
|
+
// - VoidOrUndefinedOnly is there to forbid any non-void return values for users with `strictNullChecks: true`
|
|
2147
1887
|
// 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
1888
|
export function act(callback: () => VoidOrUndefinedOnly): void;
|
|
2149
1889
|
export function act<T>(callback: () => T | Promise<T>): Promise<T>;
|
|
@@ -2171,6 +1911,39 @@ declare namespace React {
|
|
|
2171
1911
|
getServerSnapshot?: () => Snapshot,
|
|
2172
1912
|
): Snapshot;
|
|
2173
1913
|
|
|
1914
|
+
export function useOptimistic<State>(
|
|
1915
|
+
passthrough: State,
|
|
1916
|
+
): [State, (action: State | ((pendingState: State) => State)) => void];
|
|
1917
|
+
export function useOptimistic<State, Action>(
|
|
1918
|
+
passthrough: State,
|
|
1919
|
+
reducer: (state: State, action: Action) => State,
|
|
1920
|
+
): [State, (action: Action) => void];
|
|
1921
|
+
|
|
1922
|
+
export type Usable<T> = PromiseLike<T> | Context<T>;
|
|
1923
|
+
|
|
1924
|
+
export function use<T>(usable: Usable<T>): T;
|
|
1925
|
+
|
|
1926
|
+
export function useActionState<State>(
|
|
1927
|
+
action: (state: Awaited<State>) => State | Promise<State>,
|
|
1928
|
+
initialState: Awaited<State>,
|
|
1929
|
+
permalink?: string,
|
|
1930
|
+
): [state: Awaited<State>, dispatch: () => void, isPending: boolean];
|
|
1931
|
+
export function useActionState<State, Payload>(
|
|
1932
|
+
action: (state: Awaited<State>, payload: Payload) => State | Promise<State>,
|
|
1933
|
+
initialState: Awaited<State>,
|
|
1934
|
+
permalink?: string,
|
|
1935
|
+
): [state: Awaited<State>, dispatch: (payload: Payload) => void, isPending: boolean];
|
|
1936
|
+
|
|
1937
|
+
// eslint-disable-next-line @typescript-eslint/no-unsafe-function-type
|
|
1938
|
+
export function cache<CachedFunction extends Function>(fn: CachedFunction): CachedFunction;
|
|
1939
|
+
|
|
1940
|
+
/**
|
|
1941
|
+
* Warning: Only available in development builds.
|
|
1942
|
+
*
|
|
1943
|
+
* @see {@link https://react.dev/reference/react/captureOwnerStack Reference docs}
|
|
1944
|
+
*/
|
|
1945
|
+
function captureOwnerStack(): string | null;
|
|
1946
|
+
|
|
2174
1947
|
//
|
|
2175
1948
|
// Event System
|
|
2176
1949
|
// ----------------------------------------------------------------------
|
|
@@ -2338,6 +2111,11 @@ declare namespace React {
|
|
|
2338
2111
|
pseudoElement: string;
|
|
2339
2112
|
}
|
|
2340
2113
|
|
|
2114
|
+
interface ToggleEvent<T = Element> extends SyntheticEvent<T, NativeToggleEvent> {
|
|
2115
|
+
oldState: "closed" | "open";
|
|
2116
|
+
newState: "closed" | "open";
|
|
2117
|
+
}
|
|
2118
|
+
|
|
2341
2119
|
interface TransitionEvent<T = Element> extends SyntheticEvent<T, NativeTransitionEvent> {
|
|
2342
2120
|
elapsedTime: number;
|
|
2343
2121
|
propertyName: string;
|
|
@@ -2365,6 +2143,7 @@ declare namespace React {
|
|
|
2365
2143
|
type UIEventHandler<T = Element> = EventHandler<UIEvent<T>>;
|
|
2366
2144
|
type WheelEventHandler<T = Element> = EventHandler<WheelEvent<T>>;
|
|
2367
2145
|
type AnimationEventHandler<T = Element> = EventHandler<AnimationEvent<T>>;
|
|
2146
|
+
type ToggleEventHandler<T = Element> = EventHandler<ToggleEvent<T>>;
|
|
2368
2147
|
type TransitionEventHandler<T = Element> = EventHandler<TransitionEvent<T>>;
|
|
2369
2148
|
|
|
2370
2149
|
//
|
|
@@ -2565,6 +2344,8 @@ declare namespace React {
|
|
|
2565
2344
|
// UI Events
|
|
2566
2345
|
onScroll?: UIEventHandler<T> | undefined;
|
|
2567
2346
|
onScrollCapture?: UIEventHandler<T> | undefined;
|
|
2347
|
+
onScrollEnd?: UIEventHandler<T> | undefined;
|
|
2348
|
+
onScrollEndCapture?: UIEventHandler<T> | undefined;
|
|
2568
2349
|
|
|
2569
2350
|
// Wheel Events
|
|
2570
2351
|
onWheel?: WheelEventHandler<T> | undefined;
|
|
@@ -2578,9 +2359,19 @@ declare namespace React {
|
|
|
2578
2359
|
onAnimationIteration?: AnimationEventHandler<T> | undefined;
|
|
2579
2360
|
onAnimationIterationCapture?: AnimationEventHandler<T> | undefined;
|
|
2580
2361
|
|
|
2362
|
+
// Toggle Events
|
|
2363
|
+
onToggle?: ToggleEventHandler<T> | undefined;
|
|
2364
|
+
onBeforeToggle?: ToggleEventHandler<T> | undefined;
|
|
2365
|
+
|
|
2581
2366
|
// Transition Events
|
|
2367
|
+
onTransitionCancel?: TransitionEventHandler<T> | undefined;
|
|
2368
|
+
onTransitionCancelCapture?: TransitionEventHandler<T> | undefined;
|
|
2582
2369
|
onTransitionEnd?: TransitionEventHandler<T> | undefined;
|
|
2583
2370
|
onTransitionEndCapture?: TransitionEventHandler<T> | undefined;
|
|
2371
|
+
onTransitionRun?: TransitionEventHandler<T> | undefined;
|
|
2372
|
+
onTransitionRunCapture?: TransitionEventHandler<T> | undefined;
|
|
2373
|
+
onTransitionStart?: TransitionEventHandler<T> | undefined;
|
|
2374
|
+
onTransitionStartCapture?: TransitionEventHandler<T> | undefined;
|
|
2584
2375
|
}
|
|
2585
2376
|
|
|
2586
2377
|
export interface CSSProperties extends CSS.Properties<string | number> {
|
|
@@ -2900,6 +2691,7 @@ declare namespace React {
|
|
|
2900
2691
|
|
|
2901
2692
|
// Standard HTML Attributes
|
|
2902
2693
|
accessKey?: string | undefined;
|
|
2694
|
+
autoCapitalize?: "off" | "none" | "on" | "sentences" | "words" | "characters" | undefined | (string & {});
|
|
2903
2695
|
autoFocus?: boolean | undefined;
|
|
2904
2696
|
className?: string | undefined;
|
|
2905
2697
|
contentEditable?: Booleanish | "inherit" | "plaintext-only" | undefined;
|
|
@@ -2938,7 +2730,6 @@ declare namespace React {
|
|
|
2938
2730
|
vocab?: string | undefined;
|
|
2939
2731
|
|
|
2940
2732
|
// Non-standard Attributes
|
|
2941
|
-
autoCapitalize?: string | undefined;
|
|
2942
2733
|
autoCorrect?: string | undefined;
|
|
2943
2734
|
autoSave?: string | undefined;
|
|
2944
2735
|
color?: string | undefined;
|
|
@@ -2951,7 +2742,16 @@ declare namespace React {
|
|
|
2951
2742
|
security?: string | undefined;
|
|
2952
2743
|
unselectable?: "on" | "off" | undefined;
|
|
2953
2744
|
|
|
2745
|
+
// Popover API
|
|
2746
|
+
popover?: "" | "auto" | "manual" | undefined;
|
|
2747
|
+
popoverTargetAction?: "toggle" | "show" | "hide" | undefined;
|
|
2748
|
+
popoverTarget?: string | undefined;
|
|
2749
|
+
|
|
2954
2750
|
// Living Standard
|
|
2751
|
+
/**
|
|
2752
|
+
* @see https://developer.mozilla.org/en-US/docs/Web/API/HTMLElement/inert
|
|
2753
|
+
*/
|
|
2754
|
+
inert?: boolean | undefined;
|
|
2955
2755
|
/**
|
|
2956
2756
|
* Hints at the type of data that might be entered by the user while editing the element or its contents
|
|
2957
2757
|
* @see {@link https://html.spec.whatwg.org/multipage/interaction.html#input-modalities:-the-inputmode-attribute}
|
|
@@ -2962,6 +2762,14 @@ declare namespace React {
|
|
|
2962
2762
|
* @see {@link https://html.spec.whatwg.org/multipage/custom-elements.html#attr-is}
|
|
2963
2763
|
*/
|
|
2964
2764
|
is?: string | undefined;
|
|
2765
|
+
/**
|
|
2766
|
+
* @see {@link https://developer.mozilla.org/en-US/docs/Web/HTML/Global_attributes/exportparts}
|
|
2767
|
+
*/
|
|
2768
|
+
exportparts?: string | undefined;
|
|
2769
|
+
/**
|
|
2770
|
+
* @see {@link https://developer.mozilla.org/en-US/docs/Web/HTML/Global_attributes/part}
|
|
2771
|
+
*/
|
|
2772
|
+
part?: string | undefined;
|
|
2965
2773
|
}
|
|
2966
2774
|
|
|
2967
2775
|
/**
|
|
@@ -2978,6 +2786,7 @@ declare namespace React {
|
|
|
2978
2786
|
action?:
|
|
2979
2787
|
| string
|
|
2980
2788
|
| undefined
|
|
2789
|
+
| ((formData: FormData) => void | Promise<void>)
|
|
2981
2790
|
| DO_NOT_USE_OR_YOU_WILL_BE_FIRED_EXPERIMENTAL_FORM_ACTIONS[
|
|
2982
2791
|
keyof DO_NOT_USE_OR_YOU_WILL_BE_FIRED_EXPERIMENTAL_FORM_ACTIONS
|
|
2983
2792
|
];
|
|
@@ -3012,6 +2821,7 @@ declare namespace React {
|
|
|
3012
2821
|
formAction?:
|
|
3013
2822
|
| string
|
|
3014
2823
|
| undefined
|
|
2824
|
+
| ((formData: FormData) => void | Promise<void>)
|
|
3015
2825
|
| DO_NOT_USE_OR_YOU_WILL_BE_FIRED_EXPERIMENTAL_FORM_ACTIONS[
|
|
3016
2826
|
keyof DO_NOT_USE_OR_YOU_WILL_BE_FIRED_EXPERIMENTAL_FORM_ACTIONS
|
|
3017
2827
|
];
|
|
@@ -3144,6 +2954,7 @@ declare namespace React {
|
|
|
3144
2954
|
form?: string | undefined;
|
|
3145
2955
|
formAction?:
|
|
3146
2956
|
| string
|
|
2957
|
+
| ((formData: FormData) => void | Promise<void>)
|
|
3147
2958
|
| DO_NOT_USE_OR_YOU_WILL_BE_FIRED_EXPERIMENTAL_FORM_ACTIONS[
|
|
3148
2959
|
keyof DO_NOT_USE_OR_YOU_WILL_BE_FIRED_EXPERIMENTAL_FORM_ACTIONS
|
|
3149
2960
|
]
|
|
@@ -3177,7 +2988,6 @@ declare namespace React {
|
|
|
3177
2988
|
|
|
3178
2989
|
interface DetailsHTMLAttributes<T> extends HTMLAttributes<T> {
|
|
3179
2990
|
open?: boolean | undefined;
|
|
3180
|
-
onToggle?: ReactEventHandler<T> | undefined;
|
|
3181
2991
|
name?: string | undefined;
|
|
3182
2992
|
}
|
|
3183
2993
|
|
|
@@ -3210,6 +3020,7 @@ declare namespace React {
|
|
|
3210
3020
|
action?:
|
|
3211
3021
|
| string
|
|
3212
3022
|
| undefined
|
|
3023
|
+
| ((formData: FormData) => void | Promise<void>)
|
|
3213
3024
|
| DO_NOT_USE_OR_YOU_WILL_BE_FIRED_EXPERIMENTAL_FORM_ACTIONS[
|
|
3214
3025
|
keyof DO_NOT_USE_OR_YOU_WILL_BE_FIRED_EXPERIMENTAL_FORM_ACTIONS
|
|
3215
3026
|
];
|
|
@@ -3248,6 +3059,8 @@ declare namespace React {
|
|
|
3248
3059
|
width?: number | string | undefined;
|
|
3249
3060
|
}
|
|
3250
3061
|
|
|
3062
|
+
interface DO_NOT_USE_OR_YOU_WILL_BE_FIRED_EXPERIMENTAL_IMG_SRC_TYPES {}
|
|
3063
|
+
|
|
3251
3064
|
interface ImgHTMLAttributes<T> extends HTMLAttributes<T> {
|
|
3252
3065
|
alt?: string | undefined;
|
|
3253
3066
|
crossOrigin?: CrossOrigin;
|
|
@@ -3257,7 +3070,12 @@ declare namespace React {
|
|
|
3257
3070
|
loading?: "eager" | "lazy" | undefined;
|
|
3258
3071
|
referrerPolicy?: HTMLAttributeReferrerPolicy | undefined;
|
|
3259
3072
|
sizes?: string | undefined;
|
|
3260
|
-
src?:
|
|
3073
|
+
src?:
|
|
3074
|
+
| string
|
|
3075
|
+
| DO_NOT_USE_OR_YOU_WILL_BE_FIRED_EXPERIMENTAL_IMG_SRC_TYPES[
|
|
3076
|
+
keyof DO_NOT_USE_OR_YOU_WILL_BE_FIRED_EXPERIMENTAL_IMG_SRC_TYPES
|
|
3077
|
+
]
|
|
3078
|
+
| undefined;
|
|
3261
3079
|
srcSet?: string | undefined;
|
|
3262
3080
|
useMap?: string | undefined;
|
|
3263
3081
|
width?: number | string | undefined;
|
|
@@ -3365,6 +3183,7 @@ declare namespace React {
|
|
|
3365
3183
|
form?: string | undefined;
|
|
3366
3184
|
formAction?:
|
|
3367
3185
|
| string
|
|
3186
|
+
| ((formData: FormData) => void | Promise<void>)
|
|
3368
3187
|
| DO_NOT_USE_OR_YOU_WILL_BE_FIRED_EXPERIMENTAL_FORM_ACTIONS[
|
|
3369
3188
|
keyof DO_NOT_USE_OR_YOU_WILL_BE_FIRED_EXPERIMENTAL_FORM_ACTIONS
|
|
3370
3189
|
]
|
|
@@ -3427,6 +3246,9 @@ declare namespace React {
|
|
|
3427
3246
|
sizes?: string | undefined;
|
|
3428
3247
|
type?: string | undefined;
|
|
3429
3248
|
charSet?: string | undefined;
|
|
3249
|
+
|
|
3250
|
+
// React props
|
|
3251
|
+
precedence?: string | undefined;
|
|
3430
3252
|
}
|
|
3431
3253
|
|
|
3432
3254
|
interface MapHTMLAttributes<T> extends HTMLAttributes<T> {
|
|
@@ -3437,6 +3259,8 @@ declare namespace React {
|
|
|
3437
3259
|
type?: string | undefined;
|
|
3438
3260
|
}
|
|
3439
3261
|
|
|
3262
|
+
interface DO_NOT_USE_OR_YOU_WILL_BE_FIRED_EXPERIMENTAL_MEDIA_SRC_TYPES {}
|
|
3263
|
+
|
|
3440
3264
|
interface MediaHTMLAttributes<T> extends HTMLAttributes<T> {
|
|
3441
3265
|
autoPlay?: boolean | undefined;
|
|
3442
3266
|
controls?: boolean | undefined;
|
|
@@ -3447,7 +3271,12 @@ declare namespace React {
|
|
|
3447
3271
|
muted?: boolean | undefined;
|
|
3448
3272
|
playsInline?: boolean | undefined;
|
|
3449
3273
|
preload?: string | undefined;
|
|
3450
|
-
src?:
|
|
3274
|
+
src?:
|
|
3275
|
+
| string
|
|
3276
|
+
| DO_NOT_USE_OR_YOU_WILL_BE_FIRED_EXPERIMENTAL_MEDIA_SRC_TYPES[
|
|
3277
|
+
keyof DO_NOT_USE_OR_YOU_WILL_BE_FIRED_EXPERIMENTAL_MEDIA_SRC_TYPES
|
|
3278
|
+
]
|
|
3279
|
+
| undefined;
|
|
3451
3280
|
}
|
|
3452
3281
|
|
|
3453
3282
|
interface MetaHTMLAttributes<T> extends HTMLAttributes<T> {
|
|
@@ -3561,6 +3390,10 @@ declare namespace React {
|
|
|
3561
3390
|
media?: string | undefined;
|
|
3562
3391
|
scoped?: boolean | undefined;
|
|
3563
3392
|
type?: string | undefined;
|
|
3393
|
+
|
|
3394
|
+
// React props
|
|
3395
|
+
href?: string | undefined;
|
|
3396
|
+
precedence?: string | undefined;
|
|
3564
3397
|
}
|
|
3565
3398
|
|
|
3566
3399
|
interface TableHTMLAttributes<T> extends HTMLAttributes<T> {
|
|
@@ -3948,259 +3781,184 @@ declare namespace React {
|
|
|
3948
3781
|
webpreferences?: string | undefined;
|
|
3949
3782
|
}
|
|
3950
3783
|
|
|
3951
|
-
//
|
|
3952
|
-
|
|
3953
|
-
|
|
3954
|
-
|
|
3955
|
-
|
|
3956
|
-
|
|
3957
|
-
|
|
3958
|
-
|
|
3959
|
-
|
|
3960
|
-
|
|
3961
|
-
|
|
3962
|
-
|
|
3963
|
-
|
|
3964
|
-
|
|
3965
|
-
|
|
3966
|
-
|
|
3967
|
-
|
|
3968
|
-
|
|
3969
|
-
|
|
3970
|
-
|
|
3971
|
-
|
|
3972
|
-
|
|
3973
|
-
|
|
3974
|
-
|
|
3975
|
-
|
|
3976
|
-
|
|
3977
|
-
|
|
3978
|
-
|
|
3979
|
-
|
|
3980
|
-
|
|
3981
|
-
|
|
3982
|
-
|
|
3983
|
-
|
|
3984
|
-
|
|
3985
|
-
|
|
3986
|
-
|
|
3987
|
-
|
|
3988
|
-
|
|
3989
|
-
|
|
3990
|
-
|
|
3991
|
-
|
|
3992
|
-
|
|
3993
|
-
|
|
3994
|
-
|
|
3995
|
-
|
|
3996
|
-
|
|
3997
|
-
|
|
3998
|
-
|
|
3999
|
-
|
|
4000
|
-
|
|
4001
|
-
|
|
4002
|
-
|
|
4003
|
-
|
|
4004
|
-
|
|
4005
|
-
|
|
4006
|
-
|
|
4007
|
-
|
|
4008
|
-
|
|
4009
|
-
|
|
4010
|
-
|
|
4011
|
-
|
|
4012
|
-
|
|
4013
|
-
|
|
4014
|
-
|
|
4015
|
-
|
|
4016
|
-
|
|
4017
|
-
|
|
4018
|
-
|
|
4019
|
-
|
|
4020
|
-
|
|
4021
|
-
|
|
4022
|
-
|
|
4023
|
-
|
|
4024
|
-
|
|
4025
|
-
|
|
4026
|
-
|
|
4027
|
-
|
|
4028
|
-
|
|
4029
|
-
|
|
4030
|
-
|
|
4031
|
-
|
|
4032
|
-
|
|
4033
|
-
|
|
4034
|
-
|
|
4035
|
-
|
|
4036
|
-
|
|
4037
|
-
|
|
4038
|
-
|
|
4039
|
-
|
|
4040
|
-
|
|
4041
|
-
|
|
4042
|
-
|
|
4043
|
-
|
|
4044
|
-
|
|
4045
|
-
|
|
4046
|
-
|
|
4047
|
-
|
|
4048
|
-
|
|
4049
|
-
|
|
4050
|
-
|
|
4051
|
-
|
|
4052
|
-
|
|
4053
|
-
|
|
4054
|
-
|
|
4055
|
-
|
|
4056
|
-
|
|
4057
|
-
|
|
4058
|
-
|
|
4059
|
-
|
|
4060
|
-
|
|
4061
|
-
|
|
4062
|
-
|
|
4063
|
-
|
|
4064
|
-
|
|
4065
|
-
|
|
4066
|
-
|
|
4067
|
-
|
|
4068
|
-
|
|
4069
|
-
|
|
4070
|
-
"
|
|
4071
|
-
|
|
4072
|
-
|
|
4073
|
-
|
|
4074
|
-
|
|
4075
|
-
|
|
4076
|
-
|
|
4077
|
-
|
|
4078
|
-
|
|
4079
|
-
|
|
4080
|
-
|
|
4081
|
-
|
|
4082
|
-
|
|
4083
|
-
|
|
4084
|
-
|
|
4085
|
-
|
|
4086
|
-
|
|
4087
|
-
|
|
4088
|
-
|
|
4089
|
-
|
|
4090
|
-
|
|
4091
|
-
|
|
4092
|
-
|
|
4093
|
-
|
|
4094
|
-
|
|
4095
|
-
|
|
4096
|
-
|
|
4097
|
-
|
|
4098
|
-
|
|
4099
|
-
|
|
4100
|
-
|
|
4101
|
-
|
|
4102
|
-
|
|
4103
|
-
|
|
4104
|
-
|
|
4105
|
-
|
|
4106
|
-
|
|
4107
|
-
|
|
4108
|
-
|
|
4109
|
-
|
|
4110
|
-
|
|
4111
|
-
|
|
4112
|
-
|
|
4113
|
-
|
|
4114
|
-
|
|
4115
|
-
|
|
4116
|
-
|
|
4117
|
-
|
|
4118
|
-
|
|
4119
|
-
|
|
4120
|
-
|
|
4121
|
-
|
|
4122
|
-
|
|
4123
|
-
|
|
4124
|
-
|
|
4125
|
-
|
|
4126
|
-
|
|
4127
|
-
|
|
4128
|
-
|
|
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
|
-
}
|
|
3784
|
+
// TODO: Move to react-dom
|
|
3785
|
+
type HTMLElementType =
|
|
3786
|
+
| "a"
|
|
3787
|
+
| "abbr"
|
|
3788
|
+
| "address"
|
|
3789
|
+
| "area"
|
|
3790
|
+
| "article"
|
|
3791
|
+
| "aside"
|
|
3792
|
+
| "audio"
|
|
3793
|
+
| "b"
|
|
3794
|
+
| "base"
|
|
3795
|
+
| "bdi"
|
|
3796
|
+
| "bdo"
|
|
3797
|
+
| "big"
|
|
3798
|
+
| "blockquote"
|
|
3799
|
+
| "body"
|
|
3800
|
+
| "br"
|
|
3801
|
+
| "button"
|
|
3802
|
+
| "canvas"
|
|
3803
|
+
| "caption"
|
|
3804
|
+
| "center"
|
|
3805
|
+
| "cite"
|
|
3806
|
+
| "code"
|
|
3807
|
+
| "col"
|
|
3808
|
+
| "colgroup"
|
|
3809
|
+
| "data"
|
|
3810
|
+
| "datalist"
|
|
3811
|
+
| "dd"
|
|
3812
|
+
| "del"
|
|
3813
|
+
| "details"
|
|
3814
|
+
| "dfn"
|
|
3815
|
+
| "dialog"
|
|
3816
|
+
| "div"
|
|
3817
|
+
| "dl"
|
|
3818
|
+
| "dt"
|
|
3819
|
+
| "em"
|
|
3820
|
+
| "embed"
|
|
3821
|
+
| "fieldset"
|
|
3822
|
+
| "figcaption"
|
|
3823
|
+
| "figure"
|
|
3824
|
+
| "footer"
|
|
3825
|
+
| "form"
|
|
3826
|
+
| "h1"
|
|
3827
|
+
| "h2"
|
|
3828
|
+
| "h3"
|
|
3829
|
+
| "h4"
|
|
3830
|
+
| "h5"
|
|
3831
|
+
| "h6"
|
|
3832
|
+
| "head"
|
|
3833
|
+
| "header"
|
|
3834
|
+
| "hgroup"
|
|
3835
|
+
| "hr"
|
|
3836
|
+
| "html"
|
|
3837
|
+
| "i"
|
|
3838
|
+
| "iframe"
|
|
3839
|
+
| "img"
|
|
3840
|
+
| "input"
|
|
3841
|
+
| "ins"
|
|
3842
|
+
| "kbd"
|
|
3843
|
+
| "keygen"
|
|
3844
|
+
| "label"
|
|
3845
|
+
| "legend"
|
|
3846
|
+
| "li"
|
|
3847
|
+
| "link"
|
|
3848
|
+
| "main"
|
|
3849
|
+
| "map"
|
|
3850
|
+
| "mark"
|
|
3851
|
+
| "menu"
|
|
3852
|
+
| "menuitem"
|
|
3853
|
+
| "meta"
|
|
3854
|
+
| "meter"
|
|
3855
|
+
| "nav"
|
|
3856
|
+
| "noscript"
|
|
3857
|
+
| "object"
|
|
3858
|
+
| "ol"
|
|
3859
|
+
| "optgroup"
|
|
3860
|
+
| "option"
|
|
3861
|
+
| "output"
|
|
3862
|
+
| "p"
|
|
3863
|
+
| "param"
|
|
3864
|
+
| "picture"
|
|
3865
|
+
| "pre"
|
|
3866
|
+
| "progress"
|
|
3867
|
+
| "q"
|
|
3868
|
+
| "rp"
|
|
3869
|
+
| "rt"
|
|
3870
|
+
| "ruby"
|
|
3871
|
+
| "s"
|
|
3872
|
+
| "samp"
|
|
3873
|
+
| "search"
|
|
3874
|
+
| "slot"
|
|
3875
|
+
| "script"
|
|
3876
|
+
| "section"
|
|
3877
|
+
| "select"
|
|
3878
|
+
| "small"
|
|
3879
|
+
| "source"
|
|
3880
|
+
| "span"
|
|
3881
|
+
| "strong"
|
|
3882
|
+
| "style"
|
|
3883
|
+
| "sub"
|
|
3884
|
+
| "summary"
|
|
3885
|
+
| "sup"
|
|
3886
|
+
| "table"
|
|
3887
|
+
| "template"
|
|
3888
|
+
| "tbody"
|
|
3889
|
+
| "td"
|
|
3890
|
+
| "textarea"
|
|
3891
|
+
| "tfoot"
|
|
3892
|
+
| "th"
|
|
3893
|
+
| "thead"
|
|
3894
|
+
| "time"
|
|
3895
|
+
| "title"
|
|
3896
|
+
| "tr"
|
|
3897
|
+
| "track"
|
|
3898
|
+
| "u"
|
|
3899
|
+
| "ul"
|
|
3900
|
+
| "var"
|
|
3901
|
+
| "video"
|
|
3902
|
+
| "wbr"
|
|
3903
|
+
| "webview";
|
|
3904
|
+
|
|
3905
|
+
// TODO: Move to react-dom
|
|
3906
|
+
type SVGElementType =
|
|
3907
|
+
| "animate"
|
|
3908
|
+
| "circle"
|
|
3909
|
+
| "clipPath"
|
|
3910
|
+
| "defs"
|
|
3911
|
+
| "desc"
|
|
3912
|
+
| "ellipse"
|
|
3913
|
+
| "feBlend"
|
|
3914
|
+
| "feColorMatrix"
|
|
3915
|
+
| "feComponentTransfer"
|
|
3916
|
+
| "feComposite"
|
|
3917
|
+
| "feConvolveMatrix"
|
|
3918
|
+
| "feDiffuseLighting"
|
|
3919
|
+
| "feDisplacementMap"
|
|
3920
|
+
| "feDistantLight"
|
|
3921
|
+
| "feDropShadow"
|
|
3922
|
+
| "feFlood"
|
|
3923
|
+
| "feFuncA"
|
|
3924
|
+
| "feFuncB"
|
|
3925
|
+
| "feFuncG"
|
|
3926
|
+
| "feFuncR"
|
|
3927
|
+
| "feGaussianBlur"
|
|
3928
|
+
| "feImage"
|
|
3929
|
+
| "feMerge"
|
|
3930
|
+
| "feMergeNode"
|
|
3931
|
+
| "feMorphology"
|
|
3932
|
+
| "feOffset"
|
|
3933
|
+
| "fePointLight"
|
|
3934
|
+
| "feSpecularLighting"
|
|
3935
|
+
| "feSpotLight"
|
|
3936
|
+
| "feTile"
|
|
3937
|
+
| "feTurbulence"
|
|
3938
|
+
| "filter"
|
|
3939
|
+
| "foreignObject"
|
|
3940
|
+
| "g"
|
|
3941
|
+
| "image"
|
|
3942
|
+
| "line"
|
|
3943
|
+
| "linearGradient"
|
|
3944
|
+
| "marker"
|
|
3945
|
+
| "mask"
|
|
3946
|
+
| "metadata"
|
|
3947
|
+
| "path"
|
|
3948
|
+
| "pattern"
|
|
3949
|
+
| "polygon"
|
|
3950
|
+
| "polyline"
|
|
3951
|
+
| "radialGradient"
|
|
3952
|
+
| "rect"
|
|
3953
|
+
| "stop"
|
|
3954
|
+
| "svg"
|
|
3955
|
+
| "switch"
|
|
3956
|
+
| "symbol"
|
|
3957
|
+
| "text"
|
|
3958
|
+
| "textPath"
|
|
3959
|
+
| "tspan"
|
|
3960
|
+
| "use"
|
|
3961
|
+
| "view";
|
|
4204
3962
|
|
|
4205
3963
|
//
|
|
4206
3964
|
// Browser Interfaces
|
|
@@ -4242,67 +4000,6 @@ declare namespace React {
|
|
|
4242
4000
|
}
|
|
4243
4001
|
|
|
4244
4002
|
// 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
4003
|
namespace JSX {
|
|
4307
4004
|
interface Element extends React.ReactElement<any, any> {}
|
|
4308
4005
|
interface ElementClass extends React.Component<any> {
|
|
@@ -4514,17 +4211,18 @@ declare global {
|
|
|
4514
4211
|
}
|
|
4515
4212
|
}
|
|
4516
4213
|
|
|
4517
|
-
|
|
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>;
|
|
4214
|
+
type InexactPartial<T> = { [K in keyof T]?: T[K] | undefined };
|
|
4526
4215
|
|
|
4527
|
-
|
|
4528
|
-
|
|
4216
|
+
// Any prop that has a default prop becomes optional, but its type is unchanged
|
|
4217
|
+
// Undeclared default props are augmented into the resulting allowable attributes
|
|
4218
|
+
// If declared props have indexed properties, ignore default props entirely as keyof gets widened
|
|
4219
|
+
// Wrap in an outer-level conditional type to allow distribution over props that are unions
|
|
4220
|
+
type Defaultize<P, D> = P extends any ? string extends keyof P ? P
|
|
4221
|
+
:
|
|
4222
|
+
& Pick<P, Exclude<keyof P, keyof D>>
|
|
4223
|
+
& InexactPartial<Pick<P, Extract<keyof P, keyof D>>>
|
|
4224
|
+
& InexactPartial<Pick<D, Exclude<keyof D, keyof P>>>
|
|
4225
|
+
: never;
|
|
4529
4226
|
|
|
4530
|
-
|
|
4227
|
+
type ReactManagedAttributes<C, P> = C extends { defaultProps: infer D } ? Defaultize<P, D>
|
|
4228
|
+
: P;
|