veryfront 0.0.88 → 0.0.90

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