-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathhtml.ts
3192 lines (2810 loc) · 101 KB
/
html.ts
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
//deno-lint-ignore-file no-empty-interface
import type * as hast from "./deps.ts";
export type HTMLChild =
| string
| number
| boolean
| hast.Element
| hast.Root
| hast.Text;
export type HTMLChildren = HTMLChild | Iterable<HTMLChild>;
export interface HTMLVoidElement extends HTMLElement {
children?: never;
}
export interface HTMLElement extends HTMLAttributes {
children?: HTMLChildren;
}
export interface HTMLAttributes {
accesskey?: string;
autocapitalize?: "off" | "none" | "on" | "setences" | "words" | "characters";
class?: string;
contenteditable?: "true" | "false" | "plaintext-only";
dir?: "ltr" | "rtl" | "auto";
draggable?: "true" | "false";
enterkeyhint?:
| "enter"
| "done"
| "go"
| "next"
| "previous"
| "search"
| "send";
hidden?: "hidden" | "until-found";
id?: string;
inert?: boolean;
inputmode?:
| "none"
| "text"
| "decimal"
| "numeric"
| "tel"
| "search"
| "email"
| "url";
is?: string;
itemid?: string;
itemprop?: string;
itemref?: string;
itemscope?: string;
itemtype?: string;
lang?: string;
nonce?: string;
spellcheck?: "true" | "false" | "default";
style?: string;
tabindex?: number;
title?: string;
translate?: "yes" | "no";
}
export interface HTMLHTML extends HTMLElement {
/**
* Specifies the XML Namespace of the document. Default value is
* "http://www.w3.org/1999/xhtml". This is required in documents parsed with
* XML parsers, and optional in text/html documents.
*/
xmlns?: string;
}
export interface HTMLArea extends HTMLVoidElement {
/**
* A text string alternative to display on browsers that do not
* display images. The text should be phrased so that it presents
* the user with the same kind of choice as the image would offer
* when displayed without the alternative text. This attribute is
* required only if the href attribute is used.
*/
alt?: string;
/**
* The coords attribute details the coordinates of the shape
* attribute in size, shape, and placement of an <area>. This
* attribute must not be used if shape is set to default.
*/
coords?: string;
/**
* This attribute, if present, indicates that the author intends the
* hyperlink to be used for downloading a resource. See <a> for a
* full description of the download attribute.
*/
download?: string;
/**
* The hyperlink target for the area. Its value is a valid URL. This
* attribute may be omitted; if so, the <area> element does not
* represent a hyperlink.
*/
href?: string;
/**
* Contains a space-separated list of URLs to which, when the
* hyperlink is followed, POST requests with the body PING will be
* sent by the browser (in the background). Typically used for
* tracking.
*/
ping?: string;
/**
* A string indicating which referrer to use when fetching the
* resource:
*/
referrerpolicy?:
| "no-referrer"
| "no-referrer-when-downgrade"
| "origin"
| "origin-when-cross-origin"
| "same-origin"
| "strict-origin"
| "strict-origin-when-cross-origin"
| "unsafe-url";
/**
* For anchors containing the href attribute, this attribute
* specifies the relationship of the target object to the link
* object. The value is a space-separated list of link types. The
* values and their semantics will be registered by some authority
* that might have meaning to the document author. The default
* relationship, if no other is given, is void. Use this attribute
* only if the href attribute is present.
*/
rel?: string;
/**
* The shape of the associated hot spot. The specifications for HTML
* defines the values rect, which defines a rectangular region;
* circle, which defines a circular region; poly, which defines a
* polygon; and default, which indicates the entire region beyond
* any defined shapes.
*/
shape?: "rect" | "circle" | "poly" | "default";
/**
* A keyword or author-defined name of the browsing context to
* display the linked resource.
*/
target?: "_self" | "_blank" | "_parent" | "_top" | string;
}
export interface HTMLBase extends HTMLVoidElement {
/**
* The base URL to be used throughout the document for relative URLs. Absolute
* and relative URLs are allowed.
* @see https://developer.mozilla.org/en-US/docs/Web/HTML/Element/html
*/
href?: string;
/**
* A keyword or author-defined name of the default browsing context
* to show the results of navigation from <a>, <area>, or <form>
* elements without explicit target attributes. The following
* keywords have special meanings
*/
target?: "_self" | "_blank" | "_parent" | "_top" | string;
}
export interface HTMLHead extends HTMLElement {}
export interface HTMLLink extends HTMLVoidElement {
/**
* This attribute is only used when rel="preload" or rel="prefetch"
* has been set on the <link> element. It specifies the type of
* content being loaded by the <link>, which is necessary for
* request matching, application of correct content security policy,
* and setting of correct Accept request header. Furthermore,
* rel="preload" uses this as a signal for request
* prioritization. The table below lists the valid values for this
* attribute and the elements or resources they apply to.
*/
as?:
| "audio"
| "document"
| "embed"
| "fetch"
| "font"
| "image"
| "object"
| "script"
| "style"
| "track"
| "video"
| "worker";
/**
* This enumerated attribute indicates whether CORS must be used when fetching
* the resource. CORS-enabled images can be reused in the <canvas> element
* without being tainted.
*/
crossorigin?: "anonymous" | "use-credentials";
/**
* Provides a hint of the relative priority to use when fetching a preloaded
* resource.
*/
fetchpriority?: "high" | "low" | "auto";
/**
* This attribute specifies the URL of the linked resource. A URL can be
* absolute or relative.
*/
href?: string;
/**
* This attribute indicates the language of the linked resource. It
* is purely advisory. Allowed values are specified by RFC 5646:
* Tags for Identifying Languages (also known as BCP 47). Use this
* attribute only if the href attribute is present.
*/
hreflang?: string;
/**
* For rel="preload" and as="image" only, the imagesizes attribute
* is a sizes attribute that indicates to preload the appropriate
* resource used by an img element with corresponding values for its
* srcset and sizes attributes.
*/
imagesizes?: string;
/**
* For rel="preload" and as="image" only, the imagesrcset attribute
* is a sourceset attribute that indicates to preload the
* appropriate resource used by an img element with corresponding
* values for its srcset and sizes attributes.
*/
imagesrcset?: string;
/**
* Contains inline metadata — a base64-encoded cryptographic hash of
* the resource (file) you're telling the browser to fetch. The
* browser can use this to verify that the fetched resource has been
* delivered free of unexpected manipulation. See Subresource
* Integrity.
*/
integrity?: string;
/**
* This attribute specifies the media that the linked resource
* applies to. Its value must be a media type / media query. This
* attribute is mainly useful when linking to external stylesheets —
* it allows the user agent to pick the best adapted one for the
* device it runs on.
*/
media?: string;
/**
* Identifies a resource that might be required by the next
* navigation and that the user agent should retrieve it. This allows
* the user agent to respond faster when the resource is requested in
* the future.
*/
prefetch?: boolean;
/**
* A string indicating which referrer to use when fetching the resource:
*/
referrerpolicy?:
| "no-referrer"
| "no-referrer-when-downgrade"
| "origin"
| "origin-when-cross-origin"
| "unsafe-url";
/**
* This attribute names a relationship of the linked document to the
* current document. The attribute must be a space-separated list of
* link type values.
*/
rel?: string;
/**
* This attribute defines the sizes of the icons for visual media
* contained in the resource. It must be present only if the rel
* contains a value of icon or a non-standard type such as Apple's
* apple-touch-icon. It may have the following values:
*/
sizes?: string;
/**
* The title attribute has special semantics on the <link>
* element. When used on a <link rel="stylesheet"> it defines a
* default or an alternate stylesheet.
*/
title?: string;
/**
* This attribute is used to define the type of the content linked
* to. The value of the attribute should be a MIME type such as
* text/html, text/css, and so on. The common use of this attribute
* is to define the type of stylesheet being referenced (such as
* text/css), but given that CSS is the only stylesheet language
* used on the web, not only is it possible to omit the type
* attribute, but is actually now recommended practice. It is also
* used on rel="preload" link types, to make sure the browser only
* downloads file types that it supports.
*/
type?: string;
/**
* This attribute explicitly indicates that certain operations
* should be blocked on the fetching of an external resource. The
* operations that are to be blocked must be a space-separated list
* of blocking attributes listed below.
*/
blocking?: string;
}
export interface HTMLMeta extends HTMLVoidElement {
/**
* This attribute declares the document's character encoding. If the
* attribute is present, its value must be an ASCII case-insensitive
* match for the string "utf-8", because UTF-8 is the only valid
* encoding for HTML5 documents. <meta> elements which declare a
* character encoding must be located entirely within the first 1024
* bytes of the document.
*/
charset?: "utf-8" | "UTF-8";
/**
* This attribute contains the value for the http-equiv or name attribute,
* depending on which is used.
*/
content?: string;
/**
* Defines a pragma directive. The attribute is named
* http-equiv(alent) because all the allowed values are names of
* particular HTTP headers:
*/
"http-equiv"?:
| "content-security-policy"
| "content-type"
| "default-style"
| "x-ua-compatible"
| "refresh";
/**
* The name and content attributes can be used together to provide
* document metadata in terms of name-value pairs, with the name
* attribute giving the metadata name, and the content attribute
* giving the value.
*/
name?: string;
/**
* The name and content attributes can be used together to provide
* document metadata in terms of name-value pairs, with the name
* attribute giving the metadata name, and the content attribute
* giving the value.
*/
property?: string;
}
export interface HTMLStyle extends HTMLElement {
/**
* This attribute defines which media the style should be applied
* to. Its value is a media query, which defaults to all if the
* attribute is missing.
*/
media?: string;
/**
* A cryptographic nonce (number used once) used to allow inline
* styles in a style-src Content-Security-Policy. The server must
* generate a unique nonce value each time it transmits a policy. It
* is critical to provide a nonce that cannot be guessed as
* bypassing a resource's policy is otherwise trivial.
*/
nonce?: string;
/**
* This attribute specifies alternative style sheet sets.
*/
title?: string;
/**
* This attribute explicitly indicates that certain operations
* should be blocked on the fetching of critical
* subresources. @import-ed stylesheets are generally considered as
* critical subresources, whereas background-image and fonts are
* not.
*/
blocking?: "render";
}
export interface HTMLTitle extends HTMLElement {}
export interface HTMLBody extends HTMLElement {}
export interface HTMLBlockquote extends HTMLElement {
/**
* A URL that designates a source document or message for the
* information quoted. This attribute is intended to point to
* information explaining the context or the reference for the
* quote.
*/
cite?: string;
}
export interface HTMListItem extends HTMLElement {
/**
* This integer attribute indicates the current ordinal value of the
* list item as defined by the <ol> element. The only allowed value
* for this attribute is a number, even if the list is displayed
* with Roman numerals or letters. List items that follow this one
* continue numbering from the value set. The value attribute has no
* meaning for unordered lists (<ul>) or for menus (<menu>).
*/
value?: number;
}
export interface HTMLOrderedList extends HTMLElement {
/**
* This Boolean attribute specifies that the list's items are in
* reverse order. Items will be numbered from high to low.
*/
reversed?: boolean;
/**
* An integer to start counting from for the list items. Always an
* Arabic numeral (1, 2, 3, etc.), even when the numbering type is
* letters or Roman numerals. For example, to start numbering
* elements from the letter "d" or the Roman numeral "iv," use
* start="4".
*/
start?: number;
/**
* Sets the numbering type:
*
* a for lowercase letters
* A for uppercase letters
* i for lowercase Roman numerals
* I for uppercase Roman numerals
* 1 for numbers (default)
*
* The specified type is used for the entire list unless a different
* type attribute is used on an enclosed <li> element.
*/
type?: "a" | "A" | "i" | "I" | "1";
}
export interface HTMLAnchor extends HTMLElement {
/**
* Causes the browser to treat the linked URL as a download. Can be
* used with or without a filename value:
*/
download?: string;
/**
* The URL that the hyperlink points to. Links are not restricted to
* HTTP-based URLs — they can use any URL scheme supported by
* browsers:
*/
href?: string;
/**
* Hints at the human language of the linked URL. No built-in
* functionality. Allowed values are the same as the global lang
* attribute.
*/
hreflang?: string;
/**
* A space-separated list of URLs. When the link is followed, the
* browser will send POST requests with the body PING to the
* URLs. Typically for tracking.
*/
ping?: string;
/**
* How much of the referrer to send when following the link.
*/
referrerpolicy?:
| "no-referrer"
| "no-referrer-when-downgrade"
| "origin"
| "origin-when-cross-origin"
| "same-origin"
| "strict-origin"
| "strict-origin-when-cross-origin"
| "unsafe-url";
/**
* The relationship of the linked URL as space-separated link types.
*/
rel?: string;
/**
* Where to display the linked URL, as the name for a browsing
* context (a tab, window, or <iframe>). The following keywords have
* special meanings for where to load the URL:
*/
target?: "_self" | "_blank" | "_parent" | "_top" | string;
/**
* Hints at the linked URL's format with a MIME type. No built-in
* functionality.
*/
type?: string;
}
export interface HTMLTime extends HTMLElement {
/**
* This attribute indicates the time and/or date of the element
* @see https://developer.mozilla.org/en-US/docs/Web/HTML/Element/time#valid_datetime_values
*/
datetime?: string;
}
export interface HTMLBDO extends HTMLElement {
/**
* The direction in which text should be rendered in this element's
* contents.
*/
dir: "rtl" | "ltr";
}
export interface HTMLData extends HTMLElement {
/**
* This attribute specifies the machine-readable translation of the
* content of the element.
*/
value: string;
}
export interface HTMLAudio extends HTMLElement {
/**
* A Boolean attribute: if specified, the audio will automatically
* begin playback as soon as it can do so, without waiting for the
* entire audio file to finish downloading.
*/
autoplay?: boolean;
/**
* If this attribute is present, the browser will offer controls to
* allow the user to control audio playback, including volume,
* seeking, and pause/resume playback.
*/
controls?: boolean;
/**
* The controlslist attribute, when specified, helps the browser
* select what controls to show for the audio element whenever the
* browser shows its own set of controls (that is, when the controls
* attribute is specified).
*/
controlslist?: string;
/**
* This enumerated attribute indicates whether to use CORS to fetch
* the related audio file. CORS-enabled resources can be reused in
* the <canvas> element without being tainted.
*/
crossorigin?: "anonymous" | "use-credentials";
/**
* A Boolean attribute used to disable the capability of remote
* playback in devices that are attached using wired (HDMI, DVI,
* etc.) and wireless technologies (Miracast, Chromecast, DLNA,
* AirPlay, etc.). See this proposed specification for more
* information.
*/
disableremotplayback?: boolean;
/**
* A Boolean attribute: if specified, the audio player will
* automatically seek back to the start upon reaching the end of the
* audio.
*/
loop?: boolean;
/**
* A Boolean attribute that indicates whether the audio will be
* initially silenced. Its default value is false.
*/
muted?: boolean;
/**
* This enumerated attribute is intended to provide a hint to the
* browser about what the author thinks will lead to the best user
* experience. It may have one of the following values:
*/
preload?: "none" | "metadata" | "auto";
/**
* The URL of the audio to embed. This is subject to HTTP access
* controls. This is optional; you may instead use the <source>
* element within the audio block to specify the audio to embed.
*/
src?: string;
}
export interface HTMLImage extends HTMLVoidElement {
/**
* Defines an alternative text description of the image.
*/
alt?: string;
/**
* Indicates if the fetching of the image must be done using a CORS
* request. Image data from a CORS-enabled image returned from a
* CORS request can be reused in the <canvas> element without being
* marked "tainted".
*
* If the crossorigin attribute is not specified, then a non-CORS
* request is sent (without the Origin request header), and the
* browser marks the image as tainted and restricts access to its
* image data, preventing its usage in <canvas> elements.
*
* If the crossorigin attribute is specified, then a CORS request is
* sent (with the Origin request header); but if the server does not
* opt into allowing cross-origin access to the image data by the
* origin site (by not sending any Access-Control-Allow-Origin
* response header, or by not including the site's origin in any
* Access-Control-Allow-Origin response header it does send), then the
* browser blocks the image from loading, and logs a CORS error to the
* devtools console.
*/
crossorigin?: "anonymous" | "use-credentials";
/**
* Provides an image decoding hint to the browser. Allowed values:
*/
decoding?: "sync" | "async" | "auto";
/**
* Marks the image for observation by the PerformanceElementTiming
* API. The value given becomes an identifier for the observed image
* element. See also the elementtiming attribute page.
*/
elementiming?: boolean;
/**
* Provides a hint of the relative priority to use when fetching the
* image
*/
fetchpriority?: "high" | "low" | "auto";
/**
* The intrinsic height of the image, in pixels. Must be an integer
* without a unit.
*/
height?: number;
/**
* This Boolean attribute indicates that the image is part of a
* server-side map. If so, the coordinates where the user clicked on
* the image are sent to the server.
*/
ismap?: boolean;
/**
* Indicates how the browser should load the image
*/
loading?: "eager" | "lazy";
/**
* A string indicating which referrer to use when fetching the
* resource:
*/
referrerpolicy?:
| "no-referrer"
| "no-referrer-when-downgrade"
| "origin"
| "origin-when-cross-origin"
| "same-origin"
| "strict-origin"
| "strict-origin-when-cross-origin"
| "unsafe-url";
/**
* One or more strings separated by commas, indicating a set of source sizes.
* Each source size consists of:
*
* 1. A media condition. This must be omitted for the last item in the list.
* 2. A source size value.
*
* Media Conditions describe properties of the viewport, not of the
* image. For example, (max-height: 500px) 1000px proposes to use a
* source of 1000px width, if the viewport is not higher than 500px.
*
* Source size values specify the intended display size of the
* image. User agents use the current source size to select one of the
* sources supplied by the srcset attribute, when those sources are
* described using width (w) descriptors. The selected source size
* affects the intrinsic size of the image (the image's display size
* if no CSS styling is applied). If the srcset attribute is absent,
* or contains no values with a width descriptor, then the sizes
* attribute has no effect.
*/
sizes?: string;
/**
* The image URL. Mandatory for the <img> element. On browsers
* supporting srcset, src is treated like a candidate image with a
* pixel density descriptor 1x, unless an image with this pixel
* density descriptor is already defined in srcset, or unless srcset
* contains w descriptors.
*/
src: string;
/**
* One or more strings separated by commas, indicating possible
* image sources for the user agent to use. Each string is composed
* of:
*
* 1. A URL to an image
* 2. Optionally, whitespace followed by one of:
* - A width descriptor (a positive integer directly followed by
* w). The width descriptor is divided by the source size
* given in the sizes attribute to calculate the effective
* pixel density.
* - A pixel density descriptor (a positive floating point number
* directly followed by x).
* If no descriptor is specified, the source is assigned the default descriptor of 1x.
*
* It is incorrect to mix width descriptors and pixel density
* descriptors in the same srcset attribute. Duplicate descriptors
* (for instance, two sources in the same srcset which are both
* described with 2x) are also invalid.
* If the srcset attribute uses width descriptors, the sizes
* attribute must also be present, or the srcset itself will be
* ignored.
*
* The user agent selects any of the available sources at its
* discretion. This provides them with significant leeway to tailor their
* selection based on things like user preferences or bandwidth
* conditions. See our Responsive images tutorial for an example.
*/
srcset?: string;
/**
* The intrinsic width of the image in pixels. Must be an integer
* without a unit.
*/
width?: number;
/**
* The partial URL (starting with #) of an image map associated with
* the element.
*/
usemap?: boolean;
}
export interface HTMLMap extends HTMLElement {
/**
* The name attribute gives the map a name so that it can be
* referenced. The attribute must be present and must have a
* non-empty value with no space characters. The value of the name
* attribute must not be equal to the value of the name attribute of
* another <map> element in the same document. If the id attribute
* is also specified, both attributes must have the same value.
*/
name: string;
}
export interface HTMLTrack extends HTMLVoidElement {
/**
* This attribute indicates that the track should be enabled unless
* the user's preferences indicate that another track is more
* appropriate. This may only be used on one track element per media
* element.
*/
default?: boolean;
/**
* How the text track is meant to be used. If omitted the default
* kind is subtitles. If the attribute contains an invalid value, it
* will use metadata (Versions of Chrome earlier than 52 treated an
* invalid value as subtitles). The following keywords are allowed:
*/
kind?: "subtitles" | "captions" | "descriptions" | "chapters" | "metadata";
/**
* A user-readable title of the text track which is used by the
* browser when listing available text tracks.
*/
label?: string;
/**
* Address of the track (.vtt file). Must be a valid URL. This
* attribute must be specified and its URL value must have the same
* origin as the document — unless the <audio> or <video> parent
* element of the track element has a crossorigin attribute.
*/
src: string;
/**
* Language of the track text data. It must be a valid BCP 47
* language tag. If the kind attribute is set to subtitles, then
* srclang must be defined
*/
srclang?: string;
}
export interface HTMLVideo extends HTMLElement {
/**
* A Boolean attribute; if specified, the video automatically begins
* to play back as soon as it can do so without stopping to finish
* loading the data.
*/
autoplay?: boolean;
/**
* If this attribute is present, the browser will offer controls to
* allow the user to control video playback, including volume,
* seeking, and pause/resume playback.
*/
controls?: boolean;
/**
* The controlslist attribute, when specified, helps the browser
* select what controls to show for the video element whenever the
* browser shows its own set of controls (that is, when the controls
* attribute is specified).
*/
controlslist?: string;
/**
* This enumerated attribute indicates whether to use CORS to fetch
* the related video. CORS-enabled resources can be reused in the
* <canvas> element without being tainted.
*/
crossorigin?: "anonymous" | "use-credentials";
/**
* Prevents the browser from suggesting a Picture-in-Picture context
* menu or to request Picture-in-Picture automatically in some
* cases.
*/
disablepictureinpicture?: boolean;
/**
* A Boolean attribute used to disable the capability of remote
* playback in devices that are attached using wired (HDMI, DVI,
* etc.) and wireless technologies (Miracast, Chromecast, DLNA,
* AirPlay, etc.).
*/
disableremoteplayback?: boolean;
/**
* The height of the video's display area, in CSS pixels (absolute
* values only; no percentages).
*/
height: number;
/**
* A Boolean attribute; if specified, the browser will automatically
* seek back to the start upon reaching the end of the video.
*/
loop?: boolean;
/**
* A Boolean attribute that indicates the default setting of the
* audio contained in the video. If set, the audio will be initially
* silenced. Its default value is false, meaning that the audio will
* be played when the video is played.
*/
muted?: boolean;
/**
* A Boolean attribute indicating that the video is to be played
* "inline", that is within the element's playback area. Note that
* the absence of this attribute does not imply that the video will
* always be played in fullscreen.
*/
playsinline?: boolean;
/**
* A URL for an image to be shown while the video is downloading. If
* this attribute isn't specified, nothing is displayed until the
* first frame is available, then the first frame is shown as the
* poster frame.
*/
poster?: string;
/**
* This enumerated attribute is intended to provide a hint to the
* browser about what the author thinks will lead to the best user
* experience regarding what content is loaded before the video is
* played.
*/
preload?: "none" | "metadata" | "auto";
/**
* The URL of the video to embed. This is optional; you may instead
* use the <source> element within the video block to specify the
* video to embed.
*/
src?: string;
/**
* The width of the video's display area, in CSS pixels (absolute
* values only; no percentages).
*/
width: number;
}
export interface HTMLEmbed extends HTMLVoidElement {
/**
* The displayed height of the resource, in CSS pixels. This must be
* an absolute value; percentages are not allowed.
*/
height?: number;
/**
* The URL of the resource being embedded.
*/
src: string;
/**
* The MIME type to use to select the plug-in to instantiate.
*/
type: string;
/**
* The displayed width of the resource, in CSS pixels. This must be
* an absolute value; percentages are not allowed.
*/
width?: number;
}
export interface HTMLIFrame extends HTMLVoidElement {
/**
* Specifies a Permissions Policy for the <iframe>. The policy
* defines what features are available to the <iframe> (for example,
* access to the microphone, camera, battery, web-share, etc.) based
* on the origin of the request.
*/
allow?: string;
/**
* Set to true if the <iframe> can activate fullscreen mode by
* calling the requestFullscreen() method.
*/
allowfullscreen?: boolean;
/**
* Set to true if a cross-origin <iframe> should be allowed to
* invoke the Payment Request API.
*/
allowpaymentrequest?: boolean;
/**
* Set to true to make the <iframe> credentialless, meaning that its
* content will be loaded in a new, ephemeral context. It doesn't
* have access to the network, cookies, and storage data associated
* with its origin. It uses a new context local to the top-level
* document lifetime. In return, the Cross-Origin-Embedder-Policy
* (COEP) embedding rules can be lifted, so documents with COEP set
* can embed third-party documents that do not. See IFrame
* credentialless for more details.
*/
credentialless?: boolean;
/**
* A Content Security Policy enforced for the embedded resource. See
* HTMLIFrameElement.csp for details.
*/
csp?: string;
/**
* The height of the frame in CSS pixels. Default is 150.
*/
height?: number;
/**
* Indicates how the browser should load the iframe
*/
loading?: "eager" | "lazy";
/**
* A targetable name for the embedded browsing context. This can be
* used in the target attribute of the <a>, <form>, or <base>
* elements; the formtarget attribute of the <input> or <button>
* elements; or the windowName parameter in the window.open()
* method.
*/
name?: string;
/**
* Indicates which referrer to send when fetching the frame's
* resource
*/
referrerpolicy?: