@pinuts/bsr-uikit-relaunch 0.2.9 → 0.2.11

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (192) hide show
  1. package/dist/hooks/withFieldGroup.d.ts.map +1 -1
  2. package/dist/hooks/withFieldGroup.js +0 -1
  3. package/dist/index.js +2 -134
  4. package/dist/{main.js.LICENSE.txt → index.js.LICENSE.txt} +2 -2
  5. package/dist/items/BSRAddressSelector/BSRAddressSelector.d.ts.map +1 -1
  6. package/dist/items/BSRAddressSelector/BSRAddressSelector.js +1 -2
  7. package/dist/items/BSRAddressSelector/BSRStreetPlzSelector.d.ts.map +1 -1
  8. package/dist/items/BSRAddressSelector/BSRStreetPlzSelector.js +1 -2
  9. package/dist/styles/main.scss +5 -3
  10. package/node_modules/@babel/runtime/helpers/esm/objectWithoutProperties.js +2 -2
  11. package/node_modules/@babel/runtime/helpers/esm/objectWithoutPropertiesLoose.js +1 -1
  12. package/node_modules/@babel/runtime/helpers/esm/superPropGet.js +4 -4
  13. package/node_modules/@babel/runtime/helpers/esm/superPropSet.js +2 -2
  14. package/node_modules/@babel/runtime/helpers/objectWithoutProperties.js +2 -2
  15. package/node_modules/@babel/runtime/helpers/objectWithoutPropertiesLoose.js +1 -1
  16. package/node_modules/@babel/runtime/helpers/superPropGet.js +4 -4
  17. package/node_modules/@babel/runtime/helpers/superPropSet.js +2 -2
  18. package/node_modules/@babel/runtime/package.json +1 -1
  19. package/node_modules/{typescript → @pinuts/form-builder/node_modules/typescript}/lib/cs/diagnosticMessages.generated.json +4 -16
  20. package/node_modules/{typescript → @pinuts/form-builder/node_modules/typescript}/lib/de/diagnosticMessages.generated.json +4 -16
  21. package/node_modules/{typescript → @pinuts/form-builder/node_modules/typescript}/lib/es/diagnosticMessages.generated.json +4 -16
  22. package/node_modules/{typescript → @pinuts/form-builder/node_modules/typescript}/lib/fr/diagnosticMessages.generated.json +4 -16
  23. package/node_modules/{typescript → @pinuts/form-builder/node_modules/typescript}/lib/it/diagnosticMessages.generated.json +4 -16
  24. package/node_modules/{typescript → @pinuts/form-builder/node_modules/typescript}/lib/ja/diagnosticMessages.generated.json +4 -16
  25. package/node_modules/{typescript → @pinuts/form-builder/node_modules/typescript}/lib/ko/diagnosticMessages.generated.json +4 -16
  26. package/node_modules/{typescript → @pinuts/form-builder/node_modules/typescript}/lib/lib.decorators.d.ts +15 -13
  27. package/node_modules/{typescript → @pinuts/form-builder/node_modules/typescript}/lib/lib.dom.d.ts +219 -1115
  28. package/node_modules/{typescript → @pinuts/form-builder/node_modules/typescript}/lib/lib.es2015.core.d.ts +9 -9
  29. package/node_modules/{typescript → @pinuts/form-builder/node_modules/typescript}/lib/lib.es2015.iterable.d.ts +27 -90
  30. package/node_modules/{typescript → @pinuts/form-builder/node_modules/typescript}/lib/lib.es2015.symbol.wellknown.d.ts +10 -10
  31. package/node_modules/{typescript → @pinuts/form-builder/node_modules/typescript}/lib/lib.es2016.array.include.d.ts +9 -9
  32. package/node_modules/{typescript → @pinuts/form-builder/node_modules/typescript}/lib/lib.es2016.intl.d.ts +1 -1
  33. package/node_modules/{typescript → @pinuts/form-builder/node_modules/typescript}/lib/lib.es2017.d.ts +2 -3
  34. package/node_modules/{typescript → @pinuts/form-builder/node_modules/typescript}/lib/lib.es2017.sharedmemory.d.ts +14 -14
  35. package/node_modules/{typescript → @pinuts/form-builder/node_modules/typescript}/lib/lib.es2017.typedarrays.d.ts +9 -9
  36. package/node_modules/{typescript → @pinuts/form-builder/node_modules/typescript}/lib/lib.es2020.bigint.d.ts +50 -54
  37. package/node_modules/{typescript → @pinuts/form-builder/node_modules/typescript}/lib/lib.es2020.intl.d.ts +36 -36
  38. package/node_modules/{typescript → @pinuts/form-builder/node_modules/typescript}/lib/lib.es2020.sharedmemory.d.ts +11 -13
  39. package/node_modules/{typescript → @pinuts/form-builder/node_modules/typescript}/lib/lib.es2020.string.d.ts +0 -2
  40. package/node_modules/{typescript → @pinuts/form-builder/node_modules/typescript}/lib/lib.es2021.intl.d.ts +17 -17
  41. package/node_modules/{typescript → @pinuts/form-builder/node_modules/typescript}/lib/lib.es2021.weakref.d.ts +0 -2
  42. package/node_modules/{typescript → @pinuts/form-builder/node_modules/typescript}/lib/lib.es2022.array.d.ts +11 -11
  43. package/node_modules/{typescript → @pinuts/form-builder/node_modules/typescript}/lib/lib.es2022.d.ts +2 -1
  44. package/node_modules/{typescript → @pinuts/form-builder/node_modules/typescript}/lib/lib.es2022.error.d.ts +0 -2
  45. package/node_modules/{typescript → @pinuts/form-builder/node_modules/typescript}/lib/lib.es2022.intl.d.ts +9 -9
  46. package/node_modules/{typescript/lib/lib.es2024.sharedmemory.d.ts → @pinuts/form-builder/node_modules/typescript/lib/lib.es2022.sharedmemory.d.ts} +0 -29
  47. package/node_modules/{typescript → @pinuts/form-builder/node_modules/typescript}/lib/lib.es2023.array.d.ts +99 -99
  48. package/node_modules/{typescript → @pinuts/form-builder/node_modules/typescript}/lib/lib.es5.d.ts +252 -252
  49. package/node_modules/{typescript → @pinuts/form-builder/node_modules/typescript}/lib/lib.esnext.array.d.ts +1 -1
  50. package/node_modules/{typescript → @pinuts/form-builder/node_modules/typescript}/lib/lib.esnext.collection.d.ts +11 -1
  51. package/node_modules/{typescript → @pinuts/form-builder/node_modules/typescript}/lib/lib.esnext.d.ts +5 -1
  52. package/node_modules/{typescript → @pinuts/form-builder/node_modules/typescript}/lib/lib.webworker.d.ts +34 -311
  53. package/node_modules/{typescript → @pinuts/form-builder/node_modules/typescript}/lib/pl/diagnosticMessages.generated.json +4 -16
  54. package/node_modules/{typescript → @pinuts/form-builder/node_modules/typescript}/lib/pt-br/diagnosticMessages.generated.json +4 -16
  55. package/node_modules/{typescript → @pinuts/form-builder/node_modules/typescript}/lib/ru/diagnosticMessages.generated.json +4 -16
  56. package/node_modules/{typescript → @pinuts/form-builder/node_modules/typescript}/lib/tr/diagnosticMessages.generated.json +4 -16
  57. package/node_modules/{typescript/lib/_tsc.js → @pinuts/form-builder/node_modules/typescript/lib/tsc.js} +1863 -3484
  58. package/node_modules/{typescript/lib/_tsserver.js → @pinuts/form-builder/node_modules/typescript/lib/tsserver.js} +1 -1
  59. package/node_modules/{typescript → @pinuts/form-builder/node_modules/typescript}/lib/typesMap.json +497 -497
  60. package/node_modules/{typescript → @pinuts/form-builder/node_modules/typescript}/lib/typescript.d.ts +22 -82
  61. package/node_modules/{typescript → @pinuts/form-builder/node_modules/typescript}/lib/typescript.js +2998 -5593
  62. package/node_modules/{typescript/lib/_typingsInstaller.js → @pinuts/form-builder/node_modules/typescript/lib/typingsInstaller.js} +16 -2
  63. package/node_modules/{typescript → @pinuts/form-builder/node_modules/typescript}/lib/zh-cn/diagnosticMessages.generated.json +5 -17
  64. package/node_modules/{typescript → @pinuts/form-builder/node_modules/typescript}/lib/zh-tw/diagnosticMessages.generated.json +4 -16
  65. package/node_modules/{typescript → @pinuts/form-builder/node_modules/typescript}/package.json +23 -22
  66. package/node_modules/@types/hoist-non-react-statics/README.md +13 -13
  67. package/node_modules/@types/hoist-non-react-statics/index.d.ts +12 -12
  68. package/node_modules/@types/hoist-non-react-statics/package.json +3 -4
  69. package/node_modules/@types/prop-types/LICENSE +21 -0
  70. package/node_modules/@types/prop-types/README.md +15 -0
  71. package/node_modules/@types/prop-types/index.d.ts +114 -0
  72. package/node_modules/@types/prop-types/package.json +35 -0
  73. package/node_modules/@types/react/README.md +3 -3
  74. package/node_modules/@types/react/canary.d.ts +118 -3
  75. package/node_modules/@types/react/experimental.d.ts +4 -89
  76. package/node_modules/@types/react/index.d.ts +772 -435
  77. package/node_modules/@types/react/package.json +9 -9
  78. package/node_modules/@types/react/ts5.0/canary.d.ts +118 -3
  79. package/node_modules/@types/react/ts5.0/experimental.d.ts +4 -89
  80. package/node_modules/@types/react/ts5.0/index.d.ts +768 -431
  81. package/node_modules/hoist-non-react-statics/CHANGELOG.md +37 -0
  82. package/node_modules/tslib/modules/index.d.ts +0 -1
  83. package/node_modules/tslib/modules/index.js +0 -2
  84. package/node_modules/tslib/package.json +1 -1
  85. package/node_modules/tslib/tslib.d.ts +0 -7
  86. package/node_modules/tslib/tslib.es6.js +1 -24
  87. package/node_modules/tslib/tslib.es6.mjs +1 -24
  88. package/node_modules/tslib/tslib.js +1 -56
  89. package/package.json +4 -5
  90. package/webpack.config.js +99 -109
  91. package/.nvmrc +0 -1
  92. package/dist/main.css +0 -4
  93. package/dist/main.js +0 -2
  94. package/dist/styles.css +0 -1
  95. package/dist/styles.js +0 -0
  96. package/node_modules/@types/react/compiler-runtime.d.ts +0 -4
  97. package/node_modules/@types/react/ts5.0/v18/global.d.ts +0 -160
  98. package/node_modules/@types/react/ts5.0/v18/index.d.ts +0 -4543
  99. package/node_modules/@types/react/ts5.0/v18/jsx-dev-runtime.d.ts +0 -45
  100. package/node_modules/@types/react/ts5.0/v18/jsx-runtime.d.ts +0 -36
  101. package/node_modules/@types/react/ts5.0/v18/ts5.0/global.d.ts +0 -160
  102. package/node_modules/@types/react/ts5.0/v18/ts5.0/index.d.ts +0 -4530
  103. package/node_modules/@types/react/ts5.0/v18/ts5.0/jsx-dev-runtime.d.ts +0 -44
  104. package/node_modules/@types/react/ts5.0/v18/ts5.0/jsx-runtime.d.ts +0 -35
  105. package/node_modules/typescript/lib/lib.es2017.arraybuffer.d.ts +0 -21
  106. package/node_modules/typescript/lib/lib.es2024.arraybuffer.d.ts +0 -65
  107. package/node_modules/typescript/lib/lib.es2024.collection.d.ts +0 -29
  108. package/node_modules/typescript/lib/lib.es2024.d.ts +0 -26
  109. package/node_modules/typescript/lib/lib.es2024.full.d.ts +0 -24
  110. package/node_modules/typescript/lib/tsc.js +0 -8
  111. package/node_modules/typescript/lib/tsserver.js +0 -8
  112. package/node_modules/typescript/lib/typingsInstaller.js +0 -8
  113. /package/dist/styles/{form.scss → _form.scss} +0 -0
  114. /package/node_modules/{typescript → @pinuts/form-builder/node_modules/typescript}/LICENSE.txt +0 -0
  115. /package/node_modules/{typescript → @pinuts/form-builder/node_modules/typescript}/README.md +0 -0
  116. /package/node_modules/{typescript → @pinuts/form-builder/node_modules/typescript}/SECURITY.md +0 -0
  117. /package/node_modules/{typescript → @pinuts/form-builder/node_modules/typescript}/ThirdPartyNoticeText.txt +0 -0
  118. /package/node_modules/{typescript → @pinuts/form-builder/node_modules/typescript}/bin/tsc +0 -0
  119. /package/node_modules/{typescript → @pinuts/form-builder/node_modules/typescript}/bin/tsserver +0 -0
  120. /package/node_modules/{typescript → @pinuts/form-builder/node_modules/typescript}/lib/cancellationToken.js +0 -0
  121. /package/node_modules/{typescript → @pinuts/form-builder/node_modules/typescript}/lib/lib.d.ts +0 -0
  122. /package/node_modules/{typescript → @pinuts/form-builder/node_modules/typescript}/lib/lib.decorators.legacy.d.ts +0 -0
  123. /package/node_modules/{typescript → @pinuts/form-builder/node_modules/typescript}/lib/lib.dom.asynciterable.d.ts +0 -0
  124. /package/node_modules/{typescript → @pinuts/form-builder/node_modules/typescript}/lib/lib.dom.iterable.d.ts +0 -0
  125. /package/node_modules/{typescript → @pinuts/form-builder/node_modules/typescript}/lib/lib.es2015.collection.d.ts +0 -0
  126. /package/node_modules/{typescript → @pinuts/form-builder/node_modules/typescript}/lib/lib.es2015.d.ts +0 -0
  127. /package/node_modules/{typescript → @pinuts/form-builder/node_modules/typescript}/lib/lib.es2015.generator.d.ts +0 -0
  128. /package/node_modules/{typescript → @pinuts/form-builder/node_modules/typescript}/lib/lib.es2015.promise.d.ts +0 -0
  129. /package/node_modules/{typescript → @pinuts/form-builder/node_modules/typescript}/lib/lib.es2015.proxy.d.ts +0 -0
  130. /package/node_modules/{typescript → @pinuts/form-builder/node_modules/typescript}/lib/lib.es2015.reflect.d.ts +0 -0
  131. /package/node_modules/{typescript → @pinuts/form-builder/node_modules/typescript}/lib/lib.es2015.symbol.d.ts +0 -0
  132. /package/node_modules/{typescript → @pinuts/form-builder/node_modules/typescript}/lib/lib.es2016.d.ts +0 -0
  133. /package/node_modules/{typescript → @pinuts/form-builder/node_modules/typescript}/lib/lib.es2016.full.d.ts +0 -0
  134. /package/node_modules/{typescript → @pinuts/form-builder/node_modules/typescript}/lib/lib.es2017.date.d.ts +0 -0
  135. /package/node_modules/{typescript → @pinuts/form-builder/node_modules/typescript}/lib/lib.es2017.full.d.ts +0 -0
  136. /package/node_modules/{typescript → @pinuts/form-builder/node_modules/typescript}/lib/lib.es2017.intl.d.ts +0 -0
  137. /package/node_modules/{typescript → @pinuts/form-builder/node_modules/typescript}/lib/lib.es2017.object.d.ts +0 -0
  138. /package/node_modules/{typescript → @pinuts/form-builder/node_modules/typescript}/lib/lib.es2017.string.d.ts +0 -0
  139. /package/node_modules/{typescript → @pinuts/form-builder/node_modules/typescript}/lib/lib.es2018.asyncgenerator.d.ts +0 -0
  140. /package/node_modules/{typescript → @pinuts/form-builder/node_modules/typescript}/lib/lib.es2018.asynciterable.d.ts +0 -0
  141. /package/node_modules/{typescript → @pinuts/form-builder/node_modules/typescript}/lib/lib.es2018.d.ts +0 -0
  142. /package/node_modules/{typescript → @pinuts/form-builder/node_modules/typescript}/lib/lib.es2018.full.d.ts +0 -0
  143. /package/node_modules/{typescript → @pinuts/form-builder/node_modules/typescript}/lib/lib.es2018.intl.d.ts +0 -0
  144. /package/node_modules/{typescript → @pinuts/form-builder/node_modules/typescript}/lib/lib.es2018.promise.d.ts +0 -0
  145. /package/node_modules/{typescript → @pinuts/form-builder/node_modules/typescript}/lib/lib.es2018.regexp.d.ts +0 -0
  146. /package/node_modules/{typescript → @pinuts/form-builder/node_modules/typescript}/lib/lib.es2019.array.d.ts +0 -0
  147. /package/node_modules/{typescript → @pinuts/form-builder/node_modules/typescript}/lib/lib.es2019.d.ts +0 -0
  148. /package/node_modules/{typescript → @pinuts/form-builder/node_modules/typescript}/lib/lib.es2019.full.d.ts +0 -0
  149. /package/node_modules/{typescript → @pinuts/form-builder/node_modules/typescript}/lib/lib.es2019.intl.d.ts +0 -0
  150. /package/node_modules/{typescript → @pinuts/form-builder/node_modules/typescript}/lib/lib.es2019.object.d.ts +0 -0
  151. /package/node_modules/{typescript → @pinuts/form-builder/node_modules/typescript}/lib/lib.es2019.string.d.ts +0 -0
  152. /package/node_modules/{typescript → @pinuts/form-builder/node_modules/typescript}/lib/lib.es2019.symbol.d.ts +0 -0
  153. /package/node_modules/{typescript → @pinuts/form-builder/node_modules/typescript}/lib/lib.es2020.d.ts +0 -0
  154. /package/node_modules/{typescript → @pinuts/form-builder/node_modules/typescript}/lib/lib.es2020.date.d.ts +0 -0
  155. /package/node_modules/{typescript → @pinuts/form-builder/node_modules/typescript}/lib/lib.es2020.full.d.ts +0 -0
  156. /package/node_modules/{typescript → @pinuts/form-builder/node_modules/typescript}/lib/lib.es2020.number.d.ts +0 -0
  157. /package/node_modules/{typescript → @pinuts/form-builder/node_modules/typescript}/lib/lib.es2020.promise.d.ts +0 -0
  158. /package/node_modules/{typescript → @pinuts/form-builder/node_modules/typescript}/lib/lib.es2020.symbol.wellknown.d.ts +0 -0
  159. /package/node_modules/{typescript → @pinuts/form-builder/node_modules/typescript}/lib/lib.es2021.d.ts +0 -0
  160. /package/node_modules/{typescript → @pinuts/form-builder/node_modules/typescript}/lib/lib.es2021.full.d.ts +0 -0
  161. /package/node_modules/{typescript → @pinuts/form-builder/node_modules/typescript}/lib/lib.es2021.promise.d.ts +0 -0
  162. /package/node_modules/{typescript → @pinuts/form-builder/node_modules/typescript}/lib/lib.es2021.string.d.ts +0 -0
  163. /package/node_modules/{typescript → @pinuts/form-builder/node_modules/typescript}/lib/lib.es2022.full.d.ts +0 -0
  164. /package/node_modules/{typescript → @pinuts/form-builder/node_modules/typescript}/lib/lib.es2022.object.d.ts +0 -0
  165. /package/node_modules/{typescript → @pinuts/form-builder/node_modules/typescript}/lib/lib.es2022.regexp.d.ts +0 -0
  166. /package/node_modules/{typescript → @pinuts/form-builder/node_modules/typescript}/lib/lib.es2022.string.d.ts +0 -0
  167. /package/node_modules/{typescript → @pinuts/form-builder/node_modules/typescript}/lib/lib.es2023.collection.d.ts +0 -0
  168. /package/node_modules/{typescript → @pinuts/form-builder/node_modules/typescript}/lib/lib.es2023.d.ts +0 -0
  169. /package/node_modules/{typescript → @pinuts/form-builder/node_modules/typescript}/lib/lib.es2023.full.d.ts +0 -0
  170. /package/node_modules/{typescript → @pinuts/form-builder/node_modules/typescript}/lib/lib.es2023.intl.d.ts +0 -0
  171. /package/node_modules/{typescript → @pinuts/form-builder/node_modules/typescript}/lib/lib.es6.d.ts +0 -0
  172. /package/node_modules/{typescript → @pinuts/form-builder/node_modules/typescript}/lib/lib.esnext.decorators.d.ts +0 -0
  173. /package/node_modules/{typescript → @pinuts/form-builder/node_modules/typescript}/lib/lib.esnext.disposable.d.ts +0 -0
  174. /package/node_modules/{typescript → @pinuts/form-builder/node_modules/typescript}/lib/lib.esnext.full.d.ts +0 -0
  175. /package/node_modules/{typescript → @pinuts/form-builder/node_modules/typescript}/lib/lib.esnext.intl.d.ts +0 -0
  176. /package/node_modules/{typescript → @pinuts/form-builder/node_modules/typescript}/lib/lib.esnext.iterator.d.ts +0 -0
  177. /package/node_modules/{typescript/lib/lib.es2024.object.d.ts → @pinuts/form-builder/node_modules/typescript/lib/lib.esnext.object.d.ts} +0 -0
  178. /package/node_modules/{typescript/lib/lib.es2024.promise.d.ts → @pinuts/form-builder/node_modules/typescript/lib/lib.esnext.promise.d.ts} +0 -0
  179. /package/node_modules/{typescript/lib/lib.es2024.regexp.d.ts → @pinuts/form-builder/node_modules/typescript/lib/lib.esnext.regexp.d.ts} +0 -0
  180. /package/node_modules/{typescript/lib/lib.es2024.string.d.ts → @pinuts/form-builder/node_modules/typescript/lib/lib.esnext.string.d.ts} +0 -0
  181. /package/node_modules/{typescript → @pinuts/form-builder/node_modules/typescript}/lib/lib.scripthost.d.ts +0 -0
  182. /package/node_modules/{typescript → @pinuts/form-builder/node_modules/typescript}/lib/lib.webworker.asynciterable.d.ts +0 -0
  183. /package/node_modules/{typescript → @pinuts/form-builder/node_modules/typescript}/lib/lib.webworker.importscripts.d.ts +0 -0
  184. /package/node_modules/{typescript → @pinuts/form-builder/node_modules/typescript}/lib/lib.webworker.iterable.d.ts +0 -0
  185. /package/node_modules/{typescript → @pinuts/form-builder/node_modules/typescript}/lib/tsserverlibrary.d.ts +0 -0
  186. /package/node_modules/{typescript → @pinuts/form-builder/node_modules/typescript}/lib/tsserverlibrary.js +0 -0
  187. /package/node_modules/{typescript → @pinuts/form-builder/node_modules/typescript}/lib/watchGuard.js +0 -0
  188. /package/node_modules/{@babel/runtime/node_modules/regenerator-runtime → regenerator-runtime}/LICENSE +0 -0
  189. /package/node_modules/{@babel/runtime/node_modules/regenerator-runtime → regenerator-runtime}/README.md +0 -0
  190. /package/node_modules/{@babel/runtime/node_modules/regenerator-runtime → regenerator-runtime}/package.json +0 -0
  191. /package/node_modules/{@babel/runtime/node_modules/regenerator-runtime → regenerator-runtime}/path.js +0 -0
  192. /package/node_modules/{@babel/runtime/node_modules/regenerator-runtime → regenerator-runtime}/runtime.js +0 -0
