@rslint/api 0.1.12 → 0.1.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.
package/dist/index.d.ts DELETED
@@ -1,1256 +0,0 @@
1
- import { Node as Node_2 } from '@typescript/ast';
2
- import { NodeArray } from '@typescript/ast';
3
- import { SourceFile } from '@typescript/ast';
4
- import { SyncRpcChannel } from '@typescript/libsyncrpc';
5
- import { SyntaxKind } from '@typescript/ast';
6
-
7
- export declare class API {
8
- private client: Client;
9
- private objectRegistry: ObjectRegistry;
10
- constructor(options: APIOptions) {
11
- this.client = new Client(options);
12
- this.objectRegistry = new ObjectRegistry(this.client);
13
- }
14
-
15
- parseConfigFile(fileName: string): ConfigResponse {
16
- return this.client.request("parseConfigFile", { fileName });
17
- }
18
-
19
- loadProject(configFileName: string): Project {
20
- const data = this.client.request("loadProject", { configFileName });
21
- return this.objectRegistry.getProject(data);
22
- }
23
-
24
- echo(message: string): string {
25
- return this.client.echo(message);
26
- }
27
-
28
- echoBinary(message: Uint8Array): Uint8Array {
29
- return this.client.echoBinary(message);
30
- }
31
-
32
- close(): void {
33
- this.client.close();
34
- }
35
- }
36
-
37
- export declare interface APIOptions {
38
- tsserverPath: string;
39
- cwd?: string;
40
- logFile?: string;
41
- fs?: FileSystem_2;
42
- }
43
-
44
- declare class Client {
45
- private channel: SyncRpcChannel;
46
- private decoder = new TextDecoder();
47
- private encoder = new TextEncoder();
48
-
49
- constructor(options: ClientOptions) {
50
- this.channel = new SyncRpcChannel(options.tsserverPath, [
51
- "--api",
52
- "-cwd",
53
- options.cwd ?? process.cwd(),
54
- ]);
55
-
56
- this.channel.requestSync(
57
- "configure",
58
- JSON.stringify({
59
- logFile: options.logFile,
60
- callbacks: Object.keys(options.fs ?? {}),
61
- }),
62
- );
63
-
64
- if (options.fs) {
65
- // for (const [key, callback] of Object.entries(options.fs)) {
66
- // this.channel.registerCallback(key, (_, arg) => {
67
- // const result = callback(JSON.parse(arg));
68
- // return JSON.stringify(result) ?? "";
69
- // });
70
- // }
71
- }
72
- }
73
-
74
- request(method: string, payload: any): any {
75
- const encodedPayload = JSON.stringify(payload);
76
- const result = this.channel.requestSync(method, encodedPayload);
77
- if (result.length) {
78
- const decodedResult = JSON.parse(result);
79
- return decodedResult;
80
- }
81
- }
82
-
83
- requestBinary(method: string, payload: any): Uint8Array {
84
- return this.channel.requestBinarySync(method, this.encoder.encode(JSON.stringify(payload)));
85
- }
86
-
87
- echo(payload: string): string {
88
- return this.channel.requestSync("echo", payload);
89
- }
90
-
91
- echoBinary(payload: Uint8Array): Uint8Array {
92
- return this.channel.requestBinarySync("echo", payload);
93
- }
94
-
95
- close(): void {
96
- this.channel.close();
97
- }
98
- }
99
-
100
- declare interface ClientOptions {
101
- tsserverPath: string;
102
- cwd?: string;
103
- logFile?: string;
104
- fs?: FileSystem_2;
105
- }
106
-
107
- declare interface ConfigResponse {
108
- options: Record<string, unknown>;
109
- fileNames: string[];
110
- }
111
-
112
- export declare class DisposableObject {
113
- private disposed: boolean = false;
114
- protected objectRegistry: ObjectRegistry;
115
- constructor(objectRegistry: ObjectRegistry) {
116
- this.objectRegistry = objectRegistry;
117
- }
118
- [globalThis.Symbol.dispose](): void {
119
- this.objectRegistry.release(this);
120
- this.disposed = true;
121
- }
122
- dispose(): void {
123
- this[globalThis.Symbol.dispose]();
124
- }
125
- isDisposed(): boolean {
126
- return this.disposed;
127
- }
128
- ensureNotDisposed(): this {
129
- if (this.disposed) {
130
- throw new Error(`${this.constructor.name} is disposed`);
131
- }
132
- return this;
133
- }
134
- }
135
-
136
- declare interface FileSystem_2 {
137
- directoryExists?: (directoryName: string) => boolean | undefined;
138
- fileExists?: (fileName: string) => boolean | undefined;
139
- getAccessibleEntries?: (directoryName: string) => FileSystemEntries | undefined;
140
- readFile?: (fileName: string) => string | null | undefined;
141
- realpath?: (path: string) => string | undefined;
142
- }
143
-
144
- declare interface FileSystemEntries {
145
- files: string[];
146
- directories: string[];
147
- }
148
-
149
- export { Node_2 as Node }
150
-
151
- declare const NODE_DATA_TYPE_CHILDREN = 0x00000000;
152
-
153
- declare const NODE_DATA_TYPE_EXTENDED = 0x80000000;
154
-
155
- declare const NODE_DATA_TYPE_STRING = 0x40000000;
156
-
157
- declare type NodeDataType = typeof NODE_DATA_TYPE_CHILDREN | typeof NODE_DATA_TYPE_STRING | typeof NODE_DATA_TYPE_EXTENDED;
158
-
159
- declare class ObjectRegistry {
160
- private client: Client;
161
- private projects: Map<string, Project> = new Map();
162
- private symbols: Map<string, Symbol_2> = new Map();
163
- private types: Map<string, Type> = new Map();
164
-
165
- constructor(client: Client) {
166
- this.client = client;
167
- }
168
-
169
- getProject(data: ProjectResponse): Project {
170
- let project = this.projects.get(data.id);
171
- if (project) {
172
- return project;
173
- }
174
-
175
- project = new Project(this.client, this, data);
176
- this.projects.set(data.id, project);
177
- return project;
178
- }
179
-
180
- getSymbol(data: SymbolResponse): Symbol_2 {
181
- let symbol = this.symbols.get(data.id);
182
- if (symbol) {
183
- return symbol;
184
- }
185
-
186
- symbol = new Symbol(this.client, this, data);
187
- this.symbols.set(data.id, symbol);
188
- return symbol;
189
- }
190
-
191
- getType(data: TypeResponse): Type {
192
- let type = this.types.get(data.id);
193
- if (type) {
194
- return type;
195
- }
196
-
197
- type = new Type(this.client, this, data);
198
- this.types.set(data.id, type);
199
- return type;
200
- }
201
-
202
- release(object: object): void {
203
- if (object instanceof Project) {
204
- this.releaseProject(object);
205
- }
206
- else if (object instanceof Symbol) {
207
- this.releaseSymbol(object);
208
- }
209
- else if (object instanceof Type) {
210
- this.releaseType(object);
211
- }
212
- else {
213
- throw new Error("Unknown object type");
214
- }
215
- }
216
-
217
- releaseProject(project: Project): void {
218
- this.projects.delete(project.id);
219
- this.client.request("release", project.id);
220
- }
221
-
222
- releaseSymbol(symbol: Symbol_2): void {
223
- this.symbols.delete(symbol.id);
224
- this.client.request("release", symbol.id);
225
- }
226
-
227
- releaseType(type: Type): void {
228
- this.types.delete(type.id);
229
- this.client.request("release", type.id);
230
- }
231
- }
232
-
233
- export declare class Project extends DisposableObject {
234
- private decoder = new TextDecoder();
235
- private client: Client;
236
-
237
- id: string;
238
- configFileName!: string;
239
- compilerOptions!: Record<string, unknown>;
240
- rootFiles!: readonly string[];
241
-
242
- constructor(client: Client, objectRegistry: ObjectRegistry, data: ProjectResponse) {
243
- super(objectRegistry);
244
- this.id = data.id;
245
- this.client = client;
246
- this.loadData(data);
247
- }
248
-
249
- loadData(data: ProjectResponse): void {
250
- this.configFileName = data.configFileName;
251
- this.compilerOptions = data.compilerOptions;
252
- this.rootFiles = data.rootFiles;
253
- }
254
-
255
- reload(): void {
256
- this.ensureNotDisposed();
257
- this.loadData(this.client.request("loadProject", { configFileName: this.configFileName }));
258
- }
259
-
260
- getSourceFile(fileName: string): SourceFile | undefined {
261
- this.ensureNotDisposed();
262
- const data = this.client.requestBinary("getSourceFile", { project: this.id, fileName });
263
- return data ? new RemoteSourceFile(data, this.decoder) as unknown as SourceFile : undefined;
264
- }
265
-
266
- getSymbolAtLocation(node: Node_2): Symbol_2 | undefined;
267
- getSymbolAtLocation(nodes: readonly Node_2[]): (Symbol_2 | undefined)[];
268
- getSymbolAtLocation(nodeOrNodes: Node_2 | readonly Node_2[]): Symbol_2 | (Symbol_2 | undefined)[] | undefined {
269
- this.ensureNotDisposed();
270
- if (Array.isArray(nodeOrNodes)) {
271
- const data = this.client.request("getSymbolsAtLocations", { project: this.id, locations: nodeOrNodes.map(node => node.id) });
272
- return data.map((d: SymbolResponse | null) => d ? this.objectRegistry.getSymbol(d) : undefined);
273
- }
274
- const data = this.client.request("getSymbolAtLocation", { project: this.id, location: (nodeOrNodes as Node_2).id });
275
- return data ? this.objectRegistry.getSymbol(data) : undefined;
276
- }
277
-
278
- getSymbolAtPosition(fileName: string, position: number): Symbol_2 | undefined;
279
- getSymbolAtPosition(fileName: string, positions: readonly number[]): (Symbol_2 | undefined)[];
280
- getSymbolAtPosition(fileName: string, positionOrPositions: number | readonly number[]): Symbol_2 | (Symbol_2 | undefined)[] | undefined {
281
- this.ensureNotDisposed();
282
- if (typeof positionOrPositions === "number") {
283
- const data = this.client.request("getSymbolAtPosition", { project: this.id, fileName, position: positionOrPositions });
284
- return data ? this.objectRegistry.getSymbol(data) : undefined;
285
- }
286
- const data = this.client.request("getSymbolsAtPositions", { project: this.id, fileName, positions: positionOrPositions });
287
- return data.map((d: SymbolResponse | null) => d ? this.objectRegistry.getSymbol(d) : undefined);
288
- }
289
-
290
- getTypeOfSymbol(symbol: Symbol_2): Type | undefined;
291
- getTypeOfSymbol(symbols: readonly Symbol_2[]): (Type | undefined)[];
292
- getTypeOfSymbol(symbolOrSymbols: Symbol_2 | readonly Symbol_2[]): Type | (Type | undefined)[] | undefined {
293
- this.ensureNotDisposed();
294
- if (Array.isArray(symbolOrSymbols)) {
295
- const data = this.client.request("getTypesOfSymbols", { project: this.id, symbols: symbolOrSymbols.map(symbol => symbol.ensureNotDisposed().id) });
296
- return data.map((d: TypeResponse | null) => d ? this.objectRegistry.getType(d) : undefined);
297
- }
298
- const data = this.client.request("getTypeOfSymbol", { project: this.id, symbol: (symbolOrSymbols as Symbol_2).ensureNotDisposed().id });
299
- return data ? this.objectRegistry.getType(data) : undefined;
300
- }
301
- }
302
-
303
- declare interface ProjectResponse {
304
- id: string;
305
- configFileName: string;
306
- compilerOptions: Record<string, unknown>;
307
- rootFiles: string[];
308
- }
309
-
310
- declare class RemoteNode extends RemoteNodeBase implements Node_2 {
311
- protected static NODE_LEN: number = NODE_LEN;
312
- private sourceFile: SourceFile;
313
- id: string;
314
-
315
- constructor(view: DataView, decoder: TextDecoder, index: number, parent: RemoteNode) {
316
- super(view, decoder, index, parent);
317
- let sourceFile: RemoteNode = this;
318
- while (sourceFile && sourceFile.kind !== SyntaxKind.SourceFile) {
319
- sourceFile = sourceFile.parent;
320
- }
321
- if (!sourceFile) {
322
- throw new Error("SourceFile not found");
323
- }
324
- this.sourceFile = sourceFile as unknown as SourceFile;
325
- this.id = `${sourceFile.id}.${this.pos}.${this.kind}`;
326
- }
327
-
328
- forEachChild<T>(visitNode: (node: Node_2) => T, visitList?: (list: NodeArray<Node_2>) => T): T | undefined {
329
- if (this.hasChildren()) {
330
- let next = this.index + 1;
331
- do {
332
- const child = this.getOrCreateChildAtNodeIndex(next);
333
- if (child instanceof RemoteNodeList) {
334
- if (visitList) {
335
- const result = visitList(child);
336
- if (result) {
337
- return result;
338
- }
339
- }
340
- for (const node of child) {
341
- const result = visitNode(node);
342
- if (result) {
343
- return result;
344
- }
345
- }
346
- }
347
- else {
348
- const result = visitNode(child);
349
- if (result) {
350
- return result;
351
- }
352
- }
353
- next = child.next;
354
- }
355
- while (next);
356
- }
357
- }
358
-
359
- getSourceFile(): SourceFile {
360
- return this.sourceFile;
361
- }
362
-
363
- protected getString(index: number): string {
364
- const start = this.view.getUint32(this.offsetStringTableOffsets + index * 4, true);
365
- const end = this.view.getUint32(this.offsetStringTableOffsets + (index + 1) * 4, true);
366
- const text = new Uint8Array(this.view.buffer, this.offsetStringTable + start, end - start);
367
- return this.decoder.decode(text);
368
- }
369
-
370
- private getOrCreateChildAtNodeIndex(index: number): RemoteNode | RemoteNodeList {
371
- const pos = this.view.getUint32(this.offsetNodes + index * NODE_LEN + NODE_OFFSET_POS, true);
372
- let child = (this._children ??= new Map()).get(pos);
373
- if (!child) {
374
- const kind = this.view.getUint32(this.offsetNodes + index * NODE_LEN + NODE_OFFSET_KIND, true);
375
- child = kind === KIND_NODE_LIST
376
- ? new RemoteNodeList(this.view, this.decoder, index, this)
377
- : new RemoteNode(this.view, this.decoder, index, this);
378
- this._children.set(pos, child);
379
- }
380
- return child;
381
- }
382
-
383
- private hasChildren(): boolean {
384
- if (this._children) {
385
- return true;
386
- }
387
- if (this.byteIndex >= this.view.byteLength - NODE_LEN) {
388
- return false;
389
- }
390
- const nextNodeParent = this.view.getUint32(this.offsetNodes + (this.index + 1) * NODE_LEN + NODE_OFFSET_PARENT, true);
391
- return nextNodeParent === this.index;
392
- }
393
-
394
- private getNamedChild(propertyName: string): RemoteNode | RemoteNodeList | undefined {
395
- const propertyNames = childProperties[this.kind];
396
- if (!propertyNames) {
397
- // `childProperties` is only defined for nodes with more than one child property.
398
- // Get the only child if it exists.
399
- const child = this.getOrCreateChildAtNodeIndex(this.index + 1);
400
- if (child.next !== 0) {
401
- throw new Error("Expected only one child");
402
- }
403
- return child;
404
- }
405
-
406
- let order = propertyNames.indexOf(propertyName);
407
- if (order === -1) {
408
- // JSDocPropertyTag and JSDocParameterTag need special handling
409
- // because they have a conditional property order
410
- const kind = this.kind;
411
- if (kind === SyntaxKind.JSDocPropertyTag) {
412
- switch (propertyName) {
413
- case "name":
414
- order = this.isNameFirst ? 0 : 1;
415
- break;
416
- case "typeExpression":
417
- order = this.isNameFirst ? 1 : 0;
418
- break;
419
- }
420
- }
421
- else if (kind === SyntaxKind.JSDocParameterTag) {
422
- switch (propertyName) {
423
- case "name":
424
- order = this.isNameFirst ? 1 : 2;
425
- case "typeExpression":
426
- order = this.isNameFirst ? 2 : 1;
427
- }
428
- }
429
- // Node kind does not have this property
430
- return undefined;
431
- }
432
- const mask = this.childMask;
433
- if (!(mask & (1 << order))) {
434
- // Property is not present
435
- return undefined;
436
- }
437
-
438
- // The property index is `order`, minus the number of zeros in the mask that are in bit positions less
439
- // than the `order`th bit. Example:
440
- //
441
- // This is a MethodDeclaration with mask 0b01110101. The possible properties are
442
- // ["modifiers", "asteriskToken", "name", "postfixToken", "typeParameters", "parameters", "type", "body"]
443
- // (it has modifiers, name, typeParameters, parameters, and type).
444
- //
445
- // | Bit | 7 | 6 | 5 | 4 | 3 | 2 | 1 | 0 |
446
- // | ----- | ---- | ---- | ---------- | -------------- | ------------ | ---- | ------------- | --------- |
447
- // | Value | 0 | 1 | 1 | 1 | 0 | 1 | 0 | 1 |
448
- // | Name | body | type | parameters | typeParameters | postfixToken | name | asteriskToken | modifiers |
449
- //
450
- // We are trying to get the index of "parameters" (bit = 5).
451
- // First, set all the more significant bits to 1:
452
- //
453
- // | Bit | 7 | 6 | 5 | 4 | 3 | 2 | 1 | 0 |
454
- // | ----- | ---- | ---- | ---------- | -------------- | ------------ | ---- | ------------- | --------- |
455
- // | Value | 1 | 1 | 1 | 1 | 0 | 1 | 0 | 1 |
456
- //
457
- // Then, flip the bits:
458
- //
459
- // | Bit | 7 | 6 | 5 | 4 | 3 | 2 | 1 | 0 |
460
- // | ----- | ---- | ---- | ---------- | -------------- | ------------ | ---- | ------------- | --------- |
461
- // | Value | 0 | 0 | 0 | 0 | 1 | 0 | 1 | 0 |
462
- //
463
- // Counting the 1s gives us the number of *missing properties* before the `order`th property. If every property
464
- // were present, we would have `parameters = children[5]`, but since `postfixToken` and `astersiskToken` are
465
- // missing, we have `parameters = children[5 - 2]`.
466
- const propertyIndex = order - popcount8[~(mask | ((0xff << order) & 0xff)) & 0xff];
467
- return this.getOrCreateChildAtNodeIndex(this.index + 1 + propertyIndex);
468
- }
469
-
470
- __print(): string {
471
- const result = [];
472
- result.push(`index: ${this.index}`);
473
- result.push(`byteIndex: ${this.byteIndex}`);
474
- result.push(`kind: ${SyntaxKind[this.kind]}`);
475
- result.push(`pos: ${this.pos}`);
476
- result.push(`end: ${this.end}`);
477
- result.push(`next: ${this.next}`);
478
- result.push(`parent: ${this.parentIndex}`);
479
- result.push(`data: ${this.data.toString(2).padStart(32, "0")}`);
480
- const dataType = this.dataType === NODE_DATA_TYPE_CHILDREN ? "children" :
481
- this.dataType === NODE_DATA_TYPE_STRING ? "string" :
482
- "extended";
483
- result.push(`dataType: ${dataType}`);
484
- if (this.dataType === NODE_DATA_TYPE_CHILDREN) {
485
- result.push(`childMask: ${this.childMask.toString(2).padStart(8, "0")}`);
486
- result.push(`childProperties: ${childProperties[this.kind]?.join(", ")}`);
487
- }
488
- return result.join("\n");
489
- }
490
-
491
- __printChildren(): string {
492
- const result = [];
493
- let next = this.index + 1;
494
- while (next) {
495
- const child = this.getOrCreateChildAtNodeIndex(next);
496
- next = child.next;
497
- result.push(child.__print());
498
- }
499
- return result.join("\n\n");
500
- }
501
-
502
- __printSubtree(): string {
503
- const result = [this.__print()];
504
- this.forEachChild(function visitNode(node) {
505
- result.push((node as RemoteNode).__print());
506
- node.forEachChild(visitNode);
507
- }, visitList => {
508
- result.push((visitList as RemoteNodeList).__print());
509
- });
510
- return result.join("\n\n");
511
- }
512
-
513
- // Boolean properties
514
- get isArrayType(): boolean | undefined {
515
- switch (this.kind) {
516
- case SyntaxKind.JSDocTypeLiteral:
517
- return (this.data & 1 << 24) !== 0;
518
- }
519
- }
520
-
521
- get isTypeOnly(): boolean | undefined {
522
- switch (this.kind) {
523
- case SyntaxKind.ImportSpecifier:
524
- case SyntaxKind.ImportClause:
525
- case SyntaxKind.ExportSpecifier:
526
- case SyntaxKind.ImportEqualsDeclaration:
527
- case SyntaxKind.ExportDeclaration:
528
- return (this.data & 1 << 24) !== 0;
529
- }
530
- }
531
-
532
- get isTypeOf(): boolean | undefined {
533
- switch (this.kind) {
534
- case SyntaxKind.ImportType:
535
- return (this.data & 1 << 24) !== 0;
536
- }
537
- }
538
-
539
- get multiline(): boolean | undefined {
540
- switch (this.kind) {
541
- case SyntaxKind.Block:
542
- case SyntaxKind.ArrayLiteralExpression:
543
- case SyntaxKind.ObjectLiteralExpression:
544
- case SyntaxKind.ImportAttributes:
545
- return (this.data & 1 << 24) !== 0;
546
- }
547
- }
548
-
549
- get isExportEquals(): boolean | undefined {
550
- switch (this.kind) {
551
- case SyntaxKind.ExportAssignment:
552
- return (this.data & 1 << 24) !== 0;
553
- }
554
- }
555
-
556
- get isBracketed(): boolean | undefined {
557
- switch (this.kind) {
558
- case SyntaxKind.JSDocPropertyTag:
559
- case SyntaxKind.JSDocParameterTag:
560
- return (this.data & 1 << 24) !== 0;
561
- }
562
- }
563
-
564
- get containsOnlyTriviaWhiteSpaces(): boolean | undefined {
565
- switch (this.kind) {
566
- case SyntaxKind.JsxText:
567
- return (this.data & 1 << 24) !== 0;
568
- }
569
- }
570
-
571
- get isNameFirst(): boolean | undefined {
572
- switch (this.kind) {
573
- case SyntaxKind.JSDocPropertyTag:
574
- case SyntaxKind.JSDocParameterTag:
575
- return (this.data & 1 << 25) !== 0;
576
- }
577
- }
578
-
579
- // Children properties
580
- get argument(): RemoteNode | undefined {
581
- return this.getNamedChild("argument") as RemoteNode;
582
- }
583
- get argumentExpression(): RemoteNode | undefined {
584
- return this.getNamedChild("argumentExpression") as RemoteNode;
585
- }
586
- get arguments(): RemoteNodeList | undefined {
587
- return this.getNamedChild("arguments") as RemoteNodeList;
588
- }
589
- get assertsModifier(): RemoteNode | undefined {
590
- return this.getNamedChild("assertsModifier") as RemoteNode;
591
- }
592
- get asteriskToken(): RemoteNode | undefined {
593
- return this.getNamedChild("asteriskToken") as RemoteNode;
594
- }
595
- get attributes(): RemoteNode | undefined {
596
- return this.getNamedChild("attributes") as RemoteNode;
597
- }
598
- get awaitModifier(): RemoteNode | undefined {
599
- return this.getNamedChild("awaitModifier") as RemoteNode;
600
- }
601
- get block(): RemoteNode | undefined {
602
- return this.getNamedChild("block") as RemoteNode;
603
- }
604
- get body(): RemoteNode | undefined {
605
- return this.getNamedChild("body") as RemoteNode;
606
- }
607
- get caseBlock(): RemoteNode | undefined {
608
- return this.getNamedChild("caseBlock") as RemoteNode;
609
- }
610
- get catchClause(): RemoteNode | undefined {
611
- return this.getNamedChild("catchClause") as RemoteNode;
612
- }
613
- get checkType(): RemoteNode | undefined {
614
- return this.getNamedChild("checkType") as RemoteNode;
615
- }
616
- get children(): RemoteNodeList | undefined {
617
- return this.getNamedChild("children") as RemoteNodeList;
618
- }
619
- get className(): RemoteNode | undefined {
620
- return this.getNamedChild("className") as RemoteNode;
621
- }
622
- get closingElement(): RemoteNode | undefined {
623
- return this.getNamedChild("closingElement") as RemoteNode;
624
- }
625
- get closingFragment(): RemoteNode | undefined {
626
- return this.getNamedChild("closingFragment") as RemoteNode;
627
- }
628
- get colonToken(): RemoteNode | undefined {
629
- return this.getNamedChild("colonToken") as RemoteNode;
630
- }
631
- get comment(): RemoteNode | undefined {
632
- return this.getNamedChild("comment") as RemoteNode;
633
- }
634
- get condition(): RemoteNode | undefined {
635
- return this.getNamedChild("condition") as RemoteNode;
636
- }
637
- get constraint(): RemoteNode | undefined {
638
- return this.getNamedChild("constraint") as RemoteNode;
639
- }
640
- get declarationList(): RemoteNode | undefined {
641
- return this.getNamedChild("declarationList") as RemoteNode;
642
- }
643
- get defaultType(): RemoteNode | undefined {
644
- return this.getNamedChild("defaultType") as RemoteNode;
645
- }
646
- get dotDotDotToken(): RemoteNode | undefined {
647
- return this.getNamedChild("dotDotDotToken") as RemoteNode;
648
- }
649
- get elements(): RemoteNodeList | undefined {
650
- return this.getNamedChild("elements") as RemoteNodeList;
651
- }
652
- get elseStatement(): RemoteNode | undefined {
653
- return this.getNamedChild("elseStatement") as RemoteNode;
654
- }
655
- get endOfFileToken(): RemoteNode | undefined {
656
- return this.getNamedChild("endOfFileToken") as RemoteNode;
657
- }
658
- get equalsGreaterThanToken(): RemoteNode | undefined {
659
- return this.getNamedChild("equalsGreaterThanToken") as RemoteNode;
660
- }
661
- get equalsToken(): RemoteNode | undefined {
662
- return this.getNamedChild("equalsToken") as RemoteNode;
663
- }
664
- get exclamationToken(): RemoteNode | undefined {
665
- return this.getNamedChild("exclamationToken") as RemoteNode;
666
- }
667
- get exportClause(): RemoteNode | undefined {
668
- return this.getNamedChild("exportClause") as RemoteNode;
669
- }
670
- get expression(): RemoteNode | undefined {
671
- return this.getNamedChild("expression") as RemoteNode;
672
- }
673
- get exprName(): RemoteNode | undefined {
674
- return this.getNamedChild("exprName") as RemoteNode;
675
- }
676
- get extendsType(): RemoteNode | undefined {
677
- return this.getNamedChild("extendsType") as RemoteNode;
678
- }
679
- get falseType(): RemoteNode | undefined {
680
- return this.getNamedChild("falseType") as RemoteNode;
681
- }
682
- get finallyBlock(): RemoteNode | undefined {
683
- return this.getNamedChild("finallyBlock") as RemoteNode;
684
- }
685
- get fullName(): RemoteNode | undefined {
686
- return this.getNamedChild("fullName") as RemoteNode;
687
- }
688
- get head(): RemoteNode | undefined {
689
- return this.getNamedChild("head") as RemoteNode;
690
- }
691
- get heritageClauses(): RemoteNodeList | undefined {
692
- return this.getNamedChild("heritageClauses") as RemoteNodeList;
693
- }
694
- get importClause(): RemoteNode | undefined {
695
- return this.getNamedChild("importClause") as RemoteNode;
696
- }
697
- get incrementor(): RemoteNode | undefined {
698
- return this.getNamedChild("incrementor") as RemoteNode;
699
- }
700
- get indexType(): RemoteNode | undefined {
701
- return this.getNamedChild("indexType") as RemoteNode;
702
- }
703
- get initializer(): RemoteNode | undefined {
704
- return this.getNamedChild("initializer") as RemoteNode;
705
- }
706
- get label(): RemoteNode | undefined {
707
- return this.getNamedChild("label") as RemoteNode;
708
- }
709
- get left(): RemoteNode | undefined {
710
- return this.getNamedChild("left") as RemoteNode;
711
- }
712
- get literal(): RemoteNode | undefined {
713
- return this.getNamedChild("literal") as RemoteNode;
714
- }
715
- get members(): RemoteNodeList | undefined {
716
- return this.getNamedChild("members") as RemoteNodeList;
717
- }
718
- get modifiers(): RemoteNodeList | undefined {
719
- return this.getNamedChild("modifiers") as RemoteNodeList;
720
- }
721
- get moduleReference(): RemoteNode | undefined {
722
- return this.getNamedChild("moduleReference") as RemoteNode;
723
- }
724
- get moduleSpecifier(): RemoteNode | undefined {
725
- return this.getNamedChild("moduleSpecifier") as RemoteNode;
726
- }
727
- get name(): RemoteNode | undefined {
728
- return this.getNamedChild("name") as RemoteNode;
729
- }
730
- get namedBindings(): RemoteNode | undefined {
731
- return this.getNamedChild("namedBindings") as RemoteNode;
732
- }
733
- get nameExpression(): RemoteNode | undefined {
734
- return this.getNamedChild("nameExpression") as RemoteNode;
735
- }
736
- get namespace(): RemoteNode | undefined {
737
- return this.getNamedChild("namespace") as RemoteNode;
738
- }
739
- get nameType(): RemoteNode | undefined {
740
- return this.getNamedChild("nameType") as RemoteNode;
741
- }
742
- get objectAssignmentInitializer(): RemoteNode | undefined {
743
- return this.getNamedChild("objectAssignmentInitializer") as RemoteNode;
744
- }
745
- get objectType(): RemoteNode | undefined {
746
- return this.getNamedChild("objectType") as RemoteNode;
747
- }
748
- get openingElement(): RemoteNode | undefined {
749
- return this.getNamedChild("openingElement") as RemoteNode;
750
- }
751
- get openingFragment(): RemoteNode | undefined {
752
- return this.getNamedChild("openingFragment") as RemoteNode;
753
- }
754
- get operatorToken(): RemoteNode | undefined {
755
- return this.getNamedChild("operatorToken") as RemoteNode;
756
- }
757
- get parameterName(): RemoteNode | undefined {
758
- return this.getNamedChild("parameterName") as RemoteNode;
759
- }
760
- get parameters(): RemoteNodeList | undefined {
761
- return this.getNamedChild("parameters") as RemoteNodeList;
762
- }
763
- get postfixToken(): RemoteNode | undefined {
764
- return this.getNamedChild("postfixToken") as RemoteNode;
765
- }
766
- get propertyName(): RemoteNode | undefined {
767
- return this.getNamedChild("propertyName") as RemoteNode;
768
- }
769
- get qualifier(): RemoteNode | undefined {
770
- return this.getNamedChild("qualifier") as RemoteNode;
771
- }
772
- get questionDotToken(): RemoteNode | undefined {
773
- return this.getNamedChild("questionDotToken") as RemoteNode;
774
- }
775
- get questionToken(): RemoteNode | undefined {
776
- return this.getNamedChild("questionToken") as RemoteNode;
777
- }
778
- get readonlyToken(): RemoteNode | undefined {
779
- return this.getNamedChild("readonlyToken") as RemoteNode;
780
- }
781
- get right(): RemoteNode | undefined {
782
- return this.getNamedChild("right") as RemoteNode;
783
- }
784
- get statement(): RemoteNode | undefined {
785
- return this.getNamedChild("statement") as RemoteNode;
786
- }
787
- get statements(): RemoteNodeList | undefined {
788
- return this.getNamedChild("statements") as RemoteNodeList;
789
- }
790
- get tag(): RemoteNode | undefined {
791
- return this.getNamedChild("tag") as RemoteNode;
792
- }
793
- get tagName(): RemoteNode | undefined {
794
- return this.getNamedChild("tagName") as RemoteNode;
795
- }
796
- get tags(): RemoteNodeList | undefined {
797
- return this.getNamedChild("tags") as RemoteNodeList;
798
- }
799
- get template(): RemoteNode | undefined {
800
- return this.getNamedChild("template") as RemoteNode;
801
- }
802
- get templateSpans(): RemoteNodeList | undefined {
803
- return this.getNamedChild("templateSpans") as RemoteNodeList;
804
- }
805
- get thenStatement(): RemoteNode | undefined {
806
- return this.getNamedChild("thenStatement") as RemoteNode;
807
- }
808
- get trueType(): RemoteNode | undefined {
809
- return this.getNamedChild("trueType") as RemoteNode;
810
- }
811
- get tryBlock(): RemoteNode | undefined {
812
- return this.getNamedChild("tryBlock") as RemoteNode;
813
- }
814
- get type(): RemoteNode | undefined {
815
- return this.getNamedChild("type") as RemoteNode;
816
- }
817
- get typeArguments(): RemoteNode | undefined {
818
- return this.getNamedChild("typeArguments") as RemoteNode;
819
- }
820
- get typeExpression(): RemoteNode | undefined {
821
- return this.getNamedChild("typeExpression") as RemoteNode;
822
- }
823
- get typeName(): RemoteNode | undefined {
824
- return this.getNamedChild("typeName") as RemoteNode;
825
- }
826
- get typeParameter(): RemoteNode | undefined {
827
- return this.getNamedChild("typeParameter") as RemoteNode;
828
- }
829
- get typeParameters(): RemoteNodeList | undefined {
830
- return this.getNamedChild("typeParameters") as RemoteNodeList;
831
- }
832
- get value(): RemoteNode | undefined {
833
- return this.getNamedChild("value") as RemoteNode;
834
- }
835
- get variableDeclaration(): RemoteNode | undefined {
836
- return this.getNamedChild("variableDeclaration") as RemoteNode;
837
- }
838
- get whenFalse(): RemoteNode | undefined {
839
- return this.getNamedChild("whenFalse") as RemoteNode;
840
- }
841
- get whenTrue(): RemoteNode | undefined {
842
- return this.getNamedChild("whenTrue") as RemoteNode;
843
- }
844
-
845
- // String properties
846
- get text(): string | undefined {
847
- switch (this.kind) {
848
- case SyntaxKind.JsxText:
849
- case SyntaxKind.Identifier:
850
- case SyntaxKind.PrivateIdentifier:
851
- case SyntaxKind.StringLiteral:
852
- case SyntaxKind.NumericLiteral:
853
- case SyntaxKind.BigIntLiteral:
854
- case SyntaxKind.RegularExpressionLiteral:
855
- case SyntaxKind.NoSubstitutionTemplateLiteral:
856
- case SyntaxKind.JSDocText: {
857
- const stringIndex = this.data & NODE_STRING_INDEX_MASK;
858
- return this.getString(stringIndex);
859
- }
860
- case SyntaxKind.SourceFile:
861
- case SyntaxKind.TemplateHead:
862
- case SyntaxKind.TemplateMiddle:
863
- case SyntaxKind.TemplateTail: {
864
- const extendedDataOffset = this.offsetExtendedData + (this.data & NODE_EXTENDED_DATA_MASK);
865
- const stringIndex = this.view.getUint32(extendedDataOffset, true);
866
- return this.getString(stringIndex);
867
- }
868
- }
869
- }
870
-
871
- get rawText(): string | undefined {
872
- switch (this.kind) {
873
- case SyntaxKind.TemplateHead:
874
- case SyntaxKind.TemplateMiddle:
875
- case SyntaxKind.TemplateTail:
876
- const extendedDataOffset = this.offsetExtendedData + (this.data & NODE_EXTENDED_DATA_MASK);
877
- const stringIndex = this.view.getUint32(extendedDataOffset + 4, true);
878
- return this.getString(stringIndex);
879
- }
880
- }
881
-
882
- get fileName(): string | undefined {
883
- switch (this.kind) {
884
- case SyntaxKind.SourceFile:
885
- const extendedDataOffset = this.offsetExtendedData + (this.data & NODE_EXTENDED_DATA_MASK);
886
- const stringIndex = this.view.getUint32(extendedDataOffset + 4, true);
887
- return this.getString(stringIndex);
888
- }
889
- }
890
-
891
- // Other properties
892
- get flags(): number {
893
- switch (this.kind) {
894
- case SyntaxKind.VariableDeclarationList:
895
- return this.data & (1 << 24 | 1 << 25) >> 24;
896
- :
897
- return 0;
898
- }
899
- }
900
-
901
- get token(): SyntaxKind | undefined {
902
- switch (this.kind) {
903
- case SyntaxKind.ImportAttributes:
904
- if ((this.data & 1 << 25) !== 0) {
905
- return SyntaxKind.AssertKeyword;
906
- }
907
- return SyntaxKind.WithKeyword;
908
- }
909
- }
910
-
911
- get templateFlags(): number | undefined {
912
- switch (this.kind) {
913
- case SyntaxKind.TemplateHead:
914
- case SyntaxKind.TemplateMiddle:
915
- case SyntaxKind.TemplateTail:
916
- const extendedDataOffset = this.offsetExtendedData + (this.data & NODE_EXTENDED_DATA_MASK);
917
- return this.view.getUint32(extendedDataOffset + 8, true);
918
- }
919
- }
920
- }
921
-
922
- declare class RemoteNodeBase {
923
- parent: RemoteNode;
924
- protected view: DataView;
925
- protected decoder: TextDecoder;
926
- protected index: number;
927
- /** Keys are positions */
928
- protected _children: Map<number, RemoteNode | RemoteNodeList> | undefined;
929
-
930
- constructor(view: DataView, decoder: TextDecoder, index: number, parent: RemoteNode) {
931
- this.view = view;
932
- this.decoder = decoder;
933
- this.index = index;
934
- this.parent = parent;
935
- }
936
-
937
- get kind(): SyntaxKind {
938
- return this.view.getUint32(this.byteIndex + NODE_OFFSET_KIND, true);
939
- }
940
-
941
- get pos(): number {
942
- return this.view.getUint32(this.byteIndex + NODE_OFFSET_POS, true);
943
- }
944
-
945
- get end(): number {
946
- return this.view.getUint32(this.byteIndex + NODE_OFFSET_END, true);
947
- }
948
-
949
- get next(): number {
950
- return this.view.getUint32(this.byteIndex + NODE_OFFSET_NEXT, true);
951
- }
952
-
953
- protected get byteIndex(): number {
954
- return this.offsetNodes + this.index * NODE_LEN;
955
- }
956
-
957
- protected get offsetStringTableOffsets(): number {
958
- return this.view.getUint32(HEADER_OFFSET_STRING_TABLE_OFFSETS, true);
959
- }
960
-
961
- protected get offsetStringTable(): number {
962
- return this.view.getUint32(HEADER_OFFSET_STRING_TABLE, true);
963
- }
964
-
965
- protected get offsetExtendedData(): number {
966
- return this.view.getUint32(HEADER_OFFSET_EXTENDED_DATA, true);
967
- }
968
-
969
- protected get offsetNodes(): number {
970
- return this.view.getUint32(HEADER_OFFSET_NODES, true);
971
- }
972
-
973
- protected get parentIndex(): number {
974
- return this.view.getUint32(this.byteIndex + NODE_OFFSET_PARENT, true);
975
- }
976
-
977
- protected get data(): number {
978
- return this.view.getUint32(this.byteIndex + NODE_OFFSET_DATA, true);
979
- }
980
-
981
- protected get dataType(): NodeDataType {
982
- return (this.data & NODE_DATA_TYPE_MASK) as NodeDataType;
983
- }
984
-
985
- protected get childMask(): number {
986
- if (this.dataType !== NODE_DATA_TYPE_CHILDREN) {
987
- return -1;
988
- }
989
- return this.data & NODE_CHILD_MASK;
990
- }
991
-
992
- protected getFileText(start: number, end: number): string {
993
- return this.decoder.decode(new Uint8Array(this.view.buffer, this.offsetStringTable + start, end - start));
994
- }
995
- }
996
-
997
- declare class RemoteNodeList extends Array<RemoteNode> implements NodeArray<RemoteNode> {
998
- parent: RemoteNode;
999
- protected view: DataView;
1000
- protected decoder: TextDecoder;
1001
- protected index: number;
1002
- /** Keys are positions */
1003
- protected _children: Map<number, RemoteNode | RemoteNodeList> | undefined;
1004
-
1005
- get pos(): number {
1006
- return this.view.getUint32(this.byteIndex + NODE_OFFSET_POS, true);
1007
- }
1008
-
1009
- get end(): number {
1010
- return this.view.getUint32(this.byteIndex + NODE_OFFSET_END, true);
1011
- }
1012
-
1013
- get next(): number {
1014
- return this.view.getUint32(this.byteIndex + NODE_OFFSET_NEXT, true);
1015
- }
1016
-
1017
- private get data(): number {
1018
- return this.view.getUint32(this.byteIndex + NODE_OFFSET_DATA, true);
1019
- }
1020
-
1021
- private get offsetNodes(): number {
1022
- return this.view.getUint32(HEADER_OFFSET_NODES, true);
1023
- }
1024
-
1025
- private get byteIndex(): number {
1026
- return this.offsetNodes + this.index * NODE_LEN;
1027
- }
1028
-
1029
- constructor(view: DataView, decoder: TextDecoder, index: number, parent: RemoteNode) {
1030
- super();
1031
- this.view = view;
1032
- this.decoder = decoder;
1033
- this.index = index;
1034
- this.parent = parent;
1035
- this.length = this.data;
1036
-
1037
- const length = this.length;
1038
- for (let i = 0; i < length; i++) {
1039
- Object.defineProperty(this, i, {
1040
- get() {
1041
- return this.at(i);
1042
- },
1043
- });
1044
- }
1045
- }
1046
-
1047
- *[Symbol.iterator](): ArrayIterator<RemoteNode> {
1048
- let next = this.index + 1;
1049
- while (next) {
1050
- const child = this.getOrCreateChildAtNodeIndex(next);
1051
- next = child.next;
1052
- yield child as RemoteNode;
1053
- }
1054
- }
1055
-
1056
- at(index: number): RemoteNode {
1057
- if (!Number.isInteger(index)) {
1058
- return undefined!;
1059
- }
1060
- if (index < 0) {
1061
- index = this.length - index;
1062
- }
1063
- let next = this.index + 1;
1064
- for (let i = 0; i < index; i++) {
1065
- const child = this.getOrCreateChildAtNodeIndex(next);
1066
- next = child.next;
1067
- }
1068
- return this.getOrCreateChildAtNodeIndex(next) as RemoteNode;
1069
- }
1070
-
1071
- private getOrCreateChildAtNodeIndex(index: number): RemoteNode | RemoteNodeList {
1072
- const pos = this.view.getUint32(this.offsetNodes + index * NODE_LEN + NODE_OFFSET_POS, true);
1073
- let child = (this._children ??= new Map()).get(pos);
1074
- if (!child) {
1075
- const kind = this.view.getUint32(this.offsetNodes + index * NODE_LEN + NODE_OFFSET_KIND, true);
1076
- if (kind === KIND_NODE_LIST) {
1077
- throw new Error("NodeList cannot directly contain another NodeList");
1078
- }
1079
- child = new RemoteNode(this.view, this.decoder, index, this.parent);
1080
- this._children.set(pos, child);
1081
- }
1082
- return child;
1083
- }
1084
-
1085
- __print(): string {
1086
- const result = [];
1087
- result.push(`kind: NodeList`);
1088
- result.push(`index: ${this.index}`);
1089
- result.push(`byteIndex: ${this.byteIndex}`);
1090
- result.push(`length: ${this.length}`);
1091
- return result.join("\n");
1092
- }
1093
- }
1094
-
1095
- export declare class RemoteSourceFile extends RemoteNode {
1096
- constructor(data: Uint8Array, decoder: TextDecoder) {
1097
- const view = new DataView(data.buffer, data.byteOffset, data.byteLength);
1098
- super(view, decoder, 1, undefined!);
1099
- this.id = this.getString(this.view.getUint32(this.offsetExtendedData + 8, true));
1100
- }
1101
- }
1102
-
1103
- declare class Symbol_2 extends DisposableObject {
1104
- private client: Client;
1105
- id: string;
1106
- name: string;
1107
- flags: SymbolFlags;
1108
- checkFlags: number;
1109
-
1110
- constructor(client: Client, objectRegistry: ObjectRegistry, data: SymbolResponse) {
1111
- super(objectRegistry);
1112
- this.client = client;
1113
- this.id = data.id;
1114
- this.name = data.name;
1115
- this.flags = data.flags;
1116
- this.checkFlags = data.checkFlags;
1117
- }
1118
- }
1119
- export { Symbol_2 as Symbol }
1120
-
1121
- export declare enum SymbolFlags {
1122
- None = 0,
1123
- FunctionScopedVariable = 1 << 0,
1124
- BlockScopedVariable = 1 << 1,
1125
- Property = 1 << 2,
1126
- EnumMember = 1 << 3,
1127
- Function = 1 << 4,
1128
- Class = 1 << 5,
1129
- Interface = 1 << 6,
1130
- ConstEnum = 1 << 7,
1131
- RegularEnum = 1 << 8,
1132
- ValueModule = 1 << 9,
1133
- NamespaceModule = 1 << 10,
1134
- TypeLiteral = 1 << 11,
1135
- ObjectLiteral = 1 << 12,
1136
- Method = 1 << 13,
1137
- Constructor = 1 << 14,
1138
- GetAccessor = 1 << 15,
1139
- SetAccessor = 1 << 16,
1140
- Signature = 1 << 17,
1141
- TypeParameter = 1 << 18,
1142
- TypeAlias = 1 << 19,
1143
- ExportValue = 1 << 20,
1144
- Alias = 1 << 21,
1145
- Prototype = 1 << 22,
1146
- ExportStar = 1 << 23,
1147
- Optional = 1 << 24,
1148
- Transient = 1 << 25,
1149
- Assignment = 1 << 26,
1150
- ModuleExports = 1 << 27,
1151
- ConstEnumOnlyModule = 1 << 28,
1152
- ReplaceableByMethod = 1 << 29,
1153
- GlobalLookup = 1 << 30,
1154
- All = 1 << 30 - 1,
1155
-
1156
- Enum = RegularEnum | ConstEnum,
1157
- Variable = FunctionScopedVariable | BlockScopedVariable,
1158
- Value = Variable | Property | EnumMember | ObjectLiteral | Function | Class | Enum | ValueModule | Method | GetAccessor | SetAccessor,
1159
- Type = Class | Interface | Enum | EnumMember | TypeLiteral | TypeParameter | TypeAlias,
1160
- Namespace = ValueModule | NamespaceModule | Enum,
1161
- Module = ValueModule | NamespaceModule,
1162
- Accessor = GetAccessor | SetAccessor,
1163
-
1164
- FunctionScopedVariableExcludes = Value & ~FunctionScopedVariable,
1165
-
1166
- BlockScopedVariableExcludes = Value,
1167
-
1168
- ParameterExcludes = Value,
1169
- PropertyExcludes = Value & ~Property,
1170
- EnumMemberExcludes = Value | Type,
1171
- FunctionExcludes = Value & ~(Function | ValueModule | Class),
1172
- ClassExcludes = (Value | Type) & ~(ValueModule | Interface | Function),
1173
- InterfaceExcludes = Type & ~(Interface | Class),
1174
- RegularEnumExcludes = (Value | Type) & ~(RegularEnum | ValueModule),
1175
- ConstEnumExcludes = (Value | Type) & ~ConstEnum,
1176
- ValueModuleExcludes = Value & ~(Function | Class | RegularEnum | ValueModule),
1177
- NamespaceModuleExcludes = None,
1178
- MethodExcludes = Value & ~Method,
1179
- GetAccessorExcludes = Value & ~SetAccessor,
1180
- SetAccessorExcludes = Value & ~GetAccessor,
1181
- AccessorExcludes = Value & ~Accessor,
1182
- TypeParameterExcludes = Type & ~TypeParameter,
1183
- TypeAliasExcludes = Type,
1184
- AliasExcludes = Alias,
1185
- ModuleMember = Variable | Function | Class | Interface | Enum | Module | TypeAlias | Alias,
1186
- ExportHasLocal = Function | Class | Enum | ValueModule,
1187
- BlockScoped = BlockScopedVariable | Class | Enum,
1188
- PropertyOrAccessor = Property | Accessor,
1189
- ClassMember = Method | Accessor | Property,
1190
- ExportSupportsDefaultModifier = Class | Function | Interface,
1191
- ExportDoesNotSupportDefaultModifier = ~ExportSupportsDefaultModifier,
1192
-
1193
- Classifiable = Class | Enum | TypeAlias | Interface | TypeParameter | Module | Alias,
1194
- LateBindingContainer = Class | Interface | TypeLiteral | ObjectLiteral | Function,
1195
- }
1196
-
1197
- declare interface SymbolResponse {
1198
- id: string;
1199
- name: string;
1200
- flags: number;
1201
- checkFlags: number;
1202
- }
1203
-
1204
- export { SyntaxKind }
1205
-
1206
- export declare class Type extends DisposableObject {
1207
- private client: Client;
1208
- id: string;
1209
- flags: TypeFlags;
1210
- constructor(client: Client, objectRegistry: ObjectRegistry, data: TypeResponse) {
1211
- super(objectRegistry);
1212
- this.client = client;
1213
- this.id = data.id;
1214
- this.flags = data.flags;
1215
- }
1216
- }
1217
-
1218
- export declare enum TypeFlags {
1219
- None = 0,
1220
- Any = 1 << 0,
1221
- Unknown = 1 << 1,
1222
- Undefined = 1 << 2,
1223
- Null = 1 << 3,
1224
- Void = 1 << 4,
1225
- String = 1 << 5,
1226
- Number = 1 << 6,
1227
- BigInt = 1 << 7,
1228
- Boolean = 1 << 8,
1229
- ESSymbol = 1 << 9,
1230
- StringLiteral = 1 << 10,
1231
- NumberLiteral = 1 << 11,
1232
- BigIntLiteral = 1 << 12,
1233
- BooleanLiteral = 1 << 13,
1234
- UniqueESSymbol = 1 << 14,
1235
- EnumLiteral = 1 << 15,
1236
- Enum = 1 << 16,
1237
- Never = 1 << 17,
1238
- TypeParameter = 1 << 18,
1239
- Object = 1 << 19,
1240
- Union = 1 << 20,
1241
- Intersection = 1 << 21,
1242
- Index = 1 << 22,
1243
- IndexedAccess = 1 << 23,
1244
- Conditional = 1 << 24,
1245
- Substitution = 1 << 25,
1246
- NonPrimitive = 1 << 26,
1247
- TemplateLiteral = 1 << 27,
1248
- StringMapping = 1 << 28,
1249
- }
1250
-
1251
- declare interface TypeResponse {
1252
- id: string;
1253
- flags: number;
1254
- }
1255
-
1256
- export { }