@shopify/ui-extensions-server-kit 5.2.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (367) hide show
  1. package/CHANGELOG.md +121 -0
  2. package/README.md +74 -0
  3. package/dist/ExtensionServerClient/ExtensionServerClient.cjs.js +1 -0
  4. package/dist/ExtensionServerClient/ExtensionServerClient.d.ts +28 -0
  5. package/dist/ExtensionServerClient/ExtensionServerClient.es.js +133 -0
  6. package/dist/ExtensionServerClient/ExtensionServerClient.test.d.ts +1 -0
  7. package/dist/ExtensionServerClient/index.d.ts +2 -0
  8. package/dist/ExtensionServerClient/types.cjs.js +1 -0
  9. package/dist/ExtensionServerClient/types.d.ts +124 -0
  10. package/dist/ExtensionServerClient/types.es.js +4 -0
  11. package/dist/context/ExtensionServerProvider.cjs.js +1 -0
  12. package/dist/context/ExtensionServerProvider.d.ts +2 -0
  13. package/dist/context/ExtensionServerProvider.es.js +29 -0
  14. package/dist/context/ExtensionServerProvider.test.d.ts +1 -0
  15. package/dist/context/constants.cjs.js +1 -0
  16. package/dist/context/constants.d.ts +3 -0
  17. package/dist/context/constants.es.js +14 -0
  18. package/dist/context/index.d.ts +3 -0
  19. package/dist/context/types.d.ts +11 -0
  20. package/dist/hooks/index.d.ts +5 -0
  21. package/dist/hooks/useExtensionClient.cjs.js +1 -0
  22. package/dist/hooks/useExtensionClient.d.ts +1 -0
  23. package/dist/hooks/useExtensionClient.es.js +8 -0
  24. package/dist/hooks/useExtensionServerContext.cjs.js +1 -0
  25. package/dist/hooks/useExtensionServerContext.d.ts +1 -0
  26. package/dist/hooks/useExtensionServerContext.es.js +6 -0
  27. package/dist/hooks/useExtensionServerEvent.cjs.js +1 -0
  28. package/dist/hooks/useExtensionServerEvent.d.ts +1 -0
  29. package/dist/hooks/useExtensionServerEvent.es.js +9 -0
  30. package/dist/hooks/useExtensionServerState.cjs.js +1 -0
  31. package/dist/hooks/useExtensionServerState.d.ts +1 -0
  32. package/dist/hooks/useExtensionServerState.es.js +9 -0
  33. package/dist/hooks/useIsomorphicLayoutEffect.cjs.js +1 -0
  34. package/dist/hooks/useIsomorphicLayoutEffect.d.ts +2 -0
  35. package/dist/hooks/useIsomorphicLayoutEffect.es.js +5 -0
  36. package/dist/i18n.cjs.js +1 -0
  37. package/dist/i18n.d.ts +93 -0
  38. package/dist/i18n.es.js +61 -0
  39. package/dist/i18n.test.d.ts +1 -0
  40. package/dist/index.cjs.js +1 -0
  41. package/dist/index.cjs2.js +1 -0
  42. package/dist/index.d.ts +7 -0
  43. package/dist/index.es.js +54 -0
  44. package/dist/index.es2.js +8 -0
  45. package/dist/state/actions/actions.cjs.js +1 -0
  46. package/dist/state/actions/actions.d.ts +6 -0
  47. package/dist/state/actions/actions.es.js +37 -0
  48. package/dist/state/actions/index.d.ts +2 -0
  49. package/dist/state/actions/types.d.ts +21 -0
  50. package/dist/state/index.d.ts +2 -0
  51. package/dist/state/reducers/constants.cjs.js +1 -0
  52. package/dist/state/reducers/constants.d.ts +2 -0
  53. package/dist/state/reducers/constants.es.js +7 -0
  54. package/dist/state/reducers/extensionServerReducer.cjs.js +1 -0
  55. package/dist/state/reducers/extensionServerReducer.d.ts +3 -0
  56. package/dist/state/reducers/extensionServerReducer.es.js +57 -0
  57. package/dist/state/reducers/extensionServerReducer.test.d.ts +1 -0
  58. package/dist/state/reducers/index.d.ts +3 -0
  59. package/dist/state/reducers/types.d.ts +6 -0
  60. package/dist/testing/MockExtensionServerProvider.cjs.js +1 -0
  61. package/dist/testing/MockExtensionServerProvider.d.ts +7 -0
  62. package/dist/testing/MockExtensionServerProvider.es.js +24 -0
  63. package/dist/testing/app.cjs.js +1 -0
  64. package/dist/testing/app.d.ts +2 -0
  65. package/dist/testing/app.es.js +16 -0
  66. package/dist/testing/extensions.cjs.js +1 -0
  67. package/dist/testing/extensions.d.ts +6 -0
  68. package/dist/testing/extensions.es.js +65 -0
  69. package/dist/testing/index.d.ts +3 -0
  70. package/dist/types.cjs.js +1 -0
  71. package/dist/types.d.ts +169 -0
  72. package/dist/types.es.js +4 -0
  73. package/dist/utilities/assetToString.cjs.js +1 -0
  74. package/dist/utilities/assetToString.d.ts +2 -0
  75. package/dist/utilities/assetToString.es.js +7 -0
  76. package/dist/utilities/assetToString.test.d.ts +1 -0
  77. package/dist/utilities/groupByKey.cjs.js +1 -0
  78. package/dist/utilities/groupByKey.d.ts +3 -0
  79. package/dist/utilities/groupByKey.es.js +6 -0
  80. package/dist/utilities/index.d.ts +7 -0
  81. package/dist/utilities/isUIExtension.cjs.js +1 -0
  82. package/dist/utilities/isUIExtension.d.ts +1 -0
  83. package/dist/utilities/isUIExtension.es.js +6 -0
  84. package/dist/utilities/isValidSurface.cjs.js +1 -0
  85. package/dist/utilities/isValidSurface.d.ts +2 -0
  86. package/dist/utilities/isValidSurface.es.js +7 -0
  87. package/dist/utilities/noop.cjs.js +1 -0
  88. package/dist/utilities/noop.d.ts +1 -0
  89. package/dist/utilities/noop.es.js +5 -0
  90. package/dist/utilities/replaceUpdated.cjs.js +1 -0
  91. package/dist/utilities/replaceUpdated.d.ts +1 -0
  92. package/dist/utilities/replaceUpdated.es.js +14 -0
  93. package/dist/utilities/replaceUpdated.test.d.ts +1 -0
  94. package/dist/utilities/set.cjs.js +1 -0
  95. package/dist/utilities/set.d.ts +4 -0
  96. package/dist/utilities/set.es.js +18 -0
  97. package/dist/utilities/set.test.d.ts +1 -0
  98. package/index.d.ts +1 -0
  99. package/index.js +1 -0
  100. package/index.mjs +1 -0
  101. package/node_modules/@shopify/react-testing/LICENSE.md +21 -0
  102. package/node_modules/@shopify/react-testing/README.md +711 -0
  103. package/node_modules/@shopify/react-testing/build/cjs/TestWrapper.js +52 -0
  104. package/node_modules/@shopify/react-testing/build/cjs/_virtual/_rollupPluginBabelHelpers.js +47 -0
  105. package/node_modules/@shopify/react-testing/build/cjs/compat.js +14 -0
  106. package/node_modules/@shopify/react-testing/build/cjs/destroy.js +13 -0
  107. package/node_modules/@shopify/react-testing/build/cjs/element.js +225 -0
  108. package/node_modules/@shopify/react-testing/build/cjs/index.js +21 -0
  109. package/node_modules/@shopify/react-testing/build/cjs/matchers/components.js +46 -0
  110. package/node_modules/@shopify/react-testing/build/cjs/matchers/context.js +25 -0
  111. package/node_modules/@shopify/react-testing/build/cjs/matchers/index.js +16 -0
  112. package/node_modules/@shopify/react-testing/build/cjs/matchers/props.js +38 -0
  113. package/node_modules/@shopify/react-testing/build/cjs/matchers/strings.js +42 -0
  114. package/node_modules/@shopify/react-testing/build/cjs/matchers/utilities.js +110 -0
  115. package/node_modules/@shopify/react-testing/build/cjs/mount.js +76 -0
  116. package/node_modules/@shopify/react-testing/build/cjs/root.js +284 -0
  117. package/node_modules/@shopify/react-testing/build/cjs/toReactString.js +86 -0
  118. package/node_modules/@shopify/react-testing/build/cjs/types.js +28 -0
  119. package/node_modules/@shopify/react-testing/build/esm/TestWrapper.mjs +44 -0
  120. package/node_modules/@shopify/react-testing/build/esm/_virtual/_rollupPluginBabelHelpers.mjs +42 -0
  121. package/node_modules/@shopify/react-testing/build/esm/compat.mjs +10 -0
  122. package/node_modules/@shopify/react-testing/build/esm/destroy.mjs +9 -0
  123. package/node_modules/@shopify/react-testing/build/esm/element.mjs +221 -0
  124. package/node_modules/@shopify/react-testing/build/esm/index.mjs +5 -0
  125. package/node_modules/@shopify/react-testing/build/esm/matchers/components.mjs +41 -0
  126. package/node_modules/@shopify/react-testing/build/esm/matchers/context.mjs +21 -0
  127. package/node_modules/@shopify/react-testing/build/esm/matchers/index.mjs +14 -0
  128. package/node_modules/@shopify/react-testing/build/esm/matchers/props.mjs +33 -0
  129. package/node_modules/@shopify/react-testing/build/esm/matchers/strings.mjs +37 -0
  130. package/node_modules/@shopify/react-testing/build/esm/matchers/utilities.mjs +101 -0
  131. package/node_modules/@shopify/react-testing/build/esm/mount.mjs +70 -0
  132. package/node_modules/@shopify/react-testing/build/esm/root.mjs +275 -0
  133. package/node_modules/@shopify/react-testing/build/esm/toReactString.mjs +80 -0
  134. package/node_modules/@shopify/react-testing/build/esm/types.mjs +26 -0
  135. package/node_modules/@shopify/react-testing/build/esnext/TestWrapper.esnext +44 -0
  136. package/node_modules/@shopify/react-testing/build/esnext/compat.esnext +10 -0
  137. package/node_modules/@shopify/react-testing/build/esnext/destroy.esnext +9 -0
  138. package/node_modules/@shopify/react-testing/build/esnext/element.esnext +221 -0
  139. package/node_modules/@shopify/react-testing/build/esnext/index.esnext +5 -0
  140. package/node_modules/@shopify/react-testing/build/esnext/matchers/components.esnext +41 -0
  141. package/node_modules/@shopify/react-testing/build/esnext/matchers/context.esnext +21 -0
  142. package/node_modules/@shopify/react-testing/build/esnext/matchers/index.esnext +14 -0
  143. package/node_modules/@shopify/react-testing/build/esnext/matchers/props.esnext +33 -0
  144. package/node_modules/@shopify/react-testing/build/esnext/matchers/strings.esnext +37 -0
  145. package/node_modules/@shopify/react-testing/build/esnext/matchers/utilities.esnext +99 -0
  146. package/node_modules/@shopify/react-testing/build/esnext/mount.esnext +71 -0
  147. package/node_modules/@shopify/react-testing/build/esnext/root.esnext +275 -0
  148. package/node_modules/@shopify/react-testing/build/esnext/toReactString.esnext +80 -0
  149. package/node_modules/@shopify/react-testing/build/esnext/types.esnext +26 -0
  150. package/node_modules/@shopify/react-testing/build/ts/TestWrapper.d.ts +17 -0
  151. package/node_modules/@shopify/react-testing/build/ts/TestWrapper.d.ts.map +1 -0
  152. package/node_modules/@shopify/react-testing/build/ts/compat.d.ts +3 -0
  153. package/node_modules/@shopify/react-testing/build/ts/compat.d.ts.map +1 -0
  154. package/node_modules/@shopify/react-testing/build/ts/destroy.d.ts +2 -0
  155. package/node_modules/@shopify/react-testing/build/ts/destroy.d.ts.map +1 -0
  156. package/node_modules/@shopify/react-testing/build/ts/element.d.ts +42 -0
  157. package/node_modules/@shopify/react-testing/build/ts/element.d.ts.map +1 -0
  158. package/node_modules/@shopify/react-testing/build/ts/index.d.ts +7 -0
  159. package/node_modules/@shopify/react-testing/build/ts/index.d.ts.map +1 -0
  160. package/node_modules/@shopify/react-testing/build/ts/matchers/components.d.ts +12 -0
  161. package/node_modules/@shopify/react-testing/build/ts/matchers/components.d.ts.map +1 -0
  162. package/node_modules/@shopify/react-testing/build/ts/matchers/context.d.ts +8 -0
  163. package/node_modules/@shopify/react-testing/build/ts/matchers/context.d.ts.map +1 -0
  164. package/node_modules/@shopify/react-testing/build/ts/matchers/index.d.ts +20 -0
  165. package/node_modules/@shopify/react-testing/build/ts/matchers/index.d.ts.map +1 -0
  166. package/node_modules/@shopify/react-testing/build/ts/matchers/props.d.ts +10 -0
  167. package/node_modules/@shopify/react-testing/build/ts/matchers/props.d.ts.map +1 -0
  168. package/node_modules/@shopify/react-testing/build/ts/matchers/strings.d.ts +11 -0
  169. package/node_modules/@shopify/react-testing/build/ts/matchers/strings.d.ts.map +1 -0
  170. package/node_modules/@shopify/react-testing/build/ts/matchers/utilities.d.ts +17 -0
  171. package/node_modules/@shopify/react-testing/build/ts/matchers/utilities.d.ts.map +1 -0
  172. package/node_modules/@shopify/react-testing/build/ts/mount.d.ts +39 -0
  173. package/node_modules/@shopify/react-testing/build/ts/mount.d.ts.map +1 -0
  174. package/node_modules/@shopify/react-testing/build/ts/root.d.ts +55 -0
  175. package/node_modules/@shopify/react-testing/build/ts/root.d.ts.map +1 -0
  176. package/node_modules/@shopify/react-testing/build/ts/toReactString.d.ts +5 -0
  177. package/node_modules/@shopify/react-testing/build/ts/toReactString.d.ts.map +1 -0
  178. package/node_modules/@shopify/react-testing/build/ts/types.d.ts +89 -0
  179. package/node_modules/@shopify/react-testing/build/ts/types.d.ts.map +1 -0
  180. package/node_modules/@shopify/react-testing/index.esnext +1 -0
  181. package/node_modules/@shopify/react-testing/index.js +1 -0
  182. package/node_modules/@shopify/react-testing/index.mjs +1 -0
  183. package/node_modules/@shopify/react-testing/matchers.esnext +1 -0
  184. package/node_modules/@shopify/react-testing/matchers.js +1 -0
  185. package/node_modules/@shopify/react-testing/matchers.mjs +1 -0
  186. package/node_modules/@shopify/react-testing/package.json +69 -0
  187. package/node_modules/@shopify/ui-extensions-test-utils/CHANGELOG.md +66 -0
  188. package/node_modules/@shopify/ui-extensions-test-utils/dist/index.js +3 -0
  189. package/node_modules/@shopify/ui-extensions-test-utils/dist/render.js +5 -0
  190. package/node_modules/@shopify/ui-extensions-test-utils/dist/renderHook.js +20 -0
  191. package/node_modules/@shopify/ui-extensions-test-utils/dist/withProviders.js +6 -0
  192. package/node_modules/@shopify/ui-extensions-test-utils/package.json +41 -0
  193. package/node_modules/@shopify/ui-extensions-test-utils/project.json +39 -0
  194. package/node_modules/@types/node/LICENSE +21 -0
  195. package/node_modules/@types/node/README.md +15 -0
  196. package/node_modules/@types/node/assert/strict.d.ts +8 -0
  197. package/node_modules/@types/node/assert.d.ts +985 -0
  198. package/node_modules/@types/node/async_hooks.d.ts +522 -0
  199. package/node_modules/@types/node/buffer.d.ts +2321 -0
  200. package/node_modules/@types/node/child_process.d.ts +1544 -0
  201. package/node_modules/@types/node/cluster.d.ts +432 -0
  202. package/node_modules/@types/node/console.d.ts +412 -0
  203. package/node_modules/@types/node/constants.d.ts +19 -0
  204. package/node_modules/@types/node/crypto.d.ts +4451 -0
  205. package/node_modules/@types/node/dgram.d.ts +586 -0
  206. package/node_modules/@types/node/diagnostics_channel.d.ts +192 -0
  207. package/node_modules/@types/node/dns/promises.d.ts +381 -0
  208. package/node_modules/@types/node/dns.d.ts +809 -0
  209. package/node_modules/@types/node/dom-events.d.ts +122 -0
  210. package/node_modules/@types/node/domain.d.ts +170 -0
  211. package/node_modules/@types/node/events.d.ts +803 -0
  212. package/node_modules/@types/node/fs/promises.d.ts +1205 -0
  213. package/node_modules/@types/node/fs.d.ts +4211 -0
  214. package/node_modules/@types/node/globals.d.ts +377 -0
  215. package/node_modules/@types/node/globals.global.d.ts +1 -0
  216. package/node_modules/@types/node/http.d.ts +1801 -0
  217. package/node_modules/@types/node/http2.d.ts +2386 -0
  218. package/node_modules/@types/node/https.d.ts +544 -0
  219. package/node_modules/@types/node/index.d.ts +88 -0
  220. package/node_modules/@types/node/inspector.d.ts +2739 -0
  221. package/node_modules/@types/node/module.d.ts +298 -0
  222. package/node_modules/@types/node/net.d.ts +913 -0
  223. package/node_modules/@types/node/os.d.ts +473 -0
  224. package/node_modules/@types/node/package.json +235 -0
  225. package/node_modules/@types/node/path.d.ts +191 -0
  226. package/node_modules/@types/node/perf_hooks.d.ts +626 -0
  227. package/node_modules/@types/node/process.d.ts +1531 -0
  228. package/node_modules/@types/node/punycode.d.ts +117 -0
  229. package/node_modules/@types/node/querystring.d.ts +141 -0
  230. package/node_modules/@types/node/readline/promises.d.ts +143 -0
  231. package/node_modules/@types/node/readline.d.ts +666 -0
  232. package/node_modules/@types/node/repl.d.ts +430 -0
  233. package/node_modules/@types/node/stream/consumers.d.ts +12 -0
  234. package/node_modules/@types/node/stream/promises.d.ts +83 -0
  235. package/node_modules/@types/node/stream/web.d.ts +336 -0
  236. package/node_modules/@types/node/stream.d.ts +1731 -0
  237. package/node_modules/@types/node/string_decoder.d.ts +67 -0
  238. package/node_modules/@types/node/test.d.ts +1113 -0
  239. package/node_modules/@types/node/timers/promises.d.ts +93 -0
  240. package/node_modules/@types/node/timers.d.ts +126 -0
  241. package/node_modules/@types/node/tls.d.ts +1203 -0
  242. package/node_modules/@types/node/trace_events.d.ts +171 -0
  243. package/node_modules/@types/node/ts4.8/assert/strict.d.ts +8 -0
  244. package/node_modules/@types/node/ts4.8/assert.d.ts +985 -0
  245. package/node_modules/@types/node/ts4.8/async_hooks.d.ts +522 -0
  246. package/node_modules/@types/node/ts4.8/buffer.d.ts +2321 -0
  247. package/node_modules/@types/node/ts4.8/child_process.d.ts +1544 -0
  248. package/node_modules/@types/node/ts4.8/cluster.d.ts +432 -0
  249. package/node_modules/@types/node/ts4.8/console.d.ts +412 -0
  250. package/node_modules/@types/node/ts4.8/constants.d.ts +19 -0
  251. package/node_modules/@types/node/ts4.8/crypto.d.ts +4450 -0
  252. package/node_modules/@types/node/ts4.8/dgram.d.ts +586 -0
  253. package/node_modules/@types/node/ts4.8/diagnostics_channel.d.ts +192 -0
  254. package/node_modules/@types/node/ts4.8/dns/promises.d.ts +381 -0
  255. package/node_modules/@types/node/ts4.8/dns.d.ts +809 -0
  256. package/node_modules/@types/node/ts4.8/dom-events.d.ts +122 -0
  257. package/node_modules/@types/node/ts4.8/domain.d.ts +170 -0
  258. package/node_modules/@types/node/ts4.8/events.d.ts +754 -0
  259. package/node_modules/@types/node/ts4.8/fs/promises.d.ts +1205 -0
  260. package/node_modules/@types/node/ts4.8/fs.d.ts +4211 -0
  261. package/node_modules/@types/node/ts4.8/globals.d.ts +377 -0
  262. package/node_modules/@types/node/ts4.8/globals.global.d.ts +1 -0
  263. package/node_modules/@types/node/ts4.8/http.d.ts +1801 -0
  264. package/node_modules/@types/node/ts4.8/http2.d.ts +2386 -0
  265. package/node_modules/@types/node/ts4.8/https.d.ts +544 -0
  266. package/node_modules/@types/node/ts4.8/index.d.ts +88 -0
  267. package/node_modules/@types/node/ts4.8/inspector.d.ts +2739 -0
  268. package/node_modules/@types/node/ts4.8/module.d.ts +298 -0
  269. package/node_modules/@types/node/ts4.8/net.d.ts +913 -0
  270. package/node_modules/@types/node/ts4.8/os.d.ts +473 -0
  271. package/node_modules/@types/node/ts4.8/path.d.ts +191 -0
  272. package/node_modules/@types/node/ts4.8/perf_hooks.d.ts +626 -0
  273. package/node_modules/@types/node/ts4.8/process.d.ts +1531 -0
  274. package/node_modules/@types/node/ts4.8/punycode.d.ts +117 -0
  275. package/node_modules/@types/node/ts4.8/querystring.d.ts +141 -0
  276. package/node_modules/@types/node/ts4.8/readline/promises.d.ts +143 -0
  277. package/node_modules/@types/node/ts4.8/readline.d.ts +666 -0
  278. package/node_modules/@types/node/ts4.8/repl.d.ts +430 -0
  279. package/node_modules/@types/node/ts4.8/stream/consumers.d.ts +12 -0
  280. package/node_modules/@types/node/ts4.8/stream/promises.d.ts +83 -0
  281. package/node_modules/@types/node/ts4.8/stream/web.d.ts +336 -0
  282. package/node_modules/@types/node/ts4.8/stream.d.ts +1731 -0
  283. package/node_modules/@types/node/ts4.8/string_decoder.d.ts +67 -0
  284. package/node_modules/@types/node/ts4.8/test.d.ts +1113 -0
  285. package/node_modules/@types/node/ts4.8/timers/promises.d.ts +93 -0
  286. package/node_modules/@types/node/ts4.8/timers.d.ts +126 -0
  287. package/node_modules/@types/node/ts4.8/tls.d.ts +1203 -0
  288. package/node_modules/@types/node/ts4.8/trace_events.d.ts +171 -0
  289. package/node_modules/@types/node/ts4.8/tty.d.ts +206 -0
  290. package/node_modules/@types/node/ts4.8/url.d.ts +937 -0
  291. package/node_modules/@types/node/ts4.8/util.d.ts +2075 -0
  292. package/node_modules/@types/node/ts4.8/v8.d.ts +541 -0
  293. package/node_modules/@types/node/ts4.8/vm.d.ts +667 -0
  294. package/node_modules/@types/node/ts4.8/wasi.d.ts +158 -0
  295. package/node_modules/@types/node/ts4.8/worker_threads.d.ts +692 -0
  296. package/node_modules/@types/node/ts4.8/zlib.d.ts +517 -0
  297. package/node_modules/@types/node/tty.d.ts +206 -0
  298. package/node_modules/@types/node/url.d.ts +937 -0
  299. package/node_modules/@types/node/util.d.ts +2075 -0
  300. package/node_modules/@types/node/v8.d.ts +541 -0
  301. package/node_modules/@types/node/vm.d.ts +667 -0
  302. package/node_modules/@types/node/wasi.d.ts +158 -0
  303. package/node_modules/@types/node/worker_threads.d.ts +692 -0
  304. package/node_modules/@types/node/zlib.d.ts +517 -0
  305. package/node_modules/@types/react/LICENSE +21 -0
  306. package/node_modules/@types/react/README.md +16 -0
  307. package/node_modules/@types/react/experimental.d.ts +192 -0
  308. package/node_modules/@types/react/global.d.ts +151 -0
  309. package/node_modules/@types/react/index.d.ts +3175 -0
  310. package/node_modules/@types/react/jsx-dev-runtime.d.ts +2 -0
  311. package/node_modules/@types/react/jsx-runtime.d.ts +2 -0
  312. package/node_modules/@types/react/package.json +149 -0
  313. package/node_modules/@vitejs/plugin-react-refresh/LICENSE +21 -0
  314. package/node_modules/@vitejs/plugin-react-refresh/README.md +73 -0
  315. package/node_modules/@vitejs/plugin-react-refresh/index.d.ts +14 -0
  316. package/node_modules/@vitejs/plugin-react-refresh/index.js +239 -0
  317. package/node_modules/@vitejs/plugin-react-refresh/package.json +35 -0
  318. package/package.json +65 -0
  319. package/project.json +74 -0
  320. package/scripts/create-entry-files.ts +44 -0
  321. package/src/ExtensionServerClient/ExtensionServerClient.test.ts +730 -0
  322. package/src/ExtensionServerClient/ExtensionServerClient.ts +310 -0
  323. package/src/ExtensionServerClient/index.ts +2 -0
  324. package/src/ExtensionServerClient/types.ts +159 -0
  325. package/src/context/ExtensionServerProvider.test.tsx +173 -0
  326. package/src/context/ExtensionServerProvider.tsx +46 -0
  327. package/src/context/constants.ts +15 -0
  328. package/src/context/index.ts +3 -0
  329. package/src/context/types.ts +13 -0
  330. package/src/hooks/index.ts +5 -0
  331. package/src/hooks/useExtensionClient.ts +6 -0
  332. package/src/hooks/useExtensionServerContext.ts +4 -0
  333. package/src/hooks/useExtensionServerEvent.ts +11 -0
  334. package/src/hooks/useExtensionServerState.ts +6 -0
  335. package/src/hooks/useIsomorphicLayoutEffect.ts +6 -0
  336. package/src/i18n.test.ts +417 -0
  337. package/src/i18n.ts +208 -0
  338. package/src/index.ts +7 -0
  339. package/src/state/actions/actions.ts +36 -0
  340. package/src/state/actions/index.ts +2 -0
  341. package/src/state/actions/types.ts +26 -0
  342. package/src/state/index.ts +2 -0
  343. package/src/state/reducers/constants.ts +6 -0
  344. package/src/state/reducers/extensionServerReducer.test.ts +160 -0
  345. package/src/state/reducers/extensionServerReducer.ts +87 -0
  346. package/src/state/reducers/index.ts +3 -0
  347. package/src/state/reducers/types.ts +7 -0
  348. package/src/testing/MockExtensionServerProvider.tsx +36 -0
  349. package/src/testing/app.ts +15 -0
  350. package/src/testing/extensions.ts +70 -0
  351. package/src/testing/index.ts +3 -0
  352. package/src/types.ts +172 -0
  353. package/src/utilities/assetToString.test.ts +16 -0
  354. package/src/utilities/assetToString.ts +8 -0
  355. package/src/utilities/groupByKey.ts +3 -0
  356. package/src/utilities/index.ts +7 -0
  357. package/src/utilities/isUIExtension.ts +7 -0
  358. package/src/utilities/isValidSurface.ts +7 -0
  359. package/src/utilities/noop.ts +1 -0
  360. package/src/utilities/replaceUpdated.test.ts +26 -0
  361. package/src/utilities/replaceUpdated.ts +16 -0
  362. package/src/utilities/set.test.ts +19 -0
  363. package/src/utilities/set.ts +29 -0
  364. package/testing.d.ts +1 -0
  365. package/testing.js +1 -0
  366. package/testing.mjs +1 -0
  367. package/tests/setup.ts +6 -0
