UNPKG

5.69 kBTypeScriptView Raw
1/** All valid namespaces in HTML. */
2export declare enum NS {
3 HTML = "http://www.w3.org/1999/xhtml",
4 MATHML = "http://www.w3.org/1998/Math/MathML",
5 SVG = "http://www.w3.org/2000/svg",
6 XLINK = "http://www.w3.org/1999/xlink",
7 XML = "http://www.w3.org/XML/1998/namespace",
8 XMLNS = "http://www.w3.org/2000/xmlns/"
9}
10export declare enum ATTRS {
11 TYPE = "type",
12 ACTION = "action",
13 ENCODING = "encoding",
14 PROMPT = "prompt",
15 NAME = "name",
16 COLOR = "color",
17 FACE = "face",
18 SIZE = "size"
19}
20/**
21 * The mode of the document.
22 *
23 * @see {@link https://dom.spec.whatwg.org/#concept-document-limited-quirks}
24 */
25export declare enum DOCUMENT_MODE {
26 NO_QUIRKS = "no-quirks",
27 QUIRKS = "quirks",
28 LIMITED_QUIRKS = "limited-quirks"
29}
30export declare enum TAG_NAMES {
31 A = "a",
32 ADDRESS = "address",
33 ANNOTATION_XML = "annotation-xml",
34 APPLET = "applet",
35 AREA = "area",
36 ARTICLE = "article",
37 ASIDE = "aside",
38 B = "b",
39 BASE = "base",
40 BASEFONT = "basefont",
41 BGSOUND = "bgsound",
42 BIG = "big",
43 BLOCKQUOTE = "blockquote",
44 BODY = "body",
45 BR = "br",
46 BUTTON = "button",
47 CAPTION = "caption",
48 CENTER = "center",
49 CODE = "code",
50 COL = "col",
51 COLGROUP = "colgroup",
52 DD = "dd",
53 DESC = "desc",
54 DETAILS = "details",
55 DIALOG = "dialog",
56 DIR = "dir",
57 DIV = "div",
58 DL = "dl",
59 DT = "dt",
60 EM = "em",
61 EMBED = "embed",
62 FIELDSET = "fieldset",
63 FIGCAPTION = "figcaption",
64 FIGURE = "figure",
65 FONT = "font",
66 FOOTER = "footer",
67 FOREIGN_OBJECT = "foreignObject",
68 FORM = "form",
69 FRAME = "frame",
70 FRAMESET = "frameset",
71 H1 = "h1",
72 H2 = "h2",
73 H3 = "h3",
74 H4 = "h4",
75 H5 = "h5",
76 H6 = "h6",
77 HEAD = "head",
78 HEADER = "header",
79 HGROUP = "hgroup",
80 HR = "hr",
81 HTML = "html",
82 I = "i",
83 IMG = "img",
84 IMAGE = "image",
85 INPUT = "input",
86 IFRAME = "iframe",
87 KEYGEN = "keygen",
88 LABEL = "label",
89 LI = "li",
90 LINK = "link",
91 LISTING = "listing",
92 MAIN = "main",
93 MALIGNMARK = "malignmark",
94 MARQUEE = "marquee",
95 MATH = "math",
96 MENU = "menu",
97 META = "meta",
98 MGLYPH = "mglyph",
99 MI = "mi",
100 MO = "mo",
101 MN = "mn",
102 MS = "ms",
103 MTEXT = "mtext",
104 NAV = "nav",
105 NOBR = "nobr",
106 NOFRAMES = "noframes",
107 NOEMBED = "noembed",
108 NOSCRIPT = "noscript",
109 OBJECT = "object",
110 OL = "ol",
111 OPTGROUP = "optgroup",
112 OPTION = "option",
113 P = "p",
114 PARAM = "param",
115 PLAINTEXT = "plaintext",
116 PRE = "pre",
117 RB = "rb",
118 RP = "rp",
119 RT = "rt",
120 RTC = "rtc",
121 RUBY = "ruby",
122 S = "s",
123 SCRIPT = "script",
124 SECTION = "section",
125 SELECT = "select",
126 SOURCE = "source",
127 SMALL = "small",
128 SPAN = "span",
129 STRIKE = "strike",
130 STRONG = "strong",
131 STYLE = "style",
132 SUB = "sub",
133 SUMMARY = "summary",
134 SUP = "sup",
135 TABLE = "table",
136 TBODY = "tbody",
137 TEMPLATE = "template",
138 TEXTAREA = "textarea",
139 TFOOT = "tfoot",
140 TD = "td",
141 TH = "th",
142 THEAD = "thead",
143 TITLE = "title",
144 TR = "tr",
145 TRACK = "track",
146 TT = "tt",
147 U = "u",
148 UL = "ul",
149 SVG = "svg",
150 VAR = "var",
151 WBR = "wbr",
152 XMP = "xmp"
153}
154/**
155 * Tag IDs are numeric IDs for known tag names.
156 *
157 * We use tag IDs to improve the performance of tag name comparisons.
158 */
159export declare enum TAG_ID {
160 UNKNOWN = 0,
161 A = 1,
162 ADDRESS = 2,
163 ANNOTATION_XML = 3,
164 APPLET = 4,
165 AREA = 5,
166 ARTICLE = 6,
167 ASIDE = 7,
168 B = 8,
169 BASE = 9,
170 BASEFONT = 10,
171 BGSOUND = 11,
172 BIG = 12,
173 BLOCKQUOTE = 13,
174 BODY = 14,
175 BR = 15,
176 BUTTON = 16,
177 CAPTION = 17,
178 CENTER = 18,
179 CODE = 19,
180 COL = 20,
181 COLGROUP = 21,
182 DD = 22,
183 DESC = 23,
184 DETAILS = 24,
185 DIALOG = 25,
186 DIR = 26,
187 DIV = 27,
188 DL = 28,
189 DT = 29,
190 EM = 30,
191 EMBED = 31,
192 FIELDSET = 32,
193 FIGCAPTION = 33,
194 FIGURE = 34,
195 FONT = 35,
196 FOOTER = 36,
197 FOREIGN_OBJECT = 37,
198 FORM = 38,
199 FRAME = 39,
200 FRAMESET = 40,
201 H1 = 41,
202 H2 = 42,
203 H3 = 43,
204 H4 = 44,
205 H5 = 45,
206 H6 = 46,
207 HEAD = 47,
208 HEADER = 48,
209 HGROUP = 49,
210 HR = 50,
211 HTML = 51,
212 I = 52,
213 IMG = 53,
214 IMAGE = 54,
215 INPUT = 55,
216 IFRAME = 56,
217 KEYGEN = 57,
218 LABEL = 58,
219 LI = 59,
220 LINK = 60,
221 LISTING = 61,
222 MAIN = 62,
223 MALIGNMARK = 63,
224 MARQUEE = 64,
225 MATH = 65,
226 MENU = 66,
227 META = 67,
228 MGLYPH = 68,
229 MI = 69,
230 MO = 70,
231 MN = 71,
232 MS = 72,
233 MTEXT = 73,
234 NAV = 74,
235 NOBR = 75,
236 NOFRAMES = 76,
237 NOEMBED = 77,
238 NOSCRIPT = 78,
239 OBJECT = 79,
240 OL = 80,
241 OPTGROUP = 81,
242 OPTION = 82,
243 P = 83,
244 PARAM = 84,
245 PLAINTEXT = 85,
246 PRE = 86,
247 RB = 87,
248 RP = 88,
249 RT = 89,
250 RTC = 90,
251 RUBY = 91,
252 S = 92,
253 SCRIPT = 93,
254 SECTION = 94,
255 SELECT = 95,
256 SOURCE = 96,
257 SMALL = 97,
258 SPAN = 98,
259 STRIKE = 99,
260 STRONG = 100,
261 STYLE = 101,
262 SUB = 102,
263 SUMMARY = 103,
264 SUP = 104,
265 TABLE = 105,
266 TBODY = 106,
267 TEMPLATE = 107,
268 TEXTAREA = 108,
269 TFOOT = 109,
270 TD = 110,
271 TH = 111,
272 THEAD = 112,
273 TITLE = 113,
274 TR = 114,
275 TRACK = 115,
276 TT = 116,
277 U = 117,
278 UL = 118,
279 SVG = 119,
280 VAR = 120,
281 WBR = 121,
282 XMP = 122
283}
284export declare function getTagID(tagName: string): TAG_ID;
285export declare const SPECIAL_ELEMENTS: Record<NS, Set<TAG_ID>>;
286export declare function isNumberedHeader(tn: TAG_ID): boolean;
287export declare function hasUnescapedText(tn: string, scriptingEnabled: boolean): boolean;
288//# sourceMappingURL=html.d.ts.map
\No newline at end of file