@ansi-tools/parser 1.0.12 → 1.0.13

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (48) hide show
  1. package/dist/constants.d.ts +56 -0
  2. package/dist/constants.d.ts.map +1 -0
  3. package/dist/constants.js +55 -0
  4. package/dist/escaped.d.ts +6 -10
  5. package/dist/escaped.d.ts.map +1 -0
  6. package/dist/escaped.js +4 -275
  7. package/dist/index.d.ts +5 -7
  8. package/dist/index.d.ts.map +1 -0
  9. package/dist/index.js +3 -3
  10. package/dist/parse.d.ts +4 -0
  11. package/dist/parse.d.ts.map +1 -0
  12. package/dist/parse.escaped.d.ts +3 -0
  13. package/dist/parse.escaped.d.ts.map +1 -0
  14. package/dist/parse.escaped.js +5 -0
  15. package/dist/parse.js +109 -0
  16. package/dist/parsers/apc.d.ts +3 -0
  17. package/dist/parsers/apc.d.ts.map +1 -0
  18. package/dist/parsers/apc.js +6 -0
  19. package/dist/parsers/csi.d.ts +3 -0
  20. package/dist/parsers/csi.d.ts.map +1 -0
  21. package/dist/parsers/csi.js +63 -0
  22. package/dist/parsers/dcs.d.ts +3 -0
  23. package/dist/parsers/dcs.d.ts.map +1 -0
  24. package/dist/parsers/dcs.js +26 -0
  25. package/dist/parsers/esc.d.ts +3 -0
  26. package/dist/parsers/esc.d.ts.map +1 -0
  27. package/dist/parsers/esc.js +8 -0
  28. package/dist/parsers/osc.d.ts +3 -0
  29. package/dist/parsers/osc.d.ts.map +1 -0
  30. package/dist/parsers/osc.js +28 -0
  31. package/dist/parsers/pm.d.ts +3 -0
  32. package/dist/parsers/pm.d.ts.map +1 -0
  33. package/dist/parsers/pm.js +6 -0
  34. package/dist/parsers/sos.d.ts +3 -0
  35. package/dist/parsers/sos.d.ts.map +1 -0
  36. package/dist/parsers/sos.js +6 -0
  37. package/dist/tokenize.d.ts +4 -0
  38. package/dist/tokenize.d.ts.map +1 -0
  39. package/dist/tokenize.escaped.d.ts +4 -0
  40. package/dist/tokenize.escaped.d.ts.map +1 -0
  41. package/dist/tokenize.escaped.js +295 -0
  42. package/dist/tokenize.js +314 -0
  43. package/dist/types.d.ts +23 -0
  44. package/dist/types.d.ts.map +1 -0
  45. package/dist/types.js +1 -0
  46. package/package.json +27 -28
  47. package/dist/parse-BCjxFvJh.js +0 -530
  48. package/dist/parse-BzJl6pBN.d.ts +0 -85