@@ -0,0 +1,3175 @@
1
+ // Type definitions for React 17.0
2
+ // Project: http://facebook.github.io/react/
3
+ // Definitions by: Asana <https://asana.com>
4
+ // AssureSign <http://www.assuresign.com>
5
+ // Microsoft <https://microsoft.com>
6
+ // John Reilly <https://github.com/johnnyreilly>
7
+ // Benoit Benezech <https://github.com/bbenezech>
8
+ // Patricio Zavolinsky <https://github.com/pzavolinsky>
9
+ // Digiguru <https://github.com/digiguru>
10
+ // Eric Anderson <https://github.com/ericanderson>
11
+ // Dovydas Navickas <https://github.com/DovydasNavickas>
12
+ // Josh Rutherford <https://github.com/theruther4d>
13
+ // Guilherme Hübner <https://github.com/guilhermehubner>
14
+ // Ferdy Budhidharma <https://github.com/ferdaber>
15
+ // Johann Rakotoharisoa <https://github.com/jrakotoharisoa>
16
+ // Olivier Pascal <https://github.com/pascaloliv>
17
+ // Martin Hochel <https://github.com/hotell>
18
+ // Frank Li <https://github.com/franklixuefei>
19
+ // Jessica Franco <https://github.com/Jessidhia>
20
+ // Saransh Kataria <https://github.com/saranshkataria>
21
+ // Kanitkorn Sujautra <https://github.com/lukyth>
22
+ // Sebastian Silbermann <https://github.com/eps1lon>
23
+ // Kyle Scully <https://github.com/zieka>
24
+ // Cong Zhang <https://github.com/dancerphil>
25
+ // Dimitri Mitropoulos <https://github.com/dimitropoulos>
26
+ // JongChan Choi <https://github.com/disjukr>
27
+ // Victor Magalhães <https://github.com/vhfmag>
28
+ // Dale Tan <https://github.com/hellatan>
29
+ // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
30
+ // TypeScript Version: 2.8
31
+
32
+ // NOTE: Users of the `experimental` builds of React should add a reference
33
+ // to 'react/experimental' in their project. See experimental.d.ts's top comment
34
+ // for reference and documentation on how exactly to do it.
35
+
36
+ /// <reference path="global.d.ts" />
37
+
38
+ import * as CSS from 'csstype';
39
+ import * as PropTypes from 'prop-types';
40
+
41
+ type NativeAnimationEvent = AnimationEvent;
42
+ type NativeClipboardEvent = ClipboardEvent;
43
+ type NativeCompositionEvent = CompositionEvent;
44
+ type NativeDragEvent = DragEvent;
45
+ type NativeFocusEvent = FocusEvent;
46
+ type NativeKeyboardEvent = KeyboardEvent;
47
+ type NativeMouseEvent = MouseEvent;
48
+ type NativeTouchEvent = TouchEvent;
49
+ type NativePointerEvent = PointerEvent;
50
+ type NativeTransitionEvent = TransitionEvent;
51
+ type NativeUIEvent = UIEvent;
52
+ type NativeWheelEvent = WheelEvent;
53
+ type Booleanish = boolean | 'true' | 'false';
54
+
55
+ /**
56
+ * defined in scheduler/tracing
57
+ */
58
+ interface SchedulerInteraction {
59
+ id: number;
60
+ name: string;
61
+ timestamp: number;
62
+ }
63
+
64
+ declare const UNDEFINED_VOID_ONLY: unique symbol;
65
+ // Destructors are only allowed to return void.
66
+ type Destructor = () => void | { [UNDEFINED_VOID_ONLY]: never };
67
+
68
+ // tslint:disable-next-line:export-just-namespace
69
+ export = React;
70
+ export as namespace React;
71
+
72
+ declare namespace React {
73
+ //
74
+ // React Elements
75
+ // ----------------------------------------------------------------------
76
+
77
+ type ElementType<P = any> =
78
+ {
79
+ [K in keyof JSX.IntrinsicElements]: P extends JSX.IntrinsicElements[K] ? K : never
80
+ }[keyof JSX.IntrinsicElements] |
81
+ ComponentType<P>;
82
+ /**
83
+ * @deprecated Please use `ElementType`
84
+ */
85
+ type ReactType<P = any> = ElementType<P>;
86
+ type ComponentType<P = {}> = ComponentClass<P> | FunctionComponent<P>;
87
+
88
+ type JSXElementConstructor<P> =
89
+ | ((props: P) => ReactElement<any, any> | null)
90
+ | (new (props: P) => Component<P, any>);
91
+
92
+ interface RefObject<T> {
93
+ readonly current: T | null;
94
+ }
95
+ type RefCallback<T> = { bivarianceHack(instance: T | null): void }["bivarianceHack"];
96
+ type Ref<T> = RefCallback<T> | RefObject<T> | null;
97
+ type LegacyRef<T> = string | Ref<T>;
98
+ /**
99
+ * Gets the instance type for a React element. The instance will be different for various component types:
100
+ *
101
+ * - React class components will be the class instance. So if you had `class Foo extends React.Component<{}> {}`
102
+ * and used `React.ElementRef<typeof Foo>` then the type would be the instance of `Foo`.
103
+ * - React stateless functional components do not have a backing instance and so `React.ElementRef<typeof Bar>`
104
+ * (when `Bar` is `function Bar() {}`) will give you the `undefined` type.
105
+ * - JSX intrinsics like `div` will give you their DOM instance. For `React.ElementRef<'div'>` that would be
106
+ * `HTMLDivElement`. For `React.ElementRef<'input'>` that would be `HTMLInputElement`.
107
+ * - React stateless functional components that forward a `ref` will give you the `ElementRef` of the forwarded
108
+ * to component.
109
+ *
110
+ * `C` must be the type _of_ a React component so you need to use typeof as in React.ElementRef<typeof MyComponent>.
111
+ *
112
+ * @todo In Flow, this works a little different with forwarded refs and the `AbstractComponent` that
113
+ * `React.forwardRef()` returns.
114
+ */
115
+ type ElementRef<
116
+ C extends
117
+ | ForwardRefExoticComponent<any>
118
+ | { new (props: any): Component<any> }
119
+ | ((props: any, context?: any) => ReactElement | null)
120
+ | keyof JSX.IntrinsicElements
121
+ > =
122
+ // need to check first if `ref` is a valid prop for ts@3.0
123
+ // otherwise it will infer `{}` instead of `never`
124
+ "ref" extends keyof ComponentPropsWithRef<C>
125
+ ? NonNullable<ComponentPropsWithRef<C>["ref"]> extends Ref<
126
+ infer Instance
127
+ >
128
+ ? Instance
129
+ : never
130
+ : never;
131
+
132
+ type ComponentState = any;
133
+
134
+ type Key = string | number;
135
+
136
+ /**
137
+ * @internal You shouldn't need to use this type since you never see these attributes
138
+ * inside your component or have to validate them.
139
+ */
140
+ interface Attributes {
141
+ key?: Key | null;
142
+ }
143
+ interface RefAttributes<T> extends Attributes {
144
+ ref?: Ref<T>;
145
+ }
146
+ interface ClassAttributes<T> extends Attributes {
147
+ ref?: LegacyRef<T>;
148
+ }
149
+
150
+ interface ReactElement<P = any, T extends string | JSXElementConstructor<any> = string | JSXElementConstructor<any>> {
151
+ type: T;
152
+ props: P;
153
+ key: Key | null;
154
+ }
155
+
156
+ interface ReactComponentElement<
157
+ T extends keyof JSX.IntrinsicElements | JSXElementConstructor<any>,
158
+ P = Pick<ComponentProps<T>, Exclude<keyof ComponentProps<T>, 'key' | 'ref'>>
159
+ > extends ReactElement<P, Exclude<T, number>> { }
160
+
161
+ /**
162
+ * @deprecated Please use `FunctionComponentElement`
163
+ */
164
+ type SFCElement<P> = FunctionComponentElement<P>;
165
+
166
+ interface FunctionComponentElement<P> extends ReactElement<P, FunctionComponent<P>> {
167
+ ref?: 'ref' extends keyof P ? P extends { ref?: infer R } ? R : never : never;
168
+ }
169
+
170
+ type CElement<P, T extends Component<P, ComponentState>> = ComponentElement<P, T>;
171
+ interface ComponentElement<P, T extends Component<P, ComponentState>> extends ReactElement<P, ComponentClass<P>> {
172
+ ref?: LegacyRef<T>;
173
+ }
174
+
175
+ type ClassicElement<P> = CElement<P, ClassicComponent<P, ComponentState>>;
176
+
177
+ // string fallback for custom web-components
178
+ interface DOMElement<P extends HTMLAttributes<T> | SVGAttributes<T>, T extends Element> extends ReactElement<P, string> {
179
+ ref: LegacyRef<T>;
180
+ }
181
+
182
+ // ReactHTML for ReactHTMLElement
183
+ interface ReactHTMLElement<T extends HTMLElement> extends DetailedReactHTMLElement<AllHTMLAttributes<T>, T> { }
184
+
185
+ interface DetailedReactHTMLElement<P extends HTMLAttributes<T>, T extends HTMLElement> extends DOMElement<P, T> {
186
+ type: keyof ReactHTML;
187
+ }
188
+
189
+ // ReactSVG for ReactSVGElement
190
+ interface ReactSVGElement extends DOMElement<SVGAttributes<SVGElement>, SVGElement> {
191
+ type: keyof ReactSVG;
192
+ }
193
+
194
+ interface ReactPortal extends ReactElement {
195
+ key: Key | null;
196
+ children: ReactNode;
197
+ }
198
+
199
+ //
200
+ // Factories
201
+ // ----------------------------------------------------------------------
202
+
203
+ type Factory<P> = (props?: Attributes & P, ...children: ReactNode[]) => ReactElement<P>;
204
+
205
+ /**
206
+ * @deprecated Please use `FunctionComponentFactory`
207
+ */
208
+ type SFCFactory<P> = FunctionComponentFactory<P>;
209
+
210
+ type FunctionComponentFactory<P> = (props?: Attributes & P, ...children: ReactNode[]) => FunctionComponentElement<P>;
211
+
212
+ type ComponentFactory<P, T extends Component<P, ComponentState>> =
213
+ (props?: ClassAttributes<T> & P, ...children: ReactNode[]) => CElement<P, T>;
214
+
215
+ type CFactory<P, T extends Component<P, ComponentState>> = ComponentFactory<P, T>;
216
+ type ClassicFactory<P> = CFactory<P, ClassicComponent<P, ComponentState>>;
217
+
218
+ type DOMFactory<P extends DOMAttributes<T>, T extends Element> =
219
+ (props?: ClassAttributes<T> & P | null, ...children: ReactNode[]) => DOMElement<P, T>;
220
+
221
+ interface HTMLFactory<T extends HTMLElement> extends DetailedHTMLFactory<AllHTMLAttributes<T>, T> {}
222
+
223
+ interface DetailedHTMLFactory<P extends HTMLAttributes<T>, T extends HTMLElement> extends DOMFactory<P, T> {
224
+ (props?: ClassAttributes<T> & P | null, ...children: ReactNode[]): DetailedReactHTMLElement<P, T>;
225
+ }
226
+
227
+ interface SVGFactory extends DOMFactory<SVGAttributes<SVGElement>, SVGElement> {
228
+ (props?: ClassAttributes<SVGElement> & SVGAttributes<SVGElement> | null, ...children: ReactNode[]): ReactSVGElement;
229
+ }
230
+
231
+ //
232
+ // React Nodes
233
+ // http://facebook.github.io/react/docs/glossary.html
234
+ // ----------------------------------------------------------------------
235
+
236
+ type ReactText = string | number;
237
+ type ReactChild = ReactElement | ReactText;
238
+
239
+ interface ReactNodeArray extends Array<ReactNode> {}
240
+ type ReactFragment = {} | ReactNodeArray;
241
+ type ReactNode = ReactChild | ReactFragment | ReactPortal | boolean | null | undefined;
242
+
243
+ //
244
+ // Top Level API
245
+ // ----------------------------------------------------------------------
246
+
247
+ // DOM Elements
248
+ function createFactory<T extends HTMLElement>(
249
+ type: keyof ReactHTML): HTMLFactory<T>;
250
+ function createFactory(
251
+ type: keyof ReactSVG): SVGFactory;
252
+ function createFactory<P extends DOMAttributes<T>, T extends Element>(
253
+ type: string): DOMFactory<P, T>;
254
+
255
+ // Custom components
256
+ function createFactory<P>(type: FunctionComponent<P>): FunctionComponentFactory<P>;
257
+ function createFactory<P>(
258
+ type: ClassType<P, ClassicComponent<P, ComponentState>, ClassicComponentClass<P>>): CFactory<P, ClassicComponent<P, ComponentState>>;
259
+ function createFactory<P, T extends Component<P, ComponentState>, C extends ComponentClass<P>>(
260
+ type: ClassType<P, T, C>): CFactory<P, T>;
261
+ function createFactory<P>(type: ComponentClass<P>): Factory<P>;
262
+
263
+ // DOM Elements
264
+ // TODO: generalize this to everything in `keyof ReactHTML`, not just "input"
265
+ function createElement(
266
+ type: "input",
267
+ props?: InputHTMLAttributes<HTMLInputElement> & ClassAttributes<HTMLInputElement> | null,
268
+ ...children: ReactNode[]): DetailedReactHTMLElement<InputHTMLAttributes<HTMLInputElement>, HTMLInputElement>;
269
+ function createElement<P extends HTMLAttributes<T>, T extends HTMLElement>(
270
+ type: keyof ReactHTML,
271
+ props?: ClassAttributes<T> & P | null,
272
+ ...children: ReactNode[]): DetailedReactHTMLElement<P, T>;
273
+ function createElement<P extends SVGAttributes<T>, T extends SVGElement>(
274
+ type: keyof ReactSVG,
275
+ props?: ClassAttributes<T> & P | null,
276
+ ...children: ReactNode[]): ReactSVGElement;
277
+ function createElement<P extends DOMAttributes<T>, T extends Element>(
278
+ type: string,
279
+ props?: ClassAttributes<T> & P | null,
280
+ ...children: ReactNode[]): DOMElement<P, T>;
281
+
282
+ // Custom components
283
+
284
+ function createElement<P extends {}>(
285
+ type: FunctionComponent<P>,
286
+ props?: Attributes & P | null,
287
+ ...children: ReactNode[]): FunctionComponentElement<P>;
288
+ function createElement<P extends {}>(
289
+ type: ClassType<P, ClassicComponent<P, ComponentState>, ClassicComponentClass<P>>,
290
+ props?: ClassAttributes<ClassicComponent<P, ComponentState>> & P | null,
291
+ ...children: ReactNode[]): CElement<P, ClassicComponent<P, ComponentState>>;
292
+ function createElement<P extends {}, T extends Component<P, ComponentState>, C extends ComponentClass<P>>(
293
+ type: ClassType<P, T, C>,
294
+ props?: ClassAttributes<T> & P | null,
295
+ ...children: ReactNode[]): CElement<P, T>;
296
+ function createElement<P extends {}>(
297
+ type: FunctionComponent<P> | ComponentClass<P> | string,
298
+ props?: Attributes & P | null,
299
+ ...children: ReactNode[]): ReactElement<P>;
300
+
301
+ // DOM Elements
302
+ // ReactHTMLElement
303
+ function cloneElement<P extends HTMLAttributes<T>, T extends HTMLElement>(
304
+ element: DetailedReactHTMLElement<P, T>,
305
+ props?: P,
306
+ ...children: ReactNode[]): DetailedReactHTMLElement<P, T>;
307
+ // ReactHTMLElement, less specific
308
+ function cloneElement<P extends HTMLAttributes<T>, T extends HTMLElement>(
309
+ element: ReactHTMLElement<T>,
310
+ props?: P,
311
+ ...children: ReactNode[]): ReactHTMLElement<T>;
312
+ // SVGElement
313
+ function cloneElement<P extends SVGAttributes<T>, T extends SVGElement>(
314
+ element: ReactSVGElement,
315
+ props?: P,
316
+ ...children: ReactNode[]): ReactSVGElement;
317
+ // DOM Element (has to be the last, because type checking stops at first overload that fits)
318
+ function cloneElement<P extends DOMAttributes<T>, T extends Element>(
319
+ element: DOMElement<P, T>,
320
+ props?: DOMAttributes<T> & P,
321
+ ...children: ReactNode[]): DOMElement<P, T>;
322
+
323
+ // Custom components
324
+ function cloneElement<P>(
325
+ element: FunctionComponentElement<P>,
326
+ props?: Partial<P> & Attributes,
327
+ ...children: ReactNode[]): FunctionComponentElement<P>;
328
+ function cloneElement<P, T extends Component<P, ComponentState>>(
329
+ element: CElement<P, T>,
330
+ props?: Partial<P> & ClassAttributes<T>,
331
+ ...children: ReactNode[]): CElement<P, T>;
332
+ function cloneElement<P>(
333
+ element: ReactElement<P>,
334
+ props?: Partial<P> & Attributes,
335
+ ...children: ReactNode[]): ReactElement<P>;
336
+
337
+ // Context via RenderProps
338
+ interface ProviderProps<T> {
339
+ value: T;
340
+ children?: ReactNode;
341
+ }
342
+
343
+ interface ConsumerProps<T> {
344
+ children: (value: T) => ReactNode;
345
+ }
346
+
347
+ // TODO: similar to how Fragment is actually a symbol, the values returned from createContext,
348
+ // forwardRef and memo are actually objects that are treated specially by the renderer; see:
349
+ // https://github.com/facebook/react/blob/v16.6.0/packages/react/src/ReactContext.js#L35-L48
350
+ // https://github.com/facebook/react/blob/v16.6.0/packages/react/src/forwardRef.js#L42-L45
351
+ // https://github.com/facebook/react/blob/v16.6.0/packages/react/src/memo.js#L27-L31
352
+ // However, we have no way of telling the JSX parser that it's a JSX element type or its props other than
353
+ // by pretending to be a normal component.
354
+ //
355
+ // We don't just use ComponentType or SFC types because you are not supposed to attach statics to this
356
+ // object, but rather to the original function.
357
+ interface ExoticComponent<P = {}> {
358
+ /**
359
+ * **NOTE**: Exotic components are not callable.
360
+ */
361
+ (props: P): (ReactElement|null);
362
+ readonly $$typeof: symbol;
363
+ }
364
+
365
+ interface NamedExoticComponent<P = {}> extends ExoticComponent<P> {
366
+ displayName?: string;
367
+ }
368
+
369
+ interface ProviderExoticComponent<P> extends ExoticComponent<P> {
370
+ propTypes?: WeakValidationMap<P>;
371
+ }
372
+
373
+ type ContextType<C extends Context<any>> = C extends Context<infer T> ? T : never;
374
+
375
+ // NOTE: only the Context object itself can get a displayName
376
+ // https://github.com/facebook/react-devtools/blob/e0b854e4c/backend/attachRendererFiber.js#L310-L325
377
+ type Provider<T> = ProviderExoticComponent<ProviderProps<T>>;
378
+ type Consumer<T> = ExoticComponent<ConsumerProps<T>>;
379
+ interface Context<T> {
380
+ Provider: Provider<T>;
381
+ Consumer: Consumer<T>;
382
+ displayName?: string;
383
+ }
384
+ function createContext<T>(
385
+ // If you thought this should be optional, see
386
+ // https://github.com/DefinitelyTyped/DefinitelyTyped/pull/24509#issuecomment-382213106
387
+ defaultValue: T,
388
+ ): Context<T>;
389
+
390
+ function isValidElement<P>(object: {} | null | undefined): object is ReactElement<P>;
391
+
392
+ const Children: ReactChildren;
393
+ const Fragment: ExoticComponent<{ children?: ReactNode }>;
394
+ const StrictMode: ExoticComponent<{ children?: ReactNode }>;
395
+
396
+ interface SuspenseProps {
397
+ children?: ReactNode;
398
+
399
+ /** A fallback react tree to show when a Suspense child (like React.lazy) suspends */
400
+ fallback: NonNullable<ReactNode>|null;
401
+ }
402
+ /**
403
+ * This feature is not yet available for server-side rendering.
404
+ * Suspense support will be added in a later release.
405
+ */
406
+ const Suspense: ExoticComponent<SuspenseProps>;
407
+ const version: string;
408
+
409
+ /**
410
+ * {@link https://github.com/bvaughn/rfcs/blob/profiler/text/0000-profiler.md#detailed-design | API}
411
+ */
412
+ type ProfilerOnRenderCallback = (
413
+ id: string,
414
+ phase: "mount" | "update",
415
+ actualDuration: number,
416
+ baseDuration: number,
417
+ startTime: number,
418
+ commitTime: number,
419
+ interactions: Set<SchedulerInteraction>,
420
+ ) => void;
421
+ interface ProfilerProps {
422
+ children?: ReactNode;
423
+ id: string;
424
+ onRender: ProfilerOnRenderCallback;
425
+ }
426
+
427
+ const Profiler: ExoticComponent<ProfilerProps>;
428
+
429
+ //
430
+ // Component API
431
+ // ----------------------------------------------------------------------
432
+
433
+ type ReactInstance = Component<any> | Element;
434
+
435
+ // Base component for plain JS classes
436
+ interface Component<P = {}, S = {}, SS = any> extends ComponentLifecycle<P, S, SS> { }
437
+ class Component<P, S> {
438
+ // tslint won't let me format the sample code in a way that vscode likes it :(
439
+ /**
440
+ * If set, `this.context` will be set at runtime to the current value of the given Context.
441
+ *
442
+ * Usage:
443
+ *
444
+ * ```ts
445
+ * type MyContext = number
446
+ * const Ctx = React.createContext<MyContext>(0)
447
+ *
448
+ * class Foo extends React.Component {
449
+ * static contextType = Ctx
450
+ * context!: React.ContextType<typeof Ctx>
451
+ * render () {
452
+ * return <>My context's value: {this.context}</>;
453
+ * }
454
+ * }
455
+ * ```
456
+ *
457
+ * @see https://reactjs.org/docs/context.html#classcontexttype
458
+ */
459
+ static contextType?: Context<any>;
460
+
461
+ /**
462
+ * If using the new style context, re-declare this in your class to be the
463
+ * `React.ContextType` of your `static contextType`.
464
+ * Should be used with type annotation or static contextType.
465
+ *
466
+ * ```ts
467
+ * static contextType = MyContext
468
+ * // For TS pre-3.7:
469
+ * context!: React.ContextType<typeof MyContext>
470
+ * // For TS 3.7 and above:
471
+ * declare context: React.ContextType<typeof MyContext>
472
+ * ```
473
+ *
474
+ * @see https://reactjs.org/docs/context.html
475
+ */
476
+ // TODO (TypeScript 3.0): unknown
477
+ context: any;
478
+
479
+ constructor(props: Readonly<P> | P);
480
+ /**
481
+ * @deprecated
482
+ * @see https://reactjs.org/docs/legacy-context.html
483
+ */
484
+ constructor(props: P, context: any);
485
+
486
+ // We MUST keep setState() as a unified signature because it allows proper checking of the method return type.
487
+ // See: https://github.com/DefinitelyTyped/DefinitelyTyped/issues/18365#issuecomment-351013257
488
+ // Also, the ` | S` allows intellisense to not be dumbisense
489
+ setState<K extends keyof S>(
490
+ state: ((prevState: Readonly<S>, props: Readonly<P>) => (Pick<S, K> | S | null)) | (Pick<S, K> | S | null),
491
+ callback?: () => void
492
+ ): void;
493
+
494
+ forceUpdate(callback?: () => void): void;
495
+ render(): ReactNode;
496
+
497
+ // React.Props<T> is now deprecated, which means that the `children`
498
+ // property is not available on `P` by default, even though you can
499
+ // always pass children as variadic arguments to `createElement`.
500
+ // In the future, if we can define its call signature conditionally
501
+ // on the existence of `children` in `P`, then we should remove this.
502
+ readonly props: Readonly<P> & Readonly<{ children?: ReactNode }>;
503
+ state: Readonly<S>;
504
+ /**
505
+ * @deprecated
506
+ * https://reactjs.org/docs/refs-and-the-dom.html#legacy-api-string-refs
507
+ */
508
+ refs: {
509
+ [key: string]: ReactInstance
510
+ };
511
+ }
512
+
513
+ class PureComponent<P = {}, S = {}, SS = any> extends Component<P, S, SS> { }
514
+
515
+ interface ClassicComponent<P = {}, S = {}> extends Component<P, S> {
516
+ replaceState(nextState: S, callback?: () => void): void;
517
+ isMounted(): boolean;
518
+ getInitialState?(): S;
519
+ }
520
+
521
+ interface ChildContextProvider<CC> {
522
+ getChildContext(): CC;
523
+ }
524
+
525
+ //
526
+ // Class Interfaces
527
+ // ----------------------------------------------------------------------
528
+
529
+ /**
530
+ * @deprecated as of recent React versions, function components can no
531
+ * longer be considered 'stateless'. Please use `FunctionComponent` instead.
532
+ *
533
+ * @see [React Hooks](https://reactjs.org/docs/hooks-intro.html)
534
+ */
535
+ type SFC<P = {}> = FunctionComponent<P>;
536
+
537
+ /**
538
+ * @deprecated as of recent React versions, function components can no
539
+ * longer be considered 'stateless'. Please use `FunctionComponent` instead.
540
+ *
541
+ * @see [React Hooks](https://reactjs.org/docs/hooks-intro.html)
542
+ */
543
+ type StatelessComponent<P = {}> = FunctionComponent<P>;
544
+
545
+ type FC<P = {}> = FunctionComponent<P>;
546
+
547
+ interface FunctionComponent<P = {}> {
548
+ (props: PropsWithChildren<P>, context?: any): ReactElement<any, any> | null;
549
+ propTypes?: WeakValidationMap<P>;
550
+ contextTypes?: ValidationMap<any>;
551
+ defaultProps?: Partial<P>;
552
+ displayName?: string;
553
+ }
554
+
555
+ type VFC<P = {}> = VoidFunctionComponent<P>;
556
+
557
+ interface VoidFunctionComponent<P = {}> {
558
+ (props: P, context?: any): ReactElement<any, any> | null;
559
+ propTypes?: WeakValidationMap<P>;
560
+ contextTypes?: ValidationMap<any>;
561
+ defaultProps?: Partial<P>;
562
+ displayName?: string;
563
+ }
564
+
565
+ type ForwardedRef<T> = ((instance: T | null) => void) | MutableRefObject<T | null> | null;
566
+
567
+ interface ForwardRefRenderFunction<T, P = {}> {
568
+ (props: PropsWithChildren<P>, ref: ForwardedRef<T>): ReactElement | null;
569
+ displayName?: string;
570
+ // explicit rejected with `never` required due to
571
+ // https://github.com/microsoft/TypeScript/issues/36826
572
+ /**
573
+ * defaultProps are not supported on render functions
574
+ */
575
+ defaultProps?: never;
576
+ /**
577
+ * propTypes are not supported on render functions
578
+ */
579
+ propTypes?: never;
580
+ }
581
+
582
+ /**
583
+ * @deprecated Use ForwardRefRenderFunction. forwardRef doesn't accept a
584
+ * "real" component.
585
+ */
586
+ interface RefForwardingComponent <T, P = {}> extends ForwardRefRenderFunction<T, P> {}
587
+
588
+ interface ComponentClass<P = {}, S = ComponentState> extends StaticLifecycle<P, S> {
589
+ new (props: P, context?: any): Component<P, S>;
590
+ propTypes?: WeakValidationMap<P>;
591
+ contextType?: Context<any>;
592
+ contextTypes?: ValidationMap<any>;
593
+ childContextTypes?: ValidationMap<any>;
594
+ defaultProps?: Partial<P>;
595
+ displayName?: string;
596
+ }
597
+
598
+ interface ClassicComponentClass<P = {}> extends ComponentClass<P> {
599
+ new (props: P, context?: any): ClassicComponent<P, ComponentState>;
600
+ getDefaultProps?(): P;
601
+ }
602
+
603
+ /**
604
+ * We use an intersection type to infer multiple type parameters from
605
+ * a single argument, which is useful for many top-level API defs.
606
+ * See https://github.com/Microsoft/TypeScript/issues/7234 for more info.
607
+ */
608
+ type ClassType<P, T extends Component<P, ComponentState>, C extends ComponentClass<P>> =
609
+ C &
610
+ (new (props: P, context?: any) => T);
611
+
612
+ //
613
+ // Component Specs and Lifecycle
614
+ // ----------------------------------------------------------------------
615
+
616
+ // This should actually be something like `Lifecycle<P, S> | DeprecatedLifecycle<P, S>`,
617
+ // as React will _not_ call the deprecated lifecycle methods if any of the new lifecycle
618
+ // methods are present.
619
+ interface ComponentLifecycle<P, S, SS = any> extends NewLifecycle<P, S, SS>, DeprecatedLifecycle<P, S> {
620
+ /**
621
+ * Called immediately after a component is mounted. Setting state here will trigger re-rendering.
622
+ */
623
+ componentDidMount?(): void;
624
+ /**
625
+ * Called to determine whether the change in props and state should trigger a re-render.
626
+ *
627
+ * `Component` always returns true.
628
+ * `PureComponent` implements a shallow comparison on props and state and returns true if any
629
+ * props or states have changed.
630
+ *
631
+ * If false is returned, `Component#render`, `componentWillUpdate`
632
+ * and `componentDidUpdate` will not be called.
633
+ */
634
+ shouldComponentUpdate?(nextProps: Readonly<P>, nextState: Readonly<S>, nextContext: any): boolean;
635
+ /**
636
+ * Called immediately before a component is destroyed. Perform any necessary cleanup in this method, such as
637
+ * cancelled network requests, or cleaning up any DOM elements created in `componentDidMount`.
638
+ */
639
+ componentWillUnmount?(): void;
640
+ /**
641
+ * Catches exceptions generated in descendant components. Unhandled exceptions will cause
642
+ * the entire component tree to unmount.
643
+ */
644
+ componentDidCatch?(error: Error, errorInfo: ErrorInfo): void;
645
+ }
646
+
647
+ // Unfortunately, we have no way of declaring that the component constructor must implement this
648
+ interface StaticLifecycle<P, S> {
649
+ getDerivedStateFromProps?: GetDerivedStateFromProps<P, S>;
650
+ getDerivedStateFromError?: GetDerivedStateFromError<P, S>;
651
+ }
652
+
653
+ type GetDerivedStateFromProps<P, S> =
654
+ /**
655
+ * Returns an update to a component's state based on its new props and old state.
656
+ *
657
+ * Note: its presence prevents any of the deprecated lifecycle methods from being invoked
658
+ */
659
+ (nextProps: Readonly<P>, prevState: S) => Partial<S> | null;
660
+
661
+ type GetDerivedStateFromError<P, S> =
662
+ /**
663
+ * This lifecycle is invoked after an error has been thrown by a descendant component.
664
+ * It receives the error that was thrown as a parameter and should return a value to update state.
665
+ *
666
+ * Note: its presence prevents any of the deprecated lifecycle methods from being invoked
667
+ */
668
+ (error: any) => Partial<S> | null;
669
+
670
+ // This should be "infer SS" but can't use it yet
671
+ interface NewLifecycle<P, S, SS> {
672
+ /**
673
+ * Runs before React applies the result of `render` to the document, and
674
+ * returns an object to be given to componentDidUpdate. Useful for saving
675
+ * things such as scroll position before `render` causes changes to it.
676
+ *
677
+ * Note: the presence of getSnapshotBeforeUpdate prevents any of the deprecated
678
+ * lifecycle events from running.
679
+ */
680
+ getSnapshotBeforeUpdate?(prevProps: Readonly<P>, prevState: Readonly<S>): SS | null;
681
+ /**
682
+ * Called immediately after updating occurs. Not called for the initial render.
683
+ *
684
+ * The snapshot is only present if getSnapshotBeforeUpdate is present and returns non-null.
685
+ */
686
+ componentDidUpdate?(prevProps: Readonly<P>, prevState: Readonly<S>, snapshot?: SS): void;
687
+ }
688
+
689
+ interface DeprecatedLifecycle<P, S> {
690
+ /**
691
+ * Called immediately before mounting occurs, and before `Component#render`.
692
+ * Avoid introducing any side-effects or subscriptions in this method.
693
+ *
694
+ * Note: the presence of getSnapshotBeforeUpdate or getDerivedStateFromProps
695
+ * prevents this from being invoked.
696
+ *
697
+ * @deprecated 16.3, use componentDidMount or the constructor instead; will stop working in React 17
698
+ * @see https://reactjs.org/blog/2018/03/27/update-on-async-rendering.html#initializing-state
699
+ * @see https://reactjs.org/blog/2018/03/27/update-on-async-rendering.html#gradual-migration-path
700
+ */
701
+ componentWillMount?(): void;
702
+ /**
703
+ * Called immediately before mounting occurs, and before `Component#render`.
704
+ * Avoid introducing any side-effects or subscriptions in this method.
705
+ *
706
+ * This method will not stop working in React 17.
707
+ *
708
+ * Note: the presence of getSnapshotBeforeUpdate or getDerivedStateFromProps
709
+ * prevents this from being invoked.
710
+ *
711
+ * @deprecated 16.3, use componentDidMount or the constructor instead
712
+ * @see https://reactjs.org/blog/2018/03/27/update-on-async-rendering.html#initializing-state
713
+ * @see https://reactjs.org/blog/2018/03/27/update-on-async-rendering.html#gradual-migration-path
714
+ */
715
+ UNSAFE_componentWillMount?(): void;
716
+ /**
717
+ * Called when the component may be receiving new props.
718
+ * React may call this even if props have not changed, so be sure to compare new and existing
719
+ * props if you only want to handle changes.
720
+ *
721
+ * Calling `Component#setState` generally does not trigger this method.
722
+ *
723
+ * Note: the presence of getSnapshotBeforeUpdate or getDerivedStateFromProps
724
+ * prevents this from being invoked.
725
+ *
726
+ * @deprecated 16.3, use static getDerivedStateFromProps instead; will stop working in React 17
727
+ * @see https://reactjs.org/blog/2018/03/27/update-on-async-rendering.html#updating-state-based-on-props
728
+ * @see https://reactjs.org/blog/2018/03/27/update-on-async-rendering.html#gradual-migration-path
729
+ */
730
+ componentWillReceiveProps?(nextProps: Readonly<P>, nextContext: any): void;
731
+ /**
732
+ * Called when the component may be receiving new props.
733
+ * React may call this even if props have not changed, so be sure to compare new and existing
734
+ * props if you only want to handle changes.
735
+ *
736
+ * Calling `Component#setState` generally does not trigger this method.
737
+ *
738
+ * This method will not stop working in React 17.
739
+ *
740
+ * Note: the presence of getSnapshotBeforeUpdate or getDerivedStateFromProps
741
+ * prevents this from being invoked.
742
+ *
743
+ * @deprecated 16.3, use static getDerivedStateFromProps instead
744
+ * @see https://reactjs.org/blog/2018/03/27/update-on-async-rendering.html#updating-state-based-on-props
745
+ * @see https://reactjs.org/blog/2018/03/27/update-on-async-rendering.html#gradual-migration-path
746
+ */
747
+ UNSAFE_componentWillReceiveProps?(nextProps: Readonly<P>, nextContext: any): void;
748
+ /**
749
+ * Called immediately before rendering when new props or state is received. Not called for the initial render.
750
+ *
751
+ * Note: You cannot call `Component#setState` here.
752
+ *
753
+ * Note: the presence of getSnapshotBeforeUpdate or getDerivedStateFromProps
754
+ * prevents this from being invoked.
755
+ *
756
+ * @deprecated 16.3, use getSnapshotBeforeUpdate instead; will stop working in React 17
757
+ * @see https://reactjs.org/blog/2018/03/27/update-on-async-rendering.html#reading-dom-properties-before-an-update
758
+ * @see https://reactjs.org/blog/2018/03/27/update-on-async-rendering.html#gradual-migration-path
759
+ */
760
+ componentWillUpdate?(nextProps: Readonly<P>, nextState: Readonly<S>, nextContext: any): void;
761
+ /**
762
+ * Called immediately before rendering when new props or state is received. Not called for the initial render.
763
+ *
764
+ * Note: You cannot call `Component#setState` here.
765
+ *
766
+ * This method will not stop working in React 17.
767
+ *
768
+ * Note: the presence of getSnapshotBeforeUpdate or getDerivedStateFromProps
769
+ * prevents this from being invoked.
770
+ *
771
+ * @deprecated 16.3, use getSnapshotBeforeUpdate instead
772
+ * @see https://reactjs.org/blog/2018/03/27/update-on-async-rendering.html#reading-dom-properties-before-an-update
773
+ * @see https://reactjs.org/blog/2018/03/27/update-on-async-rendering.html#gradual-migration-path
774
+ */
775
+ UNSAFE_componentWillUpdate?(nextProps: Readonly<P>, nextState: Readonly<S>, nextContext: any): void;
776
+ }
777
+
778
+ interface Mixin<P, S> extends ComponentLifecycle<P, S> {
779
+ mixins?: Array<Mixin<P, S>>;
780
+ statics?: {
781
+ [key: string]: any;
782
+ };
783
+
784
+ displayName?: string;
785
+ propTypes?: ValidationMap<any>;
786
+ contextTypes?: ValidationMap<any>;
787
+ childContextTypes?: ValidationMap<any>;
788
+
789
+ getDefaultProps?(): P;
790
+ getInitialState?(): S;
791
+ }
792
+
793
+ interface ComponentSpec<P, S> extends Mixin<P, S> {
794
+ render(): ReactNode;
795
+
796
+ [propertyName: string]: any;
797
+ }
798
+
799
+ function createRef<T>(): RefObject<T>;
800
+
801
+ // will show `ForwardRef(${Component.displayName || Component.name})` in devtools by default,
802
+ // but can be given its own specific name
803
+ interface ForwardRefExoticComponent<P> extends NamedExoticComponent<P> {
804
+ defaultProps?: Partial<P>;
805
+ propTypes?: WeakValidationMap<P>;
806
+ }
807
+
808
+ function forwardRef<T, P = {}>(render: ForwardRefRenderFunction<T, P>): ForwardRefExoticComponent<PropsWithoutRef<P> & RefAttributes<T>>;
809
+
810
+ /** Ensures that the props do not include ref at all */
811
+ type PropsWithoutRef<P> =
812
+ // Just Pick would be sufficient for this, but I'm trying to avoid unnecessary mapping over union types
813
+ // https://github.com/Microsoft/TypeScript/issues/28339
814
+ 'ref' extends keyof P
815
+ ? Pick<P, Exclude<keyof P, 'ref'>>
816
+ : P;
817
+ /** Ensures that the props do not include string ref, which cannot be forwarded */
818
+ type PropsWithRef<P> =
819
+ // Just "P extends { ref?: infer R }" looks sufficient, but R will infer as {} if P is {}.
820
+ 'ref' extends keyof P
821
+ ? P extends { ref?: infer R }
822
+ ? string extends R
823
+ ? PropsWithoutRef<P> & { ref?: Exclude<R, string> }
824
+ : P
825
+ : P
826
+ : P;
827
+
828
+ type PropsWithChildren<P> = P & { children?: ReactNode };
829
+
830
+ /**
831
+ * NOTE: prefer ComponentPropsWithRef, if the ref is forwarded,
832
+ * or ComponentPropsWithoutRef when refs are not supported.
833
+ */
834
+ type ComponentProps<T extends keyof JSX.IntrinsicElements | JSXElementConstructor<any>> =
835
+ T extends JSXElementConstructor<infer P>
836
+ ? P
837
+ : T extends keyof JSX.IntrinsicElements
838
+ ? JSX.IntrinsicElements[T]
839
+ : {};
840
+ type ComponentPropsWithRef<T extends ElementType> =
841
+ T extends ComponentClass<infer P>
842
+ ? PropsWithoutRef<P> & RefAttributes<InstanceType<T>>
843
+ : PropsWithRef<ComponentProps<T>>;
844
+ type ComponentPropsWithoutRef<T extends ElementType> =
845
+ PropsWithoutRef<ComponentProps<T>>;
846
+
847
+ // will show `Memo(${Component.displayName || Component.name})` in devtools by default,
848
+ // but can be given its own specific name
849
+ type MemoExoticComponent<T extends ComponentType<any>> = NamedExoticComponent<ComponentPropsWithRef<T>> & {
850
+ readonly type: T;
851
+ };
852
+
853
+ function memo<P extends object>(
854
+ Component: SFC<P>,
855
+ propsAreEqual?: (prevProps: Readonly<PropsWithChildren<P>>, nextProps: Readonly<PropsWithChildren<P>>) => boolean
856
+ ): NamedExoticComponent<P>;
857
+ function memo<T extends ComponentType<any>>(
858
+ Component: T,
859
+ propsAreEqual?: (prevProps: Readonly<ComponentProps<T>>, nextProps: Readonly<ComponentProps<T>>) => boolean
860
+ ): MemoExoticComponent<T>;
861
+
862
+ type LazyExoticComponent<T extends ComponentType<any>> = ExoticComponent<ComponentPropsWithRef<T>> & {
863
+ readonly _result: T;
864
+ };
865
+
866
+ function lazy<T extends ComponentType<any>>(
867
+ factory: () => Promise<{ default: T }>
868
+ ): LazyExoticComponent<T>;
869
+
870
+ //
871
+ // React Hooks
872
+ // ----------------------------------------------------------------------
873
+
874
+ // based on the code in https://github.com/facebook/react/pull/13968
875
+
876
+ // Unlike the class component setState, the updates are not allowed to be partial
877
+ type SetStateAction<S> = S | ((prevState: S) => S);
878
+ // this technically does accept a second argument, but it's already under a deprecation warning
879
+ // and it's not even released so probably better to not define it.
880
+ type Dispatch<A> = (value: A) => void;
881
+ // Since action _can_ be undefined, dispatch may be called without any parameters.
882
+ type DispatchWithoutAction = () => void;
883
+ // Unlike redux, the actions _can_ be anything
884
+ type Reducer<S, A> = (prevState: S, action: A) => S;
885
+ // If useReducer accepts a reducer without action, dispatch may be called without any parameters.
886
+ type ReducerWithoutAction<S> = (prevState: S) => S;
887
+ // types used to try and prevent the compiler from reducing S
888
+ // to a supertype common with the second argument to useReducer()
889
+ type ReducerState<R extends Reducer<any, any>> = R extends Reducer<infer S, any> ? S : never;
890
+ type ReducerAction<R extends Reducer<any, any>> = R extends Reducer<any, infer A> ? A : never;
891
+ // The identity check is done with the SameValue algorithm (Object.is), which is stricter than ===
892
+ type ReducerStateWithoutAction<R extends ReducerWithoutAction<any>> =
893
+ R extends ReducerWithoutAction<infer S> ? S : never;
894
+ // TODO (TypeScript 3.0): ReadonlyArray<unknown>
895
+ type DependencyList = ReadonlyArray<any>;
896
+
897
+ // NOTE: callbacks are _only_ allowed to return either void, or a destructor.
898
+ type EffectCallback = () => (void | Destructor);
899
+
900
+ interface MutableRefObject<T> {
901
+ current: T;
902
+ }
903
+
904
+ // This will technically work if you give a Consumer<T> or Provider<T> but it's deprecated and warns
905
+ /**
906
+ * Accepts a context object (the value returned from `React.createContext`) and returns the current
907
+ * context value, as given by the nearest context provider for the given context.
908
+ *
909
+ * @version 16.8.0
910
+ * @see https://reactjs.org/docs/hooks-reference.html#usecontext
911
+ */
912
+ function useContext<T>(context: Context<T>/*, (not public API) observedBits?: number|boolean */): T;
913
+ /**
914
+ * Returns a stateful value, and a function to update it.
915
+ *
916
+ * @version 16.8.0
917
+ * @see https://reactjs.org/docs/hooks-reference.html#usestate
918
+ */
919
+ function useState<S>(initialState: S | (() => S)): [S, Dispatch<SetStateAction<S>>];
920
+ // convenience overload when first argument is omitted
921
+ /**
922
+ * Returns a stateful value, and a function to update it.
923
+ *
924
+ * @version 16.8.0
925
+ * @see https://reactjs.org/docs/hooks-reference.html#usestate
926
+ */
927
+ function useState<S = undefined>(): [S | undefined, Dispatch<SetStateAction<S | undefined>>];
928
+ /**
929
+ * An alternative to `useState`.
930
+ *
931
+ * `useReducer` is usually preferable to `useState` when you have complex state logic that involves
932
+ * multiple sub-values. It also lets you optimize performance for components that trigger deep
933
+ * updates because you can pass `dispatch` down instead of callbacks.
934
+ *
935
+ * @version 16.8.0
936
+ * @see https://reactjs.org/docs/hooks-reference.html#usereducer
937
+ */
938
+ // overload where dispatch could accept 0 arguments.
939
+ function useReducer<R extends ReducerWithoutAction<any>, I>(
940
+ reducer: R,
941
+ initializerArg: I,
942
+ initializer: (arg: I) => ReducerStateWithoutAction<R>
943
+ ): [ReducerStateWithoutAction<R>, DispatchWithoutAction];
944
+ /**
945
+ * An alternative to `useState`.
946
+ *
947
+ * `useReducer` is usually preferable to `useState` when you have complex state logic that involves
948
+ * multiple sub-values. It also lets you optimize performance for components that trigger deep
949
+ * updates because you can pass `dispatch` down instead of callbacks.
950
+ *
951
+ * @version 16.8.0
952
+ * @see https://reactjs.org/docs/hooks-reference.html#usereducer
953
+ */
954
+ // overload where dispatch could accept 0 arguments.
955
+ function useReducer<R extends ReducerWithoutAction<any>>(
956
+ reducer: R,
957
+ initializerArg: ReducerStateWithoutAction<R>,
958
+ initializer?: undefined
959
+ ): [ReducerStateWithoutAction<R>, DispatchWithoutAction];
960
+ /**
961
+ * An alternative to `useState`.
962
+ *
963
+ * `useReducer` is usually preferable to `useState` when you have complex state logic that involves
964
+ * multiple sub-values. It also lets you optimize performance for components that trigger deep
965
+ * updates because you can pass `dispatch` down instead of callbacks.
966
+ *
967
+ * @version 16.8.0
968
+ * @see https://reactjs.org/docs/hooks-reference.html#usereducer
969
+ */
970
+ // overload where "I" may be a subset of ReducerState<R>; used to provide autocompletion.
971
+ // If "I" matches ReducerState<R> exactly then the last overload will allow initializer to be omitted.
972
+ // the last overload effectively behaves as if the identity function (x => x) is the initializer.
973
+ function useReducer<R extends Reducer<any, any>, I>(
974
+ reducer: R,
975
+ initializerArg: I & ReducerState<R>,
976
+ initializer: (arg: I & ReducerState<R>) => ReducerState<R>
977
+ ): [ReducerState<R>, Dispatch<ReducerAction<R>>];
978
+ /**
979
+ * An alternative to `useState`.
980
+ *
981
+ * `useReducer` is usually preferable to `useState` when you have complex state logic that involves
982
+ * multiple sub-values. It also lets you optimize performance for components that trigger deep
983
+ * updates because you can pass `dispatch` down instead of callbacks.
984
+ *
985
+ * @version 16.8.0
986
+ * @see https://reactjs.org/docs/hooks-reference.html#usereducer
987
+ */
988
+ // overload for free "I"; all goes as long as initializer converts it into "ReducerState<R>".
989
+ function useReducer<R extends Reducer<any, any>, I>(
990
+ reducer: R,
991
+ initializerArg: I,
992
+ initializer: (arg: I) => ReducerState<R>
993
+ ): [ReducerState<R>, Dispatch<ReducerAction<R>>];
994
+ /**
995
+ * An alternative to `useState`.
996
+ *
997
+ * `useReducer` is usually preferable to `useState` when you have complex state logic that involves
998
+ * multiple sub-values. It also lets you optimize performance for components that trigger deep
999
+ * updates because you can pass `dispatch` down instead of callbacks.
1000
+ *
1001
+ * @version 16.8.0
1002
+ * @see https://reactjs.org/docs/hooks-reference.html#usereducer
1003
+ */
1004
+
1005
+ // I'm not sure if I keep this 2-ary or if I make it (2,3)-ary; it's currently (2,3)-ary.
1006
+ // The Flow types do have an overload for 3-ary invocation with undefined initializer.
1007
+
1008
+ // NOTE: without the ReducerState indirection, TypeScript would reduce S to be the most common
1009
+ // supertype between the reducer's return type and the initialState (or the initializer's return type),
1010
+ // which would prevent autocompletion from ever working.
1011
+
1012
+ // TODO: double-check if this weird overload logic is necessary. It is possible it's either a bug
1013
+ // in older versions, or a regression in newer versions of the typescript completion service.
1014
+ function useReducer<R extends Reducer<any, any>>(
1015
+ reducer: R,
1016
+ initialState: ReducerState<R>,
1017
+ initializer?: undefined
1018
+ ): [ReducerState<R>, Dispatch<ReducerAction<R>>];
1019
+ /**
1020
+ * `useRef` returns a mutable ref object whose `.current` property is initialized to the passed argument
1021
+ * (`initialValue`). The returned object will persist for the full lifetime of the component.
1022
+ *
1023
+ * Note that `useRef()` is useful for more than the `ref` attribute. It’s handy for keeping any mutable
1024
+ * value around similar to how you’d use instance fields in classes.
1025
+ *
1026
+ * @version 16.8.0
1027
+ * @see https://reactjs.org/docs/hooks-reference.html#useref
1028
+ */
1029
+ // TODO (TypeScript 3.0): <T extends unknown>
1030
+ function useRef<T>(initialValue: T): MutableRefObject<T>;
1031
+ // convenience overload for refs given as a ref prop as they typically start with a null value
1032
+ /**
1033
+ * `useRef` returns a mutable ref object whose `.current` property is initialized to the passed argument
1034
+ * (`initialValue`). The returned object will persist for the full lifetime of the component.
1035
+ *
1036
+ * Note that `useRef()` is useful for more than the `ref` attribute. It’s handy for keeping any mutable
1037
+ * value around similar to how you’d use instance fields in classes.
1038
+ *
1039
+ * Usage note: if you need the result of useRef to be directly mutable, include `| null` in the type
1040
+ * of the generic argument.
1041
+ *
1042
+ * @version 16.8.0
1043
+ * @see https://reactjs.org/docs/hooks-reference.html#useref
1044
+ */
1045
+ // TODO (TypeScript 3.0): <T extends unknown>
1046
+ function useRef<T>(initialValue: T|null): RefObject<T>;
1047
+ // convenience overload for potentially undefined initialValue / call with 0 arguments
1048
+ // has a default to stop it from defaulting to {} instead
1049
+ /**
1050
+ * `useRef` returns a mutable ref object whose `.current` property is initialized to the passed argument
1051
+ * (`initialValue`). The returned object will persist for the full lifetime of the component.
1052
+ *
1053
+ * Note that `useRef()` is useful for more than the `ref` attribute. It’s handy for keeping any mutable
1054
+ * value around similar to how you’d use instance fields in classes.
1055
+ *
1056
+ * @version 16.8.0
1057
+ * @see https://reactjs.org/docs/hooks-reference.html#useref
1058
+ */
1059
+ // TODO (TypeScript 3.0): <T extends unknown>
1060
+ function useRef<T = undefined>(): MutableRefObject<T | undefined>;
1061
+ /**
1062
+ * The signature is identical to `useEffect`, but it fires synchronously after all DOM mutations.
1063
+ * Use this to read layout from the DOM and synchronously re-render. Updates scheduled inside
1064
+ * `useLayoutEffect` will be flushed synchronously, before the browser has a chance to paint.
1065
+ *
1066
+ * Prefer the standard `useEffect` when possible to avoid blocking visual updates.
1067
+ *
1068
+ * If you’re migrating code from a class component, `useLayoutEffect` fires in the same phase as
1069
+ * `componentDidMount` and `componentDidUpdate`.
1070
+ *
1071
+ * @version 16.8.0
1072
+ * @see https://reactjs.org/docs/hooks-reference.html#uselayouteffect
1073
+ */
1074
+ function useLayoutEffect(effect: EffectCallback, deps?: DependencyList): void;
1075
+ /**
1076
+ * Accepts a function that contains imperative, possibly effectful code.
1077
+ *
1078
+ * @param effect Imperative function that can return a cleanup function
1079
+ * @param deps If present, effect will only activate if the values in the list change.
1080
+ *
1081
+ * @version 16.8.0
1082
+ * @see https://reactjs.org/docs/hooks-reference.html#useeffect
1083
+ */
1084
+ function useEffect(effect: EffectCallback, deps?: DependencyList): void;
1085
+ // NOTE: this does not accept strings, but this will have to be fixed by removing strings from type Ref<T>
1086
+ /**
1087
+ * `useImperativeHandle` customizes the instance value that is exposed to parent components when using
1088
+ * `ref`. As always, imperative code using refs should be avoided in most cases.
1089
+ *
1090
+ * `useImperativeHandle` should be used with `React.forwardRef`.
1091
+ *
1092
+ * @version 16.8.0
1093
+ * @see https://reactjs.org/docs/hooks-reference.html#useimperativehandle
1094
+ */
1095
+ function useImperativeHandle<T, R extends T>(ref: Ref<T>|undefined, init: () => R, deps?: DependencyList): void;
1096
+ // I made 'inputs' required here and in useMemo as there's no point to memoizing without the memoization key
1097
+ // useCallback(X) is identical to just using X, useMemo(() => Y) is identical to just using Y.
1098
+ /**
1099
+ * `useCallback` will return a memoized version of the callback that only changes if one of the `inputs`
1100
+ * has changed.
1101
+ *
1102
+ * @version 16.8.0
1103
+ * @see https://reactjs.org/docs/hooks-reference.html#usecallback
1104
+ */
1105
+ // TODO (TypeScript 3.0): <T extends (...args: never[]) => unknown>
1106
+ function useCallback<T extends (...args: any[]) => any>(callback: T, deps: DependencyList): T;
1107
+ /**
1108
+ * `useMemo` will only recompute the memoized value when one of the `deps` has changed.
1109
+ *
1110
+ * Usage note: if calling `useMemo` with a referentially stable function, also give it as the input in
1111
+ * the second argument.
1112
+ *
1113
+ * ```ts
1114
+ * function expensive () { ... }
1115
+ *
1116
+ * function Component () {
1117
+ * const expensiveResult = useMemo(expensive, [expensive])
1118
+ * return ...
1119
+ * }
1120
+ * ```
1121
+ *
1122
+ * @version 16.8.0
1123
+ * @see https://reactjs.org/docs/hooks-reference.html#usememo
1124
+ */
1125
+ // allow undefined, but don't make it optional as that is very likely a mistake
1126
+ function useMemo<T>(factory: () => T, deps: DependencyList | undefined): T;
1127
+ /**
1128
+ * `useDebugValue` can be used to display a label for custom hooks in React DevTools.
1129
+ *
1130
+ * NOTE: We don’t recommend adding debug values to every custom hook.
1131
+ * It’s most valuable for custom hooks that are part of shared libraries.
1132
+ *
1133
+ * @version 16.8.0
1134
+ * @see https://reactjs.org/docs/hooks-reference.html#usedebugvalue
1135
+ */
1136
+ // the name of the custom hook is itself derived from the function name at runtime:
1137
+ // it's just the function name without the "use" prefix.
1138
+ function useDebugValue<T>(value: T, format?: (value: T) => any): void;
1139
+
1140
+ //
1141
+ // Event System
1142
+ // ----------------------------------------------------------------------
1143
+ // TODO: change any to unknown when moving to TS v3
1144
+ interface BaseSyntheticEvent<E = object, C = any, T = any> {
1145
+ nativeEvent: E;
1146
+ currentTarget: C;
1147
+ target: T;
1148
+ bubbles: boolean;
1149
+ cancelable: boolean;
1150
+ defaultPrevented: boolean;
1151
+ eventPhase: number;
1152
+ isTrusted: boolean;
1153
+ preventDefault(): void;
1154
+ isDefaultPrevented(): boolean;
1155
+ stopPropagation(): void;
1156
+ isPropagationStopped(): boolean;
1157
+ persist(): void;
1158
+ timeStamp: number;
1159
+ type: string;
1160
+ }
1161
+
1162
+ /**
1163
+ * currentTarget - a reference to the element on which the event listener is registered.
1164
+ *
1165
+ * target - a reference to the element from which the event was originally dispatched.
1166
+ * This might be a child element to the element on which the event listener is registered.
1167
+ * If you thought this should be `EventTarget & T`, see https://github.com/DefinitelyTyped/DefinitelyTyped/issues/11508#issuecomment-256045682
1168
+ */
1169
+ interface SyntheticEvent<T = Element, E = Event> extends BaseSyntheticEvent<E, EventTarget & T, EventTarget> {}
1170
+
1171
+ interface ClipboardEvent<T = Element> extends SyntheticEvent<T, NativeClipboardEvent> {
1172
+ clipboardData: DataTransfer;
1173
+ }
1174
+
1175
+ interface CompositionEvent<T = Element> extends SyntheticEvent<T, NativeCompositionEvent> {
1176
+ data: string;
1177
+ }
1178
+
1179
+ interface DragEvent<T = Element> extends MouseEvent<T, NativeDragEvent> {
1180
+ dataTransfer: DataTransfer;
1181
+ }
1182
+
1183
+ interface PointerEvent<T = Element> extends MouseEvent<T, NativePointerEvent> {
1184
+ pointerId: number;
1185
+ pressure: number;
1186
+ tangentialPressure: number;
1187
+ tiltX: number;
1188
+ tiltY: number;
1189
+ twist: number;
1190
+ width: number;
1191
+ height: number;
1192
+ pointerType: 'mouse' | 'pen' | 'touch';
1193
+ isPrimary: boolean;
1194
+ }
1195
+
1196
+ interface FocusEvent<T = Element> extends SyntheticEvent<T, NativeFocusEvent> {
1197
+ relatedTarget: EventTarget | null;
1198
+ target: EventTarget & T;
1199
+ }
1200
+
1201
+ interface FormEvent<T = Element> extends SyntheticEvent<T> {
1202
+ }
1203
+
1204
+ interface InvalidEvent<T = Element> extends SyntheticEvent<T> {
1205
+ target: EventTarget & T;
1206
+ }
1207
+
1208
+ interface ChangeEvent<T = Element> extends SyntheticEvent<T> {
1209
+ target: EventTarget & T;
1210
+ }
1211
+
1212
+ interface KeyboardEvent<T = Element> extends SyntheticEvent<T, NativeKeyboardEvent> {
1213
+ altKey: boolean;
1214
+ /** @deprecated */
1215
+ charCode: number;
1216
+ ctrlKey: boolean;
1217
+ code: string;
1218
+ /**
1219
+ * 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.
1220
+ */
1221
+ getModifierState(key: string): boolean;
1222
+ /**
1223
+ * See the [DOM Level 3 Events spec](https://www.w3.org/TR/uievents-key/#named-key-attribute-values). for possible values
1224
+ */
1225
+ key: string;
1226
+ /** @deprecated */
1227
+ keyCode: number;
1228
+ locale: string;
1229
+ location: number;
1230
+ metaKey: boolean;
1231
+ repeat: boolean;
1232
+ shiftKey: boolean;
1233
+ /** @deprecated */
1234
+ which: number;
1235
+ }
1236
+
1237
+ interface MouseEvent<T = Element, E = NativeMouseEvent> extends UIEvent<T, E> {
1238
+ altKey: boolean;
1239
+ button: number;
1240
+ buttons: number;
1241
+ clientX: number;
1242
+ clientY: number;
1243
+ ctrlKey: boolean;
1244
+ /**
1245
+ * 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.
1246
+ */
1247
+ getModifierState(key: string): boolean;
1248
+ metaKey: boolean;
1249
+ movementX: number;
1250
+ movementY: number;
1251
+ pageX: number;
1252
+ pageY: number;
1253
+ relatedTarget: EventTarget | null;
1254
+ screenX: number;
1255
+ screenY: number;
1256
+ shiftKey: boolean;
1257
+ }
1258
+
1259
+ interface TouchEvent<T = Element> extends UIEvent<T, NativeTouchEvent> {
1260
+ altKey: boolean;
1261
+ changedTouches: TouchList;
1262
+ ctrlKey: boolean;
1263
+ /**
1264
+ * 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.
1265
+ */
1266
+ getModifierState(key: string): boolean;
1267
+ metaKey: boolean;
1268
+ shiftKey: boolean;
1269
+ targetTouches: TouchList;
1270
+ touches: TouchList;
1271
+ }
1272
+
1273
+ interface UIEvent<T = Element, E = NativeUIEvent> extends SyntheticEvent<T, E> {
1274
+ detail: number;
1275
+ view: AbstractView;
1276
+ }
1277
+
1278
+ interface WheelEvent<T = Element> extends MouseEvent<T, NativeWheelEvent> {
1279
+ deltaMode: number;
1280
+ deltaX: number;
1281
+ deltaY: number;
1282
+ deltaZ: number;
1283
+ }
1284
+
1285
+ interface AnimationEvent<T = Element> extends SyntheticEvent<T, NativeAnimationEvent> {
1286
+ animationName: string;
1287
+ elapsedTime: number;
1288
+ pseudoElement: string;
1289
+ }
1290
+
1291
+ interface TransitionEvent<T = Element> extends SyntheticEvent<T, NativeTransitionEvent> {
1292
+ elapsedTime: number;
1293
+ propertyName: string;
1294
+ pseudoElement: string;
1295
+ }
1296
+
1297
+ //
1298
+ // Event Handler Types
1299
+ // ----------------------------------------------------------------------
1300
+
1301
+ type EventHandler<E extends SyntheticEvent<any>> = { bivarianceHack(event: E): void }["bivarianceHack"];
1302
+
1303
+ type ReactEventHandler<T = Element> = EventHandler<SyntheticEvent<T>>;
1304
+
1305
+ type ClipboardEventHandler<T = Element> = EventHandler<ClipboardEvent<T>>;
1306
+ type CompositionEventHandler<T = Element> = EventHandler<CompositionEvent<T>>;
1307
+ type DragEventHandler<T = Element> = EventHandler<DragEvent<T>>;
1308
+ type FocusEventHandler<T = Element> = EventHandler<FocusEvent<T>>;
1309
+ type FormEventHandler<T = Element> = EventHandler<FormEvent<T>>;
1310
+ type ChangeEventHandler<T = Element> = EventHandler<ChangeEvent<T>>;
1311
+ type KeyboardEventHandler<T = Element> = EventHandler<KeyboardEvent<T>>;
1312
+ type MouseEventHandler<T = Element> = EventHandler<MouseEvent<T>>;
1313
+ type TouchEventHandler<T = Element> = EventHandler<TouchEvent<T>>;
1314
+ type PointerEventHandler<T = Element> = EventHandler<PointerEvent<T>>;
1315
+ type UIEventHandler<T = Element> = EventHandler<UIEvent<T>>;
1316
+ type WheelEventHandler<T = Element> = EventHandler<WheelEvent<T>>;
1317
+ type AnimationEventHandler<T = Element> = EventHandler<AnimationEvent<T>>;
1318
+ type TransitionEventHandler<T = Element> = EventHandler<TransitionEvent<T>>;
1319
+
1320
+ //
1321
+ // Props / DOM Attributes
1322
+ // ----------------------------------------------------------------------
1323
+
1324
+ /**
1325
+ * @deprecated. This was used to allow clients to pass `ref` and `key`
1326
+ * to `createElement`, which is no longer necessary due to intersection
1327
+ * types. If you need to declare a props object before passing it to
1328
+ * `createElement` or a factory, use `ClassAttributes<T>`:
1329
+ *
1330
+ * ```ts
1331
+ * var b: Button | null;
1332
+ * var props: ButtonProps & ClassAttributes<Button> = {
1333
+ * ref: b => button = b, // ok!
1334
+ * label: "I'm a Button"
1335
+ * };
1336
+ * ```
1337
+ */
1338
+ interface Props<T> {
1339
+ children?: ReactNode;
1340
+ key?: Key;
1341
+ ref?: LegacyRef<T>;
1342
+ }
1343
+
1344
+ interface HTMLProps<T> extends AllHTMLAttributes<T>, ClassAttributes<T> {
1345
+ }
1346
+
1347
+ type DetailedHTMLProps<E extends HTMLAttributes<T>, T> = ClassAttributes<T> & E;
1348
+
1349
+ interface SVGProps<T> extends SVGAttributes<T>, ClassAttributes<T> {
1350
+ }
1351
+
1352
+ interface DOMAttributes<T> {
1353
+ children?: ReactNode;
1354
+ dangerouslySetInnerHTML?: {
1355
+ __html: string;
1356
+ };
1357
+
1358
+ // Clipboard Events
1359
+ onCopy?: ClipboardEventHandler<T>;
1360
+ onCopyCapture?: ClipboardEventHandler<T>;
1361
+ onCut?: ClipboardEventHandler<T>;
1362
+ onCutCapture?: ClipboardEventHandler<T>;
1363
+ onPaste?: ClipboardEventHandler<T>;
1364
+ onPasteCapture?: ClipboardEventHandler<T>;
1365
+
1366
+ // Composition Events
1367
+ onCompositionEnd?: CompositionEventHandler<T>;
1368
+ onCompositionEndCapture?: CompositionEventHandler<T>;
1369
+ onCompositionStart?: CompositionEventHandler<T>;
1370
+ onCompositionStartCapture?: CompositionEventHandler<T>;
1371
+ onCompositionUpdate?: CompositionEventHandler<T>;
1372
+ onCompositionUpdateCapture?: CompositionEventHandler<T>;
1373
+
1374
+ // Focus Events
1375
+ onFocus?: FocusEventHandler<T>;
1376
+ onFocusCapture?: FocusEventHandler<T>;
1377
+ onBlur?: FocusEventHandler<T>;
1378
+ onBlurCapture?: FocusEventHandler<T>;
1379
+
1380
+ // Form Events
1381
+ onChange?: FormEventHandler<T>;
1382
+ onChangeCapture?: FormEventHandler<T>;
1383
+ onBeforeInput?: FormEventHandler<T>;
1384
+ onBeforeInputCapture?: FormEventHandler<T>;
1385
+ onInput?: FormEventHandler<T>;
1386
+ onInputCapture?: FormEventHandler<T>;
1387
+ onReset?: FormEventHandler<T>;
1388
+ onResetCapture?: FormEventHandler<T>;
1389
+ onSubmit?: FormEventHandler<T>;
1390
+ onSubmitCapture?: FormEventHandler<T>;
1391
+ onInvalid?: FormEventHandler<T>;
1392
+ onInvalidCapture?: FormEventHandler<T>;
1393
+
1394
+ // Image Events
1395
+ onLoad?: ReactEventHandler<T>;
1396
+ onLoadCapture?: ReactEventHandler<T>;
1397
+ onError?: ReactEventHandler<T>; // also a Media Event
1398
+ onErrorCapture?: ReactEventHandler<T>; // also a Media Event
1399
+
1400
+ // Keyboard Events
1401
+ onKeyDown?: KeyboardEventHandler<T>;
1402
+ onKeyDownCapture?: KeyboardEventHandler<T>;
1403
+ onKeyPress?: KeyboardEventHandler<T>;
1404
+ onKeyPressCapture?: KeyboardEventHandler<T>;
1405
+ onKeyUp?: KeyboardEventHandler<T>;
1406
+ onKeyUpCapture?: KeyboardEventHandler<T>;
1407
+
1408
+ // Media Events
1409
+ onAbort?: ReactEventHandler<T>;
1410
+ onAbortCapture?: ReactEventHandler<T>;
1411
+ onCanPlay?: ReactEventHandler<T>;
1412
+ onCanPlayCapture?: ReactEventHandler<T>;
1413
+ onCanPlayThrough?: ReactEventHandler<T>;
1414
+ onCanPlayThroughCapture?: ReactEventHandler<T>;
1415
+ onDurationChange?: ReactEventHandler<T>;
1416
+ onDurationChangeCapture?: ReactEventHandler<T>;
1417
+ onEmptied?: ReactEventHandler<T>;
1418
+ onEmptiedCapture?: ReactEventHandler<T>;
1419
+ onEncrypted?: ReactEventHandler<T>;
1420
+ onEncryptedCapture?: ReactEventHandler<T>;
1421
+ onEnded?: ReactEventHandler<T>;
1422
+ onEndedCapture?: ReactEventHandler<T>;
1423
+ onLoadedData?: ReactEventHandler<T>;
1424
+ onLoadedDataCapture?: ReactEventHandler<T>;
1425
+ onLoadedMetadata?: ReactEventHandler<T>;
1426
+ onLoadedMetadataCapture?: ReactEventHandler<T>;
1427
+ onLoadStart?: ReactEventHandler<T>;
1428
+ onLoadStartCapture?: ReactEventHandler<T>;
1429
+ onPause?: ReactEventHandler<T>;
1430
+ onPauseCapture?: ReactEventHandler<T>;
1431
+ onPlay?: ReactEventHandler<T>;
1432
+ onPlayCapture?: ReactEventHandler<T>;
1433
+ onPlaying?: ReactEventHandler<T>;
1434
+ onPlayingCapture?: ReactEventHandler<T>;
1435
+ onProgress?: ReactEventHandler<T>;
1436
+ onProgressCapture?: ReactEventHandler<T>;
1437
+ onRateChange?: ReactEventHandler<T>;
1438
+ onRateChangeCapture?: ReactEventHandler<T>;
1439
+ onSeeked?: ReactEventHandler<T>;
1440
+ onSeekedCapture?: ReactEventHandler<T>;
1441
+ onSeeking?: ReactEventHandler<T>;
1442
+ onSeekingCapture?: ReactEventHandler<T>;
1443
+ onStalled?: ReactEventHandler<T>;
1444
+ onStalledCapture?: ReactEventHandler<T>;
1445
+ onSuspend?: ReactEventHandler<T>;
1446
+ onSuspendCapture?: ReactEventHandler<T>;
1447
+ onTimeUpdate?: ReactEventHandler<T>;
1448
+ onTimeUpdateCapture?: ReactEventHandler<T>;
1449
+ onVolumeChange?: ReactEventHandler<T>;
1450
+ onVolumeChangeCapture?: ReactEventHandler<T>;
1451
+ onWaiting?: ReactEventHandler<T>;
1452
+ onWaitingCapture?: ReactEventHandler<T>;
1453
+
1454
+ // MouseEvents
1455
+ onAuxClick?: MouseEventHandler<T>;
1456
+ onAuxClickCapture?: MouseEventHandler<T>;
1457
+ onClick?: MouseEventHandler<T>;
1458
+ onClickCapture?: MouseEventHandler<T>;
1459
+ onContextMenu?: MouseEventHandler<T>;
1460
+ onContextMenuCapture?: MouseEventHandler<T>;
1461
+ onDoubleClick?: MouseEventHandler<T>;
1462
+ onDoubleClickCapture?: MouseEventHandler<T>;
1463
+ onDrag?: DragEventHandler<T>;
1464
+ onDragCapture?: DragEventHandler<T>;
1465
+ onDragEnd?: DragEventHandler<T>;
1466
+ onDragEndCapture?: DragEventHandler<T>;
1467
+ onDragEnter?: DragEventHandler<T>;
1468
+ onDragEnterCapture?: DragEventHandler<T>;
1469
+ onDragExit?: DragEventHandler<T>;
1470
+ onDragExitCapture?: DragEventHandler<T>;
1471
+ onDragLeave?: DragEventHandler<T>;
1472
+ onDragLeaveCapture?: DragEventHandler<T>;
1473
+ onDragOver?: DragEventHandler<T>;
1474
+ onDragOverCapture?: DragEventHandler<T>;
1475
+ onDragStart?: DragEventHandler<T>;
1476
+ onDragStartCapture?: DragEventHandler<T>;
1477
+ onDrop?: DragEventHandler<T>;
1478
+ onDropCapture?: DragEventHandler<T>;
1479
+ onMouseDown?: MouseEventHandler<T>;
1480
+ onMouseDownCapture?: MouseEventHandler<T>;
1481
+ onMouseEnter?: MouseEventHandler<T>;
1482
+ onMouseLeave?: MouseEventHandler<T>;
1483
+ onMouseMove?: MouseEventHandler<T>;
1484
+ onMouseMoveCapture?: MouseEventHandler<T>;
1485
+ onMouseOut?: MouseEventHandler<T>;
1486
+ onMouseOutCapture?: MouseEventHandler<T>;
1487
+ onMouseOver?: MouseEventHandler<T>;
1488
+ onMouseOverCapture?: MouseEventHandler<T>;
1489
+ onMouseUp?: MouseEventHandler<T>;
1490
+ onMouseUpCapture?: MouseEventHandler<T>;
1491
+
1492
+ // Selection Events
1493
+ onSelect?: ReactEventHandler<T>;
1494
+ onSelectCapture?: ReactEventHandler<T>;
1495
+
1496
+ // Touch Events
1497
+ onTouchCancel?: TouchEventHandler<T>;
1498
+ onTouchCancelCapture?: TouchEventHandler<T>;
1499
+ onTouchEnd?: TouchEventHandler<T>;
1500
+ onTouchEndCapture?: TouchEventHandler<T>;
1501
+ onTouchMove?: TouchEventHandler<T>;
1502
+ onTouchMoveCapture?: TouchEventHandler<T>;
1503
+ onTouchStart?: TouchEventHandler<T>;
1504
+ onTouchStartCapture?: TouchEventHandler<T>;
1505
+
1506
+ // Pointer Events
1507
+ onPointerDown?: PointerEventHandler<T>;
1508
+ onPointerDownCapture?: PointerEventHandler<T>;
1509
+ onPointerMove?: PointerEventHandler<T>;
1510
+ onPointerMoveCapture?: PointerEventHandler<T>;
1511
+ onPointerUp?: PointerEventHandler<T>;
1512
+ onPointerUpCapture?: PointerEventHandler<T>;
1513
+ onPointerCancel?: PointerEventHandler<T>;
1514
+ onPointerCancelCapture?: PointerEventHandler<T>;
1515
+ onPointerEnter?: PointerEventHandler<T>;
1516
+ onPointerEnterCapture?: PointerEventHandler<T>;
1517
+ onPointerLeave?: PointerEventHandler<T>;
1518
+ onPointerLeaveCapture?: PointerEventHandler<T>;
1519
+ onPointerOver?: PointerEventHandler<T>;
1520
+ onPointerOverCapture?: PointerEventHandler<T>;
1521
+ onPointerOut?: PointerEventHandler<T>;
1522
+ onPointerOutCapture?: PointerEventHandler<T>;
1523
+ onGotPointerCapture?: PointerEventHandler<T>;
1524
+ onGotPointerCaptureCapture?: PointerEventHandler<T>;
1525
+ onLostPointerCapture?: PointerEventHandler<T>;
1526
+ onLostPointerCaptureCapture?: PointerEventHandler<T>;
1527
+
1528
+ // UI Events
1529
+ onScroll?: UIEventHandler<T>;
1530
+ onScrollCapture?: UIEventHandler<T>;
1531
+
1532
+ // Wheel Events
1533
+ onWheel?: WheelEventHandler<T>;
1534
+ onWheelCapture?: WheelEventHandler<T>;
1535
+
1536
+ // Animation Events
1537
+ onAnimationStart?: AnimationEventHandler<T>;
1538
+ onAnimationStartCapture?: AnimationEventHandler<T>;
1539
+ onAnimationEnd?: AnimationEventHandler<T>;
1540
+ onAnimationEndCapture?: AnimationEventHandler<T>;
1541
+ onAnimationIteration?: AnimationEventHandler<T>;
1542
+ onAnimationIterationCapture?: AnimationEventHandler<T>;
1543
+
1544
+ // Transition Events
1545
+ onTransitionEnd?: TransitionEventHandler<T>;
1546
+ onTransitionEndCapture?: TransitionEventHandler<T>;
1547
+ }
1548
+
1549
+ export interface CSSProperties extends CSS.Properties<string | number> {
1550
+ /**
1551
+ * The index signature was removed to enable closed typing for style
1552
+ * using CSSType. You're able to use type assertion or module augmentation
1553
+ * to add properties or an index signature of your own.
1554
+ *
1555
+ * For examples and more information, visit:
1556
+ * https://github.com/frenic/csstype#what-should-i-do-when-i-get-type-errors
1557
+ */
1558
+ }
1559
+
1560
+ // All the WAI-ARIA 1.1 attributes from https://www.w3.org/TR/wai-aria-1.1/
1561
+ interface AriaAttributes {
1562
+ /** Identifies the currently active element when DOM focus is on a composite widget, textbox, group, or application. */
1563
+ 'aria-activedescendant'?: string;
1564
+ /** 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. */
1565
+ 'aria-atomic'?: boolean | 'false' | 'true';
1566
+ /**
1567
+ * 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
1568
+ * presented if they are made.
1569
+ */
1570
+ 'aria-autocomplete'?: 'none' | 'inline' | 'list' | 'both';
1571
+ /** 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. */
1572
+ 'aria-busy'?: boolean | 'false' | 'true';
1573
+ /**
1574
+ * Indicates the current "checked" state of checkboxes, radio buttons, and other widgets.
1575
+ * @see aria-pressed @see aria-selected.
1576
+ */
1577
+ 'aria-checked'?: boolean | 'false' | 'mixed' | 'true';
1578
+ /**
1579
+ * Defines the total number of columns in a table, grid, or treegrid.
1580
+ * @see aria-colindex.
1581
+ */
1582
+ 'aria-colcount'?: number;
1583
+ /**
1584
+ * Defines an element's column index or position with respect to the total number of columns within a table, grid, or treegrid.
1585
+ * @see aria-colcount @see aria-colspan.
1586
+ */
1587
+ 'aria-colindex'?: number;
1588
+ /**
1589
+ * Defines the number of columns spanned by a cell or gridcell within a table, grid, or treegrid.
1590
+ * @see aria-colindex @see aria-rowspan.
1591
+ */
1592
+ 'aria-colspan'?: number;
1593
+ /**
1594
+ * Identifies the element (or elements) whose contents or presence are controlled by the current element.
1595
+ * @see aria-owns.
1596
+ */
1597
+ 'aria-controls'?: string;
1598
+ /** Indicates the element that represents the current item within a container or set of related elements. */
1599
+ 'aria-current'?: boolean | 'false' | 'true' | 'page' | 'step' | 'location' | 'date' | 'time';
1600
+ /**
1601
+ * Identifies the element (or elements) that describes the object.
1602
+ * @see aria-labelledby
1603
+ */
1604
+ 'aria-describedby'?: string;
1605
+ /**
1606
+ * Identifies the element that provides a detailed, extended description for the object.
1607
+ * @see aria-describedby.
1608
+ */
1609
+ 'aria-details'?: string;
1610
+ /**
1611
+ * Indicates that the element is perceivable but disabled, so it is not editable or otherwise operable.
1612
+ * @see aria-hidden @see aria-readonly.
1613
+ */
1614
+ 'aria-disabled'?: boolean | 'false' | 'true';
1615
+ /**
1616
+ * Indicates what functions can be performed when a dragged object is released on the drop target.
1617
+ * @deprecated in ARIA 1.1
1618
+ */
1619
+ 'aria-dropeffect'?: 'none' | 'copy' | 'execute' | 'link' | 'move' | 'popup';
1620
+ /**
1621
+ * Identifies the element that provides an error message for the object.
1622
+ * @see aria-invalid @see aria-describedby.
1623
+ */
1624
+ 'aria-errormessage'?: string;
1625
+ /** Indicates whether the element, or another grouping element it controls, is currently expanded or collapsed. */
1626
+ 'aria-expanded'?: boolean | 'false' | 'true';
1627
+ /**
1628
+ * Identifies the next element (or elements) in an alternate reading order of content which, at the user's discretion,
1629
+ * allows assistive technology to override the general default of reading in document source order.
1630
+ */
1631
+ 'aria-flowto'?: string;
1632
+ /**
1633
+ * Indicates an element's "grabbed" state in a drag-and-drop operation.
1634
+ * @deprecated in ARIA 1.1
1635
+ */
1636
+ 'aria-grabbed'?: boolean | 'false' | 'true';
1637
+ /** Indicates the availability and type of interactive popup element, such as menu or dialog, that can be triggered by an element. */
1638
+ 'aria-haspopup'?: boolean | 'false' | 'true' | 'menu' | 'listbox' | 'tree' | 'grid' | 'dialog';
1639
+ /**
1640
+ * Indicates whether the element is exposed to an accessibility API.
1641
+ * @see aria-disabled.
1642
+ */
1643
+ 'aria-hidden'?: boolean | 'false' | 'true';
1644
+ /**
1645
+ * Indicates the entered value does not conform to the format expected by the application.
1646
+ * @see aria-errormessage.
1647
+ */
1648
+ 'aria-invalid'?: boolean | 'false' | 'true' | 'grammar' | 'spelling';
1649
+ /** Indicates keyboard shortcuts that an author has implemented to activate or give focus to an element. */
1650
+ 'aria-keyshortcuts'?: string;
1651
+ /**
1652
+ * Defines a string value that labels the current element.
1653
+ * @see aria-labelledby.
1654
+ */
1655
+ 'aria-label'?: string;
1656
+ /**
1657
+ * Identifies the element (or elements) that labels the current element.
1658
+ * @see aria-describedby.
1659
+ */
1660
+ 'aria-labelledby'?: string;
1661
+ /** Defines the hierarchical level of an element within a structure. */
1662
+ 'aria-level'?: number;
1663
+ /** 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. */
1664
+ 'aria-live'?: 'off' | 'assertive' | 'polite';
1665
+ /** Indicates whether an element is modal when displayed. */
1666
+ 'aria-modal'?: boolean | 'false' | 'true';
1667
+ /** Indicates whether a text box accepts multiple lines of input or only a single line. */
1668
+ 'aria-multiline'?: boolean | 'false' | 'true';
1669
+ /** Indicates that the user may select more than one item from the current selectable descendants. */
1670
+ 'aria-multiselectable'?: boolean | 'false' | 'true';
1671
+ /** Indicates whether the element's orientation is horizontal, vertical, or unknown/ambiguous. */
1672
+ 'aria-orientation'?: 'horizontal' | 'vertical';
1673
+ /**
1674
+ * Identifies an element (or elements) in order to define a visual, functional, or contextual parent/child relationship
1675
+ * between DOM elements where the DOM hierarchy cannot be used to represent the relationship.
1676
+ * @see aria-controls.
1677
+ */
1678
+ 'aria-owns'?: string;
1679
+ /**
1680
+ * Defines a short hint (a word or short phrase) intended to aid the user with data entry when the control has no value.
1681
+ * A hint could be a sample value or a brief description of the expected format.
1682
+ */
1683
+ 'aria-placeholder'?: string;
1684
+ /**
1685
+ * 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.
1686
+ * @see aria-setsize.
1687
+ */
1688
+ 'aria-posinset'?: number;
1689
+ /**
1690
+ * Indicates the current "pressed" state of toggle buttons.
1691
+ * @see aria-checked @see aria-selected.
1692
+ */
1693
+ 'aria-pressed'?: boolean | 'false' | 'mixed' | 'true';
1694
+ /**
1695
+ * Indicates that the element is not editable, but is otherwise operable.
1696
+ * @see aria-disabled.
1697
+ */
1698
+ 'aria-readonly'?: boolean | 'false' | 'true';
1699
+ /**
1700
+ * Indicates what notifications the user agent will trigger when the accessibility tree within a live region is modified.
1701
+ * @see aria-atomic.
1702
+ */
1703
+ 'aria-relevant'?: 'additions' | 'additions removals' | 'additions text' | 'all' | 'removals' | 'removals additions' | 'removals text' | 'text' | 'text additions' | 'text removals';
1704
+ /** Indicates that user input is required on the element before a form may be submitted. */
1705
+ 'aria-required'?: boolean | 'false' | 'true';
1706
+ /** Defines a human-readable, author-localized description for the role of an element. */
1707
+ 'aria-roledescription'?: string;
1708
+ /**
1709
+ * Defines the total number of rows in a table, grid, or treegrid.
1710
+ * @see aria-rowindex.
1711
+ */
1712
+ 'aria-rowcount'?: number;
1713
+ /**
1714
+ * Defines an element's row index or position with respect to the total number of rows within a table, grid, or treegrid.
1715
+ * @see aria-rowcount @see aria-rowspan.
1716
+ */
1717
+ 'aria-rowindex'?: number;
1718
+ /**
1719
+ * Defines the number of rows spanned by a cell or gridcell within a table, grid, or treegrid.
1720
+ * @see aria-rowindex @see aria-colspan.
1721
+ */
1722
+ 'aria-rowspan'?: number;
1723
+ /**
1724
+ * Indicates the current "selected" state of various widgets.
1725
+ * @see aria-checked @see aria-pressed.
1726
+ */
1727
+ 'aria-selected'?: boolean | 'false' | 'true';
1728
+ /**
1729
+ * 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.
1730
+ * @see aria-posinset.
1731
+ */
1732
+ 'aria-setsize'?: number;
1733
+ /** Indicates if items in a table or grid are sorted in ascending or descending order. */
1734
+ 'aria-sort'?: 'none' | 'ascending' | 'descending' | 'other';
1735
+ /** Defines the maximum allowed value for a range widget. */
1736
+ 'aria-valuemax'?: number;
1737
+ /** Defines the minimum allowed value for a range widget. */
1738
+ 'aria-valuemin'?: number;
1739
+ /**
1740
+ * Defines the current value for a range widget.
1741
+ * @see aria-valuetext.
1742
+ */
1743
+ 'aria-valuenow'?: number;
1744
+ /** Defines the human readable text alternative of aria-valuenow for a range widget. */
1745
+ 'aria-valuetext'?: string;
1746
+ }
1747
+
1748
+ interface HTMLAttributes<T> extends AriaAttributes, DOMAttributes<T> {
1749
+ // React-specific Attributes
1750
+ defaultChecked?: boolean;
1751
+ defaultValue?: string | number | ReadonlyArray<string>;
1752
+ suppressContentEditableWarning?: boolean;
1753
+ suppressHydrationWarning?: boolean;
1754
+
1755
+ // Standard HTML Attributes
1756
+ accessKey?: string;
1757
+ className?: string;
1758
+ contentEditable?: Booleanish | "inherit";
1759
+ contextMenu?: string;
1760
+ dir?: string;
1761
+ draggable?: Booleanish;
1762
+ hidden?: boolean;
1763
+ id?: string;
1764
+ lang?: string;
1765
+ placeholder?: string;
1766
+ slot?: string;
1767
+ spellCheck?: Booleanish;
1768
+ style?: CSSProperties;
1769
+ tabIndex?: number;
1770
+ title?: string;
1771
+ translate?: 'yes' | 'no';
1772
+
1773
+ // Unknown
1774
+ radioGroup?: string; // <command>, <menuitem>
1775
+
1776
+ // WAI-ARIA
1777
+ role?: string;
1778
+
1779
+ // RDFa Attributes
1780
+ about?: string;
1781
+ datatype?: string;
1782
+ inlist?: any;
1783
+ prefix?: string;
1784
+ property?: string;
1785
+ resource?: string;
1786
+ typeof?: string;
1787
+ vocab?: string;
1788
+
1789
+ // Non-standard Attributes
1790
+ autoCapitalize?: string;
1791
+ autoCorrect?: string;
1792
+ autoSave?: string;
1793
+ color?: string;
1794
+ itemProp?: string;
1795
+ itemScope?: boolean;
1796
+ itemType?: string;
1797
+ itemID?: string;
1798
+ itemRef?: string;
1799
+ results?: number;
1800
+ security?: string;
1801
+ unselectable?: 'on' | 'off';
1802
+
1803
+ // Living Standard
1804
+ /**
1805
+ * Hints at the type of data that might be entered by the user while editing the element or its contents
1806
+ * @see https://html.spec.whatwg.org/multipage/interaction.html#input-modalities:-the-inputmode-attribute
1807
+ */
1808
+ inputMode?: 'none' | 'text' | 'tel' | 'url' | 'email' | 'numeric' | 'decimal' | 'search';
1809
+ /**
1810
+ * Specify that a standard HTML element should behave like a defined custom built-in element
1811
+ * @see https://html.spec.whatwg.org/multipage/custom-elements.html#attr-is
1812
+ */
1813
+ is?: string;
1814
+ }
1815
+
1816
+ interface AllHTMLAttributes<T> extends HTMLAttributes<T> {
1817
+ // Standard HTML Attributes
1818
+ accept?: string;
1819
+ acceptCharset?: string;
1820
+ action?: string;
1821
+ allowFullScreen?: boolean;
1822
+ allowTransparency?: boolean;
1823
+ alt?: string;
1824
+ as?: string;
1825
+ async?: boolean;
1826
+ autoComplete?: string;
1827
+ autoFocus?: boolean;
1828
+ autoPlay?: boolean;
1829
+ capture?: boolean | string;
1830
+ cellPadding?: number | string;
1831
+ cellSpacing?: number | string;
1832
+ charSet?: string;
1833
+ challenge?: string;
1834
+ checked?: boolean;
1835
+ cite?: string;
1836
+ classID?: string;
1837
+ cols?: number;
1838
+ colSpan?: number;
1839
+ content?: string;
1840
+ controls?: boolean;
1841
+ coords?: string;
1842
+ crossOrigin?: string;
1843
+ data?: string;
1844
+ dateTime?: string;
1845
+ default?: boolean;
1846
+ defer?: boolean;
1847
+ disabled?: boolean;
1848
+ download?: any;
1849
+ encType?: string;
1850
+ form?: string;
1851
+ formAction?: string;
1852
+ formEncType?: string;
1853
+ formMethod?: string;
1854
+ formNoValidate?: boolean;
1855
+ formTarget?: string;
1856
+ frameBorder?: number | string;
1857
+ headers?: string;
1858
+ height?: number | string;
1859
+ high?: number;
1860
+ href?: string;
1861
+ hrefLang?: string;
1862
+ htmlFor?: string;
1863
+ httpEquiv?: string;
1864
+ integrity?: string;
1865
+ keyParams?: string;
1866
+ keyType?: string;
1867
+ kind?: string;
1868
+ label?: string;
1869
+ list?: string;
1870
+ loop?: boolean;
1871
+ low?: number;
1872
+ manifest?: string;
1873
+ marginHeight?: number;
1874
+ marginWidth?: number;
1875
+ max?: number | string;
1876
+ maxLength?: number;
1877
+ media?: string;
1878
+ mediaGroup?: string;
1879
+ method?: string;
1880
+ min?: number | string;
1881
+ minLength?: number;
1882
+ multiple?: boolean;
1883
+ muted?: boolean;
1884
+ name?: string;
1885
+ nonce?: string;
1886
+ noValidate?: boolean;
1887
+ open?: boolean;
1888
+ optimum?: number;
1889
+ pattern?: string;
1890
+ placeholder?: string;
1891
+ playsInline?: boolean;
1892
+ poster?: string;
1893
+ preload?: string;
1894
+ readOnly?: boolean;
1895
+ rel?: string;
1896
+ required?: boolean;
1897
+ reversed?: boolean;
1898
+ rows?: number;
1899
+ rowSpan?: number;
1900
+ sandbox?: string;
1901
+ scope?: string;
1902
+ scoped?: boolean;
1903
+ scrolling?: string;
1904
+ seamless?: boolean;
1905
+ selected?: boolean;
1906
+ shape?: string;
1907
+ size?: number;
1908
+ sizes?: string;
1909
+ span?: number;
1910
+ src?: string;
1911
+ srcDoc?: string;
1912
+ srcLang?: string;
1913
+ srcSet?: string;
1914
+ start?: number;
1915
+ step?: number | string;
1916
+ summary?: string;
1917
+ target?: string;
1918
+ type?: string;
1919
+ useMap?: string;
1920
+ value?: string | ReadonlyArray<string> | number;
1921
+ width?: number | string;
1922
+ wmode?: string;
1923
+ wrap?: string;
1924
+ }
1925
+
1926
+ type HTMLAttributeReferrerPolicy =
1927
+ | ''
1928
+ | 'no-referrer'
1929
+ | 'no-referrer-when-downgrade'
1930
+ | 'origin'
1931
+ | 'origin-when-cross-origin'
1932
+ | 'same-origin'
1933
+ | 'strict-origin'
1934
+ | 'strict-origin-when-cross-origin'
1935
+ | 'unsafe-url';
1936
+
1937
+ interface AnchorHTMLAttributes<T> extends HTMLAttributes<T> {
1938
+ download?: any;
1939
+ href?: string;
1940
+ hrefLang?: string;
1941
+ media?: string;
1942
+ ping?: string;
1943
+ rel?: string;
1944
+ target?: string;
1945
+ type?: string;
1946
+ referrerPolicy?: HTMLAttributeReferrerPolicy;
1947
+ }
1948
+
1949
+ interface AudioHTMLAttributes<T> extends MediaHTMLAttributes<T> {}
1950
+
1951
+ interface AreaHTMLAttributes<T> extends HTMLAttributes<T> {
1952
+ alt?: string;
1953
+ coords?: string;
1954
+ download?: any;
1955
+ href?: string;
1956
+ hrefLang?: string;
1957
+ media?: string;
1958
+ referrerPolicy?: HTMLAttributeReferrerPolicy;
1959
+ rel?: string;
1960
+ shape?: string;
1961
+ target?: string;
1962
+ }
1963
+
1964
+ interface BaseHTMLAttributes<T> extends HTMLAttributes<T> {
1965
+ href?: string;
1966
+ target?: string;
1967
+ }
1968
+
1969
+ interface BlockquoteHTMLAttributes<T> extends HTMLAttributes<T> {
1970
+ cite?: string;
1971
+ }
1972
+
1973
+ interface ButtonHTMLAttributes<T> extends HTMLAttributes<T> {
1974
+ autoFocus?: boolean;
1975
+ disabled?: boolean;
1976
+ form?: string;
1977
+ formAction?: string;
1978
+ formEncType?: string;
1979
+ formMethod?: string;
1980
+ formNoValidate?: boolean;
1981
+ formTarget?: string;
1982
+ name?: string;
1983
+ type?: 'submit' | 'reset' | 'button';
1984
+ value?: string | ReadonlyArray<string> | number;
1985
+ }
1986
+
1987
+ interface CanvasHTMLAttributes<T> extends HTMLAttributes<T> {
1988
+ height?: number | string;
1989
+ width?: number | string;
1990
+ }
1991
+
1992
+ interface ColHTMLAttributes<T> extends HTMLAttributes<T> {
1993
+ span?: number;
1994
+ width?: number | string;
1995
+ }
1996
+
1997
+ interface ColgroupHTMLAttributes<T> extends HTMLAttributes<T> {
1998
+ span?: number;
1999
+ }
2000
+
2001
+ interface DataHTMLAttributes<T> extends HTMLAttributes<T> {
2002
+ value?: string | ReadonlyArray<string> | number;
2003
+ }
2004
+
2005
+ interface DetailsHTMLAttributes<T> extends HTMLAttributes<T> {
2006
+ open?: boolean;
2007
+ onToggle?: ReactEventHandler<T>;
2008
+ }
2009
+
2010
+ interface DelHTMLAttributes<T> extends HTMLAttributes<T> {
2011
+ cite?: string;
2012
+ dateTime?: string;
2013
+ }
2014
+
2015
+ interface DialogHTMLAttributes<T> extends HTMLAttributes<T> {
2016
+ open?: boolean;
2017
+ }
2018
+
2019
+ interface EmbedHTMLAttributes<T> extends HTMLAttributes<T> {
2020
+ height?: number | string;
2021
+ src?: string;
2022
+ type?: string;
2023
+ width?: number | string;
2024
+ }
2025
+
2026
+ interface FieldsetHTMLAttributes<T> extends HTMLAttributes<T> {
2027
+ disabled?: boolean;
2028
+ form?: string;
2029
+ name?: string;
2030
+ }
2031
+
2032
+ interface FormHTMLAttributes<T> extends HTMLAttributes<T> {
2033
+ acceptCharset?: string;
2034
+ action?: string;
2035
+ autoComplete?: string;
2036
+ encType?: string;
2037
+ method?: string;
2038
+ name?: string;
2039
+ noValidate?: boolean;
2040
+ target?: string;
2041
+ }
2042
+
2043
+ interface HtmlHTMLAttributes<T> extends HTMLAttributes<T> {
2044
+ manifest?: string;
2045
+ }
2046
+
2047
+ interface IframeHTMLAttributes<T> extends HTMLAttributes<T> {
2048
+ allow?: string;
2049
+ allowFullScreen?: boolean;
2050
+ allowTransparency?: boolean;
2051
+ /** @deprecated */
2052
+ frameBorder?: number | string;
2053
+ height?: number | string;
2054
+ loading?: "eager" | "lazy";
2055
+ /** @deprecated */
2056
+ marginHeight?: number;
2057
+ /** @deprecated */
2058
+ marginWidth?: number;
2059
+ name?: string;
2060
+ referrerPolicy?: HTMLAttributeReferrerPolicy;
2061
+ sandbox?: string;
2062
+ /** @deprecated */
2063
+ scrolling?: string;
2064
+ seamless?: boolean;
2065
+ src?: string;
2066
+ srcDoc?: string;
2067
+ width?: number | string;
2068
+ }
2069
+
2070
+ interface ImgHTMLAttributes<T> extends HTMLAttributes<T> {
2071
+ alt?: string;
2072
+ crossOrigin?: "anonymous" | "use-credentials" | "";
2073
+ decoding?: "async" | "auto" | "sync";
2074
+ height?: number | string;
2075
+ loading?: "eager" | "lazy";
2076
+ referrerPolicy?: HTMLAttributeReferrerPolicy;
2077
+ sizes?: string;
2078
+ src?: string;
2079
+ srcSet?: string;
2080
+ useMap?: string;
2081
+ width?: number | string;
2082
+ }
2083
+
2084
+ interface InsHTMLAttributes<T> extends HTMLAttributes<T> {
2085
+ cite?: string;
2086
+ dateTime?: string;
2087
+ }
2088
+
2089
+ interface InputHTMLAttributes<T> extends HTMLAttributes<T> {
2090
+ accept?: string;
2091
+ alt?: string;
2092
+ autoComplete?: string;
2093
+ autoFocus?: boolean;
2094
+ capture?: boolean | string; // https://www.w3.org/TR/html-media-capture/#the-capture-attribute
2095
+ checked?: boolean;
2096
+ crossOrigin?: string;
2097
+ disabled?: boolean;
2098
+ enterKeyHint?: 'enter' | 'done' | 'go' | 'next' | 'previous' | 'search' | 'send';
2099
+ form?: string;
2100
+ formAction?: string;
2101
+ formEncType?: string;
2102
+ formMethod?: string;
2103
+ formNoValidate?: boolean;
2104
+ formTarget?: string;
2105
+ height?: number | string;
2106
+ list?: string;
2107
+ max?: number | string;
2108
+ maxLength?: number;
2109
+ min?: number | string;
2110
+ minLength?: number;
2111
+ multiple?: boolean;
2112
+ name?: string;
2113
+ pattern?: string;
2114
+ placeholder?: string;
2115
+ readOnly?: boolean;
2116
+ required?: boolean;
2117
+ size?: number;
2118
+ src?: string;
2119
+ step?: number | string;
2120
+ type?: string;
2121
+ value?: string | ReadonlyArray<string> | number;
2122
+ width?: number | string;
2123
+
2124
+ onChange?: ChangeEventHandler<T>;
2125
+ }
2126
+
2127
+ interface KeygenHTMLAttributes<T> extends HTMLAttributes<T> {
2128
+ autoFocus?: boolean;
2129
+ challenge?: string;
2130
+ disabled?: boolean;
2131
+ form?: string;
2132
+ keyType?: string;
2133
+ keyParams?: string;
2134
+ name?: string;
2135
+ }
2136
+
2137
+ interface LabelHTMLAttributes<T> extends HTMLAttributes<T> {
2138
+ form?: string;
2139
+ htmlFor?: string;
2140
+ }
2141
+
2142
+ interface LiHTMLAttributes<T> extends HTMLAttributes<T> {
2143
+ value?: string | ReadonlyArray<string> | number;
2144
+ }
2145
+
2146
+ interface LinkHTMLAttributes<T> extends HTMLAttributes<T> {
2147
+ as?: string;
2148
+ crossOrigin?: string;
2149
+ href?: string;
2150
+ hrefLang?: string;
2151
+ integrity?: string;
2152
+ media?: string;
2153
+ referrerPolicy?: HTMLAttributeReferrerPolicy;
2154
+ rel?: string;
2155
+ sizes?: string;
2156
+ type?: string;
2157
+ charSet?: string;
2158
+ }
2159
+
2160
+ interface MapHTMLAttributes<T> extends HTMLAttributes<T> {
2161
+ name?: string;
2162
+ }
2163
+
2164
+ interface MenuHTMLAttributes<T> extends HTMLAttributes<T> {
2165
+ type?: string;
2166
+ }
2167
+
2168
+ interface MediaHTMLAttributes<T> extends HTMLAttributes<T> {
2169
+ autoPlay?: boolean;
2170
+ controls?: boolean;
2171
+ controlsList?: string;
2172
+ crossOrigin?: string;
2173
+ loop?: boolean;
2174
+ mediaGroup?: string;
2175
+ muted?: boolean;
2176
+ playsInline?: boolean;
2177
+ preload?: string;
2178
+ src?: string;
2179
+ }
2180
+
2181
+ interface MetaHTMLAttributes<T> extends HTMLAttributes<T> {
2182
+ charSet?: string;
2183
+ content?: string;
2184
+ httpEquiv?: string;
2185
+ name?: string;
2186
+ }
2187
+
2188
+ interface MeterHTMLAttributes<T> extends HTMLAttributes<T> {
2189
+ form?: string;
2190
+ high?: number;
2191
+ low?: number;
2192
+ max?: number | string;
2193
+ min?: number | string;
2194
+ optimum?: number;
2195
+ value?: string | ReadonlyArray<string> | number;
2196
+ }
2197
+
2198
+ interface QuoteHTMLAttributes<T> extends HTMLAttributes<T> {
2199
+ cite?: string;
2200
+ }
2201
+
2202
+ interface ObjectHTMLAttributes<T> extends HTMLAttributes<T> {
2203
+ classID?: string;
2204
+ data?: string;
2205
+ form?: string;
2206
+ height?: number | string;
2207
+ name?: string;
2208
+ type?: string;
2209
+ useMap?: string;
2210
+ width?: number | string;
2211
+ wmode?: string;
2212
+ }
2213
+
2214
+ interface OlHTMLAttributes<T> extends HTMLAttributes<T> {
2215
+ reversed?: boolean;
2216
+ start?: number;
2217
+ type?: '1' | 'a' | 'A' | 'i' | 'I';
2218
+ }
2219
+
2220
+ interface OptgroupHTMLAttributes<T> extends HTMLAttributes<T> {
2221
+ disabled?: boolean;
2222
+ label?: string;
2223
+ }
2224
+
2225
+ interface OptionHTMLAttributes<T> extends HTMLAttributes<T> {
2226
+ disabled?: boolean;
2227
+ label?: string;
2228
+ selected?: boolean;
2229
+ value?: string | ReadonlyArray<string> | number;
2230
+ }
2231
+
2232
+ interface OutputHTMLAttributes<T> extends HTMLAttributes<T> {
2233
+ form?: string;
2234
+ htmlFor?: string;
2235
+ name?: string;
2236
+ }
2237
+
2238
+ interface ParamHTMLAttributes<T> extends HTMLAttributes<T> {
2239
+ name?: string;
2240
+ value?: string | ReadonlyArray<string> | number;
2241
+ }
2242
+
2243
+ interface ProgressHTMLAttributes<T> extends HTMLAttributes<T> {
2244
+ max?: number | string;
2245
+ value?: string | ReadonlyArray<string> | number;
2246
+ }
2247
+
2248
+ interface SlotHTMLAttributes<T> extends HTMLAttributes<T> {
2249
+ name?: string;
2250
+ }
2251
+
2252
+ interface ScriptHTMLAttributes<T> extends HTMLAttributes<T> {
2253
+ async?: boolean;
2254
+ /** @deprecated */
2255
+ charSet?: string;
2256
+ crossOrigin?: string;
2257
+ defer?: boolean;
2258
+ integrity?: string;
2259
+ noModule?: boolean;
2260
+ nonce?: string;
2261
+ referrerPolicy?: HTMLAttributeReferrerPolicy;
2262
+ src?: string;
2263
+ type?: string;
2264
+ }
2265
+
2266
+ interface SelectHTMLAttributes<T> extends HTMLAttributes<T> {
2267
+ autoComplete?: string;
2268
+ autoFocus?: boolean;
2269
+ disabled?: boolean;
2270
+ form?: string;
2271
+ multiple?: boolean;
2272
+ name?: string;
2273
+ required?: boolean;
2274
+ size?: number;
2275
+ value?: string | ReadonlyArray<string> | number;
2276
+ onChange?: ChangeEventHandler<T>;
2277
+ }
2278
+
2279
+ interface SourceHTMLAttributes<T> extends HTMLAttributes<T> {
2280
+ media?: string;
2281
+ sizes?: string;
2282
+ src?: string;
2283
+ srcSet?: string;
2284
+ type?: string;
2285
+ }
2286
+
2287
+ interface StyleHTMLAttributes<T> extends HTMLAttributes<T> {
2288
+ media?: string;
2289
+ nonce?: string;
2290
+ scoped?: boolean;
2291
+ type?: string;
2292
+ }
2293
+
2294
+ interface TableHTMLAttributes<T> extends HTMLAttributes<T> {
2295
+ cellPadding?: number | string;
2296
+ cellSpacing?: number | string;
2297
+ summary?: string;
2298
+ width?: number | string;
2299
+ }
2300
+
2301
+ interface TextareaHTMLAttributes<T> extends HTMLAttributes<T> {
2302
+ autoComplete?: string;
2303
+ autoFocus?: boolean;
2304
+ cols?: number;
2305
+ dirName?: string;
2306
+ disabled?: boolean;
2307
+ form?: string;
2308
+ maxLength?: number;
2309
+ minLength?: number;
2310
+ name?: string;
2311
+ placeholder?: string;
2312
+ readOnly?: boolean;
2313
+ required?: boolean;
2314
+ rows?: number;
2315
+ value?: string | ReadonlyArray<string> | number;
2316
+ wrap?: string;
2317
+
2318
+ onChange?: ChangeEventHandler<T>;
2319
+ }
2320
+
2321
+ interface TdHTMLAttributes<T> extends HTMLAttributes<T> {
2322
+ align?: "left" | "center" | "right" | "justify" | "char";
2323
+ colSpan?: number;
2324
+ headers?: string;
2325
+ rowSpan?: number;
2326
+ scope?: string;
2327
+ abbr?: string;
2328
+ height?: number | string;
2329
+ width?: number | string;
2330
+ valign?: "top" | "middle" | "bottom" | "baseline";
2331
+ }
2332
+
2333
+ interface ThHTMLAttributes<T> extends HTMLAttributes<T> {
2334
+ align?: "left" | "center" | "right" | "justify" | "char";
2335
+ colSpan?: number;
2336
+ headers?: string;
2337
+ rowSpan?: number;
2338
+ scope?: string;
2339
+ abbr?: string;
2340
+ }
2341
+
2342
+ interface TimeHTMLAttributes<T> extends HTMLAttributes<T> {
2343
+ dateTime?: string;
2344
+ }
2345
+
2346
+ interface TrackHTMLAttributes<T> extends HTMLAttributes<T> {
2347
+ default?: boolean;
2348
+ kind?: string;
2349
+ label?: string;
2350
+ src?: string;
2351
+ srcLang?: string;
2352
+ }
2353
+
2354
+ interface VideoHTMLAttributes<T> extends MediaHTMLAttributes<T> {
2355
+ height?: number | string;
2356
+ playsInline?: boolean;
2357
+ poster?: string;
2358
+ width?: number | string;
2359
+ disablePictureInPicture?: boolean;
2360
+ disableRemotePlayback?: boolean;
2361
+ }
2362
+
2363
+ // this list is "complete" in that it contains every SVG attribute
2364
+ // that React supports, but the types can be improved.
2365
+ // Full list here: https://facebook.github.io/react/docs/dom-elements.html
2366
+ //
2367
+ // The three broad type categories are (in order of restrictiveness):
2368
+ // - "number | string"
2369
+ // - "string"
2370
+ // - union of string literals
2371
+ interface SVGAttributes<T> extends AriaAttributes, DOMAttributes<T> {
2372
+ // Attributes which also defined in HTMLAttributes
2373
+ // See comment in SVGDOMPropertyConfig.js
2374
+ className?: string;
2375
+ color?: string;
2376
+ height?: number | string;
2377
+ id?: string;
2378
+ lang?: string;
2379
+ max?: number | string;
2380
+ media?: string;
2381
+ method?: string;
2382
+ min?: number | string;
2383
+ name?: string;
2384
+ style?: CSSProperties;
2385
+ target?: string;
2386
+ type?: string;
2387
+ width?: number | string;
2388
+
2389
+ // Other HTML properties supported by SVG elements in browsers
2390
+ role?: string;
2391
+ tabIndex?: number;
2392
+ crossOrigin?: "anonymous" | "use-credentials" | "";
2393
+
2394
+ // SVG Specific attributes
2395
+ accentHeight?: number | string;
2396
+ accumulate?: "none" | "sum";
2397
+ additive?: "replace" | "sum";
2398
+ alignmentBaseline?: "auto" | "baseline" | "before-edge" | "text-before-edge" | "middle" | "central" | "after-edge" |
2399
+ "text-after-edge" | "ideographic" | "alphabetic" | "hanging" | "mathematical" | "inherit";
2400
+ allowReorder?: "no" | "yes";
2401
+ alphabetic?: number | string;
2402
+ amplitude?: number | string;
2403
+ arabicForm?: "initial" | "medial" | "terminal" | "isolated";
2404
+ ascent?: number | string;
2405
+ attributeName?: string;
2406
+ attributeType?: string;
2407
+ autoReverse?: Booleanish;
2408
+ azimuth?: number | string;
2409
+ baseFrequency?: number | string;
2410
+ baselineShift?: number | string;
2411
+ baseProfile?: number | string;
2412
+ bbox?: number | string;
2413
+ begin?: number | string;
2414
+ bias?: number | string;
2415
+ by?: number | string;
2416
+ calcMode?: number | string;
2417
+ capHeight?: number | string;
2418
+ clip?: number | string;
2419
+ clipPath?: string;
2420
+ clipPathUnits?: number | string;
2421
+ clipRule?: number | string;
2422
+ colorInterpolation?: number | string;
2423
+ colorInterpolationFilters?: "auto" | "sRGB" | "linearRGB" | "inherit";
2424
+ colorProfile?: number | string;
2425
+ colorRendering?: number | string;
2426
+ contentScriptType?: number | string;
2427
+ contentStyleType?: number | string;
2428
+ cursor?: number | string;
2429
+ cx?: number | string;
2430
+ cy?: number | string;
2431
+ d?: string;
2432
+ decelerate?: number | string;
2433
+ descent?: number | string;
2434
+ diffuseConstant?: number | string;
2435
+ direction?: number | string;
2436
+ display?: number | string;
2437
+ divisor?: number | string;
2438
+ dominantBaseline?: number | string;
2439
+ dur?: number | string;
2440
+ dx?: number | string;
2441
+ dy?: number | string;
2442
+ edgeMode?: number | string;
2443
+ elevation?: number | string;
2444
+ enableBackground?: number | string;
2445
+ end?: number | string;
2446
+ exponent?: number | string;
2447
+ externalResourcesRequired?: Booleanish;
2448
+ fill?: string;
2449
+ fillOpacity?: number | string;
2450
+ fillRule?: "nonzero" | "evenodd" | "inherit";
2451
+ filter?: string;
2452
+ filterRes?: number | string;
2453
+ filterUnits?: number | string;
2454
+ floodColor?: number | string;
2455
+ floodOpacity?: number | string;
2456
+ focusable?: Booleanish | "auto";
2457
+ fontFamily?: string;
2458
+ fontSize?: number | string;
2459
+ fontSizeAdjust?: number | string;
2460
+ fontStretch?: number | string;
2461
+ fontStyle?: number | string;
2462
+ fontVariant?: number | string;
2463
+ fontWeight?: number | string;
2464
+ format?: number | string;
2465
+ from?: number | string;
2466
+ fx?: number | string;
2467
+ fy?: number | string;
2468
+ g1?: number | string;
2469
+ g2?: number | string;
2470
+ glyphName?: number | string;
2471
+ glyphOrientationHorizontal?: number | string;
2472
+ glyphOrientationVertical?: number | string;
2473
+ glyphRef?: number | string;
2474
+ gradientTransform?: string;
2475
+ gradientUnits?: string;
2476
+ hanging?: number | string;
2477
+ horizAdvX?: number | string;
2478
+ horizOriginX?: number | string;
2479
+ href?: string;
2480
+ ideographic?: number | string;
2481
+ imageRendering?: number | string;
2482
+ in2?: number | string;
2483
+ in?: string;
2484
+ intercept?: number | string;
2485
+ k1?: number | string;
2486
+ k2?: number | string;
2487
+ k3?: number | string;
2488
+ k4?: number | string;
2489
+ k?: number | string;
2490
+ kernelMatrix?: number | string;
2491
+ kernelUnitLength?: number | string;
2492
+ kerning?: number | string;
2493
+ keyPoints?: number | string;
2494
+ keySplines?: number | string;
2495
+ keyTimes?: number | string;
2496
+ lengthAdjust?: number | string;
2497
+ letterSpacing?: number | string;
2498
+ lightingColor?: number | string;
2499
+ limitingConeAngle?: number | string;
2500
+ local?: number | string;
2501
+ markerEnd?: string;
2502
+ markerHeight?: number | string;
2503
+ markerMid?: string;
2504
+ markerStart?: string;
2505
+ markerUnits?: number | string;
2506
+ markerWidth?: number | string;
2507
+ mask?: string;
2508
+ maskContentUnits?: number | string;
2509
+ maskUnits?: number | string;
2510
+ mathematical?: number | string;
2511
+ mode?: number | string;
2512
+ numOctaves?: number | string;
2513
+ offset?: number | string;
2514
+ opacity?: number | string;
2515
+ operator?: number | string;
2516
+ order?: number | string;
2517
+ orient?: number | string;
2518
+ orientation?: number | string;
2519
+ origin?: number | string;
2520
+ overflow?: number | string;
2521
+ overlinePosition?: number | string;
2522
+ overlineThickness?: number | string;
2523
+ paintOrder?: number | string;
2524
+ panose1?: number | string;
2525
+ path?: string;
2526
+ pathLength?: number | string;
2527
+ patternContentUnits?: string;
2528
+ patternTransform?: number | string;
2529
+ patternUnits?: string;
2530
+ pointerEvents?: number | string;
2531
+ points?: string;
2532
+ pointsAtX?: number | string;
2533
+ pointsAtY?: number | string;
2534
+ pointsAtZ?: number | string;
2535
+ preserveAlpha?: Booleanish;
2536
+ preserveAspectRatio?: string;
2537
+ primitiveUnits?: number | string;
2538
+ r?: number | string;
2539
+ radius?: number | string;
2540
+ refX?: number | string;
2541
+ refY?: number | string;
2542
+ renderingIntent?: number | string;
2543
+ repeatCount?: number | string;
2544
+ repeatDur?: number | string;
2545
+ requiredExtensions?: number | string;
2546
+ requiredFeatures?: number | string;
2547
+ restart?: number | string;
2548
+ result?: string;
2549
+ rotate?: number | string;
2550
+ rx?: number | string;
2551
+ ry?: number | string;
2552
+ scale?: number | string;
2553
+ seed?: number | string;
2554
+ shapeRendering?: number | string;
2555
+ slope?: number | string;
2556
+ spacing?: number | string;
2557
+ specularConstant?: number | string;
2558
+ specularExponent?: number | string;
2559
+ speed?: number | string;
2560
+ spreadMethod?: string;
2561
+ startOffset?: number | string;
2562
+ stdDeviation?: number | string;
2563
+ stemh?: number | string;
2564
+ stemv?: number | string;
2565
+ stitchTiles?: number | string;
2566
+ stopColor?: string;
2567
+ stopOpacity?: number | string;
2568
+ strikethroughPosition?: number | string;
2569
+ strikethroughThickness?: number | string;
2570
+ string?: number | string;
2571
+ stroke?: string;
2572
+ strokeDasharray?: string | number;
2573
+ strokeDashoffset?: string | number;
2574
+ strokeLinecap?: "butt" | "round" | "square" | "inherit";
2575
+ strokeLinejoin?: "miter" | "round" | "bevel" | "inherit";
2576
+ strokeMiterlimit?: number | string;
2577
+ strokeOpacity?: number | string;
2578
+ strokeWidth?: number | string;
2579
+ surfaceScale?: number | string;
2580
+ systemLanguage?: number | string;
2581
+ tableValues?: number | string;
2582
+ targetX?: number | string;
2583
+ targetY?: number | string;
2584
+ textAnchor?: string;
2585
+ textDecoration?: number | string;
2586
+ textLength?: number | string;
2587
+ textRendering?: number | string;
2588
+ to?: number | string;
2589
+ transform?: string;
2590
+ u1?: number | string;
2591
+ u2?: number | string;
2592
+ underlinePosition?: number | string;
2593
+ underlineThickness?: number | string;
2594
+ unicode?: number | string;
2595
+ unicodeBidi?: number | string;
2596
+ unicodeRange?: number | string;
2597
+ unitsPerEm?: number | string;
2598
+ vAlphabetic?: number | string;
2599
+ values?: string;
2600
+ vectorEffect?: number | string;
2601
+ version?: string;
2602
+ vertAdvY?: number | string;
2603
+ vertOriginX?: number | string;
2604
+ vertOriginY?: number | string;
2605
+ vHanging?: number | string;
2606
+ vIdeographic?: number | string;
2607
+ viewBox?: string;
2608
+ viewTarget?: number | string;
2609
+ visibility?: number | string;
2610
+ vMathematical?: number | string;
2611
+ widths?: number | string;
2612
+ wordSpacing?: number | string;
2613
+ writingMode?: number | string;
2614
+ x1?: number | string;
2615
+ x2?: number | string;
2616
+ x?: number | string;
2617
+ xChannelSelector?: string;
2618
+ xHeight?: number | string;
2619
+ xlinkActuate?: string;
2620
+ xlinkArcrole?: string;
2621
+ xlinkHref?: string;
2622
+ xlinkRole?: string;
2623
+ xlinkShow?: string;
2624
+ xlinkTitle?: string;
2625
+ xlinkType?: string;
2626
+ xmlBase?: string;
2627
+ xmlLang?: string;
2628
+ xmlns?: string;
2629
+ xmlnsXlink?: string;
2630
+ xmlSpace?: string;
2631
+ y1?: number | string;
2632
+ y2?: number | string;
2633
+ y?: number | string;
2634
+ yChannelSelector?: string;
2635
+ z?: number | string;
2636
+ zoomAndPan?: string;
2637
+ }
2638
+
2639
+ interface WebViewHTMLAttributes<T> extends HTMLAttributes<T> {
2640
+ allowFullScreen?: boolean;
2641
+ allowpopups?: boolean;
2642
+ autoFocus?: boolean;
2643
+ autosize?: boolean;
2644
+ blinkfeatures?: string;
2645
+ disableblinkfeatures?: string;
2646
+ disableguestresize?: boolean;
2647
+ disablewebsecurity?: boolean;
2648
+ guestinstance?: string;
2649
+ httpreferrer?: string;
2650
+ nodeintegration?: boolean;
2651
+ partition?: string;
2652
+ plugins?: boolean;
2653
+ preload?: string;
2654
+ src?: string;
2655
+ useragent?: string;
2656
+ webpreferences?: string;
2657
+ }
2658
+
2659
+ //
2660
+ // React.DOM
2661
+ // ----------------------------------------------------------------------
2662
+
2663
+ interface ReactHTML {
2664
+ a: DetailedHTMLFactory<AnchorHTMLAttributes<HTMLAnchorElement>, HTMLAnchorElement>;
2665
+ abbr: DetailedHTMLFactory<HTMLAttributes<HTMLElement>, HTMLElement>;
2666
+ address: DetailedHTMLFactory<HTMLAttributes<HTMLElement>, HTMLElement>;
2667
+ area: DetailedHTMLFactory<AreaHTMLAttributes<HTMLAreaElement>, HTMLAreaElement>;
2668
+ article: DetailedHTMLFactory<HTMLAttributes<HTMLElement>, HTMLElement>;
2669
+ aside: DetailedHTMLFactory<HTMLAttributes<HTMLElement>, HTMLElement>;
2670
+ audio: DetailedHTMLFactory<AudioHTMLAttributes<HTMLAudioElement>, HTMLAudioElement>;
2671
+ b: DetailedHTMLFactory<HTMLAttributes<HTMLElement>, HTMLElement>;
2672
+ base: DetailedHTMLFactory<BaseHTMLAttributes<HTMLBaseElement>, HTMLBaseElement>;
2673
+ bdi: DetailedHTMLFactory<HTMLAttributes<HTMLElement>, HTMLElement>;
2674
+ bdo: DetailedHTMLFactory<HTMLAttributes<HTMLElement>, HTMLElement>;
2675
+ big: DetailedHTMLFactory<HTMLAttributes<HTMLElement>, HTMLElement>;
2676
+ blockquote: DetailedHTMLFactory<BlockquoteHTMLAttributes<HTMLElement>, HTMLElement>;
2677
+ body: DetailedHTMLFactory<HTMLAttributes<HTMLBodyElement>, HTMLBodyElement>;
2678
+ br: DetailedHTMLFactory<HTMLAttributes<HTMLBRElement>, HTMLBRElement>;
2679
+ button: DetailedHTMLFactory<ButtonHTMLAttributes<HTMLButtonElement>, HTMLButtonElement>;
2680
+ canvas: DetailedHTMLFactory<CanvasHTMLAttributes<HTMLCanvasElement>, HTMLCanvasElement>;
2681
+ caption: DetailedHTMLFactory<HTMLAttributes<HTMLElement>, HTMLElement>;
2682
+ cite: DetailedHTMLFactory<HTMLAttributes<HTMLElement>, HTMLElement>;
2683
+ code: DetailedHTMLFactory<HTMLAttributes<HTMLElement>, HTMLElement>;
2684
+ col: DetailedHTMLFactory<ColHTMLAttributes<HTMLTableColElement>, HTMLTableColElement>;
2685
+ colgroup: DetailedHTMLFactory<ColgroupHTMLAttributes<HTMLTableColElement>, HTMLTableColElement>;
2686
+ data: DetailedHTMLFactory<DataHTMLAttributes<HTMLDataElement>, HTMLDataElement>;
2687
+ datalist: DetailedHTMLFactory<HTMLAttributes<HTMLDataListElement>, HTMLDataListElement>;
2688
+ dd: DetailedHTMLFactory<HTMLAttributes<HTMLElement>, HTMLElement>;
2689
+ del: DetailedHTMLFactory<DelHTMLAttributes<HTMLElement>, HTMLElement>;
2690
+ details: DetailedHTMLFactory<DetailsHTMLAttributes<HTMLElement>, HTMLElement>;
2691
+ dfn: DetailedHTMLFactory<HTMLAttributes<HTMLElement>, HTMLElement>;
2692
+ dialog: DetailedHTMLFactory<DialogHTMLAttributes<HTMLDialogElement>, HTMLDialogElement>;
2693
+ div: DetailedHTMLFactory<HTMLAttributes<HTMLDivElement>, HTMLDivElement>;
2694
+ dl: DetailedHTMLFactory<HTMLAttributes<HTMLDListElement>, HTMLDListElement>;
2695
+ dt: DetailedHTMLFactory<HTMLAttributes<HTMLElement>, HTMLElement>;
2696
+ em: DetailedHTMLFactory<HTMLAttributes<HTMLElement>, HTMLElement>;
2697
+ embed: DetailedHTMLFactory<EmbedHTMLAttributes<HTMLEmbedElement>, HTMLEmbedElement>;
2698
+ fieldset: DetailedHTMLFactory<FieldsetHTMLAttributes<HTMLFieldSetElement>, HTMLFieldSetElement>;
2699
+ figcaption: DetailedHTMLFactory<HTMLAttributes<HTMLElement>, HTMLElement>;
2700
+ figure: DetailedHTMLFactory<HTMLAttributes<HTMLElement>, HTMLElement>;
2701
+ footer: DetailedHTMLFactory<HTMLAttributes<HTMLElement>, HTMLElement>;
2702
+ form: DetailedHTMLFactory<FormHTMLAttributes<HTMLFormElement>, HTMLFormElement>;
2703
+ h1: DetailedHTMLFactory<HTMLAttributes<HTMLHeadingElement>, HTMLHeadingElement>;
2704
+ h2: DetailedHTMLFactory<HTMLAttributes<HTMLHeadingElement>, HTMLHeadingElement>;
2705
+ h3: DetailedHTMLFactory<HTMLAttributes<HTMLHeadingElement>, HTMLHeadingElement>;
2706
+ h4: DetailedHTMLFactory<HTMLAttributes<HTMLHeadingElement>, HTMLHeadingElement>;
2707
+ h5: DetailedHTMLFactory<HTMLAttributes<HTMLHeadingElement>, HTMLHeadingElement>;
2708
+ h6: DetailedHTMLFactory<HTMLAttributes<HTMLHeadingElement>, HTMLHeadingElement>;
2709
+ head: DetailedHTMLFactory<HTMLAttributes<HTMLElement>, HTMLHeadElement>;
2710
+ header: DetailedHTMLFactory<HTMLAttributes<HTMLElement>, HTMLElement>;
2711
+ hgroup: DetailedHTMLFactory<HTMLAttributes<HTMLElement>, HTMLElement>;
2712
+ hr: DetailedHTMLFactory<HTMLAttributes<HTMLHRElement>, HTMLHRElement>;
2713
+ html: DetailedHTMLFactory<HtmlHTMLAttributes<HTMLHtmlElement>, HTMLHtmlElement>;
2714
+ i: DetailedHTMLFactory<HTMLAttributes<HTMLElement>, HTMLElement>;
2715
+ iframe: DetailedHTMLFactory<IframeHTMLAttributes<HTMLIFrameElement>, HTMLIFrameElement>;
2716
+ img: DetailedHTMLFactory<ImgHTMLAttributes<HTMLImageElement>, HTMLImageElement>;
2717
+ input: DetailedHTMLFactory<InputHTMLAttributes<HTMLInputElement>, HTMLInputElement>;
2718
+ ins: DetailedHTMLFactory<InsHTMLAttributes<HTMLModElement>, HTMLModElement>;
2719
+ kbd: DetailedHTMLFactory<HTMLAttributes<HTMLElement>, HTMLElement>;
2720
+ keygen: DetailedHTMLFactory<KeygenHTMLAttributes<HTMLElement>, HTMLElement>;
2721
+ label: DetailedHTMLFactory<LabelHTMLAttributes<HTMLLabelElement>, HTMLLabelElement>;
2722
+ legend: DetailedHTMLFactory<HTMLAttributes<HTMLLegendElement>, HTMLLegendElement>;
2723
+ li: DetailedHTMLFactory<LiHTMLAttributes<HTMLLIElement>, HTMLLIElement>;
2724
+ link: DetailedHTMLFactory<LinkHTMLAttributes<HTMLLinkElement>, HTMLLinkElement>;
2725
+ main: DetailedHTMLFactory<HTMLAttributes<HTMLElement>, HTMLElement>;
2726
+ map: DetailedHTMLFactory<MapHTMLAttributes<HTMLMapElement>, HTMLMapElement>;
2727
+ mark: DetailedHTMLFactory<HTMLAttributes<HTMLElement>, HTMLElement>;
2728
+ menu: DetailedHTMLFactory<MenuHTMLAttributes<HTMLElement>, HTMLElement>;
2729
+ menuitem: DetailedHTMLFactory<HTMLAttributes<HTMLElement>, HTMLElement>;
2730
+ meta: DetailedHTMLFactory<MetaHTMLAttributes<HTMLMetaElement>, HTMLMetaElement>;
2731
+ meter: DetailedHTMLFactory<MeterHTMLAttributes<HTMLElement>, HTMLElement>;
2732
+ nav: DetailedHTMLFactory<HTMLAttributes<HTMLElement>, HTMLElement>;
2733
+ noscript: DetailedHTMLFactory<HTMLAttributes<HTMLElement>, HTMLElement>;
2734
+ object: DetailedHTMLFactory<ObjectHTMLAttributes<HTMLObjectElement>, HTMLObjectElement>;
2735
+ ol: DetailedHTMLFactory<OlHTMLAttributes<HTMLOListElement>, HTMLOListElement>;
2736
+ optgroup: DetailedHTMLFactory<OptgroupHTMLAttributes<HTMLOptGroupElement>, HTMLOptGroupElement>;
2737
+ option: DetailedHTMLFactory<OptionHTMLAttributes<HTMLOptionElement>, HTMLOptionElement>;
2738
+ output: DetailedHTMLFactory<OutputHTMLAttributes<HTMLElement>, HTMLElement>;
2739
+ p: DetailedHTMLFactory<HTMLAttributes<HTMLParagraphElement>, HTMLParagraphElement>;
2740
+ param: DetailedHTMLFactory<ParamHTMLAttributes<HTMLParamElement>, HTMLParamElement>;
2741
+ picture: DetailedHTMLFactory<HTMLAttributes<HTMLElement>, HTMLElement>;
2742
+ pre: DetailedHTMLFactory<HTMLAttributes<HTMLPreElement>, HTMLPreElement>;
2743
+ progress: DetailedHTMLFactory<ProgressHTMLAttributes<HTMLProgressElement>, HTMLProgressElement>;
2744
+ q: DetailedHTMLFactory<QuoteHTMLAttributes<HTMLQuoteElement>, HTMLQuoteElement>;
2745
+ rp: DetailedHTMLFactory<HTMLAttributes<HTMLElement>, HTMLElement>;
2746
+ rt: DetailedHTMLFactory<HTMLAttributes<HTMLElement>, HTMLElement>;
2747
+ ruby: DetailedHTMLFactory<HTMLAttributes<HTMLElement>, HTMLElement>;
2748
+ s: DetailedHTMLFactory<HTMLAttributes<HTMLElement>, HTMLElement>;
2749
+ samp: DetailedHTMLFactory<HTMLAttributes<HTMLElement>, HTMLElement>;
2750
+ slot: DetailedHTMLFactory<SlotHTMLAttributes<HTMLSlotElement>, HTMLSlotElement>;
2751
+ script: DetailedHTMLFactory<ScriptHTMLAttributes<HTMLScriptElement>, HTMLScriptElement>;
2752
+ section: DetailedHTMLFactory<HTMLAttributes<HTMLElement>, HTMLElement>;
2753
+ select: DetailedHTMLFactory<SelectHTMLAttributes<HTMLSelectElement>, HTMLSelectElement>;
2754
+ small: DetailedHTMLFactory<HTMLAttributes<HTMLElement>, HTMLElement>;
2755
+ source: DetailedHTMLFactory<SourceHTMLAttributes<HTMLSourceElement>, HTMLSourceElement>;
2756
+ span: DetailedHTMLFactory<HTMLAttributes<HTMLSpanElement>, HTMLSpanElement>;
2757
+ strong: DetailedHTMLFactory<HTMLAttributes<HTMLElement>, HTMLElement>;
2758
+ style: DetailedHTMLFactory<StyleHTMLAttributes<HTMLStyleElement>, HTMLStyleElement>;
2759
+ sub: DetailedHTMLFactory<HTMLAttributes<HTMLElement>, HTMLElement>;
2760
+ summary: DetailedHTMLFactory<HTMLAttributes<HTMLElement>, HTMLElement>;
2761
+ sup: DetailedHTMLFactory<HTMLAttributes<HTMLElement>, HTMLElement>;
2762
+ table: DetailedHTMLFactory<TableHTMLAttributes<HTMLTableElement>, HTMLTableElement>;
2763
+ template: DetailedHTMLFactory<HTMLAttributes<HTMLTemplateElement>, HTMLTemplateElement>;
2764
+ tbody: DetailedHTMLFactory<HTMLAttributes<HTMLTableSectionElement>, HTMLTableSectionElement>;
2765
+ td: DetailedHTMLFactory<TdHTMLAttributes<HTMLTableDataCellElement>, HTMLTableDataCellElement>;
2766
+ textarea: DetailedHTMLFactory<TextareaHTMLAttributes<HTMLTextAreaElement>, HTMLTextAreaElement>;
2767
+ tfoot: DetailedHTMLFactory<HTMLAttributes<HTMLTableSectionElement>, HTMLTableSectionElement>;
2768
+ th: DetailedHTMLFactory<ThHTMLAttributes<HTMLTableHeaderCellElement>, HTMLTableHeaderCellElement>;
2769
+ thead: DetailedHTMLFactory<HTMLAttributes<HTMLTableSectionElement>, HTMLTableSectionElement>;
2770
+ time: DetailedHTMLFactory<TimeHTMLAttributes<HTMLElement>, HTMLElement>;
2771
+ title: DetailedHTMLFactory<HTMLAttributes<HTMLTitleElement>, HTMLTitleElement>;
2772
+ tr: DetailedHTMLFactory<HTMLAttributes<HTMLTableRowElement>, HTMLTableRowElement>;
2773
+ track: DetailedHTMLFactory<TrackHTMLAttributes<HTMLTrackElement>, HTMLTrackElement>;
2774
+ u: DetailedHTMLFactory<HTMLAttributes<HTMLElement>, HTMLElement>;
2775
+ ul: DetailedHTMLFactory<HTMLAttributes<HTMLUListElement>, HTMLUListElement>;
2776
+ "var": DetailedHTMLFactory<HTMLAttributes<HTMLElement>, HTMLElement>;
2777
+ video: DetailedHTMLFactory<VideoHTMLAttributes<HTMLVideoElement>, HTMLVideoElement>;
2778
+ wbr: DetailedHTMLFactory<HTMLAttributes<HTMLElement>, HTMLElement>;
2779
+ webview: DetailedHTMLFactory<WebViewHTMLAttributes<HTMLWebViewElement>, HTMLWebViewElement>;
2780
+ }
2781
+
2782
+ interface ReactSVG {
2783
+ animate: SVGFactory;
2784
+ circle: SVGFactory;
2785
+ clipPath: SVGFactory;
2786
+ defs: SVGFactory;
2787
+ desc: SVGFactory;
2788
+ ellipse: SVGFactory;
2789
+ feBlend: SVGFactory;
2790
+ feColorMatrix: SVGFactory;
2791
+ feComponentTransfer: SVGFactory;
2792
+ feComposite: SVGFactory;
2793
+ feConvolveMatrix: SVGFactory;
2794
+ feDiffuseLighting: SVGFactory;
2795
+ feDisplacementMap: SVGFactory;
2796
+ feDistantLight: SVGFactory;
2797
+ feDropShadow: SVGFactory;
2798
+ feFlood: SVGFactory;
2799
+ feFuncA: SVGFactory;
2800
+ feFuncB: SVGFactory;
2801
+ feFuncG: SVGFactory;
2802
+ feFuncR: SVGFactory;
2803
+ feGaussianBlur: SVGFactory;
2804
+ feImage: SVGFactory;
2805
+ feMerge: SVGFactory;
2806
+ feMergeNode: SVGFactory;
2807
+ feMorphology: SVGFactory;
2808
+ feOffset: SVGFactory;
2809
+ fePointLight: SVGFactory;
2810
+ feSpecularLighting: SVGFactory;
2811
+ feSpotLight: SVGFactory;
2812
+ feTile: SVGFactory;
2813
+ feTurbulence: SVGFactory;
2814
+ filter: SVGFactory;
2815
+ foreignObject: SVGFactory;
2816
+ g: SVGFactory;
2817
+ image: SVGFactory;
2818
+ line: SVGFactory;
2819
+ linearGradient: SVGFactory;
2820
+ marker: SVGFactory;
2821
+ mask: SVGFactory;
2822
+ metadata: SVGFactory;
2823
+ path: SVGFactory;
2824
+ pattern: SVGFactory;
2825
+ polygon: SVGFactory;
2826
+ polyline: SVGFactory;
2827
+ radialGradient: SVGFactory;
2828
+ rect: SVGFactory;
2829
+ stop: SVGFactory;
2830
+ svg: SVGFactory;
2831
+ switch: SVGFactory;
2832
+ symbol: SVGFactory;
2833
+ text: SVGFactory;
2834
+ textPath: SVGFactory;
2835
+ tspan: SVGFactory;
2836
+ use: SVGFactory;
2837
+ view: SVGFactory;
2838
+ }
2839
+
2840
+ interface ReactDOM extends ReactHTML, ReactSVG { }
2841
+
2842
+ //
2843
+ // React.PropTypes
2844
+ // ----------------------------------------------------------------------
2845
+
2846
+ type Validator<T> = PropTypes.Validator<T>;
2847
+
2848
+ type Requireable<T> = PropTypes.Requireable<T>;
2849
+
2850
+ type ValidationMap<T> = PropTypes.ValidationMap<T>;
2851
+
2852
+ type WeakValidationMap<T> = {
2853
+ [K in keyof T]?: null extends T[K]
2854
+ ? Validator<T[K] | null | undefined>
2855
+ : undefined extends T[K]
2856
+ ? Validator<T[K] | null | undefined>
2857
+ : Validator<T[K]>
2858
+ };
2859
+
2860
+ interface ReactPropTypes {
2861
+ any: typeof PropTypes.any;
2862
+ array: typeof PropTypes.array;
2863
+ bool: typeof PropTypes.bool;
2864
+ func: typeof PropTypes.func;
2865
+ number: typeof PropTypes.number;
2866
+ object: typeof PropTypes.object;
2867
+ string: typeof PropTypes.string;
2868
+ node: typeof PropTypes.node;
2869
+ element: typeof PropTypes.element;
2870
+ instanceOf: typeof PropTypes.instanceOf;
2871
+ oneOf: typeof PropTypes.oneOf;
2872
+ oneOfType: typeof PropTypes.oneOfType;
2873
+ arrayOf: typeof PropTypes.arrayOf;
2874
+ objectOf: typeof PropTypes.objectOf;
2875
+ shape: typeof PropTypes.shape;
2876
+ exact: typeof PropTypes.exact;
2877
+ }
2878
+
2879
+ //
2880
+ // React.Children
2881
+ // ----------------------------------------------------------------------
2882
+
2883
+ interface ReactChildren {
2884
+ map<T, C>(children: C | C[], fn: (child: C, index: number) => T):
2885
+ C extends null | undefined ? C : Array<Exclude<T, boolean | null | undefined>>;
2886
+ forEach<C>(children: C | C[], fn: (child: C, index: number) => void): void;
2887
+ count(children: any): number;
2888
+ only<C>(children: C): C extends any[] ? never : C;
2889
+ toArray(children: ReactNode | ReactNode[]): Array<Exclude<ReactNode, boolean | null | undefined>>;
2890
+ }
2891
+
2892
+ //
2893
+ // Browser Interfaces
2894
+ // https://github.com/nikeee/2048-typescript/blob/master/2048/js/touch.d.ts
2895
+ // ----------------------------------------------------------------------
2896
+
2897
+ interface AbstractView {
2898
+ styleMedia: StyleMedia;
2899
+ document: Document;
2900
+ }
2901
+
2902
+ interface Touch {
2903
+ identifier: number;
2904
+ target: EventTarget;
2905
+ screenX: number;
2906
+ screenY: number;
2907
+ clientX: number;
2908
+ clientY: number;
2909
+ pageX: number;
2910
+ pageY: number;
2911
+ }
2912
+
2913
+ interface TouchList {
2914
+ [index: number]: Touch;
2915
+ length: number;
2916
+ item(index: number): Touch;
2917
+ identifiedTouch(identifier: number): Touch;
2918
+ }
2919
+
2920
+ //
2921
+ // Error Interfaces
2922
+ // ----------------------------------------------------------------------
2923
+ interface ErrorInfo {
2924
+ /**
2925
+ * Captures which component contained the exception, and its ancestors.
2926
+ */
2927
+ componentStack: string;
2928
+ }
2929
+ }
2930
+
2931
+ // naked 'any' type in a conditional type will short circuit and union both the then/else branches
2932
+ // so boolean is only resolved for T = any
2933
+ type IsExactlyAny<T> = boolean extends (T extends never ? true : false) ? true : false;
2934
+
2935
+ type ExactlyAnyPropertyKeys<T> = { [K in keyof T]: IsExactlyAny<T[K]> extends true ? K : never }[keyof T];
2936
+ type NotExactlyAnyPropertyKeys<T> = Exclude<keyof T, ExactlyAnyPropertyKeys<T>>;
2937
+
2938
+ // Try to resolve ill-defined props like for JS users: props can be any, or sometimes objects with properties of type any
2939
+ type MergePropTypes<P, T> =
2940
+ // Distribute over P in case it is a union type
2941
+ P extends any
2942
+ // If props is type any, use propTypes definitions
2943
+ ? IsExactlyAny<P> extends true ? T :
2944
+ // If declared props have indexed properties, ignore inferred props entirely as keyof gets widened
2945
+ string extends keyof P ? P :
2946
+ // Prefer declared types which are not exactly any
2947
+ & Pick<P, NotExactlyAnyPropertyKeys<P>>
2948
+ // For props which are exactly any, use the type inferred from propTypes if present
2949
+ & Pick<T, Exclude<keyof T, NotExactlyAnyPropertyKeys<P>>>
2950
+ // Keep leftover props not specified in propTypes
2951
+ & Pick<P, Exclude<keyof P, keyof T>>
2952
+ : never;
2953
+
2954
+ // Any prop that has a default prop becomes optional, but its type is unchanged
2955
+ // Undeclared default props are augmented into the resulting allowable attributes
2956
+ // If declared props have indexed properties, ignore default props entirely as keyof gets widened
2957
+ // Wrap in an outer-level conditional type to allow distribution over props that are unions
2958
+ type Defaultize<P, D> = P extends any
2959
+ ? string extends keyof P ? P :
2960
+ & Pick<P, Exclude<keyof P, keyof D>>
2961
+ & Partial<Pick<P, Extract<keyof P, keyof D>>>
2962
+ & Partial<Pick<D, Exclude<keyof D, keyof P>>>
2963
+ : never;
2964
+
2965
+ type ReactManagedAttributes<C, P> = C extends { propTypes: infer T; defaultProps: infer D; }
2966
+ ? Defaultize<MergePropTypes<P, PropTypes.InferProps<T>>, D>
2967
+ : C extends { propTypes: infer T; }
2968
+ ? MergePropTypes<P, PropTypes.InferProps<T>>
2969
+ : C extends { defaultProps: infer D; }
2970
+ ? Defaultize<P, D>
2971
+ : P;
2972
+
2973
+ declare global {
2974
+ namespace JSX {
2975
+ interface Element extends React.ReactElement<any, any> { }
2976
+ interface ElementClass extends React.Component<any> {
2977
+ render(): React.ReactNode;
2978
+ }
2979
+ interface ElementAttributesProperty { props: {}; }
2980
+ interface ElementChildrenAttribute { children: {}; }
2981
+
2982
+ // We can't recurse forever because `type` can't be self-referential;
2983
+ // let's assume it's reasonable to do a single React.lazy() around a single React.memo() / vice-versa
2984
+ type LibraryManagedAttributes<C, P> = C extends React.MemoExoticComponent<infer T> | React.LazyExoticComponent<infer T>
2985
+ ? T extends React.MemoExoticComponent<infer U> | React.LazyExoticComponent<infer U>
2986
+ ? ReactManagedAttributes<U, P>
2987
+ : ReactManagedAttributes<T, P>
2988
+ : ReactManagedAttributes<C, P>;
2989
+
2990
+ interface IntrinsicAttributes extends React.Attributes { }
2991
+ interface IntrinsicClassAttributes<T> extends React.ClassAttributes<T> { }
2992
+
2993
+ interface IntrinsicElements {
2994
+ // HTML
2995
+ a: React.DetailedHTMLProps<React.AnchorHTMLAttributes<HTMLAnchorElement>, HTMLAnchorElement>;
2996
+ abbr: React.DetailedHTMLProps<React.HTMLAttributes<HTMLElement>, HTMLElement>;
2997
+ address: React.DetailedHTMLProps<React.HTMLAttributes<HTMLElement>, HTMLElement>;
2998
+ area: React.DetailedHTMLProps<React.AreaHTMLAttributes<HTMLAreaElement>, HTMLAreaElement>;
2999
+ article: React.DetailedHTMLProps<React.HTMLAttributes<HTMLElement>, HTMLElement>;
3000
+ aside: React.DetailedHTMLProps<React.HTMLAttributes<HTMLElement>, HTMLElement>;
3001
+ audio: React.DetailedHTMLProps<React.AudioHTMLAttributes<HTMLAudioElement>, HTMLAudioElement>;
3002
+ b: React.DetailedHTMLProps<React.HTMLAttributes<HTMLElement>, HTMLElement>;
3003
+ base: React.DetailedHTMLProps<React.BaseHTMLAttributes<HTMLBaseElement>, HTMLBaseElement>;
3004
+ bdi: React.DetailedHTMLProps<React.HTMLAttributes<HTMLElement>, HTMLElement>;
3005
+ bdo: React.DetailedHTMLProps<React.HTMLAttributes<HTMLElement>, HTMLElement>;
3006
+ big: React.DetailedHTMLProps<React.HTMLAttributes<HTMLElement>, HTMLElement>;
3007
+ blockquote: React.DetailedHTMLProps<React.BlockquoteHTMLAttributes<HTMLElement>, HTMLElement>;
3008
+ body: React.DetailedHTMLProps<React.HTMLAttributes<HTMLBodyElement>, HTMLBodyElement>;
3009
+ br: React.DetailedHTMLProps<React.HTMLAttributes<HTMLBRElement>, HTMLBRElement>;
3010
+ button: React.DetailedHTMLProps<React.ButtonHTMLAttributes<HTMLButtonElement>, HTMLButtonElement>;
3011
+ canvas: React.DetailedHTMLProps<React.CanvasHTMLAttributes<HTMLCanvasElement>, HTMLCanvasElement>;
3012
+ caption: React.DetailedHTMLProps<React.HTMLAttributes<HTMLElement>, HTMLElement>;
3013
+ cite: React.DetailedHTMLProps<React.HTMLAttributes<HTMLElement>, HTMLElement>;
3014
+ code: React.DetailedHTMLProps<React.HTMLAttributes<HTMLElement>, HTMLElement>;
3015
+ col: React.DetailedHTMLProps<React.ColHTMLAttributes<HTMLTableColElement>, HTMLTableColElement>;
3016
+ colgroup: React.DetailedHTMLProps<React.ColgroupHTMLAttributes<HTMLTableColElement>, HTMLTableColElement>;
3017
+ data: React.DetailedHTMLProps<React.DataHTMLAttributes<HTMLDataElement>, HTMLDataElement>;
3018
+ datalist: React.DetailedHTMLProps<React.HTMLAttributes<HTMLDataListElement>, HTMLDataListElement>;
3019
+ dd: React.DetailedHTMLProps<React.HTMLAttributes<HTMLElement>, HTMLElement>;
3020
+ del: React.DetailedHTMLProps<React.DelHTMLAttributes<HTMLElement>, HTMLElement>;
3021
+ details: React.DetailedHTMLProps<React.DetailsHTMLAttributes<HTMLElement>, HTMLElement>;
3022
+ dfn: React.DetailedHTMLProps<React.HTMLAttributes<HTMLElement>, HTMLElement>;
3023
+ dialog: React.DetailedHTMLProps<React.DialogHTMLAttributes<HTMLDialogElement>, HTMLDialogElement>;
3024
+ div: React.DetailedHTMLProps<React.HTMLAttributes<HTMLDivElement>, HTMLDivElement>;
3025
+ dl: React.DetailedHTMLProps<React.HTMLAttributes<HTMLDListElement>, HTMLDListElement>;
3026
+ dt: React.DetailedHTMLProps<React.HTMLAttributes<HTMLElement>, HTMLElement>;
3027
+ em: React.DetailedHTMLProps<React.HTMLAttributes<HTMLElement>, HTMLElement>;
3028
+ embed: React.DetailedHTMLProps<React.EmbedHTMLAttributes<HTMLEmbedElement>, HTMLEmbedElement>;
3029
+ fieldset: React.DetailedHTMLProps<React.FieldsetHTMLAttributes<HTMLFieldSetElement>, HTMLFieldSetElement>;
3030
+ figcaption: React.DetailedHTMLProps<React.HTMLAttributes<HTMLElement>, HTMLElement>;
3031
+ figure: React.DetailedHTMLProps<React.HTMLAttributes<HTMLElement>, HTMLElement>;
3032
+ footer: React.DetailedHTMLProps<React.HTMLAttributes<HTMLElement>, HTMLElement>;
3033
+ form: React.DetailedHTMLProps<React.FormHTMLAttributes<HTMLFormElement>, HTMLFormElement>;
3034
+ h1: React.DetailedHTMLProps<React.HTMLAttributes<HTMLHeadingElement>, HTMLHeadingElement>;
3035
+ h2: React.DetailedHTMLProps<React.HTMLAttributes<HTMLHeadingElement>, HTMLHeadingElement>;
3036
+ h3: React.DetailedHTMLProps<React.HTMLAttributes<HTMLHeadingElement>, HTMLHeadingElement>;
3037
+ h4: React.DetailedHTMLProps<React.HTMLAttributes<HTMLHeadingElement>, HTMLHeadingElement>;
3038
+ h5: React.DetailedHTMLProps<React.HTMLAttributes<HTMLHeadingElement>, HTMLHeadingElement>;
3039
+ h6: React.DetailedHTMLProps<React.HTMLAttributes<HTMLHeadingElement>, HTMLHeadingElement>;
3040
+ head: React.DetailedHTMLProps<React.HTMLAttributes<HTMLHeadElement>, HTMLHeadElement>;
3041
+ header: React.DetailedHTMLProps<React.HTMLAttributes<HTMLElement>, HTMLElement>;
3042
+ hgroup: React.DetailedHTMLProps<React.HTMLAttributes<HTMLElement>, HTMLElement>;
3043
+ hr: React.DetailedHTMLProps<React.HTMLAttributes<HTMLHRElement>, HTMLHRElement>;
3044
+ html: React.DetailedHTMLProps<React.HtmlHTMLAttributes<HTMLHtmlElement>, HTMLHtmlElement>;
3045
+ i: React.DetailedHTMLProps<React.HTMLAttributes<HTMLElement>, HTMLElement>;
3046
+ iframe: React.DetailedHTMLProps<React.IframeHTMLAttributes<HTMLIFrameElement>, HTMLIFrameElement>;
3047
+ img: React.DetailedHTMLProps<React.ImgHTMLAttributes<HTMLImageElement>, HTMLImageElement>;
3048
+ input: React.DetailedHTMLProps<React.InputHTMLAttributes<HTMLInputElement>, HTMLInputElement>;
3049
+ ins: React.DetailedHTMLProps<React.InsHTMLAttributes<HTMLModElement>, HTMLModElement>;
3050
+ kbd: React.DetailedHTMLProps<React.HTMLAttributes<HTMLElement>, HTMLElement>;
3051
+ keygen: React.DetailedHTMLProps<React.KeygenHTMLAttributes<HTMLElement>, HTMLElement>;
3052
+ label: React.DetailedHTMLProps<React.LabelHTMLAttributes<HTMLLabelElement>, HTMLLabelElement>;
3053
+ legend: React.DetailedHTMLProps<React.HTMLAttributes<HTMLLegendElement>, HTMLLegendElement>;
3054
+ li: React.DetailedHTMLProps<React.LiHTMLAttributes<HTMLLIElement>, HTMLLIElement>;
3055
+ link: React.DetailedHTMLProps<React.LinkHTMLAttributes<HTMLLinkElement>, HTMLLinkElement>;
3056
+ main: React.DetailedHTMLProps<React.HTMLAttributes<HTMLElement>, HTMLElement>;
3057
+ map: React.DetailedHTMLProps<React.MapHTMLAttributes<HTMLMapElement>, HTMLMapElement>;
3058
+ mark: React.DetailedHTMLProps<React.HTMLAttributes<HTMLElement>, HTMLElement>;
3059
+ menu: React.DetailedHTMLProps<React.MenuHTMLAttributes<HTMLElement>, HTMLElement>;
3060
+ menuitem: React.DetailedHTMLProps<React.HTMLAttributes<HTMLElement>, HTMLElement>;
3061
+ meta: React.DetailedHTMLProps<React.MetaHTMLAttributes<HTMLMetaElement>, HTMLMetaElement>;
3062
+ meter: React.DetailedHTMLProps<React.MeterHTMLAttributes<HTMLElement>, HTMLElement>;
3063
+ nav: React.DetailedHTMLProps<React.HTMLAttributes<HTMLElement>, HTMLElement>;
3064
+ noindex: React.DetailedHTMLProps<React.HTMLAttributes<HTMLElement>, HTMLElement>;
3065
+ noscript: React.DetailedHTMLProps<React.HTMLAttributes<HTMLElement>, HTMLElement>;
3066
+ object: React.DetailedHTMLProps<React.ObjectHTMLAttributes<HTMLObjectElement>, HTMLObjectElement>;
3067
+ ol: React.DetailedHTMLProps<React.OlHTMLAttributes<HTMLOListElement>, HTMLOListElement>;
3068
+ optgroup: React.DetailedHTMLProps<React.OptgroupHTMLAttributes<HTMLOptGroupElement>, HTMLOptGroupElement>;
3069
+ option: React.DetailedHTMLProps<React.OptionHTMLAttributes<HTMLOptionElement>, HTMLOptionElement>;
3070
+ output: React.DetailedHTMLProps<React.OutputHTMLAttributes<HTMLElement>, HTMLElement>;
3071
+ p: React.DetailedHTMLProps<React.HTMLAttributes<HTMLParagraphElement>, HTMLParagraphElement>;
3072
+ param: React.DetailedHTMLProps<React.ParamHTMLAttributes<HTMLParamElement>, HTMLParamElement>;
3073
+ picture: React.DetailedHTMLProps<React.HTMLAttributes<HTMLElement>, HTMLElement>;
3074
+ pre: React.DetailedHTMLProps<React.HTMLAttributes<HTMLPreElement>, HTMLPreElement>;
3075
+ progress: React.DetailedHTMLProps<React.ProgressHTMLAttributes<HTMLProgressElement>, HTMLProgressElement>;
3076
+ q: React.DetailedHTMLProps<React.QuoteHTMLAttributes<HTMLQuoteElement>, HTMLQuoteElement>;
3077
+ rp: React.DetailedHTMLProps<React.HTMLAttributes<HTMLElement>, HTMLElement>;
3078
+ rt: React.DetailedHTMLProps<React.HTMLAttributes<HTMLElement>, HTMLElement>;
3079
+ ruby: React.DetailedHTMLProps<React.HTMLAttributes<HTMLElement>, HTMLElement>;
3080
+ s: React.DetailedHTMLProps<React.HTMLAttributes<HTMLElement>, HTMLElement>;
3081
+ samp: React.DetailedHTMLProps<React.HTMLAttributes<HTMLElement>, HTMLElement>;
3082
+ slot: React.DetailedHTMLProps<React.SlotHTMLAttributes<HTMLSlotElement>, HTMLSlotElement>;
3083
+ script: React.DetailedHTMLProps<React.ScriptHTMLAttributes<HTMLScriptElement>, HTMLScriptElement>;
3084
+ section: React.DetailedHTMLProps<React.HTMLAttributes<HTMLElement>, HTMLElement>;
3085
+ select: React.DetailedHTMLProps<React.SelectHTMLAttributes<HTMLSelectElement>, HTMLSelectElement>;
3086
+ small: React.DetailedHTMLProps<React.HTMLAttributes<HTMLElement>, HTMLElement>;
3087
+ source: React.DetailedHTMLProps<React.SourceHTMLAttributes<HTMLSourceElement>, HTMLSourceElement>;
3088
+ span: React.DetailedHTMLProps<React.HTMLAttributes<HTMLSpanElement>, HTMLSpanElement>;
3089
+ strong: React.DetailedHTMLProps<React.HTMLAttributes<HTMLElement>, HTMLElement>;
3090
+ style: React.DetailedHTMLProps<React.StyleHTMLAttributes<HTMLStyleElement>, HTMLStyleElement>;
3091
+ sub: React.DetailedHTMLProps<React.HTMLAttributes<HTMLElement>, HTMLElement>;
3092
+ summary: React.DetailedHTMLProps<React.HTMLAttributes<HTMLElement>, HTMLElement>;
3093
+ sup: React.DetailedHTMLProps<React.HTMLAttributes<HTMLElement>, HTMLElement>;
3094
+ table: React.DetailedHTMLProps<React.TableHTMLAttributes<HTMLTableElement>, HTMLTableElement>;
3095
+ template: React.DetailedHTMLProps<React.HTMLAttributes<HTMLTemplateElement>, HTMLTemplateElement>;
3096
+ tbody: React.DetailedHTMLProps<React.HTMLAttributes<HTMLTableSectionElement>, HTMLTableSectionElement>;
3097
+ td: React.DetailedHTMLProps<React.TdHTMLAttributes<HTMLTableDataCellElement>, HTMLTableDataCellElement>;
3098
+ textarea: React.DetailedHTMLProps<React.TextareaHTMLAttributes<HTMLTextAreaElement>, HTMLTextAreaElement>;
3099
+ tfoot: React.DetailedHTMLProps<React.HTMLAttributes<HTMLTableSectionElement>, HTMLTableSectionElement>;
3100
+ th: React.DetailedHTMLProps<React.ThHTMLAttributes<HTMLTableHeaderCellElement>, HTMLTableHeaderCellElement>;
3101
+ thead: React.DetailedHTMLProps<React.HTMLAttributes<HTMLTableSectionElement>, HTMLTableSectionElement>;
3102
+ time: React.DetailedHTMLProps<React.TimeHTMLAttributes<HTMLElement>, HTMLElement>;
3103
+ title: React.DetailedHTMLProps<React.HTMLAttributes<HTMLTitleElement>, HTMLTitleElement>;
3104
+ tr: React.DetailedHTMLProps<React.HTMLAttributes<HTMLTableRowElement>, HTMLTableRowElement>;
3105
+ track: React.DetailedHTMLProps<React.TrackHTMLAttributes<HTMLTrackElement>, HTMLTrackElement>;
3106
+ u: React.DetailedHTMLProps<React.HTMLAttributes<HTMLElement>, HTMLElement>;
3107
+ ul: React.DetailedHTMLProps<React.HTMLAttributes<HTMLUListElement>, HTMLUListElement>;
3108
+ "var": React.DetailedHTMLProps<React.HTMLAttributes<HTMLElement>, HTMLElement>;
3109
+ video: React.DetailedHTMLProps<React.VideoHTMLAttributes<HTMLVideoElement>, HTMLVideoElement>;
3110
+ wbr: React.DetailedHTMLProps<React.HTMLAttributes<HTMLElement>, HTMLElement>;
3111
+ webview: React.DetailedHTMLProps<React.WebViewHTMLAttributes<HTMLWebViewElement>, HTMLWebViewElement>;
3112
+
3113
+ // SVG
3114
+ svg: React.SVGProps<SVGSVGElement>;
3115
+
3116
+ animate: React.SVGProps<SVGElement>; // TODO: It is SVGAnimateElement but is not in TypeScript's lib.dom.d.ts for now.
3117
+ animateMotion: React.SVGProps<SVGElement>;
3118
+ animateTransform: React.SVGProps<SVGElement>; // TODO: It is SVGAnimateTransformElement but is not in TypeScript's lib.dom.d.ts for now.
3119
+ circle: React.SVGProps<SVGCircleElement>;
3120
+ clipPath: React.SVGProps<SVGClipPathElement>;
3121
+ defs: React.SVGProps<SVGDefsElement>;
3122
+ desc: React.SVGProps<SVGDescElement>;
3123
+ ellipse: React.SVGProps<SVGEllipseElement>;
3124
+ feBlend: React.SVGProps<SVGFEBlendElement>;
3125
+ feColorMatrix: React.SVGProps<SVGFEColorMatrixElement>;
3126
+ feComponentTransfer: React.SVGProps<SVGFEComponentTransferElement>;
3127
+ feComposite: React.SVGProps<SVGFECompositeElement>;
3128
+ feConvolveMatrix: React.SVGProps<SVGFEConvolveMatrixElement>;
3129
+ feDiffuseLighting: React.SVGProps<SVGFEDiffuseLightingElement>;
3130
+ feDisplacementMap: React.SVGProps<SVGFEDisplacementMapElement>;
3131
+ feDistantLight: React.SVGProps<SVGFEDistantLightElement>;
3132
+ feDropShadow: React.SVGProps<SVGFEDropShadowElement>;
3133
+ feFlood: React.SVGProps<SVGFEFloodElement>;
3134
+ feFuncA: React.SVGProps<SVGFEFuncAElement>;
3135
+ feFuncB: React.SVGProps<SVGFEFuncBElement>;
3136
+ feFuncG: React.SVGProps<SVGFEFuncGElement>;
3137
+ feFuncR: React.SVGProps<SVGFEFuncRElement>;
3138
+ feGaussianBlur: React.SVGProps<SVGFEGaussianBlurElement>;
3139
+ feImage: React.SVGProps<SVGFEImageElement>;
3140
+ feMerge: React.SVGProps<SVGFEMergeElement>;
3141
+ feMergeNode: React.SVGProps<SVGFEMergeNodeElement>;
3142
+ feMorphology: React.SVGProps<SVGFEMorphologyElement>;
3143
+ feOffset: React.SVGProps<SVGFEOffsetElement>;
3144
+ fePointLight: React.SVGProps<SVGFEPointLightElement>;
3145
+ feSpecularLighting: React.SVGProps<SVGFESpecularLightingElement>;
3146
+ feSpotLight: React.SVGProps<SVGFESpotLightElement>;
3147
+ feTile: React.SVGProps<SVGFETileElement>;
3148
+ feTurbulence: React.SVGProps<SVGFETurbulenceElement>;
3149
+ filter: React.SVGProps<SVGFilterElement>;
3150
+ foreignObject: React.SVGProps<SVGForeignObjectElement>;
3151
+ g: React.SVGProps<SVGGElement>;
3152
+ image: React.SVGProps<SVGImageElement>;
3153
+ line: React.SVGProps<SVGLineElement>;
3154
+ linearGradient: React.SVGProps<SVGLinearGradientElement>;
3155
+ marker: React.SVGProps<SVGMarkerElement>;
3156
+ mask: React.SVGProps<SVGMaskElement>;
3157
+ metadata: React.SVGProps<SVGMetadataElement>;
3158
+ mpath: React.SVGProps<SVGElement>;
3159
+ path: React.SVGProps<SVGPathElement>;
3160
+ pattern: React.SVGProps<SVGPatternElement>;
3161
+ polygon: React.SVGProps<SVGPolygonElement>;
3162
+ polyline: React.SVGProps<SVGPolylineElement>;
3163
+ radialGradient: React.SVGProps<SVGRadialGradientElement>;
3164
+ rect: React.SVGProps<SVGRectElement>;
3165
+ stop: React.SVGProps<SVGStopElement>;
3166
+ switch: React.SVGProps<SVGSwitchElement>;
3167
+ symbol: React.SVGProps<SVGSymbolElement>;
3168
+ text: React.SVGProps<SVGTextElement>;
3169
+ textPath: React.SVGProps<SVGTextPathElement>;
3170
+ tspan: React.SVGProps<SVGTSpanElement>;
3171
+ use: React.SVGProps<SVGUseElement>;
3172
+ view: React.SVGProps<SVGViewElement>;
3173
+ }
3174
+ }
3175
+ }