-
Notifications
You must be signed in to change notification settings - Fork 57
Expand file tree
/
Copy pathJSX.d.ts
More file actions
1438 lines (1323 loc) · 46.9 KB
/
JSX.d.ts
File metadata and controls
1438 lines (1323 loc) · 46.9 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
// Type definitions for Nullstack
// Project: http://github.com/nullstack/nullstack/
// Definitions by: Asana <https://asana.com>
// AssureSign <http://www.assuresign.com>
// Microsoft <https://microsoft.com>
// John Reilly <https://github.com/johnnyreilly>
// Benoit Benezech <https://github.com/bbenezech>
// Patricio Zavolinsky <https://github.com/pzavolinsky>
// Eric Anderson <https://github.com/ericanderson>
// Dovydas Navickas <https://github.com/DovydasNavickas>
// Josh Rutherford <https://github.com/theruther4d>
// Guilherme Hübner <https://github.com/guilhermehubner>
// Ferdy Budhidharma <https://github.com/ferdaber>
// Johann Rakotoharisoa <https://github.com/jrakotoharisoa>
// Olivier Pascal <https://github.com/pascaloliv>
// Martin Hochel <https://github.com/hotell>
// Frank Li <https://github.com/franklixuefei>
// Jessica Franco <https://github.com/Jessidhia>
// Saransh Kataria <https://github.com/saranshkataria>
// Kanitkorn Sujautra <https://github.com/lukyth>
// Sebastian Silbermann <https://github.com/eps1lon>
// Kyle Scully <https://github.com/zieka>
// Cong Zhang <https://github.com/dancerphil>
// Dimitri Mitropoulos <https://github.com/dimitropoulos>
// JongChan Choi <https://github.com/disjukr>
// Victor Magalhães <https://github.com/vhfmag>
// Dale Tan <https://github.com/hellatan>
// Priyanshu Rav <https://github.com/priyanshurav>
// Guilherme Correia <https://github.com/GuiDevloper>
// TypeScript Version: 2.8
import { NullstackClientContext } from './ClientContext'
type NativeDragEvent = globalThis.DragEvent
type NativeFocusEvent = globalThis.FocusEvent
type NativeKeyboardEvent = globalThis.KeyboardEvent
type NativeMouseEvent = globalThis.MouseEvent
type NativePointerEvent = globalThis.PointerEvent
type NativeUIEvent = globalThis.UIEvent
type NativeWheelEvent = globalThis.WheelEvent
type Booleanish = boolean | 'true' | 'false'
//
// Nullstack Elements
// ----------------------------------------------------------------------
export interface Attributes<HTMLElementType = unknown> {
html?: string
source?: object
bind?: NullstackClientContext['bind'] | string | number | boolean
debounce?: number
ref?: HTMLElementType | ((context?: Partial<NullstackClientContext>) => void) | NullstackClientContext['ref']
'data-'?: any
children?: NullstackNode
route?: string
persistent?: boolean
[key: string]: any
}
export interface NullstackAttributes extends Attributes {}
export interface ClassAttributes<T = unknown> extends Attributes<T> {
key?: string
}
//
// Factories
// ----------------------------------------------------------------------
type DetailedHTMLFactory<P, T = any> = P
export interface SVGFactory {}
export type NullstackFragment = NullstackNode[]
export type NullstackNode = NullstackFragment | string | number | boolean | null | undefined
//
// Event System
// ----------------------------------------------------------------------
// TODO: change any to unknown when moving to TS v3
export interface BaseSyntheticEvent<E = object, C = any, T = any> {
nativeEvent: E
currentTarget: C
target: T
bubbles: boolean
cancelable: boolean
defaultPrevented: boolean
eventPhase: number
isTrusted: boolean
preventDefault(): void
isDefaultPrevented(): boolean
stopPropagation(): void
timeStamp: number
type: string
}
/**
* currentTarget - a reference to the element on which the event listener is registered.
*
* target - a reference to the element from which the event was originally dispatched.
* This might be a child element to the element on which the event listener is registered.
* If you thought this should be `EventTarget & T`, see https://github.com/DefinitelyTyped/DefinitelyTyped/issues/11508#issuecomment-256045682
*/
export type SyntheticEvent<T = Element, E = Event> = BaseSyntheticEvent<E, EventTarget & T, EventTarget>
export interface DragEvent<T = Element> extends MouseEvent<T, NativeDragEvent> {
dataTransfer: DataTransfer
}
export interface PointerEvent<T = Element> extends MouseEvent<T, NativePointerEvent> {
pointerId: number
pressure: number
tangentialPressure: number
tiltX: number
tiltY: number
twist: number
width: number
height: number
pointerType: 'mouse' | 'pen' | 'touch'
isPrimary: boolean
}
export interface FocusEvent<Target = Element, RelatedTarget = Element>
extends SyntheticEvent<Target, NativeFocusEvent> {
relatedTarget: (EventTarget & RelatedTarget) | null
target: EventTarget & Target
}
export type FormEvent<T = Element> = SyntheticEvent<T>
export interface ChangeEvent<T = Element> extends SyntheticEvent<T> {
target: EventTarget & T
}
export interface KeyboardEvent<T = Element> extends UIEvent<T, NativeKeyboardEvent> {
altKey: boolean
/** @deprecated */
charCode: number
ctrlKey: boolean
code: string
/**
* 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.
*/
getModifierState(key: string): boolean
/**
* See the [DOM Level 3 Events spec](https://www.w3.org/TR/uievents-key/#named-key-attribute-values). for possible values
*/
key: string
/** @deprecated */
keyCode: number
location: number
metaKey: boolean
repeat: boolean
shiftKey: boolean
/** @deprecated */
which: number
}
export interface MouseEvent<T = Element, E = NativeMouseEvent> extends UIEvent<T, E> {
altKey: boolean
button: number
buttons: number
clientX: number
clientY: number
ctrlKey: boolean
/**
* 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.
*/
getModifierState(key: string): boolean
metaKey: boolean
movementX: number
movementY: number
pageX: number
pageY: number
relatedTarget: EventTarget | null
screenX: number
screenY: number
shiftKey: boolean
}
export interface UIEvent<T = Element, E = NativeUIEvent> extends SyntheticEvent<T, E> {
detail: number
}
export interface WheelEvent<T = Element> extends MouseEvent<T, NativeWheelEvent> {
deltaMode: number
deltaX: number
deltaY: number
deltaZ: number
}
//
// Event Handler Types
// ----------------------------------------------------------------------
type EventHandler<E extends SyntheticEvent<any>> =
| object
| {
bivarianceHack(event: { event: E } & NullstackClientContext): void
}['bivarianceHack']
type NullstackEventHandler<T = Element> = EventHandler<SyntheticEvent<T>>
type DragEventHandler<T = Element> = EventHandler<DragEvent<T>>
type FocusEventHandler<T = Element> = EventHandler<FocusEvent<T>>
type FormEventHandler<T = Element> = EventHandler<FormEvent<T>>
type ChangeEventHandler<T = Element> = EventHandler<ChangeEvent<T>>
type KeyboardEventHandler<T = Element> = EventHandler<KeyboardEvent<T>>
type MouseEventHandler<T = Element> = EventHandler<MouseEvent<T>>
type PointerEventHandler<T = Element> = EventHandler<PointerEvent<T>>
type UIEventHandler<T = Element> = EventHandler<UIEvent<T>>
type WheelEventHandler<T = Element> = EventHandler<WheelEvent<T>>
//
// Props / DOM Attributes
// ----------------------------------------------------------------------
type DetailedHTMLProps<E extends HTMLAttributes<T>, T> = E
export interface SVGProps<T> extends SVGAttributes<T>, ClassAttributes<T> {}
export interface DOMAttributes<T> extends Attributes<T> {
// Focus Events
onfocus?: FocusEventHandler<T>
onblur?: FocusEventHandler<T>
// Form Events
onchange?: FormEventHandler<T>
oninput?: FormEventHandler<T>
onreset?: FormEventHandler<T>
onsubmit?: FormEventHandler<T>
oninvalid?: FormEventHandler<T>
// Image Events
onload?: NullstackEventHandler<T>
onerror?: NullstackEventHandler<T> // also a Media Event
// Keyboard Events
onkeydown?: KeyboardEventHandler<T>
/** @deprecated */
onkeypress?: KeyboardEventHandler<T>
onkeyup?: KeyboardEventHandler<T>
// Media Events
onabort?: NullstackEventHandler<T>
oncanplay?: NullstackEventHandler<T>
oncanplaythrough?: NullstackEventHandler<T>
ondurationchange?: NullstackEventHandler<T>
onemptied?: NullstackEventHandler<T>
onended?: NullstackEventHandler<T>
onloadeddata?: NullstackEventHandler<T>
onloadedmetadata?: NullstackEventHandler<T>
onloadstart?: NullstackEventHandler<T>
onpause?: NullstackEventHandler<T>
onplay?: NullstackEventHandler<T>
onplaying?: NullstackEventHandler<T>
onprogress?: NullstackEventHandler<T>
onratechange?: NullstackEventHandler<T>
onseeked?: NullstackEventHandler<T>
onseeking?: NullstackEventHandler<T>
onstalled?: NullstackEventHandler<T>
onsuspend?: NullstackEventHandler<T>
ontimeupdate?: NullstackEventHandler<T>
onvolumechange?: NullstackEventHandler<T>
onwaiting?: NullstackEventHandler<T>
// MouseEvents
onclick?: MouseEventHandler<T>
oncontextmenu?: MouseEventHandler<T>
ondblclick?: MouseEventHandler<T>
ondrag?: DragEventHandler<T>
ondragend?: DragEventHandler<T>
ondragenter?: DragEventHandler<T>
ondragleave?: DragEventHandler<T>
ondragover?: DragEventHandler<T>
ondragstart?: DragEventHandler<T>
ondrop?: DragEventHandler<T>
onmousedown?: MouseEventHandler<T>
onmouseenter?: MouseEventHandler<T>
onmouseleave?: MouseEventHandler<T>
onmousemove?: MouseEventHandler<T>
onmouseout?: MouseEventHandler<T>
onmouseover?: MouseEventHandler<T>
onmouseup?: MouseEventHandler<T>
// Wheel Events
/** @deprecated */
onmousewheel?: WheelEventHandler<T>
// Selection Events
onselect?: NullstackEventHandler<T>
// Pointer Events
onpointerdown?: PointerEventHandler<T>
onpointermove?: PointerEventHandler<T>
onpointerup?: PointerEventHandler<T>
onpointercancel?: PointerEventHandler<T>
onpointerenter?: PointerEventHandler<T>
onpointerleave?: PointerEventHandler<T>
onpointerover?: PointerEventHandler<T>
onpointerout?: PointerEventHandler<T>
// UI Events
onscroll?: UIEventHandler<T>
}
// All the WAI-ARIA 1.1 attributes from https://www.w3.org/TR/wai-aria-1.1/
export interface AriaAttributes {
/** Identifies the currently active element when DOM focus is on a composite widget, textbox, group, or application */
'aria-activedescendant'?: string
/** 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. */
'aria-atomic'?: Booleanish
/**
* 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
* presented if they are made.
*/
'aria-autocomplete'?: 'none' | 'inline' | 'list' | 'both'
/** 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. */
'aria-busy'?: Booleanish
/**
* Indicates the current "checked" state of checkboxes, radio buttons, and other widgets.
* @see aria-pressed @see aria-selected.
*/
'aria-checked'?: boolean | 'false' | 'mixed' | 'true'
/**
* Defines the total number of columns in a table, grid, or treegrid.
* @see aria-colindex.
*/
'aria-colcount'?: number
/**
* Defines an element's column index or position with respect to the total number of columns within a table, grid, or treegrid.
* @see aria-colcount @see aria-colspa
*/
'aria-colindex'?: number
/**
* Defines the number of columns spanned by a cell or gridcell within a table, grid, or treegrid.
* @see aria-colindex @see aria-rowspa
*/
'aria-colspan'?: number
/**
* Identifies the element (or elements) whose contents or presence are controlled by the current element.
* @see aria-owns.
*/
'aria-controls'?: string
/** Indicates the element that represents the current item within a container or set of related elements. */
'aria-current'?: boolean | 'false' | 'true' | 'page' | 'step' | 'location' | 'date' | 'time'
/**
* Identifies the element (or elements) that describes the object.
* @see aria-labelledby
*/
'aria-describedby'?: string
/**
* Identifies the element that provides a detailed, extended description for the object.
* @see aria-describedby.
*/
'aria-details'?: string
/**
* Indicates that the element is perceivable but disabled, so it is not editable or otherwise operable.
* @see aria-hidden @see aria-readonly.
*/
'aria-disabled'?: Booleanish
/**
* Indicates what functions can be performed when a dragged object is released on the drop target.
* @deprecated in ARIA 1.1
*/
'aria-dropeffect'?: 'none' | 'copy' | 'execute' | 'link' | 'move' | 'popup'
/**
* Identifies the element that provides an error message for the object.
* @see aria-invalid @see aria-describedby.
*/
'aria-errormessage'?: string
/** Indicates whether the element, or another grouping element it controls, is currently expanded or collapsed. */
'aria-expanded'?: Booleanish
/**
* Identifies the next element (or elements) in an alternate reading order of content which, at the user's discretion,
* allows assistive technology to override the general default of reading in document source order.
*/
'aria-flowto'?: string
/**
* Indicates an element's "grabbed" state in a drag-and-drop operatio
* @deprecated in ARIA 1.1
*/
'aria-grabbed'?: Booleanish
/** Indicates the availability and type of interactive popup element, such as menu or dialog, that can be triggered by an element. */
'aria-haspopup'?: boolean | 'false' | 'true' | 'menu' | 'listbox' | 'tree' | 'grid' | 'dialog'
/**
* Indicates whether the element is exposed to an accessibility API.
* @see aria-disabled.
*/
'aria-hidden'?: Booleanish
/**
* Indicates the entered value does not conform to the format expected by the applicatio
* @see aria-errormessage.
*/
'aria-invalid'?: boolean | 'false' | 'true' | 'grammar' | 'spelling'
/** Indicates keyboard shortcuts that an author has implemented to activate or give focus to an element. */
'aria-keyshortcuts'?: string
/**
* Defines a string value that labels the current element.
* @see aria-labelledby.
*/
'aria-label'?: string
/**
* Identifies the element (or elements) that labels the current element.
* @see aria-describedby.
*/
'aria-labelledby'?: string
/** Defines the hierarchical level of an element within a structure. */
'aria-level'?: number
/** 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 regio */
'aria-live'?: 'off' | 'assertive' | 'polite'
/** Indicates whether an element is modal when displayed. */
'aria-modal'?: Booleanish
/** Indicates whether a text box accepts multiple lines of input or only a single line. */
'aria-multiline'?: Booleanish
/** Indicates that the user may select more than one item from the current selectable descendants. */
'aria-multiselectable'?: Booleanish
/** Indicates whether the element's orientation is horizontal, vertical, or unknown/ambiguous. */
'aria-orientation'?: 'horizontal' | 'vertical'
/**
* Identifies an element (or elements) in order to define a visual, functional, or contextual parent/child relationship
* between DOM elements where the DOM hierarchy cannot be used to represent the relationship.
* @see aria-controls.
*/
'aria-owns'?: string
/**
* Defines a short hint (a word or short phrase) intended to aid the user with data entry when the control has no value.
* A hint could be a sample value or a brief description of the expected format.
*/
'aria-placeholder'?: string
/**
* 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.
* @see aria-setsize.
*/
'aria-posinset'?: number
/**
* Indicates the current "pressed" state of toggle buttons.
* @see aria-checked @see aria-selected.
*/
'aria-pressed'?: boolean | 'false' | 'mixed' | 'true'
/**
* Indicates that the element is not editable, but is otherwise operable.
* @see aria-disabled.
*/
'aria-readonly'?: Booleanish
/**
* Indicates what notifications the user agent will trigger when the accessibility tree within a live region is modified.
* @see aria-atomic.
*/
'aria-relevant'?:
| 'additions'
| 'additions removals'
| 'additions text'
| 'all'
| 'removals'
| 'removals additions'
| 'removals text'
| 'text'
| 'text additions'
| 'text removals'
| undefined
/** Indicates that user input is required on the element before a form may be submitted. */
'aria-required'?: Booleanish
/** Defines a human-readable, author-localized description for the role of an element. */
'aria-roledescription'?: string
/**
* Defines the total number of rows in a table, grid, or treegrid.
* @see aria-rowindex.
*/
'aria-rowcount'?: number
/**
* Defines an element's row index or position with respect to the total number of rows within a table, grid, or treegrid.
* @see aria-rowcount @see aria-rowspa
*/
'aria-rowindex'?: number
/**
* Defines the number of rows spanned by a cell or gridcell within a table, grid, or treegrid.
* @see aria-rowindex @see aria-colspa
*/
'aria-rowspan'?: number
/**
* Indicates the current "selected" state of various widgets.
* @see aria-checked @see aria-pressed.
*/
'aria-selected'?: Booleanish
/**
* 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.
* @see aria-posinset.
*/
'aria-setsize'?: number
/** Indicates if items in a table or grid are sorted in ascending or descending order. */
'aria-sort'?: 'none' | 'ascending' | 'descending' | 'other'
/** Defines the maximum allowed value for a range widget. */
'aria-valuemax'?: number
/** Defines the minimum allowed value for a range widget. */
'aria-valuemin'?: number
/**
* Defines the current value for a range widget.
* @see aria-valuetext.
*/
'aria-valuenow'?: number
/** Defines the human readable text alternative of aria-valuenow for a range widget. */
'aria-valuetext'?: string
}
// All the WAI-ARIA 1.1 role attribute values from https://www.w3.org/TR/wai-aria-1.1/#role_definitions
type AriaRole =
| 'alert'
| 'alertdialog'
| 'application'
| 'article'
| 'banner'
| 'button'
| 'cell'
| 'checkbox'
| 'columnheader'
| 'combobox'
| 'complementary'
| 'contentinfo'
| 'definition'
| 'dialog'
| 'directory'
| 'document'
| 'feed'
| 'figure'
| 'form'
| 'grid'
| 'gridcell'
| 'group'
| 'heading'
| 'img'
| 'link'
| 'list'
| 'listbox'
| 'listitem'
| 'log'
| 'main'
| 'marquee'
| 'math'
| 'menu'
| 'menubar'
| 'menuitem'
| 'menuitemcheckbox'
| 'menuitemradio'
| 'navigation'
| 'none'
| 'note'
| 'option'
| 'presentation'
| 'progressbar'
| 'radio'
| 'radiogroup'
| 'region'
| 'row'
| 'rowgroup'
| 'rowheader'
| 'scrollbar'
| 'search'
| 'searchbox'
| 'separator'
| 'slider'
| 'spinbutton'
| 'status'
| 'switch'
| 'tab'
| 'table'
| 'tablist'
| 'tabpanel'
| 'term'
| 'textbox'
| 'timer'
| 'toolbar'
| 'tooltip'
| 'tree'
| 'treegrid'
| 'treeitem'
| (string & {})
type Falsy = false | 0 | '' | null | undefined
type CssClass = string | Falsy | Array<string | Falsy>
type CssStyle = string | Falsy | Array<string | Falsy>
export interface HTMLAttributes<T> extends AriaAttributes, DOMAttributes<T> {
// Standard HTML Attributes
accesskey?: string
class?: CssClass
contenteditable?: Booleanish | 'inherit'
contextmenu?: string
dir?: string
draggable?: Booleanish
hidden?: boolean
id?: string
lang?: string
placeholder?: string
slot?: string
spellcheck?: Booleanish
style?: CssStyle
tabindex?: number | string
title?: string
translate?: 'yes' | 'no'
// WAI-ARIA
role?: AriaRole
// Non-standard Attributes
autocapitalize?: string
itemprop?: string
itemscope?: boolean
itemtype?: string
itemid?: string
itemref?: string
// Living Standard
/**
* Hints at the type of data that might be entered by the user while editing the element or its contents
* @see https://html.spec.whatwg.org/multipage/interactiohtml#input-modalities:-the-inputmode-attribute
*/
inputmode?: 'none' | 'text' | 'tel' | 'url' | 'email' | 'numeric' | 'decimal' | 'search'
/**
* Specify that a standard HTML element should behave like a defined custom built-in element
* @see https://html.spec.whatwg.org/multipage/custom-elements.html#attr-is
*/
is?: string
}
export interface AllHTMLAttributes<T> extends HTMLAttributes<T> {
// Standard HTML Attributes
accept?: string
'accept-charset'?: string
action?: string
allowfullScreen?: boolean
allowTransparency?: boolean
alt?: string
as?: string
async?: boolean
autocomplete?: string
autofocus?: boolean
autoplay?: boolean
capture?: boolean | 'user' | 'environment'
charset?: string
checked?: boolean
cite?: string
classid?: string
cols?: number
colspan?: number
content?: string
controls?: boolean
coords?: string
crossorigin?: 'anonymous' | 'use-credentials' | ''
datetime?: string
default?: boolean
defer?: boolean
disabled?: boolean
download?: any
enctype?: string
form?: string
formaction?: string
formenctype?: string
formmethod?: string
formnovalidate?: boolean
formtarget?: string
headers?: string
height?: number | string
high?: number
href?: string
hreflang?: string
'http-equiv'?: string
integrity?: string
kind?: string
label?: string
list?: string
loop?: boolean
low?: number
manifest?: string
max?: number | string
maxlength?: number
media?: string
mediagroup?: string
method?: string
min?: number | string
minlength?: number
multiple?: boolean
muted?: boolean
name?: string
nonce?: string
novalidate?: boolean
open?: boolean
optimum?: number
pattern?: string
placeholder?: string
playsinline?: boolean
poster?: string
preload?: string
readonly?: boolean
rel?: string
required?: boolean
reversed?: boolean
rows?: number
rowspan?: number
sandbox?: string
scope?: string
scoped?: boolean
seamless?: boolean
selected?: boolean
shape?: string
size?: number
sizes?: string
span?: number
src?: string
srcdoc?: string
srclang?: string
srcset?: string
start?: number
step?: number | string
summary?: string
target?: string
type?: string
usemap?: string
value?: string | ReadonlyArray<string> | number
width?: number | string
wrap?: string
}
type HTMLAttributeReferrerPolicy =
| ''
| 'no-referrer'
| 'no-referrer-when-downgrade'
| 'origin'
| 'origin-when-cross-origin'
| 'same-origin'
| 'strict-origin'
| 'strict-origin-when-cross-origin'
| 'unsafe-url'
type HTMLAttributeAnchorTarget = '_self' | '_blank' | '_parent' | '_top' | (string & {})
export interface AnchorHTMLAttributes<T> extends HTMLAttributes<T> {
download?: any
href?: string
hreflang?: string
media?: string
ping?: string
rel?: string
target?: HTMLAttributeAnchorTarget
type?: string
referrerpolicy?: HTMLAttributeReferrerPolicy
// Nullstack Router
params?: object
path?: string
}
export type AudioHTMLAttributes<T> = MediaHTMLAttributes<T>
export interface AreaHTMLAttributes<T> extends HTMLAttributes<T> {
alt?: string
coords?: string
download?: any
href?: string
hreflang?: string
media?: string
referrerpolicy?: HTMLAttributeReferrerPolicy
rel?: string
shape?: string
target?: string
}
export interface BaseHTMLAttributes<T> extends HTMLAttributes<T> {
href?: string
target?: string
}
export interface BlockquoteHTMLAttributes<T> extends HTMLAttributes<T> {
cite?: string
}
export interface ButtonHTMLAttributes<T> extends HTMLAttributes<T> {
autofocus?: boolean
disabled?: boolean
form?: string
formaction?: string
formenctype?: string
formmethod?: string
formnovalidate?: boolean
formtarget?: string
name?: string
type?: 'submit' | 'reset' | 'button'
value?: string | ReadonlyArray<string> | number
}
export interface CanvasHTMLAttributes<T> extends HTMLAttributes<T> {
height?: number | string
width?: number | string
}
export interface ColHTMLAttributes<T> extends HTMLAttributes<T> {
span?: number
/** @deprecated */
width?: number | string
}
export interface ColgroupHTMLAttributes<T> extends HTMLAttributes<T> {
span?: number
}
export interface DataHTMLAttributes<T> extends HTMLAttributes<T> {
value?: string | ReadonlyArray<string> | number
}
export interface DetailsHTMLAttributes<T> extends HTMLAttributes<T> {
open?: boolean
}
export interface DelHTMLAttributes<T> extends HTMLAttributes<T> {
cite?: string
datetime?: string
}
export interface DialogHTMLAttributes<T> extends HTMLAttributes<T> {
open?: boolean
}
export interface EmbedHTMLAttributes<T> extends HTMLAttributes<T> {
height?: number | string
src?: string
type?: string
width?: number | string
}
export interface FieldsetHTMLAttributes<T> extends HTMLAttributes<T> {
disabled?: boolean
form?: string
name?: string
}
export interface FormHTMLAttributes<T> extends HTMLAttributes<T> {
'accept-charset'?: string
action?: string
autocomplete?: string
enctype?: string
method?: string
name?: string
novalidate?: boolean
target?: string
}
export interface HtmlHTMLAttributes<T> extends HTMLAttributes<T> {
manifest?: string
}
export interface IframeHTMLAttributes<T> extends HTMLAttributes<T> {
allow?: string
allowfullScreen?: boolean
allowTransparency?: boolean
/** @deprecated */
frameBorder?: number | string
height?: number | string
loading?: 'eager' | 'lazy'
/** @deprecated */
marginHeight?: number
/** @deprecated */
marginWidth?: number
name?: string
referrerpolicy?: HTMLAttributeReferrerPolicy
sandbox?: string
/** @deprecated */
scrolling?: string
seamless?: boolean
src?: string
srcdoc?: string
width?: number | string
}
export interface ImgHTMLAttributes<T> extends HTMLAttributes<T> {
alt?: string
crossorigin?: 'anonymous' | 'use-credentials' | ''
decoding?: 'async' | 'auto' | 'sync'
height?: number | string
loading?: 'eager' | 'lazy'
referrerpolicy?: HTMLAttributeReferrerPolicy
sizes?: string
src?: string
srcset?: string
usemap?: string
width?: number | string
}
export interface InsHTMLAttributes<T> extends HTMLAttributes<T> {
cite?: string
datetime?: string
}
type HTMLInputTypeAttribute =
| 'button'
| 'checkbox'
| 'color'
| 'date'
| 'datetime'
| 'datetime-local'
| 'email'
| 'file'
| 'hidden'
| 'image'
| 'month'
| 'number'
| 'password'
| 'radio'
| 'range'
| 'reset'
| 'search'
| 'submit'
| 'tel'
| 'text'
| 'time'
| 'url'
| 'week'
| (string & {})
export interface InputHTMLAttributes<T> extends HTMLAttributes<T> {
accept?: string
alt?: string
autocomplete?: string
autofocus?: boolean
/** @see https://www.w3.org/TR/html-media-capture/#the-capture-attribute */
capture?: boolean | 'user' | 'environment'
checked?: boolean
disabled?: boolean
enterkeyhint?: 'enter' | 'done' | 'go' | 'next' | 'previous' | 'search' | 'send'
form?: string
formaction?: string
formenctype?: string
formmethod?: string
formnovalidate?: boolean
formtarget?: string
height?: number | string
list?: string
max?: number | string
maxlength?: number
min?: number | string
minlength?: number
multiple?: boolean
name?: string
pattern?: string
placeholder?: string
readonly?: boolean
required?: boolean
size?: number
src?: string
step?: number | string
type?: HTMLInputTypeAttribute
value?: string | ReadonlyArray<string> | number
width?: number | string
onchange?: ChangeEventHandler<T>
}
export interface KeygenHTMLAttributes<T> extends HTMLAttributes<T> {
autofocus?: boolean
challenge?: string
disabled?: boolean
form?: string
keytype?: string
keyparams?: string
name?: string
}
export interface LabelHTMLAttributes<T> extends HTMLAttributes<T> {
form?: string
}
export interface LiHTMLAttributes<T> extends HTMLAttributes<T> {
value?: string | ReadonlyArray<string> | number
}
export interface LinkHTMLAttributes<T> extends HTMLAttributes<T> {
as?: string
crossorigin?: true | 'anonymous' | 'use-credentials' | ''
href?: string
hreflang?: string
integrity?: string
media?: string
referrerpolicy?: HTMLAttributeReferrerPolicy
rel?: string
sizes?: string
type?: string
charset?: string
}
export interface MapHTMLAttributes<T> extends HTMLAttributes<T> {
name?: string
}
export interface MenuHTMLAttributes<T> extends HTMLAttributes<T> {
type?: string
}
export interface MediaHTMLAttributes<T> extends HTMLAttributes<T> {
autoplay?: boolean
controls?: boolean