@@ -5,6 +5,7 @@
5
5
  /// <reference path="global.d.ts" />
6
6
 
7
7
  import * as CSS from "csstype";
8
+ import * as PropTypes from "prop-types";
8
9
 
9
10
  type NativeAnimationEvent = AnimationEvent;
10
11
  type NativeClipboardEvent = ClipboardEvent;
@@ -15,7 +16,6 @@ type NativeKeyboardEvent = KeyboardEvent;
15
16
  type NativeMouseEvent = MouseEvent;
16
17
  type NativeTouchEvent = TouchEvent;
17
18
  type NativePointerEvent = PointerEvent;
18
- type NativeToggleEvent = ToggleEvent;
19
19
  type NativeTransitionEvent = TransitionEvent;
20
20
  type NativeUIEvent = UIEvent;
21
21
  type NativeWheelEvent = WheelEvent;
@@ -33,25 +33,6 @@ 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
-
55
36
  /**
56
37
  * The function returned from an effect passed to {@link React.useEffect useEffect},
57
38
  * which can be used to clean up the effect when the component unmounts.
@@ -112,7 +93,8 @@ declare namespace React {
112
93
  * Represents any user-defined component, either as a function or a class.
113
94
  *
114
95
  * Similar to {@link JSXElementConstructor}, but with extra properties like
115
- * {@link FunctionComponent.defaultProps defaultProps }.
96
+ * {@link FunctionComponent.defaultProps defaultProps } and
97
+ * {@link ComponentClass.contextTypes contextTypes}.
116
98
  *
117
99
  * @template P The props the component accepts.
118
100
  *
@@ -125,18 +107,34 @@ declare namespace React {
125
107
  * Represents any user-defined component, either as a function or a class.
126
108
  *
127
109
  * Similar to {@link ComponentType}, but without extra properties like
128
- * {@link FunctionComponent.defaultProps defaultProps }.
110
+ * {@link FunctionComponent.defaultProps defaultProps } and
111
+ * {@link ComponentClass.contextTypes contextTypes}.
129
112
  *
130
113
  * @template P The props the component accepts.
131
114
  */
132
115
  type JSXElementConstructor<P> =
133
116
  | ((
134
117
  props: P,
118
+ /**
119
+ * @deprecated
120
+ *
121
+ * @see {@link https://legacy.reactjs.org/docs/legacy-context.html#referencing-context-in-stateless-function-components React Docs}
122
+ */
123
+ deprecatedLegacyContext?: any,
135
124
  ) => ReactElement<any, any> | null)
136
- // constructor signature must match React.Component
137
- | (new(props: P) => Component<any, any>);
125
+ | (new(
126
+ props: P,
127
+ /**
128
+ * @deprecated
129
+ *
130
+ * @see {@link https://legacy.reactjs.org/docs/legacy-context.html#referencing-context-in-lifecycle-methods React Docs}
131
+ */
132
+ deprecatedLegacyContext?: any,
133
+ ) => Component<any, any>);
138
134
 
139
135
  /**
136
+ * A readonly ref container where {@link current} cannot be mutated.
137
+ *
140
138
  * Created by {@link createRef}, or {@link useRef} when passed `null`.
141
139
  *
142
140
  * @template T The type of the ref's value.
@@ -153,7 +151,7 @@ declare namespace React {
153
151
  /**
154
152
  * The current value of the ref.
155
153
  */
156
- current: T;
154
+ readonly current: T | null;
157
155
  }
158
156
 