@@ -1,530 +0,0 @@
1
- //#region src/constants.ts
2
- const BELL = 7;
3
- const BELL_CODE = String.fromCharCode(BELL);
4
- const CAN = 24;
5
- const CAN_CODE = String.fromCharCode(CAN);
6
- const SUB = 26;
7
- const SUB_CODE = String.fromCharCode(SUB);
8
- const ESC = 27;
9
- const ESC_CODE = String.fromCharCode(ESC);
10
- const BACKSLASH = 92;
11
- const BACKSLASH_CODE = String.fromCharCode(BACKSLASH);
12
- const DCS = 144;
13
- const DCS_CODE = String.fromCharCode(DCS);
14
- const SOS = 152;
15
- const SOS_CODE = String.fromCharCode(SOS);
16
- const CSI = 155;
17
- const CSI_CODE = String.fromCharCode(CSI);
18
- const ST = 156;
19
- const ST_CODE = String.fromCharCode(ST);
20
- const OSC = 157;
21
- const OSC_CODE = String.fromCharCode(OSC);
22
- const PM = 158;
23
- const PM_CODE = String.fromCharCode(PM);
24
- const APC = 159;
25
- const APC_CODE = String.fromCharCode(APC);
26
- const CSI_OPEN = "[".charCodeAt(0);
27
- const CSI_OPEN_CODE = String.fromCharCode(CSI_OPEN);
28
- const OSC_OPEN = "]".charCodeAt(0);
29
- const OSC_OPEN_CODE = String.fromCharCode(OSC_OPEN);
30
- const DEC_OPEN = "?".charCodeAt(0);
31
- const PRIVATE_OPENERS = new Set([
32
- "<",
33
- "=",
34
- ">"
35
- ]);
36
- const DCS_OPEN = "P";
37
- const APC_OPEN = "_";
38
- const SOS_OPEN = "^";
39
- const PM_OPEN = "X";
40
- const STRING_OPENERS = new Set([
41
- DCS_OPEN,
42
- APC_OPEN,
43
- SOS_OPEN,
44
- PM_OPEN
45
- ]);
46
- const INTERRUPTERS = new Set([
47
- CAN,
48
- SUB,
49
- ESC,
50
- CSI,
51
- OSC,
52
- DCS,
53
- APC,
54
- PM,
55
- SOS
56
- ]);
57
- const C0_INTERRUPTERS = new Set([CAN, SUB]);
58
- const PARAM_SEPARATOR = /[;:]/;
59
- const TOKEN_TYPES = {
60
- TEXT: "TEXT",
61
- INTRODUCER: "INTRODUCER",
62
- DATA: "DATA",
63
- FINAL: "FINAL"
64
- };
65
- const CODE_TYPES = {
66
- CSI: "CSI",
67
- DCS: "DCS",
68
- DEC: "DEC",
69
- ESC: "ESC",
70
- OSC: "OSC",
71
- PRIVATE: "PRIVATE",
72
- SGR: "SGR",
73
- STRING: "STRING",
74
- TEXT: "TEXT"
75
- };
76
-
77
- //#endregion
78
- //#region src/parsers/apc.ts
79
- function parseAPC(introducer, dataTokens, final) {
80
- const data = dataTokens.map((t) => t.raw).join("");
81
- const raw = introducer.raw + data + (final?.raw || "");
82
- return {
83
- type: CODE_TYPES.STRING,
84
- pos: introducer.pos,
85
- raw,
86
- command: "APC",
87
- params: data ? [data] : []
88
- };
89
- }
90
-
91
- //#endregion
92
- //#region src/parsers/csi.ts
93
- function parseCSI(introducer, dataTokens, final) {
94
- const data = dataTokens.map((t) => t.raw).join("");
95
- const raw = introducer.raw + data + (final?.raw || "");
96
- const params = [];
97
- let type = CODE_TYPES.CSI;
98
- let intermediates = "";
99
- let paramSection = "";
100
- if (data) {
101
- let i = 0;
102
- while (i < data.length) {
103
- const charCode = data.charCodeAt(i);
104
- if (charCode >= 48 && charCode <= 63) {
105
- paramSection += data[i];
106
- i++;
107
- } else break;
108
- }
109
- intermediates = data.slice(i);
110
- }
111
- if (paramSection) for (const part of paramSection.split(PARAM_SEPARATOR)) params.push(part || "0");
112
- const command = intermediates + (final?.raw ?? "");
113
- const start = params[0];
114
- if (start?.startsWith("?")) {
115
- type = CODE_TYPES.DEC;
116
- if (start.length > 1) params[0] = start.slice(1);
117
- else params.shift();
118
- return {
119
- type,
120
- pos: introducer.pos,
121
- raw,
122
- command,
123
- params
124
- };
125
- }
126
- for (const param of params) if (param && param.length > 0 && PRIVATE_OPENERS.has(param[0])) {
127
- type = CODE_TYPES.PRIVATE;
128
- const privateCommand = param[0] + command;
129
- for (let i = 0; i < params.length; i++) if (params[i] && params[i].length > 0 && PRIVATE_OPENERS.has(params[i][0])) {
130
- if (params[i].length > 1) params[i] = params[i].slice(1);
131
- else params.splice(i, 1);
132
- break;
133
- }
134
- return {
135
- type,
136
- pos: introducer.pos,
137
- raw,
138
- command: privateCommand,
139
- params
140
- };
141
- }
142
- if (command === "m" && params.length === 5 && params[1] === "2" && (start === "38" || start === "48")) params.splice(2, 0, "0");
143
- if (command === "r" && params.length === 2 && params[1] === "0") params[1] = "-1";
144
- return {
145
- type,
146
- pos: introducer.pos,
147
- raw,
148
- command,
149
- params
150
- };
151
- }
152
-
153
- //#endregion
154
- //#region src/parsers/dcs.ts
155
- const DCS_PATTERNS = new Map([
156
- ["$q", 2],
157
- ["+q", 2],
158
- ["+p", 2],
159
- ["|", 1],
160
- ["{", 1]
161
- ]);
162
- function parseDCS(introducer, dataTokens, final) {
163
- const data = dataTokens.map((t) => t.raw).join("");
164
- const raw = introducer.raw + data + (final?.raw ?? "");
165
- if (!data) return {
166
- type: CODE_TYPES.DCS,
167
- pos: introducer.pos,
168
- raw,
169
- command: "",
170
- params: []
171
- };
172
- for (const [pattern, length] of DCS_PATTERNS) if (data.startsWith(pattern)) {
173
- const remainder = data.slice(length);
174
- const params = [];
175
- if (remainder) for (const part of remainder.split(PARAM_SEPARATOR)) params.push(part || "-1");
176
- return {
177
- type: CODE_TYPES.DCS,
178
- pos: introducer.pos,
179
- raw,
180
- command: pattern,
181
- params
182
- };
183
- }
184
- return {
185
- type: CODE_TYPES.DCS,
186
- pos: introducer.pos,
187
- raw,
188
- command: "",
189
- params: [data]
190
- };
191
- }
192
-
193
- //#endregion
194
- //#region src/parsers/esc.ts
195
- function parseESC(introducer, dataTokens, final) {
196
- const data = dataTokens.map((t) => t.raw).join("");
197
- const command = introducer.intermediate || (dataTokens[0]?.raw ?? final?.raw ?? "");
198
- const params = introducer.intermediate ? final?.raw ? [final.raw] : [] : [];
199
- const raw = introducer.raw + data + (final?.raw ?? "");
200
- return {
201
- type: CODE_TYPES.ESC,
202
- pos: introducer.pos,
203
- raw,
204
- command,
205
- params
206
- };
207
- }
208
-
209
- //#endregion
210
- //#region src/parsers/osc.ts
211
- function parseOSC(introducer, dataTokens, final) {
212
- const data = dataTokens.map((t) => t.raw).join("");
213
- const raw = introducer.raw + data + (final?.raw || "");
214
- const semicolonIndex = data.indexOf(";");
215
- if (semicolonIndex === -1) return {
216
- type: CODE_TYPES.OSC,
217
- pos: introducer.pos,
218
- raw,
219
- command: data,
220
- params: []
221
- };
222
- const command = data.slice(0, semicolonIndex);
223
- const remainder = data.slice(semicolonIndex + 1);
224
- if (command === "1337") return {
225
- type: CODE_TYPES.OSC,
226
- pos: introducer.pos,
227
- raw,
228
- command,
229
- params: [remainder]
230
- };
231
- const params = [];
232
- if (remainder) {
233
- let current = "";
234
- for (let i = 0; i < remainder.length; i++) if (remainder[i] === ";") {
235
- params.push(current);
236
- current = "";
237
- } else current += remainder[i];
238
- params.push(current);
239
- }
240
- return {
241
- type: CODE_TYPES.OSC,
242
- pos: introducer.pos,
243
- raw,
244
- command,
245
- params
246
- };
247
- }
248
-
249
- //#endregion
250
- //#region src/parsers/pm.ts
251
- function parsePM(introducer, dataTokens, final) {
252
- const data = dataTokens.map((t) => t.raw).join("");
253
- const raw = introducer.raw + data + (final?.raw || "");
254
- return {
255
- type: CODE_TYPES.STRING,
256
- pos: introducer.pos,
257
- raw,
258
- command: "PM",
259
- params: data ? [data] : []
260
- };
261
- }
262
-
263
- //#endregion
264
- //#region src/parsers/sos.ts
265
- function parseSOS(introducer, dataTokens, final) {
266
- const data = dataTokens.map((t) => t.raw).join("");
267
- const raw = introducer.raw + data + (final?.raw || "");
268
- return {
269
- type: CODE_TYPES.STRING,
270
- pos: introducer.pos,
271
- raw,
272
- command: "SOS",
273
- params: data ? [data] : []
274
- };
275
- }
276
-
277
- //#endregion
278
- //#region src/tokenize.ts
279
- function emit$1(token) {
280
- return token;
281
- }
282
- function* tokenizer(input) {
283
- let i = 0;
284
- let state = "GROUND";
285
- let currentCode;
286
- function setState(next, code) {
287
- state = next;
288
- currentCode = code;
289
- }
290
- while (i < input.length) if (state === "GROUND") {
291
- const textStart = i;
292
- let charCode = input.charCodeAt(i);
293
- let char = input[i];
294
- while (i < input.length) {
295
- if (charCode === ESC || charCode === CSI || charCode === OSC || charCode === DCS || charCode === APC || charCode === PM || charCode === SOS) break;
296
- i++;
297
- charCode = input.charCodeAt(i);
298
- char = input[i];
299
- }
300
- if (i > textStart) yield emit$1({
301
- type: TOKEN_TYPES.TEXT,
302
- pos: textStart,
303
- raw: input.substring(textStart, i)
304
- });
305
- if (i < input.length) {
306
- if (charCode === CSI || charCode === OSC || charCode === DCS || charCode === APC || charCode === PM || charCode === SOS) {
307
- yield emit$1({
308
- type: TOKEN_TYPES.INTRODUCER,
309
- pos: i,
310
- raw: char,
311
- code: char
312
- });
313
- i++;
314
- setState("SEQUENCE", charCode);
315
- } else if (charCode === ESC) {
316
- const next = input[i + 1];
317
- const nextCode = input.charCodeAt(i + 1);
318
- if (nextCode === CSI_OPEN) {
319
- yield emit$1({
320
- type: TOKEN_TYPES.INTRODUCER,
321
- pos: i,
322
- raw: char + next,
323
- code: CSI_CODE
324
- });
325
- i += 2;
326
- setState("SEQUENCE", CSI);
327
- } else if (nextCode === OSC_OPEN) {
328
- yield emit$1({
329
- type: TOKEN_TYPES.INTRODUCER,
330
- pos: i,
331
- raw: char + next,
332
- code: OSC_CODE
333
- });
334
- i += 2;
335
- setState("SEQUENCE", OSC);
336
- } else if (STRING_OPENERS.has(next)) {
337
- yield emit$1({
338
- type: TOKEN_TYPES.INTRODUCER,
339
- pos: i,
340
- raw: char + next,
341
- code: next
342
- });
343
- i += 2;
344
- setState("SEQUENCE", nextCode);
345
- } else if (next) {
346
- let j = i + 1;
347
- while (j < input.length && input.charCodeAt(j) >= 32 && input.charCodeAt(j) <= 47) j++;
348
- if (j < input.length) {
349
- const is = input.slice(i + 1, j);
350
- if (is) yield emit$1({
351
- type: TOKEN_TYPES.INTRODUCER,
352
- pos: i,
353
- raw: char + is,
354
- code: ESC_CODE,
355
- intermediate: is
356
- });
357
- else yield emit$1({
358
- type: TOKEN_TYPES.INTRODUCER,
359
- pos: i,
360
- raw: char,
361
- code: ESC_CODE
362
- });
363
- i = j;
364
- setState("SEQUENCE", ESC);
365
- } else i = j;
366
- } else i++;
367
- }
368
- }
369
- } else if (state === "SEQUENCE") {
370
- const pos = i;
371
- let data = "";
372
- if (currentCode === CSI) while (i < input.length) {
373
- const charCode = input.charCodeAt(i);
374
- const char = input[i];
375
- if (INTERRUPTERS.has(charCode)) {
376
- if (data) yield emit$1({
377
- type: TOKEN_TYPES.DATA,
378
- pos,
379
- raw: data
380
- });
381
- setState("GROUND");
382
- if (C0_INTERRUPTERS.has(charCode)) i++;
383
- break;
384
- }
385
- if (charCode >= 64 && charCode <= 126) {
386
- if (data) yield emit$1({
387
- type: TOKEN_TYPES.DATA,
388
- pos,
389
- raw: data
390
- });
391
- yield emit$1({
392
- type: TOKEN_TYPES.FINAL,
393
- pos: i,
394
- raw: char
395
- });
396
- i++;
397
- setState("GROUND");
398
- break;
399
- }
400
- data += char;
401
- i++;
402
- }
403
- else if (currentCode === ESC) {
404
- if (i < input.length) {
405
- const charCode = input.charCodeAt(i);
406
- if (INTERRUPTERS.has(charCode)) {
407
- setState("GROUND");
408
- if (C0_INTERRUPTERS.has(charCode)) i++;
409
- } else {
410
- yield emit$1({
411
- type: TOKEN_TYPES.FINAL,
412
- pos: i,
413
- raw: input[i]
414
- });
415
- i++;
416
- setState("GROUND");
417
- }
418
- }
419
- } else if (currentCode) while (i < input.length) {
420
- const char = input[i];
421
- const charCode = char.charCodeAt(0);
422
- let terminator;
423
- if (charCode === ESC && input.charCodeAt(i + 1) === BACKSLASH) terminator = ESC_CODE + BACKSLASH_CODE;
424
- else if (charCode === ST) terminator = ST_CODE;
425
- else if (charCode === BELL && currentCode === OSC) terminator = BELL_CODE;
426
- if (terminator) {
427
- if (data) yield emit$1({
428
- type: TOKEN_TYPES.DATA,
429
- pos,
430
- raw: data
431
- });
432
- yield emit$1({
433
- type: TOKEN_TYPES.FINAL,
434
- pos: i,
435
- raw: terminator
436
- });
437
- i += terminator.length;
438
- setState("GROUND");
439
- break;
440
- }
441
- if (INTERRUPTERS.has(charCode)) {
442
- if (data) yield emit$1({
443
- type: TOKEN_TYPES.DATA,
444
- pos,
445
- raw: data
446
- });
447
- setState("GROUND");
448
- if (C0_INTERRUPTERS.has(charCode)) i++;
449
- break;
450
- }
451
- data += char;
452
- i++;
453
- }
454
- if (state === "SEQUENCE") setState("GROUND");
455
- }
456
- }
457
- function tokenize(input) {
458
- return Array.from(tokenizer(input));
459
- }
460
-
461
- //#endregion
462
- //#region src/parse.ts
463
- function emit(token) {
464
- return token;
465
- }
466
- function* parser(tokens) {
467
- let current = tokens.next();
468
- while (!current.done) {
469
- const token = current.value;
470
- if (token.type === TOKEN_TYPES.TEXT) {
471
- yield emit({
472
- type: CODE_TYPES.TEXT,
473
- pos: token.pos,
474
- raw: token.raw
475
- });
476
- current = tokens.next();
477
- continue;
478
- }
479
- if (token.type === TOKEN_TYPES.INTRODUCER) {
480
- const introducer = token;
481
- const data = [];
482
- let final;
483
- current = tokens.next();
484
- while (!current.done) {
485
- const nextToken = current.value;
486
- if (nextToken.type === TOKEN_TYPES.DATA) data.push(nextToken);
487
- else if (nextToken.type === TOKEN_TYPES.FINAL) {
488
- final = nextToken;
489
- current = tokens.next();
490
- break;
491
- } else if (nextToken.type === TOKEN_TYPES.INTRODUCER) break;
492
- else if (nextToken.type === TOKEN_TYPES.TEXT) break;
493
- current = tokens.next();
494
- }
495
- switch (introducer.code) {
496
- case CSI_CODE:
497
- yield emit(parseCSI(introducer, data, final));
498
- break;
499
- case OSC_CODE:
500
- yield emit(parseOSC(introducer, data, final));
501
- break;
502
- case DCS_CODE:
503
- case DCS_OPEN:
504
- yield emit(parseDCS(introducer, data, final));
505
- break;
506
- case APC_CODE:
507
- case APC_OPEN:
508
- yield emit(parseAPC(introducer, data, final));
509
- break;
510
- case PM_CODE:
511
- case PM_OPEN:
512
- yield emit(parsePM(introducer, data, final));
513
- break;
514
- case SOS_CODE:
515
- case SOS_OPEN:
516
- yield emit(parseSOS(introducer, data, final));
517
- break;
518
- case ESC_CODE:
519
- yield emit(parseESC(introducer, data, final));
520
- break;
521
- }
522
- } else current = tokens.next();
523
- }
524
- }
525
- function parse(input) {
526
- return Array.from(parser(tokenizer(input)));
527
- }
528
-
529
- //#endregion
530
- export { APC, APC_CODE, APC_OPEN, BACKSLASH, BACKSLASH_CODE, BELL, BELL_CODE, C0_INTERRUPTERS, CAN, CAN_CODE, CODE_TYPES, CSI, CSI_CODE, CSI_OPEN, CSI_OPEN_CODE, DCS, DCS_CODE, DCS_OPEN, DEC_OPEN, ESC, ESC_CODE, INTERRUPTERS, OSC, OSC_CODE, OSC_OPEN, OSC_OPEN_CODE, PARAM_SEPARATOR, PM, PM_CODE, PM_OPEN, PRIVATE_OPENERS, SOS, SOS_CODE, SOS_OPEN, ST, STRING_OPENERS, ST_CODE, SUB, SUB_CODE, TOKEN_TYPES, parse, parser, tokenize, tokenizer };
@@ -1,85 +0,0 @@
1
- //#region src/constants.d.ts
2
- declare const BELL = 7;
3
- declare const BELL_CODE: string;
4
- declare const CAN = 24;
5
- declare const CAN_CODE: string;
6
- declare const SUB = 26;
7
- declare const SUB_CODE: string;
8
- declare const ESC = 27;
9
- declare const ESC_CODE: string;
10
- declare const BACKSLASH = 92;
11
- declare const BACKSLASH_CODE: string;
12
- declare const DCS = 144;
13
- declare const DCS_CODE: string;
14
- declare const SOS = 152;
15
- declare const SOS_CODE: string;
16
- declare const CSI = 155;
17
- declare const CSI_CODE: string;
18
- declare const ST = 156;
19
- declare const ST_CODE: string;
20
- declare const OSC = 157;
21
- declare const OSC_CODE: string;
22
- declare const PM = 158;
23
- declare const PM_CODE: string;
24
- declare const APC = 159;
25
- declare const APC_CODE: string;
26
- declare const CSI_OPEN: number;
27
- declare const CSI_OPEN_CODE: string;
28
- declare const OSC_OPEN: number;
29
- declare const OSC_OPEN_CODE: string;
30
- declare const DEC_OPEN: number;
31
- declare const PRIVATE_OPENERS: Set<string>;
32
- declare const DCS_OPEN = "P";
33
- declare const APC_OPEN = "_";
34
- declare const SOS_OPEN = "^";
35
- declare const PM_OPEN = "X";
36
- declare const STRING_OPENERS: Set<string>;
37
- declare const INTERRUPTERS: Set<number>;
38
- declare const C0_INTERRUPTERS: Set<number>;
39
- declare const PARAM_SEPARATOR: RegExp;
40
- declare const TOKEN_TYPES: {
41
- readonly TEXT: "TEXT";
42
- readonly INTRODUCER: "INTRODUCER";
43
- readonly DATA: "DATA";
44
- readonly FINAL: "FINAL";
45
- };
46
- declare const CODE_TYPES: {
47
- readonly CSI: "CSI";
48
- readonly DCS: "DCS";
49
- readonly DEC: "DEC";
50
- readonly ESC: "ESC";
51
- readonly OSC: "OSC";
52
- readonly PRIVATE: "PRIVATE";
53
- readonly SGR: "SGR";
54
- readonly STRING: "STRING";
55
- readonly TEXT: "TEXT";
56
- };
57
- //#endregion
58
- //#region src/types.d.ts
59
- type TOKEN = {
60
- type: keyof typeof TOKEN_TYPES;
61
- pos: number;
62
- raw: string;
63
- code?: string;
64
- intermediate?: string;
65
- };
66
- type CONTROL_CODE_TYPE = Exclude<keyof typeof CODE_TYPES, TEXT["type"]>;
67
- type CONTROL_CODE = {
68
- type: CONTROL_CODE_TYPE;
69
- command: string;
70
- raw: string;
71
- params: string[];
72
- pos: number;
73
- };
74
- type TEXT = {
75
- type: "TEXT";
76
- raw: string;
77
- pos: number;
78
- };
79
- type CODE = CONTROL_CODE | TEXT;
80
- //#endregion
81
- //#region src/parse.d.ts
82
- declare function parser(tokens: IterableIterator<TOKEN>): IterableIterator<CODE>;
83
- declare function parse(input: string): CODE[];
84
- //#endregion
85
- export { APC, APC_CODE, APC_OPEN, BACKSLASH, BACKSLASH_CODE, BELL, BELL_CODE, C0_INTERRUPTERS, CAN, CAN_CODE, CODE, CODE_TYPES, CONTROL_CODE, CSI, CSI_CODE, CSI_OPEN, CSI_OPEN_CODE, DCS, DCS_CODE, DCS_OPEN, DEC_OPEN, ESC, ESC_CODE, INTERRUPTERS, OSC, OSC_CODE, OSC_OPEN, OSC_OPEN_CODE, PARAM_SEPARATOR, PM, PM_CODE, PM_OPEN, PRIVATE_OPENERS, SOS, SOS_CODE, SOS_OPEN, ST, STRING_OPENERS, ST_CODE, SUB, SUB_CODE, TEXT, TOKEN, TOKEN_TYPES, parse, parser };