alicezetion 1.8.6 → 1.8.8

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