159
157
  interface DO_NOT_USE_OR_YOU_WILL_BE_FIRED_CALLBACK_REF_RETURN_VALUES {
@@ -176,7 +174,6 @@ declare namespace React {
176
174
  instance: T | null,
177
175
  ):
178
176
  | void
179
- | (() => VoidOrUndefinedOnly)
180
177
  | DO_NOT_USE_OR_YOU_WILL_BE_FIRED_CALLBACK_REF_RETURN_VALUES[
181
178
  keyof DO_NOT_USE_OR_YOU_WILL_BE_FIRED_CALLBACK_REF_RETURN_VALUES
182
179
  ];
@@ -189,15 +186,22 @@ declare namespace React {
189
186
  * @see {@link RefObject}
190
187
  */
191
188
 
192
- type Ref<T> = RefCallback<T> | RefObject<T | null> | null;
189
+ type Ref<T> = RefCallback<T> | RefObject<T> | null;
193
190
  /**
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.
191
+ * A legacy implementation of refs where you can pass a string to a ref prop.
192
+ *
193
+ * @see {@link https://react.dev/reference/react/Component#refs React Docs}
194
+ *
195
+ * @example
196
+ *
197
+ * ```tsx
198
+ * <div ref="myRef" />
199
+ * ```
196
200
  */
197
- type LegacyRef<T> = Ref<T>;
201
+ // TODO: Remove the string ref special case from `PropsWithRef` once we remove LegacyRef
202
+ type LegacyRef<T> = string | Ref<T>;
203
+
198
204
  /**
199
- * @deprecated Use `ComponentRef<T>` instead
200
- *
201
205
  * Retrieves the type of the 'ref' prop for a given component type or tag name.
202
206
  *
203
207
  * @template C The component type.
@@ -218,9 +222,17 @@ declare namespace React {
218
222
  C extends
219
223
  | ForwardRefExoticComponent<any>
220
224
  | { new(props: any): Component<any> }
221
- | ((props: any) => ReactElement | null)
225
+ | ((props: any, deprecatedLegacyContext?: any) => ReactElement | null)
222
226
  | keyof JSX.IntrinsicElements,
223
- > = ComponentRef<C>;
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;
224
236
 
225
237
  type ComponentState = any;
226
238
 
@@ -288,7 +300,7 @@ declare namespace React {
288
300
  *
289
301
  * @see {@link https://react.dev/learn/referencing-values-with-refs#refs-and-the-dom React Docs}
290
302
  */
291
- ref?: Ref<T> | undefined;
303
+ ref?: LegacyRef<T> | undefined;
292
304
  }
293
305
 
294
306
  /**
@@ -313,7 +325,7 @@ declare namespace React {
313
325
  * ```
314
326
  */
315
327
  interface ReactElement<
316
- P = unknown,
328
+ P = any,
317
329
  T extends string | JSXElementConstructor<any> = string | JSXElementConstructor<any>,
318
330
  > {
319
331
  type: T;
@@ -329,28 +341,13 @@ declare namespace React {
329
341
  P = Pick<ComponentProps<T>, Exclude<keyof ComponentProps<T>, "key" | "ref">>,
330
342
  > extends ReactElement<P, Exclude<T, number>> {}
331
343
 
332
- /**
333
- * @deprecated Use `ReactElement<P, React.FunctionComponent<P>>`
334
- */
335
344
  interface FunctionComponentElement<P> extends ReactElement<P, FunctionComponent<P>> {
336
- /**
337
- * @deprecated Use `element.props.ref` instead.
338
- */
339
345
  ref?: ("ref" extends keyof P ? P extends { ref?: infer R | undefined } ? R : never : never) | undefined;
340
346
  }
341
347
 
342
- /**
343
- * @deprecated Use `ReactElement<P, React.ComponentClass<P>>`
344
- */
345
348
  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
- /**
351
- * @deprecated Use `element.props.ref` instead.
352
- */
353
- ref?: Ref<T> | undefined;
350
+ ref?: LegacyRef<T> | undefined;
354
351
  }
355
352
 
356
353
  /**
@@ -359,34 +356,89 @@ declare namespace React {
359
356
  type ClassicElement<P> = CElement<P, ClassicComponent<P, ComponentState>>;
360
357
 
361
358
  // string fallback for custom web-components
362
- /**
363
- * @deprecated Use `ReactElement<P, string>`
364
- */
365
359
  interface DOMElement<P extends HTMLAttributes<T> | SVGAttributes<T>, T extends Element>
366
360
  extends ReactElement<P, string>
367
361
  {
368
- /**
369
- * @deprecated Use `element.props.ref` instead.
370
- */
371
- ref: Ref<T>;
362
+ ref: LegacyRef<T>;
372
363
  }
373
364
 
374
365
  // ReactHTML for ReactHTMLElement
375
366
  interface ReactHTMLElement<T extends HTMLElement> extends DetailedReactHTMLElement<AllHTMLAttributes<T>, T> {}
376
367
 
377
368
  interface DetailedReactHTMLElement<P extends HTMLAttributes<T>, T extends HTMLElement> extends DOMElement<P, T> {
378
- type: HTMLElementType;
369
+ type: keyof ReactHTML;
379
370
  }
380
371
 
381
372
  // ReactSVG for ReactSVGElement
382
373
  interface ReactSVGElement extends DOMElement<SVGAttributes<SVGElement>, SVGElement> {
383
- type: SVGElementType;
374
+ type: keyof ReactSVG;
384
375
  }
385
376
 
386
377
  interface ReactPortal extends ReactElement {
387
378
  children: ReactNode;
388
379
  }
389
380
 
381
+ //
382
+ // Factories
383
+ // ----------------------------------------------------------------------
384
+
385
+ type Factory<P> = (props?: Attributes & P, ...children: ReactNode[]) => ReactElement<P>;
386
+
387
+ /**
388
+ * @deprecated Please use `FunctionComponentFactory`
389
+ */
390
+ type SFCFactory<P> = FunctionComponentFactory<P>;
391
+
392
+ type FunctionComponentFactory<P> = (
393
+ props?: Attributes & P,
394
+ ...children: ReactNode[]
395
+ ) => FunctionComponentElement<P>;
396
+
397
+ type ComponentFactory<P, T extends Component<P, ComponentState>> = (
398
+ props?: ClassAttributes<T> & P,
399
+ ...children: ReactNode[]
400
+ ) => CElement<P, T>;
401
+
402
+ type CFactory<P, T extends Component<P, ComponentState>> = ComponentFactory<P, T>;
403
+ type ClassicFactory<P> = CFactory<P, ClassicComponent<P, ComponentState>>;
404
+
405
+ type DOMFactory<P extends DOMAttributes<T>, T extends Element> = (
406
+ props?: ClassAttributes<T> & P | null,
407
+ ...children: ReactNode[]
408
+ ) => DOMElement<P, T>;
409
+
410
+ interface HTMLFactory<T extends HTMLElement> extends DetailedHTMLFactory<AllHTMLAttributes<T>, T> {}
411
+
412
+ interface DetailedHTMLFactory<P extends HTMLAttributes<T>, T extends HTMLElement> extends DOMFactory<P, T> {
413
+ (props?: ClassAttributes<T> & P | null, ...children: ReactNode[]): DetailedReactHTMLElement<P, T>;
414
+ }
415
+
416
+ interface SVGFactory extends DOMFactory<SVGAttributes<SVGElement>, SVGElement> {
417
+ (
418
+ props?: ClassAttributes<SVGElement> & SVGAttributes<SVGElement> | null,
419
+ ...children: ReactNode[]
420
+ ): ReactSVGElement;
421
+ }
422
+
423
+ /**
424
+ * @deprecated - This type is not relevant when using React. Inline the type instead to make the intent clear.
425
+ */
426
+ type ReactText = string | number;
427
+ /**
428
+ * @deprecated - This type is not relevant when using React. Inline the type instead to make the intent clear.
429
+ */
430
+ type ReactChild = ReactElement | string | number;
431
+
432
+ /**
433
+ * @deprecated Use either `ReactNode[]` if you need an array or `Iterable<ReactNode>` if its passed to a host component.
434
+ */
435
+ interface ReactNodeArray extends ReadonlyArray<ReactNode> {}
436
+ /**
437
+ * WARNING: Not related to `React.Fragment`.
438
+ * @deprecated This type is not relevant when using React. Inline the type instead to make the intent clear.
439
+ */
440
+ type ReactFragment = Iterable<ReactNode>;
441
+
390
442
  /**
391
443
  * For internal usage only.
392
444
  * Different release channels declare additional types of ReactNode this particular release channel accepts.
@@ -428,7 +480,6 @@ declare namespace React {
428
480
  | ReactElement
429
481
  | string
430
482
  | number
431
- | bigint
432
483
  | Iterable<ReactNode>
433
484
  | ReactPortal
434
485
  | boolean
@@ -436,13 +487,36 @@ declare namespace React {
436
487
  | undefined
437
488
  | DO_NOT_USE_OR_YOU_WILL_BE_FIRED_EXPERIMENTAL_REACT_NODES[
438
489
  keyof DO_NOT_USE_OR_YOU_WILL_BE_FIRED_EXPERIMENTAL_REACT_NODES
439
- ]
440
- | Promise<AwaitedReactNode>;
490
+ ];
441
491
 
442
492
  //
443
493
  // Top Level API
444
494
  // ----------------------------------------------------------------------
445
495
 
496
+ // DOM Elements
497
+ /** @deprecated */
498
+ function createFactory<T extends HTMLElement>(
499
+ type: keyof ReactHTML,
500
+ ): HTMLFactory<T>;
501
+ /** @deprecated */
502
+ function createFactory(
503
+ type: keyof ReactSVG,
504
+ ): SVGFactory;
505
+ /** @deprecated */
506
+ function createFactory<P extends DOMAttributes<T>, T extends Element>(
507
+ type: string,
508
+ ): DOMFactory<P, T>;
509
+
510
+ // Custom components
511
+ /** @deprecated */
512
+ function createFactory<P>(type: FunctionComponent<P>): FunctionComponentFactory<P>;
513
+ /** @deprecated */
514
+ function createFactory<P, T extends Component<P, ComponentState>, C extends ComponentClass<P>>(
515
+ type: ClassType<P, T, C>,
516
+ ): CFactory<P, T>;
517
+ /** @deprecated */
518
+ function createFactory<P>(type: ComponentClass<P>): Factory<P>;
519
+
446
520
  // DOM Elements
447
521
  // TODO: generalize this to everything in `keyof ReactHTML`, not just "input"
448
522
  function createElement(
@@ -451,12 +525,12 @@ declare namespace React {
451
525
  ...children: ReactNode[]
452
526
  ): DetailedReactHTMLElement<InputHTMLAttributes<HTMLInputElement>, HTMLInputElement>;
453
527
  function createElement<P extends HTMLAttributes<T>, T extends HTMLElement>(
454
- type: HTMLElementType,
528
+ type: keyof ReactHTML,
455
529
  props?: ClassAttributes<T> & P | null,
456
530
  ...children: ReactNode[]
457
531
  ): DetailedReactHTMLElement<P, T>;
458
532
  function createElement<P extends SVGAttributes<T>, T extends SVGElement>(
459
- type: SVGElementType,
533
+ type: keyof ReactSVG,
460
534
  props?: ClassAttributes<T> & P | null,
461
535
  ...children: ReactNode[]
462
536
  ): ReactSVGElement;
@@ -585,6 +659,7 @@ declare namespace React {
585
659
  * @template P The props the component accepts.
586
660
  */
587
661
  interface ProviderExoticComponent<P> extends ExoticComponent<P> {
662
+ propTypes?: WeakValidationMap<P> | undefined;
588
663
  }
589
664
 
590
665
  /**
@@ -666,7 +741,7 @@ declare namespace React {
666
741
  * const ThemeContext = createContext('light');
667
742
  * ```
668
743
  */
669
- interface Context<T> extends Provider<T> {
744
+ interface Context<T> {
670
745
  Provider: Provider<T>;
671
746
  Consumer: Consumer<T>;
672
747
  /**
@@ -695,13 +770,6 @@ declare namespace React {
695
770
  * import { createContext } from 'react';
696
771
  *
697
772
  * const ThemeContext = createContext('light');
698
- * function App() {
699
- * return (
700
- * <ThemeContext value="dark">
701
- * <Toolbar />
702
- * </ThemeContext>
703
- * );
704
- * }
705
773
  * ```
706
774
  */
707
775
  function createContext<T>(
@@ -712,6 +780,9 @@ declare namespace React {
712
780
 
713
781
  function isValidElement<P>(object: {} | null | undefined): object is ReactElement<P>;
714
782
 
783
+ /**
784
+ * Maintainer's note: Sync with {@link ReactChildren} until {@link ReactChildren} is removed.
785
+ */
715
786
  const Children: {
716
787
  map<T, C>(
717
788
  children: C | readonly C[],
@@ -917,12 +988,6 @@ declare namespace React {
917
988
  */
918
989
  static contextType?: Context<any> | undefined;
919
990
 
920
- /**
921
- * Ignored by React.
922
- * @deprecated Only kept in types for backwards compatibility. Will be removed in a future major release.
923
- */
924
- static propTypes?: any;
925
-
926
991
  /**
927
992
  * If using the new style context, re-declare this in your class to be the
928
993
  * `React.ContextType` of your `static contextType`.
@@ -941,8 +1006,12 @@ declare namespace React {
941
1006
  */
942
1007
  context: unknown;
943
1008
 
944
- // Keep in sync with constructor signature of JSXElementConstructor and ComponentClass.
945
1009
  constructor(props: P);
1010
+ /**
1011
+ * @deprecated
1012
+ * @see {@link https://legacy.reactjs.org/docs/legacy-context.html React Docs}
1013
+ */
1014
+ constructor(props: P, context: any);
946
1015
 
947
1016
  // We MUST keep setState() as a unified signature because it allows proper checking of the method return type.
948
1017
  // See: https://github.com/DefinitelyTyped/DefinitelyTyped/issues/18365#issuecomment-351013257
@@ -957,6 +1026,14 @@ declare namespace React {
957
1026
 
958
1027
  readonly props: Readonly<P>;
959
1028
  state: Readonly<S>;
1029
+ /**
1030
+ * @deprecated
1031
+ *
1032
+ * @see {@link https://legacy.reactjs.org/docs/refs-and-the-dom.html#legacy-api-string-refs Legacy React Docs}
1033
+ */
1034
+ refs: {
1035
+ [key: string]: ReactInstance;
1036
+ };
960
1037
  }
961
1038
 
962
1039
  class PureComponent<P = {}, S = {}, SS = any> extends Component<P, S, SS> {}
@@ -973,6 +1050,10 @@ declare namespace React {
973
1050
  getInitialState?(): S;
974
1051
  }
975
1052
 
1053
+ interface ChildContextProvider<CC> {
1054
+ getChildContext(): CC;
1055
+ }
1056
+
976
1057
  //
977
1058
  // Class Interfaces
978
1059
  // ----------------------------------------------------------------------
@@ -1037,12 +1118,58 @@ declare namespace React {
1037
1118
  * ```
1038
1119
  */
1039
1120
  interface FunctionComponent<P = {}> {
1040
- (props: P): ReactElement<any, any> | null;
1121
+ (
1122
+ props: P,
1123
+ /**
1124
+ * @deprecated
1125
+ *
1126
+ * @see {@link https://legacy.reactjs.org/docs/legacy-context.html#referencing-context-in-lifecycle-methods React Docs}
1127
+ */
1128
+ deprecatedLegacyContext?: any,
1129
+ ): ReactElement<any, any> | null;
1130
+ /**
1131
+ * Used to declare the types of the props accepted by the
1132
+ * component. These types will be checked during rendering
1133
+ * and in development only.
1134
+ *
1135
+ * We recommend using TypeScript instead of checking prop
1136
+ * types at runtime.
1137
+ *
1138
+ * @see {@link https://react.dev/reference/react/Component#static-proptypes React Docs}
1139
+ */
1140
+ propTypes?: WeakValidationMap<P> | undefined;
1041
1141
  /**
1042
- * Ignored by React.
1043
- * @deprecated Only kept in types for backwards compatibility. Will be removed in a future major release.
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}
1044
1148
  */
1045
- propTypes?: any;
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;
1046
1173
  /**
1047
1174
  * Used in debugging messages. You might want to set it
1048
1175
  * explicitly if you want to display a different name for
@@ -1064,6 +1191,38 @@ declare namespace React {
1064
1191
  displayName?: string | undefined;
1065
1192
  }
1066
1193
 
1194
+ /**
1195
+ * @deprecated - Equivalent to {@link React.FunctionComponent}.
1196
+ *
1197
+ * @see {@link React.FunctionComponent}
1198
+ * @alias {@link VoidFunctionComponent}
1199
+ */
1200
+ type VFC<P = {}> = VoidFunctionComponent<P>;
1201
+
1202
+ /**
1203
+ * @deprecated - Equivalent to {@link React.FunctionComponent}.
1204
+ *
1205
+ * @see {@link React.FunctionComponent}
1206
+ */
1207
+ interface VoidFunctionComponent<P = {}> {
1208
+ (
1209
+ props: P,
1210
+ /**
1211
+ * @deprecated
1212
+ *
1213
+ * @see {@link https://legacy.reactjs.org/docs/legacy-context.html#referencing-context-in-lifecycle-methods React Docs}
1214
+ */
1215
+ deprecatedLegacyContext?: any,
1216
+ ): ReactElement<any, any> | null;
1217
+ propTypes?: WeakValidationMap<P> | undefined;
1218
+ contextTypes?: ValidationMap<any> | undefined;
1219
+ /**
1220
+ * @deprecated Use {@link https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Operators/Destructuring_assignment#default_value|default values for destructuring assignments instead}.
1221
+ */
1222
+ defaultProps?: Partial<P> | undefined;
1223
+ displayName?: string | undefined;
1224
+ }
1225
+
1067
1226
  /**
1068
1227
  * The type of the ref received by a {@link ForwardRefRenderFunction}.
1069
1228
  *
@@ -1098,10 +1257,19 @@ declare namespace React {
1098
1257
  */
1099
1258
  displayName?: string | undefined;
1100
1259
  /**
1101
- * Ignored by React.
1102
- * @deprecated Only kept in types for backwards compatibility. Will be removed in a future major release.
1260
+ * defaultProps are not supported on render functions passed to forwardRef.
1261
+ *
1262
+ * @see {@link https://github.com/microsoft/TypeScript/issues/36826 linked GitHub issue} for context
1263
+ * @see {@link https://react.dev/reference/react/Component#static-defaultprops React Docs}
1103
1264
  */
1104
- propTypes?: any;
1265
+ defaultProps?: never | undefined;
1266
+ /**
1267
+ * propTypes are not supported on render functions passed to forwardRef.
1268
+ *
1269
+ * @see {@link https://github.com/microsoft/TypeScript/issues/36826 linked GitHub issue} for context
1270
+ * @see {@link https://react.dev/reference/react/Component#static-proptypes React Docs}
1271
+ */
1272
+ propTypes?: never | undefined;
1105
1273
  }
1106
1274
 
1107
1275
  /**
@@ -1111,14 +1279,48 @@ declare namespace React {
1111
1279
  * @template S The internal state of the component.
1112
1280
  */
1113
1281
  interface ComponentClass<P = {}, S = ComponentState> extends StaticLifecycle<P, S> {
1114
- // constructor signature must match React.Component
1115
- new(props: P): Component<P, S>;
1282
+ new(
1283
+ props: P,
1284
+ /**
1285
+ * @deprecated
1286
+ *
1287
+ * @see {@link https://legacy.reactjs.org/docs/legacy-context.html#referencing-context-in-lifecycle-methods React Docs}
1288
+ */
1289
+ deprecatedLegacyContext?: any,
1290
+ ): Component<P, S>;
1116
1291
  /**
1117
- * Ignored by React.
1118
- * @deprecated Only kept in types for backwards compatibility. Will be removed in a future major release.
1292
+ * Used to declare the types of the props accepted by the
1293
+ * component. These types will be checked during rendering
1294
+ * and in development only.
1295
+ *
1296
+ * We recommend using TypeScript instead of checking prop
1297
+ * types at runtime.
1298
+ *
1299
+ * @see {@link https://react.dev/reference/react/Component#static-proptypes React Docs}
1119
1300
  */
1120
- propTypes?: any;
1301
+ propTypes?: WeakValidationMap<P> | undefined;
1121
1302
  contextType?: Context<any> | undefined;
1303
+ /**
1304
+ * @deprecated use {@link ComponentClass.contextType} instead
1305
+ *
1306
+ * Lets you specify which legacy context is consumed by
1307
+ * this component.
1308
+ *
1309
+ * @see {@link https://legacy.reactjs.org/docs/legacy-context.html Legacy React Docs}
1310
+ */
1311
+ contextTypes?: ValidationMap<any> | undefined;
1312
+ /**
1313
+ * @deprecated
1314
+ *
1315
+ * @see {@link https://legacy.reactjs.org/docs/legacy-context.html#how-to-use-context Legacy React Docs}
1316
+ */
1317
+ childContextTypes?: ValidationMap<any> | undefined;
1318
+ /**
1319
+ * Used to define default values for the props accepted by
1320
+ * the component.
1321
+ *
1322
+ * @see {@link https://react.dev/reference/react/Component#static-defaultprops React Docs}
1323
+ */
1122
1324
  defaultProps?: Partial<P> | undefined;
1123
1325
  /**
1124
1326
  * Used in debugging messages. You might want to set it
@@ -1137,7 +1339,7 @@ declare namespace React {
1137
1339
  * @see {@link https://www.npmjs.com/package/create-react-class `create-react-class` on npm}
1138
1340
  */
1139
1341
  interface ClassicComponentClass<P = {}> extends ComponentClass<P> {
1140
- new(props: P): ClassicComponent<P, ComponentState>;
1342
+ new(props: P, deprecatedLegacyContext?: any): ClassicComponent<P, ComponentState>;
1141
1343
  getDefaultProps?(): P;
1142
1344
  }
1143
1345
 
@@ -1152,7 +1354,7 @@ declare namespace React {
1152
1354
  */
1153
1355
  type ClassType<P, T extends Component<P, ComponentState>, C extends ComponentClass<P>> =
1154
1356
  & C
1155
- & (new(props: P) => T);
1357
+ & (new(props: P, deprecatedLegacyContext?: any) => T);
1156
1358
 
1157
1359
  //
1158
1360
  // Component Specs and Lifecycle
@@ -1176,7 +1378,7 @@ declare namespace React {
1176
1378
  * If false is returned, {@link Component.render}, `componentWillUpdate`
1177
1379
  * and `componentDidUpdate` will not be called.
1178
1380
  */
1179
- shouldComponentUpdate?(nextProps: Readonly<P>, nextState: Readonly<S>): boolean;
1381
+ shouldComponentUpdate?(nextProps: Readonly<P>, nextState: Readonly<S>, nextContext: any): boolean;
1180
1382
  /**
1181
1383
  * Called immediately before a component is destroyed. Perform any necessary cleanup in this method, such as
1182
1384
  * cancelled network requests, or cleaning up any DOM elements created in `componentDidMount`.
@@ -1275,7 +1477,7 @@ declare namespace React {
1275
1477
  * @see {@link https://legacy.reactjs.org/blog/2018/03/27/update-on-async-rendering.html#updating-state-based-on-props}
1276
1478
  * @see {@link https://legacy.reactjs.org/blog/2018/03/27/update-on-async-rendering.html#gradual-migration-path}
1277
1479
  */
1278
- componentWillReceiveProps?(nextProps: Readonly<P>): void;
1480
+ componentWillReceiveProps?(nextProps: Readonly<P>, nextContext: any): void;
1279
1481
  /**
1280
1482
  * Called when the component may be receiving new props.
1281
1483
  * React may call this even if props have not changed, so be sure to compare new and existing
@@ -1293,7 +1495,7 @@ declare namespace React {
1293
1495
  * @see {@link https://legacy.reactjs.org/blog/2018/03/27/update-on-async-rendering.html#updating-state-based-on-props}
1294
1496
  * @see {@link https://legacy.reactjs.org/blog/2018/03/27/update-on-async-rendering.html#gradual-migration-path}
1295
1497
  */
1296
- UNSAFE_componentWillReceiveProps?(nextProps: Readonly<P>): void;
1498
+ UNSAFE_componentWillReceiveProps?(nextProps: Readonly<P>, nextContext: any): void;
1297
1499
  /**
1298
1500
  * Called immediately before rendering when new props or state is received. Not called for the initial render.
1299
1501
  *
@@ -1307,7 +1509,7 @@ declare namespace React {
1307
1509
  * @see {@link https://legacy.reactjs.org/blog/2018/03/27/update-on-async-rendering.html#reading-dom-properties-before-an-update}
1308
1510
  * @see {@link https://legacy.reactjs.org/blog/2018/03/27/update-on-async-rendering.html#gradual-migration-path}
1309
1511
  */
1310
- componentWillUpdate?(nextProps: Readonly<P>, nextState: Readonly<S>): void;
1512
+ componentWillUpdate?(nextProps: Readonly<P>, nextState: Readonly<S>, nextContext: any): void;
1311
1513
  /**
1312
1514
  * Called immediately before rendering when new props or state is received. Not called for the initial render.
1313
1515
  *
@@ -1323,10 +1525,41 @@ declare namespace React {
1323
1525
  * @see {@link https://legacy.reactjs.org/blog/2018/03/27/update-on-async-rendering.html#reading-dom-properties-before-an-update}
1324
1526
  * @see {@link https://legacy.reactjs.org/blog/2018/03/27/update-on-async-rendering.html#gradual-migration-path}
1325
1527
  */
1326
- UNSAFE_componentWillUpdate?(nextProps: Readonly<P>, nextState: Readonly<S>): void;
1528
+ UNSAFE_componentWillUpdate?(nextProps: Readonly<P>, nextState: Readonly<S>, nextContext: any): void;
1529
+ }
1530
+
1531
+ /**
1532
+ * @deprecated
1533
+ *
1534
+ * @see {@link https://legacy.reactjs.org/blog/2016/07/13/mixins-considered-harmful.html Mixins Considered Harmful}
1535
+ */
1536
+ interface Mixin<P, S> extends ComponentLifecycle<P, S> {
1537
+ mixins?: Array<Mixin<P, S>> | undefined;
1538
+ statics?: {
1539
+ [key: string]: any;
1540
+ } | undefined;
1541
+
1542
+ displayName?: string | undefined;
1543
+ propTypes?: ValidationMap<any> | undefined;
1544
+ contextTypes?: ValidationMap<any> | undefined;
1545
+ childContextTypes?: ValidationMap<any> | undefined;
1546
+
1547
+ getDefaultProps?(): P;
1548
+ getInitialState?(): S;
1327
1549
  }
1328
1550
 
1329
- function createRef<T>(): RefObject<T | null>;
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>;
1330
1563
 
1331
1564
  /**
1332
1565
  * The type of the component returned from {@link forwardRef}.
@@ -1337,10 +1570,10 @@ declare namespace React {
1337
1570
  */
1338
1571
  interface ForwardRefExoticComponent<P> extends NamedExoticComponent<P> {
1339
1572
  /**
1340
- * Ignored by React.
1341
- * @deprecated Only kept in types for backwards compatibility. Will be removed in a future major release.
1573
+ * @deprecated Use {@link https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Operators/Destructuring_assignment#default_value|default values for destructuring assignments instead}.
1342
1574
  */
1343
- propTypes?: any;
1575
+ defaultProps?: Partial<P> | undefined;
1576
+ propTypes?: WeakValidationMap<P> | undefined;
1344
1577
  }
1345
1578
 
1346
1579
  /**
@@ -1377,18 +1610,23 @@ declare namespace React {
1377
1610
  /**
1378
1611
  * Omits the 'ref' attribute from the given props object.
1379
1612
  *
1380
- * @template Props The props object type.
1613
+ * @template P The props object type.
1381
1614
  */
1382
- type PropsWithoutRef<Props> =
1615
+ type PropsWithoutRef<P> =
1383
1616
  // Omit would not be sufficient for this. We'd like to avoid unnecessary mapping and need a distributive conditional to support unions.
1384
1617
  // see: https://www.typescriptlang.org/docs/handbook/2/conditional-types.html#distributive-conditional-types
1385
1618
  // https://github.com/Microsoft/TypeScript/issues/28339
1386
- Props extends any ? ("ref" extends keyof Props ? Omit<Props, "ref"> : Props) : Props;
1387
- /**
1388
- * Ensures that the props do not include string ref, which cannot be forwarded
1389
- * @deprecated Use `Props` directly. `PropsWithRef<Props>` is just an alias for `Props`
1390
- */
1391
- type PropsWithRef<Props> = Props;
1619
+ P extends any ? ("ref" extends keyof P ? Omit<P, "ref"> : P) : P;
1620
+ /** Ensures that the props do not include string ref, which cannot be forwarded */
1621
+ type PropsWithRef<P> =
1622
+ // Note: String refs can be forwarded. We can't fix this bug without breaking a bunch of libraries now though.
1623
+ // Just "P extends { ref?: infer R }" looks sufficient, but R will infer as {} if P is {}.
1624
+ "ref" extends keyof P
1625
+ ? P extends { ref?: infer R | undefined }
1626
+ ? string extends R ? PropsWithoutRef<P> & { ref?: Exclude<R, string> | undefined }
1627
+ : P
1628
+ : P
1629
+ : P;
1392
1630
 
1393
1631
  type PropsWithChildren<P = unknown> = P & { children?: ReactNode | undefined };
1394
1632
 
@@ -1420,7 +1658,7 @@ declare namespace React {
1420
1658
  * ```
1421
1659
  */
1422
1660
  type ComponentProps<T extends keyof JSX.IntrinsicElements | JSXElementConstructor<any>> = T extends
1423
- JSXElementConstructor<infer Props> ? Props
1661
+ JSXElementConstructor<infer P> ? P
1424
1662
  : T extends keyof JSX.IntrinsicElements ? JSX.IntrinsicElements[T]
1425
1663
  : {};
1426
1664
 
@@ -1447,11 +1685,9 @@ declare namespace React {
1447
1685
  * type MyComponentPropsWithRef = React.ComponentPropsWithRef<typeof MyComponent>;
1448
1686
  * ```
1449
1687
  */
1450
- type ComponentPropsWithRef<T extends ElementType> = T extends JSXElementConstructor<infer Props>
1451
- // If it's a class i.e. newable we're dealing with a class component
1452
- ? T extends abstract new(args: any) => any ? PropsWithoutRef<Props> & RefAttributes<InstanceType<T>>
1453
- : Props
1454
- : ComponentProps<T>;
1688
+ type ComponentPropsWithRef<T extends ElementType> = T extends (new(props: infer P) => Component<any, any>)
1689
+ ? PropsWithoutRef<P> & RefAttributes<InstanceType<T>>
1690
+ : PropsWithRef<ComponentProps<T>>;
1455
1691
  /**
1456
1692
  * Used to retrieve the props a custom component accepts with its ref.
1457
1693
  *
@@ -1468,10 +1704,9 @@ declare namespace React {
1468
1704
  * type MyComponentPropsWithRef = React.CustomComponentPropsWithRef<typeof MyComponent>;
1469
1705
  * ```
1470
1706
  */
1471
- type CustomComponentPropsWithRef<T extends ComponentType> = T extends JSXElementConstructor<infer Props>
1472
- // If it's a class i.e. newable we're dealing with a class component
1473
- ? T extends abstract new(args: any) => any ? PropsWithoutRef<Props> & RefAttributes<InstanceType<T>>
1474
- : Props
1707
+ type CustomComponentPropsWithRef<T extends ComponentType> = T extends (new(props: infer P) => Component<any, any>)
1708
+ ? (PropsWithoutRef<P> & RefAttributes<InstanceType<T>>)
1709
+ : T extends ((props: infer P, legacyContext?: any) => ReactNode) ? PropsWithRef<P>
1475
1710
  : never;
1476
1711
 
1477
1712
  /**
@@ -1499,24 +1734,10 @@ declare namespace React {
1499
1734
  */
1500
1735
  type ComponentPropsWithoutRef<T extends ElementType> = PropsWithoutRef<ComponentProps<T>>;
1501
1736
 
1502
- /**
1503
- * Retrieves the type of the 'ref' prop for a given component type or tag name.
1504
- *
1505
- * @template C The component type.
1506
- *
1507
- * @example
1508
- *
1509
- * ```tsx
1510
- * type MyComponentRef = React.ComponentRef<typeof MyComponent>;
1511
- * ```
1512
- *
1513
- * @example
1514
- *
1515
- * ```tsx
1516
- * type DivRef = React.ComponentRef<'div'>;
1517
- * ```
1518
- */
1519
- type ComponentRef<T extends ElementType> = ComponentPropsWithRef<T> extends RefAttributes<infer Method> ? Method
1737
+ type ComponentRef<T extends ElementType> = T extends NamedExoticComponent<
1738
+ ComponentPropsWithoutRef<T> & RefAttributes<infer Method>
1739
+ > ? Method
1740
+ : ComponentPropsWithRef<T> extends RefAttributes<infer Method> ? Method
1520
1741
  : never;
1521
1742
 
1522
1743
  // will show `Memo(${Component.displayName || Component.name})` in devtools by default,
@@ -1617,11 +1838,6 @@ declare namespace React {
1617
1838
  * A {@link Dispatch} function can sometimes be called without any arguments.
1618
1839
  */
1619
1840
  type DispatchWithoutAction = () => void;
1620
- // Limit the reducer to accept only 0 or 1 action arguments
1621
- // eslint-disable-next-line @definitelytyped/no-single-element-tuple-type
1622
- type AnyActionArg = [] | [any];
1623
- // Get the dispatch type from the reducer arguments (captures optional action argument correctly)
1624
- type ActionDispatch<ActionArg extends AnyActionArg> = (...args: ActionArg) => void;
1625
1841
  // Unlike redux, the actions _can_ be anything
1626
1842
  type Reducer<S, A> = (prevState: S, action: A) => S;
1627
1843
  // If useReducer accepts a reducer without action, dispatch may be called without any parameters.
@@ -1629,14 +1845,15 @@ declare namespace React {
1629
1845
  // types used to try and prevent the compiler from reducing S
1630
1846
  // to a supertype common with the second argument to useReducer()
1631
1847
  type ReducerState<R extends Reducer<any, any>> = R extends Reducer<infer S, any> ? S : never;
1848
+ type ReducerAction<R extends Reducer<any, any>> = R extends Reducer<any, infer A> ? A : never;
1849
+ // The identity check is done with the SameValue algorithm (Object.is), which is stricter than ===
1850
+ type ReducerStateWithoutAction<R extends ReducerWithoutAction<any>> = R extends ReducerWithoutAction<infer S> ? S
1851
+ : never;
1632
1852
  type DependencyList = readonly unknown[];
1633
1853
 
1634
1854
  // NOTE: callbacks are _only_ allowed to return either void, or a destructor.
1635
1855
  type EffectCallback = () => void | Destructor;
1636
1856
 
1637
- /**
1638
- * @deprecated Use `RefObject` instead.
1639
- */
1640
1857
  interface MutableRefObject<T> {
1641
1858
  current: T;
1642
1859
  }
@@ -1675,10 +1892,12 @@ declare namespace React {
1675
1892
  * @version 16.8.0
1676
1893
  * @see {@link https://react.dev/reference/react/useReducer}
1677
1894
  */
1678
- function useReducer<S, A extends AnyActionArg>(
1679
- reducer: (prevState: S, ...args: A) => S,
1680
- initialState: S,
1681
- ): [S, ActionDispatch<A>];
1895
+ // overload where dispatch could accept 0 arguments.
1896
+ function useReducer<R extends ReducerWithoutAction<any>, I>(
1897
+ reducer: R,
1898
+ initializerArg: I,
1899
+ initializer: (arg: I) => ReducerStateWithoutAction<R>,
1900
+ ): [ReducerStateWithoutAction<R>, DispatchWithoutAction];
1682
1901
  /**
1683
1902
  * An alternative to `useState`.
1684
1903
  *
@@ -1689,10 +1908,12 @@ declare namespace React {
1689
1908
  * @version 16.8.0
1690
1909
  * @see {@link https://react.dev/reference/react/useReducer}
1691
1910
  */
1692
- function useReducer<S, A extends AnyActionArg>(
1693
- reducer: (prevState: S, ...args: A) => S,
1694
- initialState: S,
1695
- ): [S, ActionDispatch<A>];
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];
1696
1917
  /**
1697
1918
  * An alternative to `useState`.
1698
1919
  *
@@ -1703,11 +1924,55 @@ declare namespace React {
1703
1924
  * @version 16.8.0
1704
1925
  * @see {@link https://react.dev/reference/react/useReducer}
1705
1926
  */
1706
- function useReducer<S, I, A extends AnyActionArg>(
1707
- reducer: (prevState: S, ...args: A) => S,
1708
- initialArg: I,
1709
- init: (i: I) => S,
1710
- ): [S, ActionDispatch<A>];
1927
+ // overload where "I" may be a subset of ReducerState<R>; used to provide autocompletion.
1928
+ // If "I" matches ReducerState<R> exactly then the last overload will allow initializer to be omitted.
1929
+ // the last overload effectively behaves as if the identity function (x => x) is the initializer.
1930
+ function useReducer<R extends Reducer<any, any>, I>(
1931
+ reducer: R,
1932
+ initializerArg: I & ReducerState<R>,
1933
+ initializer: (arg: I & ReducerState<R>) => ReducerState<R>,
1934
+ ): [ReducerState<R>, Dispatch<ReducerAction<R>>];
1935
+ /**
1936
+ * An alternative to `useState`.
1937
+ *
1938
+ * `useReducer` is usually preferable to `useState` when you have complex state logic that involves
1939
+ * multiple sub-values. It also lets you optimize performance for components that trigger deep
1940
+ * updates because you can pass `dispatch` down instead of callbacks.
1941
+ *
1942
+ * @version 16.8.0
1943
+ * @see {@link https://react.dev/reference/react/useReducer}
1944
+ */
1945
+ // overload for free "I"; all goes as long as initializer converts it into "ReducerState<R>".
1946
+ function useReducer<R extends Reducer<any, any>, I>(
1947
+ reducer: R,
1948
+ initializerArg: I,
1949
+ initializer: (arg: I) => ReducerState<R>,
1950
+ ): [ReducerState<R>, Dispatch<ReducerAction<R>>];
1951
+ /**
1952
+ * An alternative to `useState`.
1953
+ *
1954
+ * `useReducer` is usually preferable to `useState` when you have complex state logic that involves
1955
+ * multiple sub-values. It also lets you optimize performance for components that trigger deep
1956
+ * updates because you can pass `dispatch` down instead of callbacks.
1957
+ *
1958
+ * @version 16.8.0
1959
+ * @see {@link https://react.dev/reference/react/useReducer}
1960
+ */
1961
+
1962
+ // I'm not sure if I keep this 2-ary or if I make it (2,3)-ary; it's currently (2,3)-ary.
1963
+ // The Flow types do have an overload for 3-ary invocation with undefined initializer.
1964
+
1965
+ // NOTE: without the ReducerState indirection, TypeScript would reduce S to be the most common
1966
+ // supertype between the reducer's return type and the initialState (or the initializer's return type),
1967
+ // which would prevent autocompletion from ever working.
1968
+
1969
+ // TODO: double-check if this weird overload logic is necessary. It is possible it's either a bug
1970
+ // in older versions, or a regression in newer versions of the typescript completion service.
1971
+ function useReducer<R extends Reducer<any, any>>(
1972
+ reducer: R,
1973
+ initialState: ReducerState<R>,
1974
+ initializer?: undefined,
1975
+ ): [ReducerState<R>, Dispatch<ReducerAction<R>>];
1711
1976
  /**
1712
1977
  * `useRef` returns a mutable ref object whose `.current` property is initialized to the passed argument
1713
1978
  * (`initialValue`). The returned object will persist for the full lifetime of the component.
@@ -1718,7 +1983,7 @@ declare namespace React {
1718
1983
  * @version 16.8.0
1719
1984
  * @see {@link https://react.dev/reference/react/useRef}
1720
1985
  */
1721
- function useRef<T>(initialValue: T): RefObject<T>;
1986
+ function useRef<T>(initialValue: T): MutableRefObject<T>;
1722
1987
  // convenience overload for refs given as a ref prop as they typically start with a null value
1723
1988
  /**
1724
1989
  * `useRef` returns a mutable ref object whose `.current` property is initialized to the passed argument
@@ -1727,11 +1992,15 @@ declare namespace React {
1727
1992
  * Note that `useRef()` is useful for more than the `ref` attribute. It’s handy for keeping any mutable
1728
1993
  * value around similar to how you’d use instance fields in classes.
1729
1994
  *
1995
+ * Usage note: if you need the result of useRef to be directly mutable, include `| null` in the type
1996
+ * of the generic argument.
1997
+ *
1730
1998
  * @version 16.8.0
1731
1999
  * @see {@link https://react.dev/reference/react/useRef}
1732
2000
  */
1733
- function useRef<T>(initialValue: T | null): RefObject<T | null>;
1734
- // convenience overload for undefined initialValue
2001
+ function useRef<T>(initialValue: T | null): RefObject<T>;
2002
+ // convenience overload for potentially undefined initialValue / call with 0 arguments
2003
+ // has a default to stop it from defaulting to {} instead
1735
2004
  /**
1736
2005
  * `useRef` returns a mutable ref object whose `.current` property is initialized to the passed argument
1737
2006
  * (`initialValue`). The returned object will persist for the full lifetime of the component.
@@ -1742,7 +2011,7 @@ declare namespace React {
1742
2011
  * @version 16.8.0
1743
2012
  * @see {@link https://react.dev/reference/react/useRef}
1744
2013
  */
1745
- function useRef<T>(initialValue: T | undefined): RefObject<T | undefined>;
2014
+ function useRef<T = undefined>(): MutableRefObject<T | undefined>;
1746
2015
  /**
1747
2016
  * The signature is identical to `useEffect`, but it fires synchronously after all DOM mutations.
1748
2017
  * Use this to read layout from the DOM and synchronously re-render. Updates scheduled inside
@@ -1789,7 +2058,7 @@ declare namespace React {
1789
2058
  */
1790
2059
  // A specific function type would not trigger implicit any.
1791
2060
  // See https://github.com/DefinitelyTyped/DefinitelyTyped/issues/52873#issuecomment-845806435 for a comparison between `Function` and more specific types.
1792
- // eslint-disable-next-line @typescript-eslint/no-unsafe-function-type
2061
+ // eslint-disable-next-line @typescript-eslint/ban-types
1793
2062
  function useCallback<T extends Function>(callback: T, deps: DependencyList): T;
1794
2063
  /**
1795
2064
  * `useMemo` will only recompute the memoized value when one of the `deps` has changed.
@@ -1812,7 +2081,8 @@ declare namespace React {
1812
2081
  // it's just the function name without the "use" prefix.
1813
2082
  function useDebugValue<T>(value: T, format?: (value: T) => any): void;
1814
2083
 
1815
- export type TransitionFunction = () => VoidOrUndefinedOnly | Promise<VoidOrUndefinedOnly>;
2084
+ // must be synchronous
2085
+ export type TransitionFunction = () => VoidOrUndefinedOnly;
1816
2086
  // strange definition to allow vscode to show documentation on the invocation
1817
2087
  export interface TransitionStartFunction {
1818
2088
  /**
@@ -1820,7 +2090,7 @@ declare namespace React {
1820
2090
  *
1821
2091
  * **If some state update causes a component to suspend, that state update should be wrapped in a transition.**
1822
2092
  *
1823
- * @param callback A function which causes state updates that can be deferred.
2093
+ * @param callback A _synchronous_ function which causes state updates that can be deferred.
1824
2094
  */
1825
2095
  (callback: TransitionFunction): void;
1826
2096
  }
@@ -1834,11 +2104,10 @@ declare namespace React {
1834
2104
  * A good example of this is a text input.
1835
2105
  *
1836
2106
  * @param value The value that is going to be deferred
1837
- * @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.
1838
2107
  *
1839
2108
  * @see {@link https://react.dev/reference/react/useDeferredValue}
1840
2109
  */
1841
- export function useDeferredValue<T>(value: T, initialValue?: T): T;
2110
+ export function useDeferredValue<T>(value: T): T;
1842
2111
 
1843
2112
  /**
1844
2113
  * Allows components to avoid undesirable loading states by waiting for content to load
@@ -1860,7 +2129,7 @@ declare namespace React {
1860
2129
  /**
1861
2130
  * Similar to `useTransition` but allows uses where hooks are not available.
1862
2131
  *
1863
- * @param callback A function which causes state updates that can be deferred.
2132
+ * @param callback A _synchronous_ function which causes state updates that can be deferred.
1864
2133
  */
1865
2134
  export function startTransition(scope: TransitionFunction): void;
1866
2135
 
@@ -1875,11 +2144,6 @@ declare namespace React {
1875
2144
  *
1876
2145
  * @see https://reactjs.org/blog/2019/02/06/react-v16.8.0.html#testing-hooks
1877
2146
  */
1878
- // NOTES
1879
- // - the order of these signatures matters - typescript will check the signatures in source order.
1880
- // If the `() => VoidOrUndefinedOnly` signature is first, it'll erroneously match a Promise returning function for users with
1881
- // `strictNullChecks: false`.
1882
- // - VoidOrUndefinedOnly is there to forbid any non-void return values for users with `strictNullChecks: true`
1883
2147
  // While act does always return Thenable, if a void function is passed, we pretend the return value is also void to not trigger dangling Promise lint rules.
1884
2148
  export function act(callback: () => VoidOrUndefinedOnly): void;
1885
2149
  export function act<T>(callback: () => T | Promise<T>): Promise<T>;
@@ -1907,32 +2171,6 @@ declare namespace React {
1907
2171
  getServerSnapshot?: () => Snapshot,
1908
2172
  ): Snapshot;
1909
2173
 
1910
- export function useOptimistic<State>(
1911
- passthrough: State,
1912
- ): [State, (action: State | ((pendingState: State) => State)) => void];
1913
- export function useOptimistic<State, Action>(
1914
- passthrough: State,
1915
- reducer: (state: State, action: Action) => State,
1916
- ): [State, (action: Action) => void];
1917
-
1918
- export type Usable<T> = PromiseLike<T> | Context<T>;
1919
-
1920
- export function use<T>(usable: Usable<T>): T;
1921
-
1922
- export function useActionState<State>(
1923
- action: (state: Awaited<State>) => State | Promise<State>,
1924
- initialState: Awaited<State>,
1925
- permalink?: string,
1926
- ): [state: Awaited<State>, dispatch: () => void, isPending: boolean];
1927
- export function useActionState<State, Payload>(
1928
- action: (state: Awaited<State>, payload: Payload) => State | Promise<State>,
1929
- initialState: Awaited<State>,
1930
- permalink?: string,
1931
- ): [state: Awaited<State>, dispatch: (payload: Payload) => void, isPending: boolean];
1932
-
1933
- // eslint-disable-next-line @typescript-eslint/no-unsafe-function-type
1934
- export function cache<CachedFunction extends Function>(fn: CachedFunction): CachedFunction;
1935
-
1936
2174
  //
1937
2175
  // Event System
1938
2176
  // ----------------------------------------------------------------------
@@ -2100,11 +2338,6 @@ declare namespace React {
2100
2338
  pseudoElement: string;
2101
2339
  }
2102
2340
 
2103
- interface ToggleEvent<T = Element> extends SyntheticEvent<T, NativeToggleEvent> {
2104
- oldState: "closed" | "open";
2105
- newState: "closed" | "open";
2106
- }
2107
-
2108
2341
  interface TransitionEvent<T = Element> extends SyntheticEvent<T, NativeTransitionEvent> {
2109
2342
  elapsedTime: number;
2110
2343
  propertyName: string;
@@ -2132,7 +2365,6 @@ declare namespace React {
2132
2365
  type UIEventHandler<T = Element> = EventHandler<UIEvent<T>>;
2133
2366
  type WheelEventHandler<T = Element> = EventHandler<WheelEvent<T>>;
2134
2367
  type AnimationEventHandler<T = Element> = EventHandler<AnimationEvent<T>>;
2135
- type ToggleEventHandler<T = Element> = EventHandler<ToggleEvent<T>>;
2136
2368
  type TransitionEventHandler<T = Element> = EventHandler<TransitionEvent<T>>;
2137
2369
 
2138
2370
  //
@@ -2346,19 +2578,9 @@ declare namespace React {
2346
2578
  onAnimationIteration?: AnimationEventHandler<T> | undefined;
2347
2579
  onAnimationIterationCapture?: AnimationEventHandler<T> | undefined;
2348
2580
 
2349
- // Toggle Events
2350
- onToggle?: ToggleEventHandler<T> | undefined;
2351
- onBeforeToggle?: ToggleEventHandler<T> | undefined;
2352
-
2353
2581
  // Transition Events
2354
- onTransitionCancel?: TransitionEventHandler<T> | undefined;
2355
- onTransitionCancelCapture?: TransitionEventHandler<T> | undefined;
2356
2582
  onTransitionEnd?: TransitionEventHandler<T> | undefined;
2357
2583
  onTransitionEndCapture?: TransitionEventHandler<T> | undefined;
2358
- onTransitionRun?: TransitionEventHandler<T> | undefined;
2359
- onTransitionRunCapture?: TransitionEventHandler<T> | undefined;
2360
- onTransitionStart?: TransitionEventHandler<T> | undefined;
2361
- onTransitionStartCapture?: TransitionEventHandler<T> | undefined;
2362
2584
  }
2363
2585
 
2364
2586
  export interface CSSProperties extends CSS.Properties<string | number> {
@@ -2678,7 +2900,6 @@ declare namespace React {
2678
2900
 
2679
2901
  // Standard HTML Attributes
2680
2902
  accessKey?: string | undefined;
2681
- autoCapitalize?: "off" | "none" | "on" | "sentences" | "words" | "characters" | undefined | (string & {});
2682
2903
  autoFocus?: boolean | undefined;
2683
2904
  className?: string | undefined;
2684
2905
  contentEditable?: Booleanish | "inherit" | "plaintext-only" | undefined;
@@ -2717,6 +2938,7 @@ declare namespace React {
2717
2938
  vocab?: string | undefined;
2718
2939
 
2719
2940
  // Non-standard Attributes
2941
+ autoCapitalize?: string | undefined;
2720
2942
  autoCorrect?: string | undefined;
2721
2943
  autoSave?: string | undefined;
2722
2944
  color?: string | undefined;
@@ -2729,16 +2951,7 @@ declare namespace React {
2729
2951
  security?: string | undefined;
2730
2952
  unselectable?: "on" | "off" | undefined;
2731
2953
 
2732
- // Popover API
2733
- popover?: "" | "auto" | "manual" | undefined;
2734
- popoverTargetAction?: "toggle" | "show" | "hide" | undefined;
2735
- popoverTarget?: string | undefined;
2736
-
2737
2954
  // Living Standard
2738
- /**
2739
- * @see https://developer.mozilla.org/en-US/docs/Web/API/HTMLElement/inert
2740
- */
2741
- inert?: boolean | undefined;
2742
2955
  /**
2743
2956
  * Hints at the type of data that might be entered by the user while editing the element or its contents
2744
2957
  * @see {@link https://html.spec.whatwg.org/multipage/interaction.html#input-modalities:-the-inputmode-attribute}
@@ -2765,7 +2978,6 @@ declare namespace React {
2765
2978
  action?:
2766
2979
  | string
2767
2980
  | undefined
2768
- | ((formData: FormData) => void | Promise<void>)
2769
2981
  | DO_NOT_USE_OR_YOU_WILL_BE_FIRED_EXPERIMENTAL_FORM_ACTIONS[
2770
2982
  keyof DO_NOT_USE_OR_YOU_WILL_BE_FIRED_EXPERIMENTAL_FORM_ACTIONS
2771
2983
  ];
@@ -2800,7 +3012,6 @@ declare namespace React {
2800
3012
  formAction?:
2801
3013
  | string
2802
3014
  | undefined
2803
- | ((formData: FormData) => void | Promise<void>)
2804
3015
  | DO_NOT_USE_OR_YOU_WILL_BE_FIRED_EXPERIMENTAL_FORM_ACTIONS[
2805
3016
  keyof DO_NOT_USE_OR_YOU_WILL_BE_FIRED_EXPERIMENTAL_FORM_ACTIONS
2806
3017
  ];
@@ -2933,7 +3144,6 @@ declare namespace React {
2933
3144
  form?: string | undefined;
2934
3145
  formAction?:
2935
3146
  | string
2936
- | ((formData: FormData) => void | Promise<void>)
2937
3147
  | DO_NOT_USE_OR_YOU_WILL_BE_FIRED_EXPERIMENTAL_FORM_ACTIONS[
2938
3148
  keyof DO_NOT_USE_OR_YOU_WILL_BE_FIRED_EXPERIMENTAL_FORM_ACTIONS
2939
3149
  ]
@@ -2967,6 +3177,7 @@ declare namespace React {
2967
3177
 
2968
3178
  interface DetailsHTMLAttributes<T> extends HTMLAttributes<T> {
2969
3179
  open?: boolean | undefined;
3180
+ onToggle?: ReactEventHandler<T> | undefined;
2970
3181
  name?: string | undefined;
2971
3182
  }
2972
3183
 
@@ -2999,7 +3210,6 @@ declare namespace React {
2999
3210
  action?:
3000
3211
  | string
3001
3212
  | undefined
3002
- | ((formData: FormData) => void | Promise<void>)
3003
3213
  | DO_NOT_USE_OR_YOU_WILL_BE_FIRED_EXPERIMENTAL_FORM_ACTIONS[
3004
3214
  keyof DO_NOT_USE_OR_YOU_WILL_BE_FIRED_EXPERIMENTAL_FORM_ACTIONS
3005
3215
  ];
@@ -3155,7 +3365,6 @@ declare namespace React {
3155
3365
  form?: string | undefined;
3156
3366
  formAction?:
3157
3367
  | string
3158
- | ((formData: FormData) => void | Promise<void>)
3159
3368
  | DO_NOT_USE_OR_YOU_WILL_BE_FIRED_EXPERIMENTAL_FORM_ACTIONS[
3160
3369
  keyof DO_NOT_USE_OR_YOU_WILL_BE_FIRED_EXPERIMENTAL_FORM_ACTIONS
3161
3370
  ]
@@ -3218,9 +3427,6 @@ declare namespace React {
3218
3427
  sizes?: string | undefined;
3219
3428
  type?: string | undefined;
3220
3429
  charSet?: string | undefined;
3221
-
3222
- // React props
3223
- precedence?: string | undefined;
3224
3430
  }
3225
3431
 
3226
3432
  interface MapHTMLAttributes<T> extends HTMLAttributes<T> {
@@ -3355,10 +3561,6 @@ declare namespace React {
3355
3561
  media?: string | undefined;
3356
3562
  scoped?: boolean | undefined;
3357
3563
  type?: string | undefined;
3358
-
3359
- // React props
3360
- href?: string | undefined;
3361
- precedence?: string | undefined;
3362
3564
  }
3363
3565
 
3364
3566
  interface TableHTMLAttributes<T> extends HTMLAttributes<T> {
@@ -3746,184 +3948,259 @@ declare namespace React {
3746
3948
  webpreferences?: string | undefined;
3747
3949
  }
3748
3950
 
3749
- // TODO: Move to react-dom
3750
- type HTMLElementType =
3751
- | "a"
3752
- | "abbr"
3753
- | "address"
3754
- | "area"
3755
- | "article"
3756
- | "aside"
3757
- | "audio"
3758
- | "b"
3759
- | "base"
3760
- | "bdi"
3761
- | "bdo"
3762
- | "big"
3763
- | "blockquote"
3764
- | "body"
3765
- | "br"
3766
- | "button"
3767
- | "canvas"
3768
- | "caption"
3769
- | "center"
3770
- | "cite"
3771
- | "code"
3772
- | "col"
3773
- | "colgroup"
3774
- | "data"
3775
- | "datalist"
3776
- | "dd"
3777
- | "del"
3778
- | "details"
3779
- | "dfn"
3780
- | "dialog"
3781
- | "div"
3782
- | "dl"
3783
- | "dt"
3784
- | "em"
3785
- | "embed"
3786
- | "fieldset"
3787
- | "figcaption"
3788
- | "figure"
3789
- | "footer"
3790
- | "form"
3791
- | "h1"
3792
- | "h2"
3793
- | "h3"
3794
- | "h4"
3795
- | "h5"
3796
- | "h6"
3797
- | "head"
3798
- | "header"
3799
- | "hgroup"
3800
- | "hr"
3801
- | "html"
3802
- | "i"
3803
- | "iframe"
3804
- | "img"
3805
- | "input"
3806
- | "ins"
3807
- | "kbd"
3808
- | "keygen"
3809
- | "label"
3810
- | "legend"
3811
- | "li"
3812
- | "link"
3813
- | "main"
3814
- | "map"
3815
- | "mark"
3816
- | "menu"
3817
- | "menuitem"
3818
- | "meta"
3819
- | "meter"
3820
- | "nav"
3821
- | "noscript"
3822
- | "object"
3823
- | "ol"
3824
- | "optgroup"
3825
- | "option"
3826
- | "output"
3827
- | "p"
3828
- | "param"
3829
- | "picture"
3830
- | "pre"
3831
- | "progress"
3832
- | "q"
3833
- | "rp"
3834
- | "rt"
3835
- | "ruby"
3836
- | "s"
3837
- | "samp"
3838
- | "search"
3839
- | "slot"
3840
- | "script"
3841
- | "section"
3842
- | "select"
3843
- | "small"
3844
- | "source"
3845
- | "span"
3846
- | "strong"
3847
- | "style"
3848
- | "sub"
3849
- | "summary"
3850
- | "sup"
3851
- | "table"
3852
- | "template"
3853
- | "tbody"
3854
- | "td"
3855
- | "textarea"
3856
- | "tfoot"
3857
- | "th"
3858
- | "thead"
3859
- | "time"
3860
- | "title"
3861
- | "tr"
3862
- | "track"
3863
- | "u"
3864
- | "ul"
3865
- | "var"
3866
- | "video"
3867
- | "wbr"
3868
- | "webview";
3869
-
3870
- // TODO: Move to react-dom
3871
- type SVGElementType =
3872
- | "animate"
3873
- | "circle"
3874
- | "clipPath"
3875
- | "defs"
3876
- | "desc"
3877
- | "ellipse"
3878
- | "feBlend"
3879
- | "feColorMatrix"
3880
- | "feComponentTransfer"
3881
- | "feComposite"
3882
- | "feConvolveMatrix"
3883
- | "feDiffuseLighting"
3884
- | "feDisplacementMap"
3885
- | "feDistantLight"
3886
- | "feDropShadow"
3887
- | "feFlood"
3888
- | "feFuncA"
3889
- | "feFuncB"
3890
- | "feFuncG"
3891
- | "feFuncR"
3892
- | "feGaussianBlur"
3893
- | "feImage"
3894
- | "feMerge"
3895
- | "feMergeNode"
3896
- | "feMorphology"
3897
- | "feOffset"
3898
- | "fePointLight"
3899
- | "feSpecularLighting"
3900
- | "feSpotLight"
3901
- | "feTile"
3902
- | "feTurbulence"
3903
- | "filter"
3904
- | "foreignObject"
3905
- | "g"
3906
- | "image"
3907
- | "line"
3908
- | "linearGradient"
3909
- | "marker"
3910
- | "mask"
3911
- | "metadata"
3912
- | "path"
3913
- | "pattern"
3914
- | "polygon"
3915
- | "polyline"
3916
- | "radialGradient"
3917
- | "rect"
3918
- | "stop"
3919
- | "svg"
3920
- | "switch"
3921
- | "symbol"
3922
- | "text"
3923
- | "textPath"
3924
- | "tspan"
3925
- | "use"
3926
- | "view";
3951
+ //
3952
+ // React.DOM
3953
+ // ----------------------------------------------------------------------
3954
+
3955
+ interface ReactHTML {
3956
+ a: DetailedHTMLFactory<AnchorHTMLAttributes<HTMLAnchorElement>, HTMLAnchorElement>;
3957
+ abbr: DetailedHTMLFactory<HTMLAttributes<HTMLElement>, HTMLElement>;
3958
+ address: DetailedHTMLFactory<HTMLAttributes<HTMLElement>, HTMLElement>;
3959
+ area: DetailedHTMLFactory<AreaHTMLAttributes<HTMLAreaElement>, HTMLAreaElement>;
3960
+ article: DetailedHTMLFactory<HTMLAttributes<HTMLElement>, HTMLElement>;
3961
+ aside: DetailedHTMLFactory<HTMLAttributes<HTMLElement>, HTMLElement>;
3962
+ audio: DetailedHTMLFactory<AudioHTMLAttributes<HTMLAudioElement>, HTMLAudioElement>;
3963
+ b: DetailedHTMLFactory<HTMLAttributes<HTMLElement>, HTMLElement>;
3964
+ base: DetailedHTMLFactory<BaseHTMLAttributes<HTMLBaseElement>, HTMLBaseElement>;
3965
+ bdi: DetailedHTMLFactory<HTMLAttributes<HTMLElement>, HTMLElement>;
3966
+ bdo: DetailedHTMLFactory<HTMLAttributes<HTMLElement>, HTMLElement>;
3967
+ big: DetailedHTMLFactory<HTMLAttributes<HTMLElement>, HTMLElement>;
3968
+ blockquote: DetailedHTMLFactory<BlockquoteHTMLAttributes<HTMLQuoteElement>, HTMLQuoteElement>;
3969
+ body: DetailedHTMLFactory<HTMLAttributes<HTMLBodyElement>, HTMLBodyElement>;
3970
+ br: DetailedHTMLFactory<HTMLAttributes<HTMLBRElement>, HTMLBRElement>;
3971
+ button: DetailedHTMLFactory<ButtonHTMLAttributes<HTMLButtonElement>, HTMLButtonElement>;
3972
+ canvas: DetailedHTMLFactory<CanvasHTMLAttributes<HTMLCanvasElement>, HTMLCanvasElement>;
3973
+ caption: DetailedHTMLFactory<HTMLAttributes<HTMLElement>, HTMLElement>;
3974
+ center: DetailedHTMLFactory<HTMLAttributes<HTMLElement>, HTMLElement>;
3975
+ cite: DetailedHTMLFactory<HTMLAttributes<HTMLElement>, HTMLElement>;
3976
+ code: DetailedHTMLFactory<HTMLAttributes<HTMLElement>, HTMLElement>;
3977
+ col: DetailedHTMLFactory<ColHTMLAttributes<HTMLTableColElement>, HTMLTableColElement>;
3978
+ colgroup: DetailedHTMLFactory<ColgroupHTMLAttributes<HTMLTableColElement>, HTMLTableColElement>;
3979
+ data: DetailedHTMLFactory<DataHTMLAttributes<HTMLDataElement>, HTMLDataElement>;
3980
+ datalist: DetailedHTMLFactory<HTMLAttributes<HTMLDataListElement>, HTMLDataListElement>;
3981
+ dd: DetailedHTMLFactory<HTMLAttributes<HTMLElement>, HTMLElement>;
3982
+ del: DetailedHTMLFactory<DelHTMLAttributes<HTMLModElement>, HTMLModElement>;
3983
+ details: DetailedHTMLFactory<DetailsHTMLAttributes<HTMLDetailsElement>, HTMLDetailsElement>;
3984
+ dfn: DetailedHTMLFactory<HTMLAttributes<HTMLElement>, HTMLElement>;
3985
+ dialog: DetailedHTMLFactory<DialogHTMLAttributes<HTMLDialogElement>, HTMLDialogElement>;
3986
+ div: DetailedHTMLFactory<HTMLAttributes<HTMLDivElement>, HTMLDivElement>;
3987
+ dl: DetailedHTMLFactory<HTMLAttributes<HTMLDListElement>, HTMLDListElement>;
3988
+ dt: DetailedHTMLFactory<HTMLAttributes<HTMLElement>, HTMLElement>;
3989
+ em: DetailedHTMLFactory<HTMLAttributes<HTMLElement>, HTMLElement>;
3990
+ embed: DetailedHTMLFactory<EmbedHTMLAttributes<HTMLEmbedElement>, HTMLEmbedElement>;
3991
+ fieldset: DetailedHTMLFactory<FieldsetHTMLAttributes<HTMLFieldSetElement>, HTMLFieldSetElement>;
3992
+ figcaption: DetailedHTMLFactory<HTMLAttributes<HTMLElement>, HTMLElement>;
3993
+ figure: DetailedHTMLFactory<HTMLAttributes<HTMLElement>, HTMLElement>;
3994
+ footer: DetailedHTMLFactory<HTMLAttributes<HTMLElement>, HTMLElement>;
3995
+ form: DetailedHTMLFactory<FormHTMLAttributes<HTMLFormElement>, HTMLFormElement>;
3996
+ h1: DetailedHTMLFactory<HTMLAttributes<HTMLHeadingElement>, HTMLHeadingElement>;
3997
+ h2: DetailedHTMLFactory<HTMLAttributes<HTMLHeadingElement>, HTMLHeadingElement>;
3998
+ h3: DetailedHTMLFactory<HTMLAttributes<HTMLHeadingElement>, HTMLHeadingElement>;
3999
+ h4: DetailedHTMLFactory<HTMLAttributes<HTMLHeadingElement>, HTMLHeadingElement>;
4000
+ h5: DetailedHTMLFactory<HTMLAttributes<HTMLHeadingElement>, HTMLHeadingElement>;
4001
+ h6: DetailedHTMLFactory<HTMLAttributes<HTMLHeadingElement>, HTMLHeadingElement>;
4002
+ head: DetailedHTMLFactory<HTMLAttributes<HTMLElement>, HTMLHeadElement>;
4003
+ header: DetailedHTMLFactory<HTMLAttributes<HTMLElement>, HTMLElement>;
4004
+ hgroup: DetailedHTMLFactory<HTMLAttributes<HTMLElement>, HTMLElement>;
4005
+ hr: DetailedHTMLFactory<HTMLAttributes<HTMLHRElement>, HTMLHRElement>;
4006
+ html: DetailedHTMLFactory<HtmlHTMLAttributes<HTMLHtmlElement>, HTMLHtmlElement>;
4007
+ i: DetailedHTMLFactory<HTMLAttributes<HTMLElement>, HTMLElement>;
4008
+ iframe: DetailedHTMLFactory<IframeHTMLAttributes<HTMLIFrameElement>, HTMLIFrameElement>;
4009
+ img: DetailedHTMLFactory<ImgHTMLAttributes<HTMLImageElement>, HTMLImageElement>;
4010
+ input: DetailedHTMLFactory<InputHTMLAttributes<HTMLInputElement>, HTMLInputElement>;
4011
+ ins: DetailedHTMLFactory<InsHTMLAttributes<HTMLModElement>, HTMLModElement>;
4012
+ kbd: DetailedHTMLFactory<HTMLAttributes<HTMLElement>, HTMLElement>;
4013
+ keygen: DetailedHTMLFactory<KeygenHTMLAttributes<HTMLElement>, HTMLElement>;
4014
+ label: DetailedHTMLFactory<LabelHTMLAttributes<HTMLLabelElement>, HTMLLabelElement>;
4015
+ legend: DetailedHTMLFactory<HTMLAttributes<HTMLLegendElement>, HTMLLegendElement>;
4016
+ li: DetailedHTMLFactory<LiHTMLAttributes<HTMLLIElement>, HTMLLIElement>;
4017
+ link: DetailedHTMLFactory<LinkHTMLAttributes<HTMLLinkElement>, HTMLLinkElement>;
4018
+ main: DetailedHTMLFactory<HTMLAttributes<HTMLElement>, HTMLElement>;
4019
+ map: DetailedHTMLFactory<MapHTMLAttributes<HTMLMapElement>, HTMLMapElement>;
4020
+ mark: DetailedHTMLFactory<HTMLAttributes<HTMLElement>, HTMLElement>;
4021
+ menu: DetailedHTMLFactory<MenuHTMLAttributes<HTMLElement>, HTMLElement>;
4022
+ menuitem: DetailedHTMLFactory<HTMLAttributes<HTMLElement>, HTMLElement>;
4023
+ meta: DetailedHTMLFactory<MetaHTMLAttributes<HTMLMetaElement>, HTMLMetaElement>;
4024
+ meter: DetailedHTMLFactory<MeterHTMLAttributes<HTMLMeterElement>, HTMLMeterElement>;
4025
+ nav: DetailedHTMLFactory<HTMLAttributes<HTMLElement>, HTMLElement>;
4026
+ noscript: DetailedHTMLFactory<HTMLAttributes<HTMLElement>, HTMLElement>;
4027
+ object: DetailedHTMLFactory<ObjectHTMLAttributes<HTMLObjectElement>, HTMLObjectElement>;
4028
+ ol: DetailedHTMLFactory<OlHTMLAttributes<HTMLOListElement>, HTMLOListElement>;
4029
+ optgroup: DetailedHTMLFactory<OptgroupHTMLAttributes<HTMLOptGroupElement>, HTMLOptGroupElement>;
4030
+ option: DetailedHTMLFactory<OptionHTMLAttributes<HTMLOptionElement>, HTMLOptionElement>;
4031
+ output: DetailedHTMLFactory<OutputHTMLAttributes<HTMLOutputElement>, HTMLOutputElement>;
4032
+ p: DetailedHTMLFactory<HTMLAttributes<HTMLParagraphElement>, HTMLParagraphElement>;
4033
+ param: DetailedHTMLFactory<ParamHTMLAttributes<HTMLParamElement>, HTMLParamElement>;
4034
+ picture: DetailedHTMLFactory<HTMLAttributes<HTMLElement>, HTMLElement>;
4035
+ pre: DetailedHTMLFactory<HTMLAttributes<HTMLPreElement>, HTMLPreElement>;
4036
+ progress: DetailedHTMLFactory<ProgressHTMLAttributes<HTMLProgressElement>, HTMLProgressElement>;
4037
+ q: DetailedHTMLFactory<QuoteHTMLAttributes<HTMLQuoteElement>, HTMLQuoteElement>;
4038
+ rp: DetailedHTMLFactory<HTMLAttributes<HTMLElement>, HTMLElement>;
4039
+ rt: DetailedHTMLFactory<HTMLAttributes<HTMLElement>, HTMLElement>;
4040
+ ruby: DetailedHTMLFactory<HTMLAttributes<HTMLElement>, HTMLElement>;
4041
+ s: DetailedHTMLFactory<HTMLAttributes<HTMLElement>, HTMLElement>;
4042
+ samp: DetailedHTMLFactory<HTMLAttributes<HTMLElement>, HTMLElement>;
4043
+ search: DetailedHTMLFactory<HTMLAttributes<HTMLElement>, HTMLElement>;
4044
+ slot: DetailedHTMLFactory<SlotHTMLAttributes<HTMLSlotElement>, HTMLSlotElement>;
4045
+ script: DetailedHTMLFactory<ScriptHTMLAttributes<HTMLScriptElement>, HTMLScriptElement>;
4046
+ section: DetailedHTMLFactory<HTMLAttributes<HTMLElement>, HTMLElement>;
4047
+ select: DetailedHTMLFactory<SelectHTMLAttributes<HTMLSelectElement>, HTMLSelectElement>;
4048
+ small: DetailedHTMLFactory<HTMLAttributes<HTMLElement>, HTMLElement>;
4049
+ source: DetailedHTMLFactory<SourceHTMLAttributes<HTMLSourceElement>, HTMLSourceElement>;
4050
+ span: DetailedHTMLFactory<HTMLAttributes<HTMLSpanElement>, HTMLSpanElement>;
4051
+ strong: DetailedHTMLFactory<HTMLAttributes<HTMLElement>, HTMLElement>;
4052
+ style: DetailedHTMLFactory<StyleHTMLAttributes<HTMLStyleElement>, HTMLStyleElement>;
4053
+ sub: DetailedHTMLFactory<HTMLAttributes<HTMLElement>, HTMLElement>;
4054
+ summary: DetailedHTMLFactory<HTMLAttributes<HTMLElement>, HTMLElement>;
4055
+ sup: DetailedHTMLFactory<HTMLAttributes<HTMLElement>, HTMLElement>;
4056
+ table: DetailedHTMLFactory<TableHTMLAttributes<HTMLTableElement>, HTMLTableElement>;
4057
+ template: DetailedHTMLFactory<HTMLAttributes<HTMLTemplateElement>, HTMLTemplateElement>;
4058
+ tbody: DetailedHTMLFactory<HTMLAttributes<HTMLTableSectionElement>, HTMLTableSectionElement>;
4059
+ td: DetailedHTMLFactory<TdHTMLAttributes<HTMLTableDataCellElement>, HTMLTableDataCellElement>;
4060
+ textarea: DetailedHTMLFactory<TextareaHTMLAttributes<HTMLTextAreaElement>, HTMLTextAreaElement>;
4061
+ tfoot: DetailedHTMLFactory<HTMLAttributes<HTMLTableSectionElement>, HTMLTableSectionElement>;
4062
+ th: DetailedHTMLFactory<ThHTMLAttributes<HTMLTableHeaderCellElement>, HTMLTableHeaderCellElement>;
4063
+ thead: DetailedHTMLFactory<HTMLAttributes<HTMLTableSectionElement>, HTMLTableSectionElement>;
4064
+ time: DetailedHTMLFactory<TimeHTMLAttributes<HTMLTimeElement>, HTMLTimeElement>;
4065
+ title: DetailedHTMLFactory<HTMLAttributes<HTMLTitleElement>, HTMLTitleElement>;
4066
+ tr: DetailedHTMLFactory<HTMLAttributes<HTMLTableRowElement>, HTMLTableRowElement>;
4067
+ track: DetailedHTMLFactory<TrackHTMLAttributes<HTMLTrackElement>, HTMLTrackElement>;
4068
+ u: DetailedHTMLFactory<HTMLAttributes<HTMLElement>, HTMLElement>;
4069
+ ul: DetailedHTMLFactory<HTMLAttributes<HTMLUListElement>, HTMLUListElement>;
4070
+ "var": DetailedHTMLFactory<HTMLAttributes<HTMLElement>, HTMLElement>;
4071
+ video: DetailedHTMLFactory<VideoHTMLAttributes<HTMLVideoElement>, HTMLVideoElement>;
4072
+ wbr: DetailedHTMLFactory<HTMLAttributes<HTMLElement>, HTMLElement>;
4073
+ webview: DetailedHTMLFactory<WebViewHTMLAttributes<HTMLWebViewElement>, HTMLWebViewElement>;
4074
+ }
4075
+
4076
+ interface ReactSVG {
4077
+ animate: SVGFactory;
4078
+ circle: SVGFactory;
4079
+ clipPath: SVGFactory;
4080
+ defs: SVGFactory;
4081
+ desc: SVGFactory;
4082
+ ellipse: SVGFactory;
4083
+ feBlend: SVGFactory;
4084
+ feColorMatrix: SVGFactory;
4085
+ feComponentTransfer: SVGFactory;
4086
+ feComposite: SVGFactory;
4087
+ feConvolveMatrix: SVGFactory;
4088
+ feDiffuseLighting: SVGFactory;
4089
+ feDisplacementMap: SVGFactory;
4090
+ feDistantLight: SVGFactory;
4091
+ feDropShadow: SVGFactory;
4092
+ feFlood: SVGFactory;
4093
+ feFuncA: SVGFactory;
4094
+ feFuncB: SVGFactory;
4095
+ feFuncG: SVGFactory;
4096
+ feFuncR: SVGFactory;
4097
+ feGaussianBlur: SVGFactory;
4098
+ feImage: SVGFactory;
4099
+ feMerge: SVGFactory;
4100
+ feMergeNode: SVGFactory;
4101
+ feMorphology: SVGFactory;
4102
+ feOffset: SVGFactory;
4103
+ fePointLight: SVGFactory;
4104
+ feSpecularLighting: SVGFactory;
4105
+ feSpotLight: SVGFactory;
4106
+ feTile: SVGFactory;
4107
+ feTurbulence: SVGFactory;
4108
+ filter: SVGFactory;
4109
+ foreignObject: SVGFactory;
4110
+ g: SVGFactory;
4111
+ image: SVGFactory;
4112
+ line: SVGFactory;
4113
+ linearGradient: SVGFactory;
4114
+ marker: SVGFactory;
4115
+ mask: SVGFactory;
4116
+ metadata: SVGFactory;
4117
+ path: SVGFactory;
4118
+ pattern: SVGFactory;
4119
+ polygon: SVGFactory;
4120
+ polyline: SVGFactory;
4121
+ radialGradient: SVGFactory;
4122
+ rect: SVGFactory;
4123
+ stop: SVGFactory;
4124
+ svg: SVGFactory;
4125
+ switch: SVGFactory;
4126
+ symbol: SVGFactory;
4127
+ text: SVGFactory;
4128
+ textPath: SVGFactory;
4129
+ tspan: SVGFactory;
4130
+ use: SVGFactory;
4131
+ view: SVGFactory;
4132
+ }
4133
+
4134
+ interface ReactDOM extends ReactHTML, ReactSVG {}
4135
+
4136
+ //
4137
+ // React.PropTypes
4138
+ // ----------------------------------------------------------------------
4139
+
4140
+ /**
4141
+ * @deprecated Use `Validator` from the ´prop-types` instead.
4142
+ */
4143
+ type Validator<T> = PropTypes.Validator<T>;
4144
+
4145
+ /**
4146
+ * @deprecated Use `Requireable` from the ´prop-types` instead.
4147
+ */
4148
+ type Requireable<T> = PropTypes.Requireable<T>;
4149
+
4150
+ /**
4151
+ * @deprecated Use `ValidationMap` from the ´prop-types` instead.
4152
+ */
4153
+ type ValidationMap<T> = PropTypes.ValidationMap<T>;
4154
+
4155
+ /**
4156
+ * @deprecated Use `WeakValidationMap` from the ´prop-types` instead.
4157
+ */
4158
+ type WeakValidationMap<T> = {
4159
+ [K in keyof T]?: null extends T[K] ? Validator<T[K] | null | undefined>
4160
+ : undefined extends T[K] ? Validator<T[K] | null | undefined>
4161
+ : Validator<T[K]>;
4162
+ };
4163
+
4164
+ /**
4165
+ * @deprecated Use `PropTypes.*` where `PropTypes` comes from `import * as PropTypes from 'prop-types'` instead.
4166
+ */
4167
+ interface ReactPropTypes {
4168
+ any: typeof PropTypes.any;
4169
+ array: typeof PropTypes.array;
4170
+ bool: typeof PropTypes.bool;
4171
+ func: typeof PropTypes.func;
4172
+ number: typeof PropTypes.number;
4173
+ object: typeof PropTypes.object;
4174
+ string: typeof PropTypes.string;
4175
+ node: typeof PropTypes.node;
4176
+ element: typeof PropTypes.element;
4177
+ instanceOf: typeof PropTypes.instanceOf;
4178
+ oneOf: typeof PropTypes.oneOf;
4179
+ oneOfType: typeof PropTypes.oneOfType;
4180
+ arrayOf: typeof PropTypes.arrayOf;
4181
+ objectOf: typeof PropTypes.objectOf;
4182
+ shape: typeof PropTypes.shape;
4183
+ exact: typeof PropTypes.exact;
4184
+ }
4185
+
4186
+ //
4187
+ // React.Children
4188
+ // ----------------------------------------------------------------------
4189
+
4190
+ /**
4191
+ * @deprecated - Use `typeof React.Children` instead.
4192
+ */
4193
+ // Sync with type of `const Children`.
4194
+ interface ReactChildren {
4195
+ map<T, C>(
4196
+ children: C | readonly C[],
4197
+ fn: (child: C, index: number) => T,
4198
+ ): C extends null | undefined ? C : Array<Exclude<T, boolean | null | undefined>>;
4199
+ forEach<C>(children: C | readonly C[], fn: (child: C, index: number) => void): void;
4200
+ count(children: any): number;
4201
+ only<C>(children: C): C extends any[] ? never : C;
4202
+ toArray(children: ReactNode | ReactNode[]): Array<Exclude<ReactNode, boolean | null | undefined>>;
4203
+ }
3927
4204
 
3928
4205
  //
3929
4206
  // Browser Interfaces
@@ -3965,6 +4242,67 @@ declare namespace React {
3965
4242
  }
3966
4243
 
3967
4244
  // Keep in sync with JSX namespace in ./jsx-runtime.d.ts and ./jsx-dev-runtime.d.ts
4245
+ namespace JSX {
4246
+ interface Element extends GlobalJSXElement {}
4247
+ interface ElementClass extends GlobalJSXElementClass {}
4248
+ interface ElementAttributesProperty extends GlobalJSXElementAttributesProperty {}
4249
+ interface ElementChildrenAttribute extends GlobalJSXElementChildrenAttribute {}
4250
+
4251
+ type LibraryManagedAttributes<C, P> = GlobalJSXLibraryManagedAttributes<C, P>;
4252
+
4253
+ interface IntrinsicAttributes extends GlobalJSXIntrinsicAttributes {}
4254
+ interface IntrinsicClassAttributes<T> extends GlobalJSXIntrinsicClassAttributes<T> {}
4255
+ interface IntrinsicElements extends GlobalJSXIntrinsicElements {}
4256
+ }
4257
+ }
4258
+
4259
+ // naked 'any' type in a conditional type will short circuit and union both the then/else branches
4260
+ // so boolean is only resolved for T = any
4261
+ type IsExactlyAny<T> = boolean extends (T extends never ? true : false) ? true : false;
4262
+
4263
+ type ExactlyAnyPropertyKeys<T> = { [K in keyof T]: IsExactlyAny<T[K]> extends true ? K : never }[keyof T];
4264
+ type NotExactlyAnyPropertyKeys<T> = Exclude<keyof T, ExactlyAnyPropertyKeys<T>>;
4265
+
4266
+ // Try to resolve ill-defined props like for JS users: props can be any, or sometimes objects with properties of type any
4267
+ type MergePropTypes<P, T> =
4268
+ // Distribute over P in case it is a union type
4269
+ P extends any
4270
+ // If props is type any, use propTypes definitions
4271
+ ? IsExactlyAny<P> extends true ? T
4272
+ // If declared props have indexed properties, ignore inferred props entirely as keyof gets widened
4273
+ : string extends keyof P ? P
4274
+ // Prefer declared types which are not exactly any
4275
+ :
4276
+ & Pick<P, NotExactlyAnyPropertyKeys<P>>
4277
+ // For props which are exactly any, use the type inferred from propTypes if present
4278
+ & Pick<T, Exclude<keyof T, NotExactlyAnyPropertyKeys<P>>>
4279
+ // Keep leftover props not specified in propTypes
4280
+ & Pick<P, Exclude<keyof P, keyof T>>
4281
+ : never;
4282
+
4283
+ type InexactPartial<T> = { [K in keyof T]?: T[K] | undefined };
4284
+
4285
+ // Any prop that has a default prop becomes optional, but its type is unchanged
4286
+ // Undeclared default props are augmented into the resulting allowable attributes
4287
+ // If declared props have indexed properties, ignore default props entirely as keyof gets widened
4288
+ // Wrap in an outer-level conditional type to allow distribution over props that are unions
4289
+ type Defaultize<P, D> = P extends any ? string extends keyof P ? P
4290
+ :
4291
+ & Pick<P, Exclude<keyof P, keyof D>>
4292
+ & InexactPartial<Pick<P, Extract<keyof P, keyof D>>>
4293
+ & InexactPartial<Pick<D, Exclude<keyof D, keyof P>>>
4294
+ : never;
4295
+
4296
+ type ReactManagedAttributes<C, P> = C extends { propTypes: infer T; defaultProps: infer D }
4297
+ ? Defaultize<MergePropTypes<P, PropTypes.InferProps<T>>, D>
4298
+ : C extends { propTypes: infer T } ? MergePropTypes<P, PropTypes.InferProps<T>>
4299
+ : C extends { defaultProps: infer D } ? Defaultize<P, D>
4300
+ : P;
4301
+
4302
+ declare global {
4303
+ /**
4304
+ * @deprecated Use `React.JSX` instead of the global `JSX` namespace.
4305
+ */
3968
4306
  namespace JSX {
3969
4307
  interface Element extends React.ReactElement<any, any> {}
3970
4308
  interface ElementClass extends React.Component<any> {
@@ -4176,18 +4514,17 @@ declare namespace React {
4176
4514
  }
4177
4515
  }
4178
4516
 
4179
- type InexactPartial<T> = { [K in keyof T]?: T[K] | undefined };
4517
+ // React.JSX needs to point to global.JSX to keep global module augmentations intact.
4518
+ // But we can't access global.JSX so we need to create these aliases instead.
4519
+ // Once the global JSX namespace will be removed we replace React.JSX with the contents of global.JSX
4520
+ interface GlobalJSXElement extends JSX.Element {}
4521
+ interface GlobalJSXElementClass extends JSX.ElementClass {}
4522
+ interface GlobalJSXElementAttributesProperty extends JSX.ElementAttributesProperty {}
4523
+ interface GlobalJSXElementChildrenAttribute extends JSX.ElementChildrenAttribute {}
4180
4524
 
4181
- // Any prop that has a default prop becomes optional, but its type is unchanged
4182
- // Undeclared default props are augmented into the resulting allowable attributes
4183
- // If declared props have indexed properties, ignore default props entirely as keyof gets widened
4184
- // Wrap in an outer-level conditional type to allow distribution over props that are unions
4185
- type Defaultize<P, D> = P extends any ? string extends keyof P ? P
4186
- :
4187
- & Pick<P, Exclude<keyof P, keyof D>>
4188
- & InexactPartial<Pick<P, Extract<keyof P, keyof D>>>
4189
- & InexactPartial<Pick<D, Exclude<keyof D, keyof P>>>
4190
- : never;
4525
+ type GlobalJSXLibraryManagedAttributes<C, P> = JSX.LibraryManagedAttributes<C, P>;
4191
4526
 
4192
- type ReactManagedAttributes<C, P> = C extends { defaultProps: infer D } ? Defaultize<P, D>
4193
- : P;
4527
+ interface GlobalJSXIntrinsicAttributes extends JSX.IntrinsicAttributes {}
4528
+ interface GlobalJSXIntrinsicClassAttributes<T> extends JSX.IntrinsicClassAttributes<T> {}
4529
+
4530
+ interface GlobalJSXIntrinsicElements extends JSX.IntrinsicElements {}