jsx.d.ts 36 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798991001011021031041051061071081091101111121131141151161171181191201211221231241251261271281291301311321331341351361371381391401411421431441451461471481491501511521531541551561571581591601611621631641651661671681691701711721731741751761771781791801811821831841851861871881891901911921931941951961971981992002012022032042052062072082092102112122132142152162172182192202212222232242252262272282292302312322332342352362372382392402412422432442452462472482492502512522532542552562572582592602612622632642652662672682692702712722732742752762772782792802812822832842852862872882892902912922932942952962972982993003013023033043053063073083093103113123133143153163173183193203213223233243253263273283293303313323333343353363373383393403413423433443453463473483493503513523533543553563573583593603613623633643653663673683693703713723733743753763773783793803813823833843853863873883893903913923933943953963973983994004014024034044054064074084094104114124134144154164174184194204214224234244254264274284294304314324334344354364374384394404414424434444454464474484494504514524534544554564574584594604614624634644654664674684694704714724734744754764774784794804814824834844854864874884894904914924934944954964974984995005015025035045055065075085095105115125135145155165175185195205215225235245255265275285295305315325335345355365375385395405415425435445455465475485495505515525535545555565575585595605615625635645655665675685695705715725735745755765775785795805815825835845855865875885895905915925935945955965975985996006016026036046056066076086096106116126136146156166176186196206216226236246256266276286296306316326336346356366376386396406416426436446456466476486496506516526536546556566576586596606616626636646656666676686696706716726736746756766776786796806816826836846856866876886896906916926936946956966976986997007017027037047057067077087097107117127137147157167177187197207217227237247257267277287297307317327337347357367377387397407417427437447457467477487497507517527537547557567577587597607617627637647657667677687697707717727737747757767777787797807817827837847857867877887897907917927937947957967977987998008018028038048058068078088098108118128138148158168178188198208218228238248258268278288298308318328338348358368378388398408418428438448458468478488498508518528538548558568578588598608618628638648658668678688698708718728738748758768778788798808818828838848858868878888898908918928938948958968978988999009019029039049059069079089099109119129139149159169179189199209219229239249259269279289299309319329339349359369379389399409419429439449459469479489499509519529539549559569579589599609619629639649659669679689699709719729739749759769779789799809819829839849859869879889899909919929939949959969979989991000100110021003100410051006100710081009101010111012101310141015101610171018101910201021102210231024102510261027102810291030103110321033103410351036103710381039104010411042104310441045104610471048104910501051105210531054105510561057105810591060106110621063106410651066106710681069107010711072107310741075107610771078107910801081108210831084108510861087108810891090109110921093109410951096109710981099110011011102110311041105110611071108110911101111111211131114111511161117111811191120112111221123112411251126112711281129113011311132113311341135113611371138113911401141114211431144114511461147114811491150115111521153115411551156115711581159116011611162116311641165116611671168116911701171117211731174117511761177117811791180118111821183118411851186118711881189119011911192119311941195119611971198119912001201120212031204120512061207120812091210121112121213121412151216121712181219122012211222122312241225122612271228122912301231123212331234123512361237123812391240124112421243124412451246124712481249125012511252125312541255125612571258125912601261126212631264126512661267126812691270127112721273127412751276127712781279128012811282128312841285128612871288128912901291129212931294129512961297129812991300130113021303
  1. import { Ref, ComponentPublicInstance } from '@vue/runtime-core'
  2. // This code is based on react definition in DefinitelyTyped published under the MIT license.
  3. // Repository: https://github.com/DefinitelyTyped/DefinitelyTyped
  4. // Path in the repository: types/react/index.d.ts
  5. //
  6. // Copyrights of original definition are:
  7. // AssureSign <http://www.assuresign.com>
  8. // Microsoft <https://microsoft.com>
  9. // John Reilly <https://github.com/johnnyreilly>
  10. // Benoit Benezech <https://github.com/bbenezech>
  11. // Patricio Zavolinsky <https://github.com/pzavolinsky>
  12. // Digiguru <https://github.com/digiguru>
  13. // Eric Anderson <https://github.com/ericanderson>
  14. // Dovydas Navickas <https://github.com/DovydasNavickas>
  15. // Josh Rutherford <https://github.com/theruther4d>
  16. // Guilherme Hübner <https://github.com/guilhermehubner>
  17. // Ferdy Budhidharma <https://github.com/ferdaber>
  18. // Johann Rakotoharisoa <https://github.com/jrakotoharisoa>
  19. // Olivier Pascal <https://github.com/pascaloliv>
  20. // Martin Hochel <https://github.com/hotell>
  21. // Frank Li <https://github.com/franklixuefei>
  22. // Jessica Franco <https://github.com/Jessidhia>
  23. // Saransh Kataria <https://github.com/saranshkataria>
  24. // Kanitkorn Sujautra <https://github.com/lukyth>
  25. // Sebastian Silbermann <https://github.com/eps1lon>
  26. import * as CSS from 'csstype'
  27. export interface CSSProperties extends CSS.Properties<string | number> {
  28. /**
  29. * The index signature was removed to enable closed typing for style
  30. * using CSSType. You're able to use type assertion or module augmentation
  31. * to add properties or an index signature of your own.
  32. *
  33. * For examples and more information, visit:
  34. * https://github.com/frenic/csstype#what-should-i-do-when-i-get-type-errors
  35. */
  36. }
  37. type Booleanish = boolean | 'true' | 'false'
  38. // All the WAI-ARIA 1.1 attributes from https://www.w3.org/TR/wai-aria-1.1/
  39. interface AriaAttributes {
  40. /** Identifies the currently active element when DOM focus is on a composite widget, textbox, group, or application. */
  41. 'aria-activedescendant'?: string
  42. /** 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. */
  43. 'aria-atomic'?: boolean | 'false' | 'true'
  44. /**
  45. * 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
  46. * presented if they are made.
  47. */
  48. 'aria-autocomplete'?: 'none' | 'inline' | 'list' | 'both'
  49. /** 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. */
  50. 'aria-busy'?: boolean | 'false' | 'true'
  51. /**
  52. * Indicates the current "checked" state of checkboxes, radio buttons, and other widgets.
  53. * @see aria-pressed @see aria-selected.
  54. */
  55. 'aria-checked'?: boolean | 'false' | 'mixed' | 'true'
  56. /**
  57. * Defines the total number of columns in a table, grid, or treegrid.
  58. * @see aria-colindex.
  59. */
  60. 'aria-colcount'?: number
  61. /**
  62. * Defines an element's column index or position with respect to the total number of columns within a table, grid, or treegrid.
  63. * @see aria-colcount @see aria-colspan.
  64. */
  65. 'aria-colindex'?: number
  66. /**
  67. * Defines the number of columns spanned by a cell or gridcell within a table, grid, or treegrid.
  68. * @see aria-colindex @see aria-rowspan.
  69. */
  70. 'aria-colspan'?: number
  71. /**
  72. * Identifies the element (or elements) whose contents or presence are controlled by the current element.
  73. * @see aria-owns.
  74. */
  75. 'aria-controls'?: string
  76. /** Indicates the element that represents the current item within a container or set of related elements. */
  77. 'aria-current'?: boolean | 'false' | 'true' | 'page' | 'step' | 'location' | 'date' | 'time'
  78. /**
  79. * Identifies the element (or elements) that describes the object.
  80. * @see aria-labelledby
  81. */
  82. 'aria-describedby'?: string
  83. /**
  84. * Identifies the element that provides a detailed, extended description for the object.
  85. * @see aria-describedby.
  86. */
  87. 'aria-details'?: string
  88. /**
  89. * Indicates that the element is perceivable but disabled, so it is not editable or otherwise operable.
  90. * @see aria-hidden @see aria-readonly.
  91. */
  92. 'aria-disabled'?: boolean | 'false' | 'true'
  93. /**
  94. * Indicates what functions can be performed when a dragged object is released on the drop target.
  95. * @deprecated in ARIA 1.1
  96. */
  97. 'aria-dropeffect'?: 'none' | 'copy' | 'execute' | 'link' | 'move' | 'popup'
  98. /**
  99. * Identifies the element that provides an error message for the object.
  100. * @see aria-invalid @see aria-describedby.
  101. */
  102. 'aria-errormessage'?: string
  103. /** Indicates whether the element, or another grouping element it controls, is currently expanded or collapsed. */
  104. 'aria-expanded'?: boolean | 'false' | 'true'
  105. /**
  106. * Identifies the next element (or elements) in an alternate reading order of content which, at the user's discretion,
  107. * allows assistive technology to override the general default of reading in document source order.
  108. */
  109. 'aria-flowto'?: string
  110. /**
  111. * Indicates an element's "grabbed" state in a drag-and-drop operation.
  112. * @deprecated in ARIA 1.1
  113. */
  114. 'aria-grabbed'?: boolean | 'false' | 'true'
  115. /** Indicates the availability and type of interactive popup element, such as menu or dialog, that can be triggered by an element. */
  116. 'aria-haspopup'?: boolean | 'false' | 'true' | 'menu' | 'listbox' | 'tree' | 'grid' | 'dialog'
  117. /**
  118. * Indicates whether the element is exposed to an accessibility API.
  119. * @see aria-disabled.
  120. */
  121. 'aria-hidden'?: boolean | 'false' | 'true'
  122. /**
  123. * Indicates the entered value does not conform to the format expected by the application.
  124. * @see aria-errormessage.
  125. */
  126. 'aria-invalid'?: boolean | 'false' | 'true' | 'grammar' | 'spelling'
  127. /** Indicates keyboard shortcuts that an author has implemented to activate or give focus to an element. */
  128. 'aria-keyshortcuts'?: string
  129. /**
  130. * Defines a string value that labels the current element.
  131. * @see aria-labelledby.
  132. */
  133. 'aria-label'?: string
  134. /**
  135. * Identifies the element (or elements) that labels the current element.
  136. * @see aria-describedby.
  137. */
  138. 'aria-labelledby'?: string
  139. /** Defines the hierarchical level of an element within a structure. */
  140. 'aria-level'?: number
  141. /** 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. */
  142. 'aria-live'?: 'off' | 'assertive' | 'polite'
  143. /** Indicates whether an element is modal when displayed. */
  144. 'aria-modal'?: boolean | 'false' | 'true'
  145. /** Indicates whether a text box accepts multiple lines of input or only a single line. */
  146. 'aria-multiline'?: boolean | 'false' | 'true'
  147. /** Indicates that the user may select more than one item from the current selectable descendants. */
  148. 'aria-multiselectable'?: boolean | 'false' | 'true'
  149. /** Indicates whether the element's orientation is horizontal, vertical, or unknown/ambiguous. */
  150. 'aria-orientation'?: 'horizontal' | 'vertical'
  151. /**
  152. * Identifies an element (or elements) in order to define a visual, functional, or contextual parent/child relationship
  153. * between DOM elements where the DOM hierarchy cannot be used to represent the relationship.
  154. * @see aria-controls.
  155. */
  156. 'aria-owns'?: string
  157. /**
  158. * Defines a short hint (a word or short phrase) intended to aid the user with data entry when the control has no value.
  159. * A hint could be a sample value or a brief description of the expected format.
  160. */
  161. 'aria-placeholder'?: string
  162. /**
  163. * 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.
  164. * @see aria-setsize.
  165. */
  166. 'aria-posinset'?: number
  167. /**
  168. * Indicates the current "pressed" state of toggle buttons.
  169. * @see aria-checked @see aria-selected.
  170. */
  171. 'aria-pressed'?: boolean | 'false' | 'mixed' | 'true'
  172. /**
  173. * Indicates that the element is not editable, but is otherwise operable.
  174. * @see aria-disabled.
  175. */
  176. 'aria-readonly'?: boolean | 'false' | 'true'
  177. /**
  178. * Indicates what notifications the user agent will trigger when the accessibility tree within a live region is modified.
  179. * @see aria-atomic.
  180. */
  181. 'aria-relevant'?: 'additions' | 'additions text' | 'all' | 'removals' | 'text'
  182. /** Indicates that user input is required on the element before a form may be submitted. */
  183. 'aria-required'?: boolean | 'false' | 'true'
  184. /** Defines a human-readable, author-localized description for the role of an element. */
  185. 'aria-roledescription'?: string
  186. /**
  187. * Defines the total number of rows in a table, grid, or treegrid.
  188. * @see aria-rowindex.
  189. */
  190. 'aria-rowcount'?: number
  191. /**
  192. * Defines an element's row index or position with respect to the total number of rows within a table, grid, or treegrid.
  193. * @see aria-rowcount @see aria-rowspan.
  194. */
  195. 'aria-rowindex'?: number
  196. /**
  197. * Defines the number of rows spanned by a cell or gridcell within a table, grid, or treegrid.
  198. * @see aria-rowindex @see aria-colspan.
  199. */
  200. 'aria-rowspan'?: number
  201. /**
  202. * Indicates the current "selected" state of various widgets.
  203. * @see aria-checked @see aria-pressed.
  204. */
  205. 'aria-selected'?: boolean | 'false' | 'true'
  206. /**
  207. * 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.
  208. * @see aria-posinset.
  209. */
  210. 'aria-setsize'?: number
  211. /** Indicates if items in a table or grid are sorted in ascending or descending order. */
  212. 'aria-sort'?: 'none' | 'ascending' | 'descending' | 'other'
  213. /** Defines the maximum allowed value for a range widget. */
  214. 'aria-valuemax'?: number
  215. /** Defines the minimum allowed value for a range widget. */
  216. 'aria-valuemin'?: number
  217. /**
  218. * Defines the current value for a range widget.
  219. * @see aria-valuetext.
  220. */
  221. 'aria-valuenow'?: number
  222. /** Defines the human readable text alternative of aria-valuenow for a range widget. */
  223. 'aria-valuetext'?: string
  224. }
  225. export interface HTMLAttributes extends AriaAttributes{
  226. domPropsInnerHTML?: string;
  227. class?: any
  228. style?: string | CSSProperties
  229. // Standard HTML Attributes
  230. accesskey?: string
  231. contenteditable?: Booleanish | "inherit"
  232. contextmenu?: string
  233. dir?: string
  234. draggable?: Booleanish
  235. hidden?: boolean
  236. id?: string
  237. lang?: string
  238. placeholder?: string
  239. spellcheck?: Booleanish
  240. tabindex?: number
  241. title?: string
  242. translate?: 'yes' | 'no'
  243. // Unknown
  244. radiogroup?: string // <command>, <menuitem>
  245. // WAI-ARIA
  246. role?: string
  247. // RDFa Attributes
  248. about?: string
  249. datatype?: string
  250. inlist?: any
  251. prefix?: string
  252. property?: string
  253. resource?: string
  254. typeof?: string
  255. vocab?: string
  256. // Non-standard Attributes
  257. autocapitalize?: string
  258. autocorrect?: string
  259. autocave?: string
  260. color?: string
  261. itemprop?: string
  262. itemscope?: boolean
  263. itemtype?: string
  264. itemid?: string
  265. itemref?: string
  266. results?: number
  267. security?: string
  268. unselectable?: 'on' | 'off'
  269. // Living Standard
  270. /**
  271. * Hints at the type of data that might be entered by the user while editing the element or its contents
  272. * @see https://html.spec.whatwg.org/multipage/interaction.html#input-modalities:-the-inputmode-attribute
  273. */
  274. inputmode?: 'none' | 'text' | 'tel' | 'url' | 'email' | 'numeric' | 'decimal' | 'search'
  275. /**
  276. * Specify that a standard HTML element should behave like a defined custom built-in element
  277. * @see https://html.spec.whatwg.org/multipage/custom-elements.html#attr-is
  278. */
  279. is?: string
  280. }
  281. export interface AnchorHTMLAttributes extends HTMLAttributes {
  282. download?: any
  283. href?: string
  284. hreflang?: string
  285. media?: string
  286. ping?: string
  287. rel?: string
  288. target?: string
  289. type?: string
  290. referrerpolicy?: string
  291. }
  292. export interface AreaHTMLAttributes extends HTMLAttributes {
  293. alt?: string
  294. coords?: string
  295. download?: any
  296. href?: string
  297. hreflang?: string
  298. media?: string
  299. rel?: string
  300. shape?: string
  301. target?: string
  302. }
  303. export interface AudioHTMLAttributes extends MediaHTMLAttributes {
  304. }
  305. export interface BaseHTMLAttributes extends HTMLAttributes {
  306. href?: string
  307. target?: string
  308. }
  309. export interface BlockquoteHTMLAttributes extends HTMLAttributes {
  310. cite?: string
  311. }
  312. export interface ButtonHTMLAttributes extends HTMLAttributes {
  313. autofocus?: boolean
  314. disabled?: boolean
  315. form?: string
  316. formaction?: string
  317. formenctype?: string
  318. formmethod?: string
  319. formnovalidate?: boolean
  320. formtarget?: string
  321. name?: string
  322. type?: 'submit' | 'reset' | 'button'
  323. value?: string | string[] | number
  324. }
  325. export interface CanvasHTMLAttributes extends HTMLAttributes {
  326. height?: number | string
  327. width?: number | string
  328. }
  329. export interface ColHTMLAttributes extends HTMLAttributes {
  330. span?: number
  331. width?: number | string
  332. }
  333. export interface ColgroupHTMLAttributes extends HTMLAttributes {
  334. span?: number
  335. }
  336. export interface DataHTMLAttributes extends HTMLAttributes {
  337. value?: string | string[] | number
  338. }
  339. export interface DetailsHTMLAttributes extends HTMLAttributes {
  340. open?: boolean
  341. }
  342. export interface DelHTMLAttributes extends HTMLAttributes {
  343. cite?: string
  344. datetime?: string
  345. }
  346. export interface DialogHTMLAttributes extends HTMLAttributes {
  347. open?: boolean
  348. }
  349. export interface EmbedHTMLAttributes extends HTMLAttributes {
  350. height?: number | string
  351. src?: string
  352. type?: string
  353. width?: number | string
  354. }
  355. export interface FieldsetHTMLAttributes extends HTMLAttributes {
  356. disabled?: boolean
  357. form?: string
  358. name?: string
  359. }
  360. export interface FormHTMLAttributes extends HTMLAttributes {
  361. acceptcharset?: string
  362. action?: string
  363. autocomplete?: string
  364. enctype?: string
  365. method?: string
  366. name?: string
  367. novalidate?: boolean
  368. target?: string
  369. }
  370. export interface HtmlHTMLAttributes extends HTMLAttributes {
  371. manifest?: string
  372. }
  373. export interface IframeHTMLAttributes extends HTMLAttributes {
  374. allow?: string
  375. allowfullscreen?: boolean
  376. allowtransparency?: boolean
  377. frameborder?: number | string
  378. height?: number | string
  379. marginheight?: number
  380. marginwidth?: number
  381. name?: string
  382. referrerpolicy?: string
  383. sandbox?: string
  384. scrolling?: string
  385. seamless?: boolean
  386. src?: string
  387. srcdoc?: string
  388. width?: number | string
  389. }
  390. export interface ImgHTMLAttributes extends HTMLAttributes {
  391. alt?: string
  392. crossorigin?: 'anonymous' | 'use-credentials' | ''
  393. decoding?: 'async' | 'auto' | 'sync'
  394. height?: number | string
  395. sizes?: string
  396. src?: string
  397. srcset?: string
  398. usemap?: string
  399. width?: number | string
  400. }
  401. export interface InsHTMLAttributes extends HTMLAttributes {
  402. cite?: string
  403. datetime?: string
  404. }
  405. export interface InputHTMLAttributes extends HTMLAttributes {
  406. accept?: string
  407. alt?: string
  408. autocomplete?: string
  409. autofocus?: boolean
  410. capture?: boolean // https://www.w3.org/tr/html-media-capture/#the-capture-attribute
  411. checked?: boolean
  412. crossorigin?: string
  413. disabled?: boolean
  414. form?: string
  415. formaction?: string
  416. formenctype?: string
  417. formmethod?: string
  418. formnovalidate?: boolean
  419. formtarget?: string
  420. height?: number | string
  421. list?: string
  422. max?: number | string
  423. maxlength?: number
  424. min?: number | string
  425. minlength?: number
  426. multiple?: boolean
  427. name?: string
  428. pattern?: string
  429. placeholder?: string
  430. readonly?: boolean
  431. required?: boolean
  432. size?: number
  433. src?: string
  434. step?: number | string
  435. type?: string
  436. value?: string | string[] | number
  437. width?: number | string
  438. }
  439. export interface KeygenHTMLAttributes extends HTMLAttributes {
  440. autofocus?: boolean
  441. challenge?: string
  442. disabled?: boolean
  443. form?: string
  444. keytype?: string
  445. keyparams?: string
  446. name?: string
  447. }
  448. export interface LabelHTMLAttributes extends HTMLAttributes {
  449. for?: string
  450. form?: string
  451. }
  452. export interface LiHTMLAttributes extends HTMLAttributes {
  453. value?: string | string[] | number
  454. }
  455. export interface LinkHTMLAttributes extends HTMLAttributes {
  456. as?: string
  457. crossorigin?: string
  458. href?: string
  459. hreflang?: string
  460. integrity?: string
  461. media?: string
  462. rel?: string
  463. sizes?: string
  464. type?: string
  465. }
  466. export interface MapHTMLAttributes extends HTMLAttributes {
  467. name?: string
  468. }
  469. export interface MenuHTMLAttributes extends HTMLAttributes {
  470. type?: string
  471. }
  472. export interface MediaHTMLAttributes extends HTMLAttributes {
  473. autoplay?: boolean
  474. controls?: boolean
  475. controlslist?: string
  476. crossorigin?: string
  477. loop?: boolean
  478. mediagroup?: string
  479. muted?: boolean
  480. playsinline?: boolean
  481. preload?: string
  482. src?: string
  483. }
  484. export interface MetaHTMLAttributes extends HTMLAttributes {
  485. charset?: string
  486. content?: string
  487. httpequiv?: string
  488. name?: string
  489. }
  490. export interface MeterHTMLAttributes extends HTMLAttributes {
  491. form?: string
  492. high?: number
  493. low?: number
  494. max?: number | string
  495. min?: number | string
  496. optimum?: number
  497. value?: string | string[] | number
  498. }
  499. export interface QuoteHTMLAttributes extends HTMLAttributes {
  500. cite?: string
  501. }
  502. export interface ObjectHTMLAttributes extends HTMLAttributes {
  503. classid?: string
  504. data?: string
  505. form?: string
  506. height?: number | string
  507. name?: string
  508. type?: string
  509. usemap?: string
  510. width?: number | string
  511. wmode?: string
  512. }
  513. export interface OlHTMLAttributes extends HTMLAttributes {
  514. reversed?: boolean
  515. start?: number
  516. type?: '1' | 'a' | 'A' | 'i' | 'I'
  517. }
  518. export interface OptgroupHTMLAttributes extends HTMLAttributes {
  519. disabled?: boolean
  520. label?: string
  521. }
  522. export interface OptionHTMLAttributes extends HTMLAttributes {
  523. disabled?: boolean
  524. label?: string
  525. selected?: boolean
  526. value?: string | string[] | number
  527. }
  528. export interface OutputHTMLAttributes extends HTMLAttributes {
  529. for?: string
  530. form?: string
  531. name?: string
  532. }
  533. export interface ParamHTMLAttributes extends HTMLAttributes {
  534. name?: string
  535. value?: string | string[] | number
  536. }
  537. export interface ProgressHTMLAttributes extends HTMLAttributes {
  538. max?: number | string
  539. value?: string | string[] | number
  540. }
  541. export interface ScriptHTMLAttributes extends HTMLAttributes {
  542. async?: boolean
  543. charset?: string
  544. crossorigin?: string
  545. defer?: boolean
  546. integrity?: string
  547. nomodule?: boolean
  548. nonce?: string
  549. src?: string
  550. type?: string
  551. }
  552. export interface SelectHTMLAttributes extends HTMLAttributes {
  553. autocomplete?: string
  554. autofocus?: boolean
  555. disabled?: boolean
  556. form?: string
  557. multiple?: boolean
  558. name?: string
  559. required?: boolean
  560. size?: number
  561. value?: string | string[] | number
  562. }
  563. export interface SourceHTMLAttributes extends HTMLAttributes {
  564. media?: string
  565. sizes?: string
  566. src?: string
  567. srcset?: string
  568. type?: string
  569. }
  570. export interface StyleHTMLAttributes extends HTMLAttributes {
  571. media?: string
  572. nonce?: string
  573. scoped?: boolean
  574. type?: string
  575. }
  576. export interface TableHTMLAttributes extends HTMLAttributes {
  577. cellpadding?: number | string
  578. cellspacing?: number | string
  579. summary?: string
  580. }
  581. export interface TextareaHTMLAttributes extends HTMLAttributes {
  582. autocomplete?: string
  583. autofocus?: boolean
  584. cols?: number
  585. dirname?: string
  586. disabled?: boolean
  587. form?: string
  588. maxlength?: number
  589. minlength?: number
  590. name?: string
  591. placeholder?: string
  592. readonly?: boolean
  593. required?: boolean
  594. rows?: number
  595. value?: string | string[] | number
  596. wrap?: string
  597. }
  598. export interface TdHTMLAttributes extends HTMLAttributes {
  599. align?: 'left' | 'center' | 'right' | 'justify' | 'char'
  600. colspan?: number
  601. headers?: string
  602. rowspan?: number
  603. scope?: string
  604. valign?: 'top' | 'middle' | 'bottom' | 'baseline'
  605. }
  606. export interface ThHTMLAttributes extends HTMLAttributes {
  607. align?: 'left' | 'center' | 'right' | 'justify' | 'char'
  608. colspan?: number
  609. headers?: string
  610. rowspan?: number
  611. scope?: string
  612. }
  613. export interface TimeHTMLAttributes extends HTMLAttributes {
  614. datetime?: string
  615. }
  616. export interface TrackHTMLAttributes extends HTMLAttributes {
  617. default?: boolean
  618. kind?: string
  619. label?: string
  620. src?: string
  621. srclang?: string
  622. }
  623. export interface VideoHTMLAttributes extends MediaHTMLAttributes {
  624. height?: number | string
  625. playsinline?: boolean
  626. poster?: string
  627. width?: number | string
  628. disablePictureInPicture?: boolean
  629. }
  630. export interface WebViewHTMLAttributes extends HTMLAttributes {
  631. allowfullscreen?: boolean
  632. allowpopups?: boolean
  633. autoFocus?: boolean
  634. autosize?: boolean
  635. blinkfeatures?: string
  636. disableblinkfeatures?: string
  637. disableguestresize?: boolean
  638. disablewebsecurity?: boolean
  639. guestinstance?: string
  640. httpreferrer?: string
  641. nodeintegration?: boolean
  642. partition?: string
  643. plugins?: boolean
  644. preload?: string
  645. src?: string
  646. useragent?: string
  647. webpreferences?: string
  648. }
  649. export interface SVGAttributes extends AriaAttributes {
  650. domPropsInnerHTML?: string;
  651. color?: string
  652. height?: number | string
  653. id?: string
  654. lang?: string
  655. max?: number | string
  656. media?: string
  657. method?: string
  658. min?: number | string
  659. name?: string
  660. target?: string
  661. type?: string
  662. width?: number | string
  663. // Other HTML properties supported by SVG elements in browsers
  664. role?: string
  665. tabindex?: number
  666. // SVG Specific attributes
  667. 'accent-height'?: number | string
  668. accumulate?: 'none' | 'sum'
  669. additive?: 'replace' | 'sum'
  670. 'alignment-baseline'?: 'auto' | 'baseline' | 'before-edge' | 'text-before-edge' | 'middle' | 'central' | 'after-edge' | 'text-after-edge' | 'ideographic' | 'alphabetic' | 'hanging' | 'mathematical' | 'inherit'
  671. allowReorder?: 'no' | 'yes'
  672. alphabetic?: number | string
  673. amplitude?: number | string
  674. 'arabic-form'?: 'initial' | 'medial' | 'terminal' | 'isolated'
  675. ascent?: number | string
  676. attributeName?: string
  677. attributeType?: string
  678. autoReverse?: number | string
  679. azimuth?: number | string
  680. baseFrequency?: number | string
  681. 'baseline-shift'?: number | string
  682. baseProfile?: number | string
  683. bbox?: number | string
  684. begin?: number | string
  685. bias?: number | string
  686. by?: number | string
  687. calcMode?: number | string
  688. 'cap-height'?: number | string
  689. clip?: number | string
  690. 'clip-path'?: string
  691. clipPathUnits?: number | string
  692. 'clip-rule'?: number | string
  693. 'color-interpolation'?: number | string
  694. 'color-interpolation-filters'?: 'auto' | 'sRGB' | 'linearRGB' | 'inherit'
  695. 'color-profile'?: number | string
  696. 'color-rendering'?: number | string
  697. contentScriptType?: number | string
  698. contentStyleType?: number | string
  699. cursor?: number | string
  700. cx?: number | string
  701. cy?: number | string
  702. d?: string
  703. decelerate?: number | string
  704. descent?: number | string
  705. diffuseConstant?: number | string
  706. direction?: number | string
  707. display?: number | string
  708. divisor?: number | string
  709. 'dominant-baseline'?: number | string
  710. dur?: number | string
  711. dx?: number | string
  712. dy?: number | string
  713. edgeMode?: number | string
  714. elevation?: number | string
  715. 'enable-background'?: number | string
  716. end?: number | string
  717. exponent?: number | string
  718. externalResourcesRequired?: number | string
  719. fill?: string
  720. 'fill-opacity'?: number | string
  721. 'fill-rule'?: 'nonzero' | 'evenodd' | 'inherit'
  722. filter?: string
  723. filterRes?: number | string
  724. filterUnits?: number | string
  725. 'flood-color'?: number | string
  726. 'flood-opacity'?: number | string
  727. focusable?: number | string
  728. 'font-family'?: string
  729. 'font-size'?: number | string
  730. 'font-size-adjust'?: number | string
  731. 'font-stretch'?: number | string
  732. 'font-style'?: number | string
  733. 'font-variant'?: number | string
  734. 'font-weight'?: number | string
  735. format?: number | string
  736. from?: number | string
  737. fx?: number | string
  738. fy?: number | string
  739. g1?: number | string
  740. g2?: number | string
  741. 'glyph-name'?: number | string
  742. 'glyph-orientation-horizontal'?: number | string
  743. 'glyph-orientation-vertical'?: number | string
  744. glyphRef?: number | string
  745. gradientTransform?: string
  746. gradientUnits?: string
  747. hanging?: number | string
  748. 'horiz-adv-x'?: number | string
  749. 'horiz-origin-x'?: number | string
  750. href?: string
  751. ideographic?: number | string
  752. 'image-rendering'?: number | string
  753. in2?: number | string
  754. in?: string
  755. intercept?: number | string
  756. k1?: number | string
  757. k2?: number | string
  758. k3?: number | string
  759. k4?: number | string
  760. k?: number | string
  761. kernelMatrix?: number | string
  762. kernelUnitLength?: number | string
  763. kerning?: number | string
  764. keyPoints?: number | string
  765. keySplines?: number | string
  766. keyTimes?: number | string
  767. lengthAdjust?: number | string
  768. 'letter-spacing'?: number | string
  769. 'lighting-color'?: number | string
  770. limitingConeAngle?: number | string
  771. local?: number | string
  772. 'marker-end'?: string
  773. markerHeight?: number | string
  774. 'marker-mid'?: string
  775. 'marker-start'?: string
  776. markerUnits?: number | string
  777. markerWidth?: number | string
  778. mask?: string
  779. maskContentUnits?: number | string
  780. maskUnits?: number | string
  781. mathematical?: number | string
  782. mode?: number | string
  783. numOctaves?: number | string
  784. offset?: number | string
  785. opacity?: number | string
  786. operator?: number | string
  787. order?: number | string
  788. orient?: number | string
  789. orientation?: number | string
  790. origin?: number | string
  791. overflow?: number | string
  792. 'overline-position'?: number | string
  793. 'overline-thickness'?: number | string
  794. 'paint-order'?: number | string
  795. 'panose-1'?: number | string
  796. pathLength?: number | string
  797. patternContentUnits?: string
  798. patternTransform?: number | string
  799. patternUnits?: string
  800. 'pointer-events'?: number | string
  801. points?: string
  802. pointsAtX?: number | string
  803. pointsAtY?: number | string
  804. pointsAtZ?: number | string
  805. preserveAlpha?: number | string
  806. preserveAspectRatio?: string
  807. primitiveUnits?: number | string
  808. r?: number | string
  809. radius?: number | string
  810. refX?: number | string
  811. refY?: number | string
  812. renderingIntent?: number | string
  813. repeatCount?: number | string
  814. repeatDur?: number | string
  815. requiredExtensions?: number | string
  816. requiredFeatures?: number | string
  817. restart?: number | string
  818. result?: string
  819. rotate?: number | string
  820. rx?: number | string
  821. ry?: number | string
  822. scale?: number | string
  823. seed?: number | string
  824. 'shape-rendering'?: number | string
  825. slope?: number | string
  826. spacing?: number | string
  827. specularConstant?: number | string
  828. specularExponent?: number | string
  829. speed?: number | string
  830. spreadMethod?: string
  831. startOffset?: number | string
  832. stdDeviation?: number | string
  833. stemh?: number | string
  834. stemv?: number | string
  835. stitchTiles?: number | string
  836. 'stop-color'?: string
  837. 'stop-opacity'?: number | string
  838. 'strikethrough-position'?: number | string
  839. 'strikethrough-thickness'?: number | string
  840. string?: number | string
  841. stroke?: string
  842. 'stroke-dasharray'?: string | number
  843. 'stroke-dashoffset'?: string | number
  844. 'stroke-linecap'?: 'butt' | 'round' | 'square' | 'inherit'
  845. 'stroke-linejoin'?: 'miter' | 'round' | 'bevel' | 'inherit'
  846. 'stroke-miterlimit'?: number | string
  847. 'stroke-opacity'?: number | string
  848. 'stroke-width'?: number | string
  849. surfaceScale?: number | string
  850. systemLanguage?: number | string
  851. tableValues?: number | string
  852. targetX?: number | string
  853. targetY?: number | string
  854. 'text-anchor'?: string
  855. 'text-decoration'?: number | string
  856. textLength?: number | string
  857. 'text-rendering'?: number | string
  858. to?: number | string
  859. transform?: string
  860. u1?: number | string
  861. u2?: number | string
  862. 'underline-position'?: number | string
  863. 'underline-thickness'?: number | string
  864. unicode?: number | string
  865. 'unicode-bidi'?: number | string
  866. 'unicode-range'?: number | string
  867. 'unitsPer-em'?: number | string
  868. 'v-alphabetic'?: number | string
  869. values?: string
  870. 'vector-effect'?: number | string
  871. version?: string
  872. 'vert-adv-y'?: number | string
  873. 'vert-origin-x'?: number | string
  874. 'vert-origin-y'?: number | string
  875. 'v-hanging'?: number | string
  876. 'v-ideographic'?: number | string
  877. viewBox?: string
  878. viewTarget?: number | string
  879. visibility?: number | string
  880. 'v-mathematical'?: number | string
  881. widths?: number | string
  882. 'word-spacing'?: number | string
  883. 'writing-mode'?: number | string
  884. x1?: number | string
  885. x2?: number | string
  886. x?: number | string
  887. xChannelSelector?: string
  888. 'x-height'?: number | string
  889. 'xlinkActuate'?: string
  890. 'xlinkArcrole'?: string
  891. 'xlinkHref'?: string
  892. 'xlinkRole'?: string
  893. 'xlinkShow'?: string
  894. 'xlinkTitle'?: string
  895. 'xlinkType'?: string
  896. y1?: number | string
  897. y2?: number | string
  898. y?: number | string
  899. yChannelSelector?: string
  900. z?: number | string
  901. zoomAndPan?: string
  902. }
  903. interface IntrinsicElementAttributes {
  904. a: AnchorHTMLAttributes
  905. abbr: HTMLAttributes
  906. address: HTMLAttributes
  907. area: AreaHTMLAttributes
  908. article: HTMLAttributes
  909. aside: HTMLAttributes
  910. audio: AudioHTMLAttributes
  911. b: HTMLAttributes
  912. base: BaseHTMLAttributes
  913. bdi: HTMLAttributes
  914. bdo: HTMLAttributes
  915. big: HTMLAttributes
  916. blockquote: BlockquoteHTMLAttributes
  917. body: HTMLAttributes
  918. br: HTMLAttributes
  919. button: ButtonHTMLAttributes
  920. canvas: CanvasHTMLAttributes
  921. caption: HTMLAttributes
  922. cite: HTMLAttributes
  923. code: HTMLAttributes
  924. col: ColHTMLAttributes
  925. colgroup: ColgroupHTMLAttributes
  926. data: DataHTMLAttributes
  927. datalist: HTMLAttributes
  928. dd: HTMLAttributes
  929. del: DelHTMLAttributes
  930. details: DetailsHTMLAttributes
  931. dfn: HTMLAttributes
  932. dialog: DialogHTMLAttributes
  933. div: HTMLAttributes
  934. dl: HTMLAttributes
  935. dt: HTMLAttributes
  936. em: HTMLAttributes
  937. embed: EmbedHTMLAttributes
  938. fieldset: FieldsetHTMLAttributes
  939. figcaption: HTMLAttributes
  940. figure: HTMLAttributes
  941. footer: HTMLAttributes
  942. form: FormHTMLAttributes
  943. h1: HTMLAttributes
  944. h2: HTMLAttributes
  945. h3: HTMLAttributes
  946. h4: HTMLAttributes
  947. h5: HTMLAttributes
  948. h6: HTMLAttributes
  949. head: HTMLAttributes
  950. header: HTMLAttributes
  951. hgroup: HTMLAttributes
  952. hr: HTMLAttributes
  953. html: HtmlHTMLAttributes
  954. i: HTMLAttributes
  955. iframe: IframeHTMLAttributes
  956. img: ImgHTMLAttributes
  957. input: InputHTMLAttributes
  958. ins: InsHTMLAttributes
  959. kbd: HTMLAttributes
  960. keygen: KeygenHTMLAttributes
  961. label: LabelHTMLAttributes
  962. legend: HTMLAttributes
  963. li: LiHTMLAttributes
  964. link: LinkHTMLAttributes
  965. main: HTMLAttributes
  966. map: MapHTMLAttributes
  967. mark: HTMLAttributes
  968. menu: MenuHTMLAttributes
  969. menuitem: HTMLAttributes
  970. meta: MetaHTMLAttributes
  971. meter: MeterHTMLAttributes
  972. nav: HTMLAttributes
  973. noindex: HTMLAttributes
  974. noscript: HTMLAttributes
  975. object: ObjectHTMLAttributes
  976. ol: OlHTMLAttributes
  977. optgroup: OptgroupHTMLAttributes
  978. option: OptionHTMLAttributes
  979. output: OutputHTMLAttributes
  980. p: HTMLAttributes
  981. param: ParamHTMLAttributes
  982. picture: HTMLAttributes
  983. pre: HTMLAttributes
  984. progress: ProgressHTMLAttributes
  985. q: QuoteHTMLAttributes
  986. rp: HTMLAttributes
  987. rt: HTMLAttributes
  988. ruby: HTMLAttributes
  989. s: HTMLAttributes
  990. samp: HTMLAttributes
  991. script: ScriptHTMLAttributes
  992. section: HTMLAttributes
  993. select: SelectHTMLAttributes
  994. small: HTMLAttributes
  995. source: SourceHTMLAttributes
  996. span: HTMLAttributes
  997. strong: HTMLAttributes
  998. style: StyleHTMLAttributes
  999. sub: HTMLAttributes
  1000. summary: HTMLAttributes
  1001. sup: HTMLAttributes
  1002. table: TableHTMLAttributes
  1003. template: HTMLAttributes
  1004. tbody: HTMLAttributes
  1005. td: TdHTMLAttributes
  1006. textarea: TextareaHTMLAttributes
  1007. tfoot: HTMLAttributes
  1008. th: ThHTMLAttributes
  1009. thead: HTMLAttributes
  1010. time: TimeHTMLAttributes
  1011. title: HTMLAttributes
  1012. tr: HTMLAttributes
  1013. track: TrackHTMLAttributes
  1014. u: HTMLAttributes
  1015. ul: HTMLAttributes
  1016. var: HTMLAttributes
  1017. video: VideoHTMLAttributes
  1018. wbr: HTMLAttributes
  1019. webview: WebViewHTMLAttributes
  1020. // SVG
  1021. svg: SVGAttributes
  1022. animate: SVGAttributes
  1023. animateMotion: SVGAttributes
  1024. animateTransform: SVGAttributes
  1025. circle: SVGAttributes
  1026. clipPath: SVGAttributes
  1027. defs: SVGAttributes
  1028. desc: SVGAttributes
  1029. ellipse: SVGAttributes
  1030. feBlend: SVGAttributes
  1031. feColorMatrix: SVGAttributes
  1032. feComponentTransfer: SVGAttributes
  1033. feComposite: SVGAttributes
  1034. feConvolveMatrix: SVGAttributes
  1035. feDiffuseLighting: SVGAttributes
  1036. feDisplacementMap: SVGAttributes
  1037. feDistantLight: SVGAttributes
  1038. feDropShadow: SVGAttributes
  1039. feFlood: SVGAttributes
  1040. feFuncA: SVGAttributes
  1041. feFuncB: SVGAttributes
  1042. feFuncG: SVGAttributes
  1043. feFuncR: SVGAttributes
  1044. feGaussianBlur: SVGAttributes
  1045. feImage: SVGAttributes
  1046. feMerge: SVGAttributes
  1047. feMergeNode: SVGAttributes
  1048. feMorphology: SVGAttributes
  1049. feOffset: SVGAttributes
  1050. fePointLight: SVGAttributes
  1051. feSpecularLighting: SVGAttributes
  1052. feSpotLight: SVGAttributes
  1053. feTile: SVGAttributes
  1054. feTurbulence: SVGAttributes
  1055. filter: SVGAttributes
  1056. foreignObject: SVGAttributes
  1057. g: SVGAttributes
  1058. image: SVGAttributes
  1059. line: SVGAttributes
  1060. linearGradient: SVGAttributes
  1061. marker: SVGAttributes
  1062. mask: SVGAttributes
  1063. metadata: SVGAttributes
  1064. mpath: SVGAttributes
  1065. path: SVGAttributes
  1066. pattern: SVGAttributes
  1067. polygon: SVGAttributes
  1068. polyline: SVGAttributes
  1069. radialGradient: SVGAttributes
  1070. rect: SVGAttributes
  1071. stop: SVGAttributes
  1072. switch: SVGAttributes
  1073. symbol: SVGAttributes
  1074. text: SVGAttributes
  1075. textPath: SVGAttributes
  1076. tspan: SVGAttributes
  1077. use: SVGAttributes
  1078. view: SVGAttributes
  1079. }
  1080. export interface Events {
  1081. // clipboard events
  1082. onCopy: ClipboardEvent
  1083. onCut: ClipboardEvent
  1084. onPaste: ClipboardEvent
  1085. // composition events
  1086. onCompositionend: CompositionEvent
  1087. onCompositionstart: CompositionEvent
  1088. onCompositionupdate: CompositionEvent
  1089. // drag drop events
  1090. onDrag: DragEvent
  1091. onDragend: DragEvent
  1092. onDragenter: DragEvent
  1093. onDragexit: DragEvent
  1094. onDragleave: DragEvent
  1095. onDragover: DragEvent
  1096. onDragstart: DragEvent
  1097. onDrop: DragEvent
  1098. // focus events
  1099. onFocus: FocusEvent
  1100. onBlur: FocusEvent
  1101. // form events
  1102. onChange: Event
  1103. onBeforeinput: Event
  1104. onInput: Event
  1105. onReset: Event
  1106. onSubmit: Event
  1107. onInvalid: Event
  1108. // image events
  1109. onLoad: Event
  1110. onError: Event
  1111. // keyboard events
  1112. onKeydown: KeyboardEvent
  1113. onKeypress: KeyboardEvent
  1114. onKeyup: KeyboardEvent
  1115. // mouse events
  1116. onAuxclick: MouseEvent
  1117. onClick: MouseEvent
  1118. onContextmenu: MouseEvent
  1119. onDblclick: MouseEvent
  1120. onMousedown: MouseEvent
  1121. onMouseenter: MouseEvent
  1122. onMouseleave: MouseEvent
  1123. onMousemove: MouseEvent
  1124. onMouseout: MouseEvent
  1125. onMouseover: MouseEvent
  1126. onMouseup: MouseEvent
  1127. // media events
  1128. onAbort: Event
  1129. onCanplay: Event
  1130. onCanplaythrough: Event
  1131. onDurationchange: Event
  1132. onEmptied: Event
  1133. onEncrypted: Event
  1134. onEnded: Event
  1135. onLoadeddata: Event
  1136. onLoadedmetadata: Event
  1137. onLoadstart: Event
  1138. onPause: Event
  1139. onPlay: Event
  1140. onPlaying: Event
  1141. onProgress: Event
  1142. onRatechange: Event
  1143. onSeeked: Event
  1144. onSeeking: Event
  1145. onStalled: Event
  1146. onSuspend: Event
  1147. onTimeupdate: Event
  1148. onVolumechange: Event
  1149. onWaiting: Event
  1150. // selection events
  1151. onSelect: Event
  1152. // UI events
  1153. onScroll: UIEvent
  1154. // touch events
  1155. onTouchcancel: TouchEvent
  1156. onTouchend: TouchEvent
  1157. onTouchmove: TouchEvent
  1158. onTouchstart: TouchEvent
  1159. // pointer events
  1160. onPointerdown: PointerEvent
  1161. onPointermove: PointerEvent
  1162. onPointerup: PointerEvent
  1163. onPointercancel: PointerEvent
  1164. onPointerenter: PointerEvent
  1165. onPointerleave: PointerEvent
  1166. onPointerover: PointerEvent
  1167. onPointerout: PointerEvent
  1168. // wheel events
  1169. onWheel: WheelEvent
  1170. // animation events
  1171. onAnimationstart: AnimationEvent
  1172. onAnimationend: AnimationEvent
  1173. onAnimationiteration: AnimationEvent
  1174. // transition events
  1175. onTransitionend: TransitionEvent
  1176. onTransitionstart: TransitionEvent
  1177. }
  1178. type StringKeyOf<T> = Extract<keyof T, string>
  1179. type EventHandlers<E> = {
  1180. [K in StringKeyOf<E>]?: E[K] extends Function ? E[K] : (payload: E[K]) => void
  1181. }
  1182. type ReservedProps = {
  1183. key?: string | number
  1184. ref?: string | Ref | ((ref: Element | ComponentPublicInstance | null) => void)
  1185. }
  1186. type ElementAttrs<T> = T & EventHandlers<Events> & ReservedProps
  1187. type NativeElements = {
  1188. [K in StringKeyOf<IntrinsicElementAttributes>]: ElementAttrs<
  1189. IntrinsicElementAttributes[K]
  1190. >
  1191. }
  1192. declare global {
  1193. namespace JSX {
  1194. interface Element {}
  1195. interface ElementClass {
  1196. $props: {}
  1197. }
  1198. interface ElementAttributesProperty {
  1199. $props: {}
  1200. }
  1201. interface IntrinsicElements extends NativeElements {
  1202. // allow arbitrary elements
  1203. [name: string]: any
  1204. }
  1205. }
  1206. }
  1207. // suppress ts:2669
  1208. export {}