@oxlint/plugins 1.43.0

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/index.d.ts ADDED
@@ -0,0 +1,3954 @@
1
+ //#endregion
2
+ //#region src-js/plugins/globals.d.ts
3
+ /**
4
+ * Globals for the file being linted.
5
+ *
6
+ * Globals are deserialized from JSON, so can only contain JSON-compatible values.
7
+ * Each global variable maps to "readonly", "writable", or "off".
8
+ */
9
+ type Globals = Record<string, "readonly" | "writable" | "off">;
10
+ /**
11
+ * Environments for the file being linted.
12
+ *
13
+ * Only includes environments that are enabled, so all properties are `true`.
14
+ */
15
+ type Envs = Record<string, true>;
16
+ //#endregion
17
+ //#region ../../node_modules/.pnpm/@types+json-schema@7.0.15/node_modules/@types/json-schema/index.d.ts
18
+ // ==================================================================================================
19
+ // JSON Schema Draft 04
20
+ // ==================================================================================================
21
+ /**
22
+ * @see https://tools.ietf.org/html/draft-zyp-json-schema-03#section-5.1
23
+ */
24
+ type JSONSchema4TypeName = "string" //
25
+ | "number" | "integer" | "boolean" | "object" | "array" | "null" | "any";
26
+ /**
27
+ * @see https://tools.ietf.org/html/draft-zyp-json-schema-04#section-3.5
28
+ */
29
+ type JSONSchema4Type = string //
30
+ | number | boolean | JSONSchema4Object | JSONSchema4Array | null;
31
+ // Workaround for infinite type recursion
32
+ interface JSONSchema4Object {
33
+ [key: string]: JSONSchema4Type;
34
+ }
35
+ // Workaround for infinite type recursion
36
+ // https://github.com/Microsoft/TypeScript/issues/3496#issuecomment-128553540
37
+ interface JSONSchema4Array extends Array<JSONSchema4Type> {}
38
+ /**
39
+ * Meta schema
40
+ *
41
+ * Recommended values:
42
+ * - 'http://json-schema.org/schema#'
43
+ * - 'http://json-schema.org/hyper-schema#'
44
+ * - 'http://json-schema.org/draft-04/schema#'
45
+ * - 'http://json-schema.org/draft-04/hyper-schema#'
46
+ * - 'http://json-schema.org/draft-03/schema#'
47
+ * - 'http://json-schema.org/draft-03/hyper-schema#'
48
+ *
49
+ * @see https://tools.ietf.org/html/draft-handrews-json-schema-validation-01#section-5
50
+ */
51
+ type JSONSchema4Version = string;
52
+ /**
53
+ * JSON Schema V4
54
+ * @see https://tools.ietf.org/html/draft-zyp-json-schema-04
55
+ */
56
+ interface JSONSchema4 {
57
+ id?: string | undefined;
58
+ $ref?: string | undefined;
59
+ $schema?: JSONSchema4Version | undefined;
60
+ /**
61
+ * This attribute is a string that provides a short description of the
62
+ * instance property.
63
+ *
64
+ * @see https://tools.ietf.org/html/draft-zyp-json-schema-03#section-5.21
65
+ */
66
+ title?: string | undefined;
67
+ /**
68
+ * This attribute is a string that provides a full description of the of
69
+ * purpose the instance property.
70
+ *
71
+ * @see https://tools.ietf.org/html/draft-zyp-json-schema-03#section-5.22
72
+ */
73
+ description?: string | undefined;
74
+ default?: JSONSchema4Type | undefined;
75
+ multipleOf?: number | undefined;
76
+ maximum?: number | undefined;
77
+ exclusiveMaximum?: boolean | undefined;
78
+ minimum?: number | undefined;
79
+ exclusiveMinimum?: boolean | undefined;
80
+ maxLength?: number | undefined;
81
+ minLength?: number | undefined;
82
+ pattern?: string | undefined;
83
+ /**
84
+ * May only be defined when "items" is defined, and is a tuple of JSONSchemas.
85
+ *
86
+ * This provides a definition for additional items in an array instance
87
+ * when tuple definitions of the items is provided. This can be false
88
+ * to indicate additional items in the array are not allowed, or it can
89
+ * be a schema that defines the schema of the additional items.
90
+ *
91
+ * @see https://tools.ietf.org/html/draft-zyp-json-schema-03#section-5.6
92
+ */
93
+ additionalItems?: boolean | JSONSchema4 | undefined;
94
+ /**
95
+ * This attribute defines the allowed items in an instance array, and
96
+ * MUST be a schema or an array of schemas. The default value is an
97
+ * empty schema which allows any value for items in the instance array.
98
+ *
99
+ * When this attribute value is a schema and the instance value is an
100
+ * array, then all the items in the array MUST be valid according to the
101
+ * schema.
102
+ *
103
+ * When this attribute value is an array of schemas and the instance
104
+ * value is an array, each position in the instance array MUST conform
105
+ * to the schema in the corresponding position for this array. This
106
+ * called tuple typing. When tuple typing is used, additional items are
107
+ * allowed, disallowed, or constrained by the "additionalItems"
108
+ * (Section 5.6) attribute using the same rules as
109
+ * "additionalProperties" (Section 5.4) for objects.
110
+ *
111
+ * @see https://tools.ietf.org/html/draft-zyp-json-schema-03#section-5.5
112
+ */
113
+ items?: JSONSchema4 | JSONSchema4[] | undefined;
114
+ maxItems?: number | undefined;
115
+ minItems?: number | undefined;
116
+ uniqueItems?: boolean | undefined;
117
+ maxProperties?: number | undefined;
118
+ minProperties?: number | undefined;
119
+ /**
120
+ * This attribute indicates if the instance must have a value, and not
121
+ * be undefined. This is false by default, making the instance
122
+ * optional.
123
+ *
124
+ * @see https://tools.ietf.org/html/draft-zyp-json-schema-03#section-5.7
125
+ */
126
+ required?: boolean | string[] | undefined;
127
+ /**
128
+ * This attribute defines a schema for all properties that are not
129
+ * explicitly defined in an object type definition. If specified, the
130
+ * value MUST be a schema or a boolean. If false is provided, no
131
+ * additional properties are allowed beyond the properties defined in
132
+ * the schema. The default value is an empty schema which allows any
133
+ * value for additional properties.
134
+ *
135
+ * @see https://tools.ietf.org/html/draft-zyp-json-schema-03#section-5.4
136
+ */
137
+ additionalProperties?: boolean | JSONSchema4 | undefined;
138
+ definitions?: {
139
+ [k: string]: JSONSchema4;
140
+ } | undefined;
141
+ /**
142
+ * This attribute is an object with property definitions that define the
143
+ * valid values of instance object property values. When the instance
144
+ * value is an object, the property values of the instance object MUST
145
+ * conform to the property definitions in this object. In this object,
146
+ * each property definition's value MUST be a schema, and the property's
147
+ * name MUST be the name of the instance property that it defines. The
148
+ * instance property value MUST be valid according to the schema from
149
+ * the property definition. Properties are considered unordered, the
150
+ * order of the instance properties MAY be in any order.
151
+ *
152
+ * @see https://tools.ietf.org/html/draft-zyp-json-schema-03#section-5.2
153
+ */
154
+ properties?: {
155
+ [k: string]: JSONSchema4;
156
+ } | undefined;
157
+ /**
158
+ * This attribute is an object that defines the schema for a set of
159
+ * property names of an object instance. The name of each property of
160
+ * this attribute's object is a regular expression pattern in the ECMA
161
+ * 262/Perl 5 format, while the value is a schema. If the pattern
162
+ * matches the name of a property on the instance object, the value of
163
+ * the instance's property MUST be valid against the pattern name's
164
+ * schema value.
165
+ *
166
+ * @see https://tools.ietf.org/html/draft-zyp-json-schema-03#section-5.3
167
+ */
168
+ patternProperties?: {
169
+ [k: string]: JSONSchema4;
170
+ } | undefined;
171
+ dependencies?: {
172
+ [k: string]: JSONSchema4 | string[];
173
+ } | undefined;
174
+ /**
175
+ * This provides an enumeration of all possible values that are valid
176
+ * for the instance property. This MUST be an array, and each item in
177
+ * the array represents a possible value for the instance value. If
178
+ * this attribute is defined, the instance value MUST be one of the
179
+ * values in the array in order for the schema to be valid.
180
+ *
181
+ * @see https://tools.ietf.org/html/draft-zyp-json-schema-03#section-5.19
182
+ */
183
+ enum?: JSONSchema4Type[] | undefined;
184
+ /**
185
+ * A single type, or a union of simple types
186
+ */
187
+ type?: JSONSchema4TypeName | JSONSchema4TypeName[] | undefined;
188
+ allOf?: JSONSchema4[] | undefined;
189
+ anyOf?: JSONSchema4[] | undefined;
190
+ oneOf?: JSONSchema4[] | undefined;
191
+ not?: JSONSchema4 | undefined;
192
+ /**
193
+ * The value of this property MUST be another schema which will provide
194
+ * a base schema which the current schema will inherit from. The
195
+ * inheritance rules are such that any instance that is valid according
196
+ * to the current schema MUST be valid according to the referenced
197
+ * schema. This MAY also be an array, in which case, the instance MUST
198
+ * be valid for all the schemas in the array. A schema that extends
199
+ * another schema MAY define additional attributes, constrain existing
200
+ * attributes, or add other constraints.
201
+ *
202
+ * Conceptually, the behavior of extends can be seen as validating an
203
+ * instance against all constraints in the extending schema as well as
204
+ * the extended schema(s).
205
+ *
206
+ * @see https://tools.ietf.org/html/draft-zyp-json-schema-03#section-5.26
207
+ */
208
+ extends?: string | string[] | undefined;
209
+ /**
210
+ * @see https://tools.ietf.org/html/draft-zyp-json-schema-04#section-5.6
211
+ */
212
+ [k: string]: any;
213
+ format?: string | undefined;
214
+ }
215
+ //#endregion
216
+ //#region src-js/plugins/json.d.ts
217
+ /**
218
+ * A JSON value.
219
+ */
220
+ type JsonValue = JsonObject | JsonValue[] | string | number | boolean | null;
221
+ /**
222
+ * A JSON object.
223
+ */
224
+ type JsonObject = {
225
+ [key: string]: JsonValue;
226
+ };
227
+ //#endregion
228
+ //#region src-js/plugins/options.d.ts
229
+ /**
230
+ * Options for a rule on a file.
231
+ */
232
+ type Options = JsonValue[];
233
+ /**
234
+ * Schema describing valid options for a rule.
235
+ * `schema` property of `RuleMeta`.
236
+ *
237
+ * Can be one of:
238
+ * - `JSONSchema4` - Full JSON Schema object (must have `type: "array"` at root).
239
+ * - `JSONSchema4[]` - Array shorthand where each element describes corresponding options element.
240
+ * - `false` - Opts out of schema validation (not recommended).
241
+ */
242
+ type RuleOptionsSchema = JSONSchema4 | JSONSchema4[] | false;
243
+ //#endregion
244
+ //#region ../../node_modules/.pnpm/type-fest@5.4.2/node_modules/type-fest/source/is-any.d.ts
245
+ /**
246
+ Returns a boolean for whether the given type is `any`.
247
+
248
+ @link https://stackoverflow.com/a/49928360/1490091
249
+
250
+ Useful in type utilities, such as disallowing `any`s to be passed to a function.
251
+
252
+ @example
253
+ ```
254
+ import type {IsAny} from 'type-fest';
255
+
256
+ const typedObject = {a: 1, b: 2} as const;
257
+ const anyObject: any = {a: 1, b: 2};
258
+
259
+ function get<O extends (IsAny<O> extends true ? {} : Record<string, number>), K extends keyof O = keyof O>(object: O, key: K) {
260
+ return object[key];
261
+ }
262
+
263
+ const typedA = get(typedObject, 'a');
264
+ //=> 1
265
+
266
+ const anyA = get(anyObject, 'a');
267
+ //=> any
268
+ ```
269
+
270
+ @category Type Guard
271
+ @category Utilities
272
+ */
273
+ type IsAny<T> = 0 extends 1 & NoInfer<T> ? true : false;
274
+ //#endregion
275
+ //#region ../../node_modules/.pnpm/type-fest@5.4.2/node_modules/type-fest/source/is-optional-key-of.d.ts
276
+ /**
277
+ Returns a boolean for whether the given key is an optional key of type.
278
+
279
+ This is useful when writing utility types or schema validators that need to differentiate `optional` keys.
280
+
281
+ @example
282
+ ```
283
+ import type {IsOptionalKeyOf} from 'type-fest';
284
+
285
+ type User = {
286
+ name: string;
287
+ surname: string;
288
+
289
+ luckyNumber?: number;
290
+ };
291
+
292
+ type Admin = {
293
+ name: string;
294
+ surname?: string;
295
+ };
296
+
297
+ type T1 = IsOptionalKeyOf<User, 'luckyNumber'>;
298
+ //=> true
299
+
300
+ type T2 = IsOptionalKeyOf<User, 'name'>;
301
+ //=> false
302
+
303
+ type T3 = IsOptionalKeyOf<User, 'name' | 'luckyNumber'>;
304
+ //=> boolean
305
+
306
+ type T4 = IsOptionalKeyOf<User | Admin, 'name'>;
307
+ //=> false
308
+
309
+ type T5 = IsOptionalKeyOf<User | Admin, 'surname'>;
310
+ //=> boolean
311
+ ```
312
+
313
+ @category Type Guard
314
+ @category Utilities
315
+ */
316
+ type IsOptionalKeyOf<Type extends object, Key extends keyof Type> = IsAny<Type | Key> extends true ? never : Key extends keyof Type ? Type extends Record<Key, Type[Key]> ? false : true : false;
317
+ //#endregion
318
+ //#region ../../node_modules/.pnpm/type-fest@5.4.2/node_modules/type-fest/source/optional-keys-of.d.ts
319
+ /**
320
+ Extract all optional keys from the given type.
321
+
322
+ This is useful when you want to create a new type that contains different type values for the optional keys only.
323
+
324
+ @example
325
+ ```
326
+ import type {OptionalKeysOf, Except} from 'type-fest';
327
+
328
+ type User = {
329
+ name: string;
330
+ surname: string;
331
+
332
+ luckyNumber?: number;
333
+ };
334
+
335
+ const REMOVE_FIELD = Symbol('remove field symbol');
336
+ type UpdateOperation<Entity extends object> = Except<Partial<Entity>, OptionalKeysOf<Entity>> & {
337
+ [Key in OptionalKeysOf<Entity>]?: Entity[Key] | typeof REMOVE_FIELD;
338
+ };
339
+
340
+ const update1: UpdateOperation<User> = {
341
+ name: 'Alice',
342
+ };
343
+
344
+ const update2: UpdateOperation<User> = {
345
+ name: 'Bob',
346
+ luckyNumber: REMOVE_FIELD,
347
+ };
348
+ ```
349
+
350
+ @category Utilities
351
+ */
352
+ type OptionalKeysOf<Type extends object> = Type extends unknown // For distributing `Type`
353
+ ? (keyof { [Key in keyof Type as IsOptionalKeyOf<Type, Key> extends false ? never : Key]: never }) & keyof Type // Intersect with `keyof Type` to ensure result of `OptionalKeysOf<Type>` is always assignable to `keyof Type`
354
+ : never;
355
+ //#endregion
356
+ //#region ../../node_modules/.pnpm/type-fest@5.4.2/node_modules/type-fest/source/required-keys-of.d.ts
357
+ /**
358
+ Extract all required keys from the given type.
359
+
360
+ This is useful when you want to create a new type that contains different type values for the required keys only or use the list of keys for validation purposes, etc...
361
+
362
+ @example
363
+ ```
364
+ import type {RequiredKeysOf} from 'type-fest';
365
+
366
+ declare function createValidation<
367
+ Entity extends object,
368
+ Key extends RequiredKeysOf<Entity> = RequiredKeysOf<Entity>,
369
+ >(field: Key, validator: (value: Entity[Key]) => boolean): (entity: Entity) => boolean;
370
+
371
+ type User = {
372
+ name: string;
373
+ surname: string;
374
+ luckyNumber?: number;
375
+ };
376
+
377
+ const validator1 = createValidation<User>('name', value => value.length < 25);
378
+ const validator2 = createValidation<User>('surname', value => value.length < 25);
379
+
380
+ // @ts-expect-error
381
+ const validator3 = createValidation<User>('luckyNumber', value => value > 0);
382
+ // Error: Argument of type '"luckyNumber"' is not assignable to parameter of type '"name" | "surname"'.
383
+ ```
384
+
385
+ @category Utilities
386
+ */
387
+ type RequiredKeysOf<Type extends object> = Type extends unknown // For distributing `Type`
388
+ ? Exclude<keyof Type, OptionalKeysOf<Type>> : never;
389
+ //#endregion
390
+ //#region ../../node_modules/.pnpm/type-fest@5.4.2/node_modules/type-fest/source/is-never.d.ts
391
+ /**
392
+ Returns a boolean for whether the given type is `never`.
393
+
394
+ @link https://github.com/microsoft/TypeScript/issues/31751#issuecomment-498526919
395
+ @link https://stackoverflow.com/a/53984913/10292952
396
+ @link https://www.zhenghao.io/posts/ts-never
397
+
398
+ Useful in type utilities, such as checking if something does not occur.
399
+
400
+ @example
401
+ ```
402
+ import type {IsNever, And} from 'type-fest';
403
+
404
+ type A = IsNever<never>;
405
+ //=> true
406
+
407
+ type B = IsNever<any>;
408
+ //=> false
409
+
410
+ type C = IsNever<unknown>;
411
+ //=> false
412
+
413
+ type D = IsNever<never[]>;
414
+ //=> false
415
+
416
+ type E = IsNever<object>;
417
+ //=> false
418
+
419
+ type F = IsNever<string>;
420
+ //=> false
421
+ ```
422
+
423
+ @example
424
+ ```
425
+ import type {IsNever} from 'type-fest';
426
+
427
+ type IsTrue<T> = T extends true ? true : false;
428
+
429
+ // When a distributive conditional is instantiated with `never`, the entire conditional results in `never`.
430
+ type A = IsTrue<never>;
431
+ //=> never
432
+
433
+ // If you don't want that behaviour, you can explicitly add an `IsNever` check before the distributive conditional.
434
+ type IsTrueFixed<T> =
435
+ IsNever<T> extends true ? false : T extends true ? true : false;
436
+
437
+ type B = IsTrueFixed<never>;
438
+ //=> false
439
+ ```
440
+
441
+ @category Type Guard
442
+ @category Utilities
443
+ */
444
+ type IsNever<T> = [T] extends [never] ? true : false;
445
+ //#endregion
446
+ //#region ../../node_modules/.pnpm/type-fest@5.4.2/node_modules/type-fest/source/if.d.ts
447
+ /**
448
+ An if-else-like type that resolves depending on whether the given `boolean` type is `true` or `false`.
449
+
450
+ Use-cases:
451
+ - You can use this in combination with `Is*` types to create an if-else-like experience. For example, `If<IsAny<any>, 'is any', 'not any'>`.
452
+
453
+ Note:
454
+ - Returns a union of if branch and else branch if the given type is `boolean` or `any`. For example, `If<boolean, 'Y', 'N'>` will return `'Y' | 'N'`.
455
+ - Returns the else branch if the given type is `never`. For example, `If<never, 'Y', 'N'>` will return `'N'`.
456
+
457
+ @example
458
+ ```
459
+ import type {If} from 'type-fest';
460
+
461
+ type A = If<true, 'yes', 'no'>;
462
+ //=> 'yes'
463
+
464
+ type B = If<false, 'yes', 'no'>;
465
+ //=> 'no'
466
+
467
+ type C = If<boolean, 'yes', 'no'>;
468
+ //=> 'yes' | 'no'
469
+
470
+ type D = If<any, 'yes', 'no'>;
471
+ //=> 'yes' | 'no'
472
+
473
+ type E = If<never, 'yes', 'no'>;
474
+ //=> 'no'
475
+ ```
476
+
477
+ @example
478
+ ```
479
+ import type {If, IsAny, IsNever} from 'type-fest';
480
+
481
+ type A = If<IsAny<unknown>, 'is any', 'not any'>;
482
+ //=> 'not any'
483
+
484
+ type B = If<IsNever<never>, 'is never', 'not never'>;
485
+ //=> 'is never'
486
+ ```
487
+
488
+ @example
489
+ ```
490
+ import type {If, IsEqual} from 'type-fest';
491
+
492
+ type IfEqual<T, U, IfBranch, ElseBranch> = If<IsEqual<T, U>, IfBranch, ElseBranch>;
493
+
494
+ type A = IfEqual<string, string, 'equal', 'not equal'>;
495
+ //=> 'equal'
496
+
497
+ type B = IfEqual<string, number, 'equal', 'not equal'>;
498
+ //=> 'not equal'
499
+ ```
500
+
501
+ Note: Sometimes using the `If` type can make an implementation non–tail-recursive, which can impact performance. In such cases, it’s better to use a conditional directly. Refer to the following example:
502
+
503
+ @example
504
+ ```
505
+ import type {If, IsEqual, StringRepeat} from 'type-fest';
506
+
507
+ type HundredZeroes = StringRepeat<'0', 100>;
508
+
509
+ // The following implementation is not tail recursive
510
+ type Includes<S extends string, Char extends string> =
511
+ S extends `${infer First}${infer Rest}`
512
+ ? If<IsEqual<First, Char>,
513
+ 'found',
514
+ Includes<Rest, Char>>
515
+ : 'not found';
516
+
517
+ // Hence, instantiations with long strings will fail
518
+ // @ts-expect-error
519
+ type Fails = Includes<HundredZeroes, '1'>;
520
+ // ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
521
+ // Error: Type instantiation is excessively deep and possibly infinite.
522
+
523
+ // However, if we use a simple conditional instead of `If`, the implementation becomes tail-recursive
524
+ type IncludesWithoutIf<S extends string, Char extends string> =
525
+ S extends `${infer First}${infer Rest}`
526
+ ? IsEqual<First, Char> extends true
527
+ ? 'found'
528
+ : IncludesWithoutIf<Rest, Char>
529
+ : 'not found';
530
+
531
+ // Now, instantiations with long strings will work
532
+ type Works = IncludesWithoutIf<HundredZeroes, '1'>;
533
+ //=> 'not found'
534
+ ```
535
+
536
+ @category Type Guard
537
+ @category Utilities
538
+ */
539
+ type If<Type extends boolean, IfBranch, ElseBranch> = IsNever<Type> extends true ? ElseBranch : Type extends true ? IfBranch : ElseBranch;
540
+ //#endregion
541
+ //#region ../../node_modules/.pnpm/type-fest@5.4.2/node_modules/type-fest/source/internal/type.d.ts
542
+ /**
543
+ An if-else-like type that resolves depending on whether the given type is `any` or `never`.
544
+
545
+ @example
546
+ ```
547
+ // When `T` is a NOT `any` or `never` (like `string`) => Returns `IfNotAnyOrNever` branch
548
+ type A = IfNotAnyOrNever<string, 'VALID', 'IS_ANY', 'IS_NEVER'>;
549
+ //=> 'VALID'
550
+
551
+ // When `T` is `any` => Returns `IfAny` branch
552
+ type B = IfNotAnyOrNever<any, 'VALID', 'IS_ANY', 'IS_NEVER'>;
553
+ //=> 'IS_ANY'
554
+
555
+ // When `T` is `never` => Returns `IfNever` branch
556
+ type C = IfNotAnyOrNever<never, 'VALID', 'IS_ANY', 'IS_NEVER'>;
557
+ //=> 'IS_NEVER'
558
+ ```
559
+
560
+ Note: Wrapping a tail-recursive type with `IfNotAnyOrNever` makes the implementation non-tail-recursive. To fix this, move the recursion into a helper type. Refer to the following example:
561
+
562
+ @example
563
+ ```ts
564
+ import type {StringRepeat} from 'type-fest';
565
+
566
+ type NineHundredNinetyNineSpaces = StringRepeat<' ', 999>;
567
+
568
+ // The following implementation is not tail recursive
569
+ type TrimLeft<S extends string> = IfNotAnyOrNever<S, S extends ` ${infer R}` ? TrimLeft<R> : S>;
570
+
571
+ // Hence, instantiations with long strings will fail
572
+ // @ts-expect-error
573
+ type T1 = TrimLeft<NineHundredNinetyNineSpaces>;
574
+ // ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
575
+ // Error: Type instantiation is excessively deep and possibly infinite.
576
+
577
+ // To fix this, move the recursion into a helper type
578
+ type TrimLeftOptimised<S extends string> = IfNotAnyOrNever<S, _TrimLeftOptimised<S>>;
579
+
580
+ type _TrimLeftOptimised<S extends string> = S extends ` ${infer R}` ? _TrimLeftOptimised<R> : S;
581
+
582
+ type T2 = TrimLeftOptimised<NineHundredNinetyNineSpaces>;
583
+ //=> ''
584
+ ```
585
+ */
586
+ type IfNotAnyOrNever<T, IfNotAnyOrNever, IfAny = any, IfNever = never> = If<IsAny<T>, IfAny, If<IsNever<T>, IfNever, IfNotAnyOrNever>>;
587
+ //#endregion
588
+ //#region ../../node_modules/.pnpm/type-fest@5.4.2/node_modules/type-fest/source/simplify.d.ts
589
+ /**
590
+ Useful to flatten the type output to improve type hints shown in editors. And also to transform an interface into a type to aide with assignability.
591
+
592
+ @example
593
+ ```
594
+ import type {Simplify} from 'type-fest';
595
+
596
+ type PositionProps = {
597
+ top: number;
598
+ left: number;
599
+ };
600
+
601
+ type SizeProps = {
602
+ width: number;
603
+ height: number;
604
+ };
605
+
606
+ // In your editor, hovering over `Props` will show a flattened object with all the properties.
607
+ type Props = Simplify<PositionProps & SizeProps>;
608
+ ```
609
+
610
+ Sometimes it is desired to pass a value as a function argument that has a different type. At first inspection it may seem assignable, and then you discover it is not because the `value`'s type definition was defined as an interface. In the following example, `fn` requires an argument of type `Record<string, unknown>`. If the value is defined as a literal, then it is assignable. And if the `value` is defined as type using the `Simplify` utility the value is assignable. But if the `value` is defined as an interface, it is not assignable because the interface is not sealed and elsewhere a non-string property could be added to the interface.
611
+
612
+ If the type definition must be an interface (perhaps it was defined in a third-party npm package), then the `value` can be defined as `const value: Simplify<SomeInterface> = ...`. Then `value` will be assignable to the `fn` argument. Or the `value` can be cast as `Simplify<SomeInterface>` if you can't re-declare the `value`.
613
+
614
+ @example
615
+ ```
616
+ import type {Simplify} from 'type-fest';
617
+
618
+ interface SomeInterface {
619
+ foo: number;
620
+ bar?: string;
621
+ baz: number | undefined;
622
+ }
623
+
624
+ type SomeType = {
625
+ foo: number;
626
+ bar?: string;
627
+ baz: number | undefined;
628
+ };
629
+
630
+ const literal = {foo: 123, bar: 'hello', baz: 456};
631
+ const someType: SomeType = literal;
632
+ const someInterface: SomeInterface = literal;
633
+
634
+ declare function fn(object: Record<string, unknown>): void;
635
+
636
+ fn(literal); // Good: literal object type is sealed
637
+ fn(someType); // Good: type is sealed
638
+ // @ts-expect-error
639
+ fn(someInterface); // Error: Index signature for type 'string' is missing in type 'someInterface'. Because `interface` can be re-opened
640
+ fn(someInterface as Simplify<SomeInterface>); // Good: transform an `interface` into a `type`
641
+ ```
642
+
643
+ @link https://github.com/microsoft/TypeScript/issues/15300
644
+ @see {@link SimplifyDeep}
645
+ @category Object
646
+ */
647
+ type Simplify<T> = { [KeyType in keyof T]: T[KeyType] } & {};
648
+ //#endregion
649
+ //#region ../../node_modules/.pnpm/type-fest@5.4.2/node_modules/type-fest/source/is-equal.d.ts
650
+ /**
651
+ Returns a boolean for whether the two given types are equal.
652
+
653
+ @link https://github.com/microsoft/TypeScript/issues/27024#issuecomment-421529650
654
+ @link https://stackoverflow.com/questions/68961864/how-does-the-equals-work-in-typescript/68963796#68963796
655
+
656
+ Use-cases:
657
+ - If you want to make a conditional branch based on the result of a comparison of two types.
658
+
659
+ @example
660
+ ```
661
+ import type {IsEqual} from 'type-fest';
662
+
663
+ // This type returns a boolean for whether the given array includes the given item.
664
+ // `IsEqual` is used to compare the given array at position 0 and the given item and then return true if they are equal.
665
+ type Includes<Value extends readonly any[], Item> =
666
+ Value extends readonly [Value[0], ...infer rest]
667
+ ? IsEqual<Value[0], Item> extends true
668
+ ? true
669
+ : Includes<rest, Item>
670
+ : false;
671
+ ```
672
+
673
+ @category Type Guard
674
+ @category Utilities
675
+ */
676
+ type IsEqual<A, B> = [A] extends [B] ? [B] extends [A] ? _IsEqual<A, B> : false : false;
677
+ // This version fails the `equalWrappedTupleIntersectionToBeNeverAndNeverExpanded` test in `test-d/is-equal.ts`.
678
+ type _IsEqual<A, B> = (<G>() => G extends A & G | G ? 1 : 2) extends (<G>() => G extends B & G | G ? 1 : 2) ? true : false;
679
+ //#endregion
680
+ //#region ../../node_modules/.pnpm/type-fest@5.4.2/node_modules/type-fest/source/omit-index-signature.d.ts
681
+ /**
682
+ Omit any index signatures from the given object type, leaving only explicitly defined properties.
683
+
684
+ This is the counterpart of `PickIndexSignature`.
685
+
686
+ Use-cases:
687
+ - Remove overly permissive signatures from third-party types.
688
+
689
+ This type was taken from this [StackOverflow answer](https://stackoverflow.com/a/68261113/420747).
690
+
691
+ It relies on the fact that an empty object (`{}`) is assignable to an object with just an index signature, like `Record<string, unknown>`, but not to an object with explicitly defined keys, like `Record<'foo' | 'bar', unknown>`.
692
+
693
+ (The actual value type, `unknown`, is irrelevant and could be any type. Only the key type matters.)
694
+
695
+ ```
696
+ const indexed: Record<string, unknown> = {}; // Allowed
697
+
698
+ // @ts-expect-error
699
+ const keyed: Record<'foo', unknown> = {}; // Error
700
+ // TS2739: Type '{}' is missing the following properties from type 'Record<"foo" | "bar", unknown>': foo, bar
701
+ ```
702
+
703
+ Instead of causing a type error like the above, you can also use a [conditional type](https://www.typescriptlang.org/docs/handbook/2/conditional-types.html) to test whether a type is assignable to another:
704
+
705
+ ```
706
+ type Indexed = {} extends Record<string, unknown>
707
+ ? '✅ `{}` is assignable to `Record<string, unknown>`'
708
+ : '❌ `{}` is NOT assignable to `Record<string, unknown>`';
709
+
710
+ type IndexedResult = Indexed;
711
+ //=> '✅ `{}` is assignable to `Record<string, unknown>`'
712
+
713
+ type Keyed = {} extends Record<'foo' | 'bar', unknown>
714
+ ? '✅ `{}` is assignable to `Record<\'foo\' | \'bar\', unknown>`'
715
+ : '❌ `{}` is NOT assignable to `Record<\'foo\' | \'bar\', unknown>`';
716
+
717
+ type KeyedResult = Keyed;
718
+ //=> '❌ `{}` is NOT assignable to `Record<\'foo\' | \'bar\', unknown>`'
719
+ ```
720
+
721
+ Using a [mapped type](https://www.typescriptlang.org/docs/handbook/2/mapped-types.html#further-exploration), you can then check for each `KeyType` of `ObjectType`...
722
+
723
+ ```
724
+ type OmitIndexSignature<ObjectType> = {
725
+ [KeyType in keyof ObjectType // Map each key of `ObjectType`...
726
+ ]: ObjectType[KeyType]; // ...to its original value, i.e. `OmitIndexSignature<Foo> == Foo`.
727
+ };
728
+ ```
729
+
730
+ ...whether an empty object (`{}`) would be assignable to an object with that `KeyType` (`Record<KeyType, unknown>`)...
731
+
732
+ ```
733
+ type OmitIndexSignature<ObjectType> = {
734
+ [KeyType in keyof ObjectType
735
+ // Is `{}` assignable to `Record<KeyType, unknown>`?
736
+ as {} extends Record<KeyType, unknown>
737
+ ? never // ✅ `{}` is assignable to `Record<KeyType, unknown>`
738
+ : KeyType // ❌ `{}` is NOT assignable to `Record<KeyType, unknown>`
739
+ ]: ObjectType[KeyType];
740
+ };
741
+ ```
742
+
743
+ If `{}` is assignable, it means that `KeyType` is an index signature and we want to remove it. If it is not assignable, `KeyType` is a "real" key and we want to keep it.
744
+
745
+ @example
746
+ ```
747
+ import type {OmitIndexSignature} from 'type-fest';
748
+
749
+ type Example = {
750
+ // These index signatures will be removed.
751
+ [x: string]: any;
752
+ [x: number]: any;
753
+ [x: symbol]: any;
754
+ [x: `head-${string}`]: string;
755
+ [x: `${string}-tail`]: string;
756
+ [x: `head-${string}-tail`]: string;
757
+ [x: `${bigint}`]: string;
758
+ [x: `embedded-${number}`]: string;
759
+
760
+ // These explicitly defined keys will remain.
761
+ foo: 'bar';
762
+ qux?: 'baz';
763
+ };
764
+
765
+ type ExampleWithoutIndexSignatures = OmitIndexSignature<Example>;
766
+ //=> {foo: 'bar'; qux?: 'baz'}
767
+ ```
768
+
769
+ @see {@link PickIndexSignature}
770
+ @category Object
771
+ */
772
+ type OmitIndexSignature<ObjectType> = { [KeyType in keyof ObjectType as {} extends Record<KeyType, unknown> ? never : KeyType]: ObjectType[KeyType] };
773
+ //#endregion
774
+ //#region ../../node_modules/.pnpm/type-fest@5.4.2/node_modules/type-fest/source/pick-index-signature.d.ts
775
+ /**
776
+ Pick only index signatures from the given object type, leaving out all explicitly defined properties.
777
+
778
+ This is the counterpart of `OmitIndexSignature`.
779
+
780
+ @example
781
+ ```
782
+ import type {PickIndexSignature} from 'type-fest';
783
+
784
+ declare const symbolKey: unique symbol;
785
+
786
+ type Example = {
787
+ // These index signatures will remain.
788
+ [x: string]: unknown;
789
+ [x: number]: unknown;
790
+ [x: symbol]: unknown;
791
+ [x: `head-${string}`]: string;
792
+ [x: `${string}-tail`]: string;
793
+ [x: `head-${string}-tail`]: string;
794
+ [x: `${bigint}`]: string;
795
+ [x: `embedded-${number}`]: string;
796
+
797
+ // These explicitly defined keys will be removed.
798
+ ['kebab-case-key']: string;
799
+ [symbolKey]: string;
800
+ foo: 'bar';
801
+ qux?: 'baz';
802
+ };
803
+
804
+ type ExampleIndexSignature = PickIndexSignature<Example>;
805
+ // {
806
+ // [x: string]: unknown;
807
+ // [x: number]: unknown;
808
+ // [x: symbol]: unknown;
809
+ // [x: `head-${string}`]: string;
810
+ // [x: `${string}-tail`]: string;
811
+ // [x: `head-${string}-tail`]: string;
812
+ // [x: `${bigint}`]: string;
813
+ // [x: `embedded-${number}`]: string;
814
+ // }
815
+ ```
816
+
817
+ @see {@link OmitIndexSignature}
818
+ @category Object
819
+ */
820
+ type PickIndexSignature<ObjectType> = { [KeyType in keyof ObjectType as {} extends Record<KeyType, unknown> ? KeyType : never]: ObjectType[KeyType] };
821
+ //#endregion
822
+ //#region ../../node_modules/.pnpm/type-fest@5.4.2/node_modules/type-fest/source/merge.d.ts
823
+ // Merges two objects without worrying about index signatures.
824
+ type SimpleMerge<Destination, Source> = Simplify<{ [Key in keyof Destination as Key extends keyof Source ? never : Key]: Destination[Key] } & Source>;
825
+ /**
826
+ Merge two types into a new type. Keys of the second type overrides keys of the first type.
827
+
828
+ @example
829
+ ```
830
+ import type {Merge} from 'type-fest';
831
+
832
+ type Foo = {
833
+ [x: string]: unknown;
834
+ [x: number]: unknown;
835
+ foo: string;
836
+ bar: symbol;
837
+ };
838
+
839
+ type Bar = {
840
+ [x: number]: number;
841
+ [x: symbol]: unknown;
842
+ bar: Date;
843
+ baz: boolean;
844
+ };
845
+
846
+ export type FooBar = Merge<Foo, Bar>;
847
+ //=> {
848
+ // [x: string]: unknown;
849
+ // [x: number]: number;
850
+ // [x: symbol]: unknown;
851
+ // foo: string;
852
+ // bar: Date;
853
+ // baz: boolean;
854
+ // }
855
+ ```
856
+
857
+ Note: If you want a merge type that more accurately reflects the runtime behavior of object spread or `Object.assign`, refer to the {@link ObjectMerge} type.
858
+
859
+ @see {@link ObjectMerge}
860
+ @category Object
861
+ */
862
+ type Merge<Destination, Source> = Destination extends unknown // For distributing `Destination`
863
+ ? Source extends unknown // For distributing `Source`
864
+ ? Simplify<SimpleMerge<PickIndexSignature<Destination>, PickIndexSignature<Source>> & SimpleMerge<OmitIndexSignature<Destination>, OmitIndexSignature<Source>>> : never // Should never happen
865
+ : never;
866
+ //#endregion
867
+ //#region ../../node_modules/.pnpm/type-fest@5.4.2/node_modules/type-fest/source/internal/object.d.ts
868
+ /**
869
+ Merges user specified options with default options.
870
+
871
+ @example
872
+ ```
873
+ type PathsOptions = {maxRecursionDepth?: number; leavesOnly?: boolean};
874
+ type DefaultPathsOptions = {maxRecursionDepth: 10; leavesOnly: false};
875
+ type SpecifiedOptions = {leavesOnly: true};
876
+
877
+ type Result = ApplyDefaultOptions<PathsOptions, DefaultPathsOptions, SpecifiedOptions>;
878
+ //=> {maxRecursionDepth: 10; leavesOnly: true}
879
+ ```
880
+
881
+ @example
882
+ ```
883
+ // Complains if default values are not provided for optional options
884
+
885
+ type PathsOptions = {maxRecursionDepth?: number; leavesOnly?: boolean};
886
+ type DefaultPathsOptions = {maxRecursionDepth: 10};
887
+ type SpecifiedOptions = {};
888
+
889
+ type Result = ApplyDefaultOptions<PathsOptions, DefaultPathsOptions, SpecifiedOptions>;
890
+ // ~~~~~~~~~~~~~~~~~~~
891
+ // Property 'leavesOnly' is missing in type 'DefaultPathsOptions' but required in type '{ maxRecursionDepth: number; leavesOnly: boolean; }'.
892
+ ```
893
+
894
+ @example
895
+ ```
896
+ // Complains if an option's default type does not conform to the expected type
897
+
898
+ type PathsOptions = {maxRecursionDepth?: number; leavesOnly?: boolean};
899
+ type DefaultPathsOptions = {maxRecursionDepth: 10; leavesOnly: 'no'};
900
+ type SpecifiedOptions = {};
901
+
902
+ type Result = ApplyDefaultOptions<PathsOptions, DefaultPathsOptions, SpecifiedOptions>;
903
+ // ~~~~~~~~~~~~~~~~~~~
904
+ // Types of property 'leavesOnly' are incompatible. Type 'string' is not assignable to type 'boolean'.
905
+ ```
906
+
907
+ @example
908
+ ```
909
+ // Complains if an option's specified type does not conform to the expected type
910
+
911
+ type PathsOptions = {maxRecursionDepth?: number; leavesOnly?: boolean};
912
+ type DefaultPathsOptions = {maxRecursionDepth: 10; leavesOnly: false};
913
+ type SpecifiedOptions = {leavesOnly: 'yes'};
914
+
915
+ type Result = ApplyDefaultOptions<PathsOptions, DefaultPathsOptions, SpecifiedOptions>;
916
+ // ~~~~~~~~~~~~~~~~
917
+ // Types of property 'leavesOnly' are incompatible. Type 'string' is not assignable to type 'boolean'.
918
+ ```
919
+ */
920
+ type ApplyDefaultOptions<Options extends object, Defaults extends Simplify<Omit<Required<Options>, RequiredKeysOf<Options>> & Partial<Record<RequiredKeysOf<Options>, never>>>, SpecifiedOptions extends Options> = If<IsAny<SpecifiedOptions>, Defaults, If<IsNever<SpecifiedOptions>, Defaults, Simplify<Merge<Defaults, { [Key in keyof SpecifiedOptions as Key extends OptionalKeysOf<Options> ? undefined extends SpecifiedOptions[Key] ? never : Key : Key]: SpecifiedOptions[Key] }> & Required<Options>>>>;
921
+ //#endregion
922
+ //#region ../../node_modules/.pnpm/type-fest@5.4.2/node_modules/type-fest/source/except.d.ts
923
+ /**
924
+ Filter out keys from an object.
925
+
926
+ Returns `never` if `Exclude` is strictly equal to `Key`.
927
+ Returns `never` if `Key` extends `Exclude`.
928
+ Returns `Key` otherwise.
929
+
930
+ @example
931
+ ```
932
+ type Filtered = Filter<'foo', 'foo'>;
933
+ //=> never
934
+ ```
935
+
936
+ @example
937
+ ```
938
+ type Filtered = Filter<'bar', string>;
939
+ //=> never
940
+ ```
941
+
942
+ @example
943
+ ```
944
+ type Filtered = Filter<'bar', 'foo'>;
945
+ //=> 'bar'
946
+ ```
947
+
948
+ @see {Except}
949
+ */
950
+ type Filter<KeyType, ExcludeType> = IsEqual<KeyType, ExcludeType> extends true ? never : (KeyType extends ExcludeType ? never : KeyType);
951
+ type ExceptOptions = {
952
+ /**
953
+ Disallow assigning non-specified properties.
954
+ Note that any omitted properties in the resulting type will be present in autocomplete as `undefined`.
955
+ @default false
956
+ */
957
+ requireExactProps?: boolean;
958
+ };
959
+ type DefaultExceptOptions = {
960
+ requireExactProps: false;
961
+ };
962
+ /**
963
+ Create a type from an object type without certain keys.
964
+
965
+ We recommend setting the `requireExactProps` option to `true`.
966
+
967
+ This type is a stricter version of [`Omit`](https://www.typescriptlang.org/docs/handbook/release-notes/typescript-3-5.html#the-omit-helper-type). The `Omit` type does not restrict the omitted keys to be keys present on the given type, while `Except` does. The benefits of a stricter type are avoiding typos and allowing the compiler to pick up on rename refactors automatically.
968
+
969
+ This type was proposed to the TypeScript team, which declined it, saying they prefer that libraries implement stricter versions of the built-in types ([microsoft/TypeScript#30825](https://github.com/microsoft/TypeScript/issues/30825#issuecomment-523668235)).
970
+
971
+ @example
972
+ ```
973
+ import type {Except} from 'type-fest';
974
+
975
+ type Foo = {
976
+ a: number;
977
+ b: string;
978
+ };
979
+
980
+ type FooWithoutA = Except<Foo, 'a'>;
981
+ //=> {b: string}
982
+
983
+ // @ts-expect-error
984
+ const fooWithoutA: FooWithoutA = {a: 1, b: '2'};
985
+ // errors: 'a' does not exist in type '{ b: string; }'
986
+
987
+ type FooWithoutB = Except<Foo, 'b', {requireExactProps: true}>;
988
+ //=> {a: number} & Partial<Record<'b', never>>
989
+
990
+ // @ts-expect-error
991
+ const fooWithoutB: FooWithoutB = {a: 1, b: '2'};
992
+ // errors at 'b': Type 'string' is not assignable to type 'undefined'.
993
+
994
+ // The `Omit` utility type doesn't work when omitting specific keys from objects containing index signatures.
995
+
996
+ // Consider the following example:
997
+
998
+ type UserData = {
999
+ [metadata: string]: string;
1000
+ email: string;
1001
+ name: string;
1002
+ role: 'admin' | 'user';
1003
+ };
1004
+
1005
+ // `Omit` clearly doesn't behave as expected in this case:
1006
+ type PostPayload = Omit<UserData, 'email'>;
1007
+ //=> {[x: string]: string; [x: number]: string}
1008
+
1009
+ // In situations like this, `Except` works better.
1010
+ // It simply removes the `email` key while preserving all the other keys.
1011
+ type PostPayloadFixed = Except<UserData, 'email'>;
1012
+ //=> {[x: string]: string; name: string; role: 'admin' | 'user'}
1013
+ ```
1014
+
1015
+ @category Object
1016
+ */
1017
+ type Except<ObjectType, KeysType extends keyof ObjectType, Options extends ExceptOptions = {}> = _Except<ObjectType, KeysType, ApplyDefaultOptions<ExceptOptions, DefaultExceptOptions, Options>>;
1018
+ type _Except<ObjectType, KeysType extends keyof ObjectType, Options extends Required<ExceptOptions>> = { [KeyType in keyof ObjectType as Filter<KeyType, KeysType>]: ObjectType[KeyType] } & (Options['requireExactProps'] extends true ? Partial<Record<KeysType, never>> : {});
1019
+ //#endregion
1020
+ //#region ../../node_modules/.pnpm/type-fest@5.4.2/node_modules/type-fest/source/require-at-least-one.d.ts
1021
+ /**
1022
+ Create a type that requires at least one of the given keys. The remaining keys are kept as is.
1023
+
1024
+ @example
1025
+ ```
1026
+ import type {RequireAtLeastOne} from 'type-fest';
1027
+
1028
+ type Responder = {
1029
+ text?: () => string;
1030
+ json?: () => string;
1031
+ secure?: boolean;
1032
+ };
1033
+
1034
+ const responder: RequireAtLeastOne<Responder, 'text' | 'json'> = {
1035
+ json: () => '{"message": "ok"}',
1036
+ secure: true,
1037
+ };
1038
+ ```
1039
+
1040
+ @category Object
1041
+ */
1042
+ type RequireAtLeastOne<ObjectType, KeysType extends keyof ObjectType = keyof ObjectType> = IfNotAnyOrNever<ObjectType, If<IsNever<KeysType>, never, _RequireAtLeastOne<ObjectType, If<IsAny<KeysType>, keyof ObjectType, KeysType>>>>;
1043
+ type _RequireAtLeastOne<ObjectType, KeysType extends keyof ObjectType> = { // For each `Key` in `KeysType` make a mapped type:
1044
+ [Key in KeysType]-?: Required<Pick<ObjectType, Key>> & // 1. Make `Key`'s type required
1045
+ // 2. Make all other keys in `KeysType` optional
1046
+ Partial<Pick<ObjectType, Exclude<KeysType, Key>>> }[KeysType] & // 3. Add the remaining keys not in `KeysType`
1047
+ Except<ObjectType, KeysType>;
1048
+ //#endregion
1049
+ //#region src-js/plugins/tokens.d.ts
1050
+ /**
1051
+ * Options for various `SourceCode` methods e.g. `getFirstToken`.
1052
+ */
1053
+ interface SkipOptions {
1054
+ /** Number of skipping tokens */
1055
+ skip?: number;
1056
+ /** `true` to include comment tokens in the result */
1057
+ includeComments?: boolean;
1058
+ /** Function to filter tokens */
1059
+ filter?: FilterFn | null;
1060
+ }
1061
+ /**
1062
+ * Options for various `SourceCode` methods e.g. `getFirstTokens`.
1063
+ */
1064
+ interface CountOptions {
1065
+ /** Maximum number of tokens to return */
1066
+ count?: number;
1067
+ /** `true` to include comment tokens in the result */
1068
+ includeComments?: boolean;
1069
+ /** Function to filter tokens */
1070
+ filter?: FilterFn | null;
1071
+ }
1072
+ /**
1073
+ * Options for `getTokenByRangeStart`.
1074
+ */
1075
+ interface RangeOptions {
1076
+ /** `true` to include comment tokens in the result */
1077
+ includeComments?: boolean;
1078
+ }
1079
+ /**
1080
+ * Filter function, passed as `filter` property of `SkipOptions` and `CountOptions`.
1081
+ */
1082
+ type FilterFn = (token: TokenOrComment) => boolean;
1083
+ /**
1084
+ * AST token type.
1085
+ */
1086
+ type Token = BooleanToken | IdentifierToken | JSXIdentifierToken | JSXTextToken | KeywordToken | NullToken | NumericToken | PrivateIdentifierToken | PunctuatorToken | RegularExpressionToken | StringToken | TemplateToken;
1087
+ interface BaseToken extends Span {
1088
+ value: string;
1089
+ }
1090
+ interface BooleanToken extends BaseToken {
1091
+ type: "Boolean";
1092
+ }
1093
+ interface IdentifierToken extends BaseToken {
1094
+ type: "Identifier";
1095
+ }
1096
+ interface JSXIdentifierToken extends BaseToken {
1097
+ type: "JSXIdentifier";
1098
+ }
1099
+ interface JSXTextToken extends BaseToken {
1100
+ type: "JSXText";
1101
+ }
1102
+ interface KeywordToken extends BaseToken {
1103
+ type: "Keyword";
1104
+ }
1105
+ interface NullToken extends BaseToken {
1106
+ type: "Null";
1107
+ }
1108
+ interface NumericToken extends BaseToken {
1109
+ type: "Numeric";
1110
+ }
1111
+ interface PrivateIdentifierToken extends BaseToken {
1112
+ type: "PrivateIdentifier";
1113
+ }
1114
+ interface PunctuatorToken extends BaseToken {
1115
+ type: "Punctuator";
1116
+ }
1117
+ interface RegularExpressionToken extends BaseToken {
1118
+ type: "RegularExpression";
1119
+ regex: {
1120
+ flags: string;
1121
+ pattern: string;
1122
+ };
1123
+ }
1124
+ interface StringToken extends BaseToken {
1125
+ type: "String";
1126
+ }
1127
+ interface TemplateToken extends BaseToken {
1128
+ type: "Template";
1129
+ }
1130
+ type TokenOrComment = Token | Comment;
1131
+ /**
1132
+ * Get all tokens that are related to the given node.
1133
+ * @param node - The AST node.
1134
+ * @param countOptions? - Options object. If is a function, equivalent to `{ filter: fn }`.
1135
+ * @returns Array of `Token`s.
1136
+ */
1137
+ /**
1138
+ * Get all tokens that are related to the given node.
1139
+ * @param node - The AST node.
1140
+ * @param beforeCount? - The number of tokens before the node to retrieve.
1141
+ * @param afterCount? - The number of tokens after the node to retrieve.
1142
+ * @returns Array of `Token`s.
1143
+ */
1144
+ declare function getTokens(node: Node, countOptions?: CountOptions | number | FilterFn | null, afterCount?: number | null): TokenOrComment[];
1145
+ /**
1146
+ * Get the first token of the given node.
1147
+ * @param node - The AST node.
1148
+ * @param skipOptions? - Options object.
1149
+ * If is a number, equivalent to `{ skip: n }`.
1150
+ * If is a function, equivalent to `{ filter: fn }`.
1151
+ * @returns `Token`, or `null` if all were skipped.
1152
+ */
1153
+ declare function getFirstToken(node: Node, skipOptions?: SkipOptions | number | FilterFn | null): TokenOrComment | null;
1154
+ /**
1155
+ * Get the first tokens of the given node.
1156
+ * @param node - The AST node.
1157
+ * @param countOptions? - Options object.
1158
+ * If is a number, equivalent to `{ count: n }`.
1159
+ * If is a function, equivalent to `{ filter: fn }`.
1160
+ * @returns Array of `Token`s.
1161
+ */
1162
+ declare function getFirstTokens(node: Node, countOptions?: CountOptions | number | FilterFn | null): TokenOrComment[];
1163
+ /**
1164
+ * Get the last token of the given node.
1165
+ * @param node - The AST node.
1166
+ * @param skipOptions? - Options object.
1167
+ * If is a number, equivalent to `{ skip: n }`.
1168
+ * If is a function, equivalent to `{ filter: fn }`.
1169
+ * @returns `Token`, or `null` if all were skipped.
1170
+ */
1171
+ declare function getLastToken(node: Node, skipOptions?: SkipOptions | number | FilterFn | null): TokenOrComment | null;
1172
+ /**
1173
+ * Get the last tokens of the given node.
1174
+ * @param node - The AST node.
1175
+ * @param countOptions? - Options object.
1176
+ * If is a number, equivalent to `{ count: n }`.
1177
+ * If is a function, equivalent to `{ filter: fn }`.
1178
+ * @returns Array of `Token`s.
1179
+ */
1180
+ declare function getLastTokens(node: Node, countOptions?: CountOptions | number | FilterFn | null): TokenOrComment[];
1181
+ /**
1182
+ * Get the token that precedes a given node or token.
1183
+ * @param nodeOrToken - The AST node or token.
1184
+ * @param skipOptions? - Options object.
1185
+ * If is a number, equivalent to `{ skip: n }`.
1186
+ * If is a function, equivalent to `{ filter: fn }`.
1187
+ * @returns `Token`, or `null` if all were skipped.
1188
+ */
1189
+ declare function getTokenBefore(nodeOrToken: NodeOrToken, skipOptions?: SkipOptions | number | FilterFn | null): TokenOrComment | null;
1190
+ /**
1191
+ * Get the token that precedes a given node or token.
1192
+ *
1193
+ * @deprecated Use `sourceCode.getTokenBefore` with `includeComments: true` instead.
1194
+ *
1195
+ * @param nodeOrToken The AST node or token.
1196
+ * @param skip - Number of tokens to skip.
1197
+ * @returns `Token`, or `null` if all were skipped.
1198
+ */
1199
+ declare function getTokenOrCommentBefore(nodeOrToken: NodeOrToken, skip?: number): TokenOrComment | null;
1200
+ /**
1201
+ * Get the tokens that precede a given node or token.
1202
+ * @param nodeOrToken - The AST node or token.
1203
+ * @param countOptions? - Options object.
1204
+ * If is a number, equivalent to `{ count: n }`.
1205
+ * If is a function, equivalent to `{ filter: fn }`.
1206
+ * @returns Array of `Token`s.
1207
+ */
1208
+ declare function getTokensBefore(nodeOrToken: NodeOrToken, countOptions?: CountOptions | number | FilterFn | null): TokenOrComment[];
1209
+ /**
1210
+ * Get the token that follows a given node or token.
1211
+ * @param nodeOrToken - The AST node or token.
1212
+ * @param skipOptions? - Options object.
1213
+ * If is a number, equivalent to `{ skip: n }`.
1214
+ * If is a function, equivalent to `{ filter: fn }`.
1215
+ * @returns `Token`, or `null` if all were skipped.
1216
+ */
1217
+ declare function getTokenAfter(nodeOrToken: NodeOrToken, skipOptions?: SkipOptions | number | FilterFn | null): TokenOrComment | null;
1218
+ /**
1219
+ * Get the token that follows a given node or token.
1220
+ *
1221
+ * @deprecated Use `sourceCode.getTokenAfter` with `includeComments: true` instead.
1222
+ *
1223
+ * @param nodeOrToken The AST node or token.
1224
+ * @param skip - Number of tokens to skip.
1225
+ * @returns `Token`, or `null` if all were skipped.
1226
+ */
1227
+ declare function getTokenOrCommentAfter(nodeOrToken: NodeOrToken, skip?: number): TokenOrComment | null;
1228
+ /**
1229
+ * Get the tokens that follow a given node or token.
1230
+ * @param nodeOrToken - The AST node or token.
1231
+ * @param countOptions? - Options object.
1232
+ * If is a number, equivalent to `{ count: n }`.
1233
+ * If is a function, equivalent to `{ filter: fn }`.
1234
+ * @returns Array of `Token`s.
1235
+ */
1236
+ declare function getTokensAfter(nodeOrToken: NodeOrToken, countOptions?: CountOptions | number | FilterFn | null): TokenOrComment[];
1237
+ /**
1238
+ * Get all of the tokens between two non-overlapping nodes.
1239
+ * @param left - Node or token before the desired token range.
1240
+ * @param right - Node or token after the desired token range.
1241
+ * @param countOptions? - Options object. If is a function, equivalent to `{ filter: fn }`.
1242
+ * @returns Array of `Token`s between `left` and `right`.
1243
+ */
1244
+ /**
1245
+ * Get all of the tokens between two non-overlapping nodes.
1246
+ * @param left - Node or token before the desired token range.
1247
+ * @param right - Node or token after the desired token range.
1248
+ * @param padding - Number of extra tokens on either side of center.
1249
+ * @returns Array of `Token`s between `left` and `right`.
1250
+ */
1251
+ declare function getTokensBetween(left: NodeOrToken, right: NodeOrToken, countOptions?: CountOptions | number | FilterFn | null): TokenOrComment[];
1252
+ /**
1253
+ * Get the first token between two non-overlapping nodes.
1254
+ * @param left - Node or token before the desired token range.
1255
+ * @param right - Node or token after the desired token range.
1256
+ * @param skipOptions? - Options object.
1257
+ * If is a number, equivalent to `{ skip: n }`.
1258
+ * If is a function, equivalent to `{ filter: fn }`.
1259
+ * @returns `Token`, or `null` if all were skipped.
1260
+ */
1261
+ declare function getFirstTokenBetween(left: NodeOrToken, right: NodeOrToken, skipOptions?: SkipOptions | number | FilterFn | null): TokenOrComment | null;
1262
+ /**
1263
+ * Get the first tokens between two non-overlapping nodes.
1264
+ * @param left - Node or token before the desired token range.
1265
+ * @param right - Node or token after the desired token range.
1266
+ * @param countOptions? - Options object.
1267
+ * If is a number, equivalent to `{ count: n }`.
1268
+ * If is a function, equivalent to `{ filter: fn }`.
1269
+ * @returns Array of `Token`s between `left` and `right`.
1270
+ */
1271
+ declare function getFirstTokensBetween(left: NodeOrToken, right: NodeOrToken, countOptions?: CountOptions | number | FilterFn | null): TokenOrComment[];
1272
+ /**
1273
+ * Get the last token between two non-overlapping nodes.
1274
+ * @param left - Node or token before the desired token range.
1275
+ * @param right - Node or token after the desired token range.
1276
+ * @param skipOptions? - Options object.
1277
+ * If is a number, equivalent to `{ skip: n }`.
1278
+ * If is a function, equivalent to `{ filter: fn }`.
1279
+ * @returns `Token`, or `null` if all were skipped.
1280
+ */
1281
+ declare function getLastTokenBetween(left: NodeOrToken, right: NodeOrToken, skipOptions?: SkipOptions | number | FilterFn | null): TokenOrComment | null;
1282
+ /**
1283
+ * Get the last tokens between two non-overlapping nodes.
1284
+ * @param left - Node or token before the desired token range.
1285
+ * @param right - Node or token after the desired token range.
1286
+ * @param countOptions? - Options object.
1287
+ * If is a number, equivalent to `{ count: n }`.
1288
+ * If is a function, equivalent to `{ filter: fn }`.
1289
+ * @returns Array of `Token`s between `left` and `right`.
1290
+ */
1291
+ declare function getLastTokensBetween(left: NodeOrToken, right: NodeOrToken, countOptions?: CountOptions | number | FilterFn | null): TokenOrComment[];
1292
+ /**
1293
+ * Get the token starting at the specified index.
1294
+ * @param index - Index of the start of the token's range.
1295
+ * @param rangeOptions - Options object.
1296
+ * @returns The token starting at index, or `null` if no such token.
1297
+ */
1298
+ declare function getTokenByRangeStart(index: number, rangeOptions?: RangeOptions | null): TokenOrComment | null;
1299
+ /**
1300
+ * Determine if two nodes or tokens have at least one whitespace character between them.
1301
+ * Order does not matter.
1302
+ *
1303
+ * Returns `false` if the given nodes or tokens overlap.
1304
+ *
1305
+ * Checks for whitespace *between tokens*, not including whitespace *inside tokens*.
1306
+ * e.g. Returns `false` for `isSpaceBetween(x, y)` in `x+" "+y`.
1307
+ *
1308
+ * @param first - The first node or token to check between.
1309
+ * @param second - The second node or token to check between.
1310
+ * @returns `true` if there is a whitespace character between
1311
+ * any of the tokens found between the two given nodes or tokens.
1312
+ */
1313
+ declare function isSpaceBetween(first: NodeOrToken, second: NodeOrToken): boolean;
1314
+ /**
1315
+ * Determine if two nodes or tokens have at least one whitespace character between them.
1316
+ * Order does not matter.
1317
+ *
1318
+ * Returns `false` if the given nodes or tokens overlap.
1319
+ *
1320
+ * Checks for whitespace *between tokens*, not including whitespace *inside tokens*.
1321
+ * e.g. Returns `false` for `isSpaceBetween(x, y)` in `x+" "+y`.
1322
+ *
1323
+ * Unlike `SourceCode#isSpaceBetween`, this function does return `true` if there is a `JSText` token between the two
1324
+ * input tokens, and it contains whitespace.
1325
+ * e.g. Returns `true` for `isSpaceBetweenTokens(x, slash)` in `<X>a b</X>`.
1326
+ *
1327
+ * @deprecated Use `sourceCode.isSpaceBetween` instead.
1328
+ *
1329
+ * @param first - The first node or token to check between.
1330
+ * @param second - The second node or token to check between.
1331
+ * @returns `true` if there is a whitespace character between
1332
+ * any of the tokens found between the two given nodes or tokens.
1333
+ */
1334
+ declare function isSpaceBetweenTokens(first: NodeOrToken, second: NodeOrToken): boolean;
1335
+ declare namespace types_d_exports {
1336
+ export { AccessorProperty, AccessorPropertyType, Argument, ArrayAssignmentTarget, ArrayExpression, ArrayExpressionElement, ArrayPattern, ArrowFunctionExpression, AssignmentExpression, AssignmentOperator, AssignmentPattern, AssignmentTarget, AssignmentTargetMaybeDefault, AssignmentTargetPattern, AssignmentTargetProperty, AssignmentTargetPropertyIdentifier, AssignmentTargetPropertyProperty, AssignmentTargetRest, AssignmentTargetWithDefault, AwaitExpression, BigIntLiteral, BinaryExpression, BinaryOperator, BindingIdentifier, BindingPattern, BindingProperty, BindingRestElement, BlockStatement, BooleanLiteral, BreakStatement, CallExpression, CatchClause, ChainElement, ChainExpression, Class, ClassBody, ClassElement, ClassType, Comment, ComputedMemberExpression, ConditionalExpression, ContinueStatement, DebuggerStatement, Declaration, Decorator, Directive, DoWhileStatement, EmptyStatement, ExportAllDeclaration, ExportDefaultDeclaration, ExportDefaultDeclarationKind, ExportNamedDeclaration, ExportSpecifier, Expression, ExpressionStatement, ForInStatement, ForOfStatement, ForStatement, ForStatementInit, ForStatementLeft, FormalParameter, FormalParameterRest, Function$1 as Function, FunctionBody, FunctionType, Hashbang, IdentifierName, IdentifierReference, IfStatement, ImportAttribute, ImportAttributeKey, ImportDeclaration, ImportDeclarationSpecifier, ImportDefaultSpecifier, ImportExpression, ImportNamespaceSpecifier, ImportOrExportKind, ImportPhase, ImportSpecifier, JSDocNonNullableType, JSDocNullableType, JSDocUnknownType, JSXAttribute, JSXAttributeItem, JSXAttributeName, JSXAttributeValue, JSXChild, JSXClosingElement, JSXClosingFragment, JSXElement, JSXElementName, JSXEmptyExpression, JSXExpression, JSXExpressionContainer, JSXFragment, JSXIdentifier, JSXMemberExpression, JSXMemberExpressionObject, JSXNamespacedName, JSXOpeningElement, JSXOpeningFragment, JSXSpreadAttribute, JSXSpreadChild, JSXText, LabelIdentifier, LabeledStatement, LogicalExpression, LogicalOperator, MemberExpression, MetaProperty, MethodDefinition, MethodDefinitionKind, MethodDefinitionType, ModuleDeclaration, ModuleExportName, ModuleKind, NewExpression, Node$1 as Node, NullLiteral, NumericLiteral, ObjectAssignmentTarget, ObjectExpression, ObjectPattern, ObjectProperty, ObjectPropertyKind, ParamPattern, ParenthesizedExpression, PrivateFieldExpression, PrivateIdentifier, PrivateInExpression, Program, PropertyDefinition, PropertyDefinitionType, PropertyKey$1 as PropertyKey, PropertyKind, RegExpLiteral, ReturnStatement, SequenceExpression, SimpleAssignmentTarget, Span, SpreadElement, Statement, StaticBlock, StaticMemberExpression, StringLiteral, Super, SwitchCase, SwitchStatement, TSAccessibility, TSAnyKeyword, TSArrayType, TSAsExpression, TSBigIntKeyword, TSBooleanKeyword, TSCallSignatureDeclaration, TSClassImplements, TSConditionalType, TSConstructSignatureDeclaration, TSConstructorType, TSEnumBody, TSEnumDeclaration, TSEnumMember, TSEnumMemberName, TSExportAssignment, TSExternalModuleReference, TSFunctionType, TSGlobalDeclaration, TSImportEqualsDeclaration, TSImportType, TSImportTypeQualifiedName, TSImportTypeQualifier, TSIndexSignature, TSIndexSignatureName, TSIndexedAccessType, TSInferType, TSInstantiationExpression, TSInterfaceBody, TSInterfaceDeclaration, TSInterfaceHeritage, TSIntersectionType, TSIntrinsicKeyword, TSLiteral, TSLiteralType, TSMappedType, TSMappedTypeModifierOperator, TSMethodSignature, TSMethodSignatureKind, TSModuleBlock, TSModuleDeclaration, TSModuleDeclarationKind, TSModuleReference, TSNamedTupleMember, TSNamespaceExportDeclaration, TSNeverKeyword, TSNonNullExpression, TSNullKeyword, TSNumberKeyword, TSObjectKeyword, TSOptionalType, TSParameterProperty, TSParenthesizedType, TSPropertySignature, TSQualifiedName, TSRestType, TSSatisfiesExpression, TSSignature, TSStringKeyword, TSSymbolKeyword, TSTemplateLiteralType, TSThisParameter, TSThisType, TSTupleElement, TSTupleType, TSType, TSTypeAliasDeclaration, TSTypeAnnotation, TSTypeAssertion, TSTypeLiteral, TSTypeName, TSTypeOperator, TSTypeOperatorOperator, TSTypeParameter, TSTypeParameterDeclaration, TSTypeParameterInstantiation, TSTypePredicate, TSTypePredicateName, TSTypeQuery, TSTypeQueryExprName, TSTypeReference, TSUndefinedKeyword, TSUnionType, TSUnknownKeyword, TSVoidKeyword, TaggedTemplateExpression, TemplateElement, TemplateElementValue, TemplateLiteral, ThisExpression, ThrowStatement, Token, TryStatement, UnaryExpression, UnaryOperator, UpdateExpression, UpdateOperator, V8IntrinsicExpression, VariableDeclaration, VariableDeclarationKind, VariableDeclarator, WhileStatement, WithStatement, YieldExpression };
1337
+ }
1338
+ interface Program extends Span {
1339
+ type: "Program";
1340
+ body: Array<Directive | Statement>;
1341
+ sourceType: ModuleKind;
1342
+ hashbang: Hashbang | null;
1343
+ comments: Comment[];
1344
+ tokens: Token[];
1345
+ parent: null;
1346
+ }
1347
+ type Expression = BooleanLiteral | NullLiteral | NumericLiteral | BigIntLiteral | RegExpLiteral | StringLiteral | TemplateLiteral | IdentifierReference | MetaProperty | Super | ArrayExpression | ArrowFunctionExpression | AssignmentExpression | AwaitExpression | BinaryExpression | CallExpression | ChainExpression | Class | ConditionalExpression | Function$1 | ImportExpression | LogicalExpression | NewExpression | ObjectExpression | ParenthesizedExpression | SequenceExpression | TaggedTemplateExpression | ThisExpression | UnaryExpression | UpdateExpression | YieldExpression | PrivateInExpression | JSXElement | JSXFragment | TSAsExpression | TSSatisfiesExpression | TSTypeAssertion | TSNonNullExpression | TSInstantiationExpression | V8IntrinsicExpression | MemberExpression;
1348
+ interface IdentifierName extends Span {
1349
+ type: "Identifier";
1350
+ decorators?: [];
1351
+ name: string;
1352
+ optional?: false;
1353
+ typeAnnotation?: null;
1354
+ parent: Node$1;
1355
+ }
1356
+ interface IdentifierReference extends Span {
1357
+ type: "Identifier";
1358
+ decorators?: [];
1359
+ name: string;
1360
+ optional?: false;
1361
+ typeAnnotation?: null;
1362
+ parent: Node$1;
1363
+ }
1364
+ interface BindingIdentifier extends Span {
1365
+ type: "Identifier";
1366
+ decorators?: [];
1367
+ name: string;
1368
+ optional?: false;
1369
+ typeAnnotation?: null;
1370
+ parent: Node$1;
1371
+ }
1372
+ interface LabelIdentifier extends Span {
1373
+ type: "Identifier";
1374
+ decorators?: [];
1375
+ name: string;
1376
+ optional?: false;
1377
+ typeAnnotation?: null;
1378
+ parent: Node$1;
1379
+ }
1380
+ interface ThisExpression extends Span {
1381
+ type: "ThisExpression";
1382
+ parent: Node$1;
1383
+ }
1384
+ interface ArrayExpression extends Span {
1385
+ type: "ArrayExpression";
1386
+ elements: Array<ArrayExpressionElement>;
1387
+ parent: Node$1;
1388
+ }
1389
+ type ArrayExpressionElement = SpreadElement | null | Expression;
1390
+ interface ObjectExpression extends Span {
1391
+ type: "ObjectExpression";
1392
+ properties: Array<ObjectPropertyKind>;
1393
+ parent: Node$1;
1394
+ }
1395
+ type ObjectPropertyKind = ObjectProperty | SpreadElement;
1396
+ interface ObjectProperty extends Span {
1397
+ type: "Property";
1398
+ kind: PropertyKind;
1399
+ key: PropertyKey$1;
1400
+ value: Expression;
1401
+ method: boolean;
1402
+ shorthand: boolean;
1403
+ computed: boolean;
1404
+ optional?: false;
1405
+ parent: Node$1;
1406
+ }
1407
+ type PropertyKey$1 = IdentifierName | PrivateIdentifier | Expression;
1408
+ type PropertyKind = "init" | "get" | "set";
1409
+ interface TemplateLiteral extends Span {
1410
+ type: "TemplateLiteral";
1411
+ quasis: Array<TemplateElement>;
1412
+ expressions: Array<Expression>;
1413
+ parent: Node$1;
1414
+ }
1415
+ interface TaggedTemplateExpression extends Span {
1416
+ type: "TaggedTemplateExpression";
1417
+ tag: Expression;
1418
+ typeArguments?: TSTypeParameterInstantiation | null;
1419
+ quasi: TemplateLiteral;
1420
+ parent: Node$1;
1421
+ }
1422
+ interface TemplateElement extends Span {
1423
+ type: "TemplateElement";
1424
+ value: TemplateElementValue;
1425
+ tail: boolean;
1426
+ parent: Node$1;
1427
+ }
1428
+ interface TemplateElementValue {
1429
+ raw: string;
1430
+ cooked: string | null;
1431
+ }
1432
+ type MemberExpression = ComputedMemberExpression | StaticMemberExpression | PrivateFieldExpression;
1433
+ interface ComputedMemberExpression extends Span {
1434
+ type: "MemberExpression";
1435
+ object: Expression;
1436
+ property: Expression;
1437
+ optional: boolean;
1438
+ computed: true;
1439
+ parent: Node$1;
1440
+ }
1441
+ interface StaticMemberExpression extends Span {
1442
+ type: "MemberExpression";
1443
+ object: Expression;
1444
+ property: IdentifierName;
1445
+ optional: boolean;
1446
+ computed: false;
1447
+ parent: Node$1;
1448
+ }
1449
+ interface PrivateFieldExpression extends Span {
1450
+ type: "MemberExpression";
1451
+ object: Expression;
1452
+ property: PrivateIdentifier;
1453
+ optional: boolean;
1454
+ computed: false;
1455
+ parent: Node$1;
1456
+ }
1457
+ interface CallExpression extends Span {
1458
+ type: "CallExpression";
1459
+ callee: Expression;
1460
+ typeArguments?: TSTypeParameterInstantiation | null;
1461
+ arguments: Array<Argument>;
1462
+ optional: boolean;
1463
+ parent: Node$1;
1464
+ }
1465
+ interface NewExpression extends Span {
1466
+ type: "NewExpression";
1467
+ callee: Expression;
1468
+ typeArguments?: TSTypeParameterInstantiation | null;
1469
+ arguments: Array<Argument>;
1470
+ parent: Node$1;
1471
+ }
1472
+ interface MetaProperty extends Span {
1473
+ type: "MetaProperty";
1474
+ meta: IdentifierName;
1475
+ property: IdentifierName;
1476
+ parent: Node$1;
1477
+ }
1478
+ interface SpreadElement extends Span {
1479
+ type: "SpreadElement";
1480
+ argument: Expression;
1481
+ parent: Node$1;
1482
+ }
1483
+ type Argument = SpreadElement | Expression;
1484
+ interface UpdateExpression extends Span {
1485
+ type: "UpdateExpression";
1486
+ operator: UpdateOperator;
1487
+ prefix: boolean;
1488
+ argument: SimpleAssignmentTarget;
1489
+ parent: Node$1;
1490
+ }
1491
+ interface UnaryExpression extends Span {
1492
+ type: "UnaryExpression";
1493
+ operator: UnaryOperator;
1494
+ argument: Expression;
1495
+ prefix: true;
1496
+ parent: Node$1;
1497
+ }
1498
+ interface BinaryExpression extends Span {
1499
+ type: "BinaryExpression";
1500
+ left: Expression;
1501
+ operator: BinaryOperator;
1502
+ right: Expression;
1503
+ parent: Node$1;
1504
+ }
1505
+ interface PrivateInExpression extends Span {
1506
+ type: "BinaryExpression";
1507
+ left: PrivateIdentifier;
1508
+ operator: "in";
1509
+ right: Expression;
1510
+ parent: Node$1;
1511
+ }
1512
+ interface LogicalExpression extends Span {
1513
+ type: "LogicalExpression";
1514
+ left: Expression;
1515
+ operator: LogicalOperator;
1516
+ right: Expression;
1517
+ parent: Node$1;
1518
+ }
1519
+ interface ConditionalExpression extends Span {
1520
+ type: "ConditionalExpression";
1521
+ test: Expression;
1522
+ consequent: Expression;
1523
+ alternate: Expression;
1524
+ parent: Node$1;
1525
+ }
1526
+ interface AssignmentExpression extends Span {
1527
+ type: "AssignmentExpression";
1528
+ operator: AssignmentOperator;
1529
+ left: AssignmentTarget;
1530
+ right: Expression;
1531
+ parent: Node$1;
1532
+ }
1533
+ type AssignmentTarget = SimpleAssignmentTarget | AssignmentTargetPattern;
1534
+ type SimpleAssignmentTarget = IdentifierReference | TSAsExpression | TSSatisfiesExpression | TSNonNullExpression | TSTypeAssertion | MemberExpression;
1535
+ type AssignmentTargetPattern = ArrayAssignmentTarget | ObjectAssignmentTarget;
1536
+ interface ArrayAssignmentTarget extends Span {
1537
+ type: "ArrayPattern";
1538
+ decorators?: [];
1539
+ elements: Array<AssignmentTargetMaybeDefault | AssignmentTargetRest | null>;
1540
+ optional?: false;
1541
+ typeAnnotation?: null;
1542
+ parent: Node$1;
1543
+ }
1544
+ interface ObjectAssignmentTarget extends Span {
1545
+ type: "ObjectPattern";
1546
+ decorators?: [];
1547
+ properties: Array<AssignmentTargetProperty | AssignmentTargetRest>;
1548
+ optional?: false;
1549
+ typeAnnotation?: null;
1550
+ parent: Node$1;
1551
+ }
1552
+ interface AssignmentTargetRest extends Span {
1553
+ type: "RestElement";
1554
+ decorators?: [];
1555
+ argument: AssignmentTarget;
1556
+ optional?: false;
1557
+ typeAnnotation?: null;
1558
+ value?: null;
1559
+ parent: Node$1;
1560
+ }
1561
+ type AssignmentTargetMaybeDefault = AssignmentTargetWithDefault | AssignmentTarget;
1562
+ interface AssignmentTargetWithDefault extends Span {
1563
+ type: "AssignmentPattern";
1564
+ decorators?: [];
1565
+ left: AssignmentTarget;
1566
+ right: Expression;
1567
+ optional?: false;
1568
+ typeAnnotation?: null;
1569
+ parent: Node$1;
1570
+ }
1571
+ type AssignmentTargetProperty = AssignmentTargetPropertyIdentifier | AssignmentTargetPropertyProperty;
1572
+ interface AssignmentTargetPropertyIdentifier extends Span {
1573
+ type: "Property";
1574
+ kind: "init";
1575
+ key: IdentifierReference;
1576
+ value: IdentifierReference | AssignmentTargetWithDefault;
1577
+ method: false;
1578
+ shorthand: true;
1579
+ computed: false;
1580
+ optional?: false;
1581
+ parent: Node$1;
1582
+ }
1583
+ interface AssignmentTargetPropertyProperty extends Span {
1584
+ type: "Property";
1585
+ kind: "init";
1586
+ key: PropertyKey$1;
1587
+ value: AssignmentTargetMaybeDefault;
1588
+ method: false;
1589
+ shorthand: false;
1590
+ computed: boolean;
1591
+ optional?: false;
1592
+ parent: Node$1;
1593
+ }
1594
+ interface SequenceExpression extends Span {
1595
+ type: "SequenceExpression";
1596
+ expressions: Array<Expression>;
1597
+ parent: Node$1;
1598
+ }
1599
+ interface Super extends Span {
1600
+ type: "Super";
1601
+ parent: Node$1;
1602
+ }
1603
+ interface AwaitExpression extends Span {
1604
+ type: "AwaitExpression";
1605
+ argument: Expression;
1606
+ parent: Node$1;
1607
+ }
1608
+ interface ChainExpression extends Span {
1609
+ type: "ChainExpression";
1610
+ expression: ChainElement;
1611
+ parent: Node$1;
1612
+ }
1613
+ type ChainElement = CallExpression | TSNonNullExpression | MemberExpression;
1614
+ interface ParenthesizedExpression extends Span {
1615
+ type: "ParenthesizedExpression";
1616
+ expression: Expression;
1617
+ parent: Node$1;
1618
+ }
1619
+ type Statement = BlockStatement | BreakStatement | ContinueStatement | DebuggerStatement | DoWhileStatement | EmptyStatement | ExpressionStatement | ForInStatement | ForOfStatement | ForStatement | IfStatement | LabeledStatement | ReturnStatement | SwitchStatement | ThrowStatement | TryStatement | WhileStatement | WithStatement | Declaration | ModuleDeclaration;
1620
+ interface Directive extends Span {
1621
+ type: "ExpressionStatement";
1622
+ expression: StringLiteral;
1623
+ directive: string;
1624
+ parent: Node$1;
1625
+ }
1626
+ interface Hashbang extends Span {
1627
+ type: "Hashbang";
1628
+ value: string;
1629
+ parent: Node$1;
1630
+ }
1631
+ interface BlockStatement extends Span {
1632
+ type: "BlockStatement";
1633
+ body: Array<Statement>;
1634
+ parent: Node$1;
1635
+ }
1636
+ type Declaration = VariableDeclaration | Function$1 | Class | TSTypeAliasDeclaration | TSInterfaceDeclaration | TSEnumDeclaration | TSModuleDeclaration | TSGlobalDeclaration | TSImportEqualsDeclaration;
1637
+ interface VariableDeclaration extends Span {
1638
+ type: "VariableDeclaration";
1639
+ kind: VariableDeclarationKind;
1640
+ declarations: Array<VariableDeclarator>;
1641
+ declare?: boolean;
1642
+ parent: Node$1;
1643
+ }
1644
+ type VariableDeclarationKind = "var" | "let" | "const" | "using" | "await using";
1645
+ interface VariableDeclarator extends Span {
1646
+ type: "VariableDeclarator";
1647
+ id: BindingPattern;
1648
+ init: Expression | null;
1649
+ definite?: boolean;
1650
+ parent: Node$1;
1651
+ }
1652
+ interface EmptyStatement extends Span {
1653
+ type: "EmptyStatement";
1654
+ parent: Node$1;
1655
+ }
1656
+ interface ExpressionStatement extends Span {
1657
+ type: "ExpressionStatement";
1658
+ expression: Expression;
1659
+ directive?: string | null;
1660
+ parent: Node$1;
1661
+ }
1662
+ interface IfStatement extends Span {
1663
+ type: "IfStatement";
1664
+ test: Expression;
1665
+ consequent: Statement;
1666
+ alternate: Statement | null;
1667
+ parent: Node$1;
1668
+ }
1669
+ interface DoWhileStatement extends Span {
1670
+ type: "DoWhileStatement";
1671
+ body: Statement;
1672
+ test: Expression;
1673
+ parent: Node$1;
1674
+ }
1675
+ interface WhileStatement extends Span {
1676
+ type: "WhileStatement";
1677
+ test: Expression;
1678
+ body: Statement;
1679
+ parent: Node$1;
1680
+ }
1681
+ interface ForStatement extends Span {
1682
+ type: "ForStatement";
1683
+ init: ForStatementInit | null;
1684
+ test: Expression | null;
1685
+ update: Expression | null;
1686
+ body: Statement;
1687
+ parent: Node$1;
1688
+ }
1689
+ type ForStatementInit = VariableDeclaration | Expression;
1690
+ interface ForInStatement extends Span {
1691
+ type: "ForInStatement";
1692
+ left: ForStatementLeft;
1693
+ right: Expression;
1694
+ body: Statement;
1695
+ parent: Node$1;
1696
+ }
1697
+ type ForStatementLeft = VariableDeclaration | AssignmentTarget;
1698
+ interface ForOfStatement extends Span {
1699
+ type: "ForOfStatement";
1700
+ await: boolean;
1701
+ left: ForStatementLeft;
1702
+ right: Expression;
1703
+ body: Statement;
1704
+ parent: Node$1;
1705
+ }
1706
+ interface ContinueStatement extends Span {
1707
+ type: "ContinueStatement";
1708
+ label: LabelIdentifier | null;
1709
+ parent: Node$1;
1710
+ }
1711
+ interface BreakStatement extends Span {
1712
+ type: "BreakStatement";
1713
+ label: LabelIdentifier | null;
1714
+ parent: Node$1;
1715
+ }
1716
+ interface ReturnStatement extends Span {
1717
+ type: "ReturnStatement";
1718
+ argument: Expression | null;
1719
+ parent: Node$1;
1720
+ }
1721
+ interface WithStatement extends Span {
1722
+ type: "WithStatement";
1723
+ object: Expression;
1724
+ body: Statement;
1725
+ parent: Node$1;
1726
+ }
1727
+ interface SwitchStatement extends Span {
1728
+ type: "SwitchStatement";
1729
+ discriminant: Expression;
1730
+ cases: Array<SwitchCase>;
1731
+ parent: Node$1;
1732
+ }
1733
+ interface SwitchCase extends Span {
1734
+ type: "SwitchCase";
1735
+ test: Expression | null;
1736
+ consequent: Array<Statement>;
1737
+ parent: Node$1;
1738
+ }
1739
+ interface LabeledStatement extends Span {
1740
+ type: "LabeledStatement";
1741
+ label: LabelIdentifier;
1742
+ body: Statement;
1743
+ parent: Node$1;
1744
+ }
1745
+ interface ThrowStatement extends Span {
1746
+ type: "ThrowStatement";
1747
+ argument: Expression;
1748
+ parent: Node$1;
1749
+ }
1750
+ interface TryStatement extends Span {
1751
+ type: "TryStatement";
1752
+ block: BlockStatement;
1753
+ handler: CatchClause | null;
1754
+ finalizer: BlockStatement | null;
1755
+ parent: Node$1;
1756
+ }
1757
+ interface CatchClause extends Span {
1758
+ type: "CatchClause";
1759
+ param: BindingPattern | null;
1760
+ body: BlockStatement;
1761
+ parent: Node$1;
1762
+ }
1763
+ interface DebuggerStatement extends Span {
1764
+ type: "DebuggerStatement";
1765
+ parent: Node$1;
1766
+ }
1767
+ type BindingPattern = BindingIdentifier | ObjectPattern | ArrayPattern | AssignmentPattern;
1768
+ interface AssignmentPattern extends Span {
1769
+ type: "AssignmentPattern";
1770
+ decorators?: [];
1771
+ left: BindingPattern;
1772
+ right: Expression;
1773
+ optional?: false;
1774
+ typeAnnotation?: null;
1775
+ parent: Node$1;
1776
+ }
1777
+ interface ObjectPattern extends Span {
1778
+ type: "ObjectPattern";
1779
+ decorators?: [];
1780
+ properties: Array<BindingProperty | BindingRestElement>;
1781
+ optional?: false;
1782
+ typeAnnotation?: null;
1783
+ parent: Node$1;
1784
+ }
1785
+ interface BindingProperty extends Span {
1786
+ type: "Property";
1787
+ kind: "init";
1788
+ key: PropertyKey$1;
1789
+ value: BindingPattern;
1790
+ method: false;
1791
+ shorthand: boolean;
1792
+ computed: boolean;
1793
+ optional?: false;
1794
+ parent: Node$1;
1795
+ }
1796
+ interface ArrayPattern extends Span {
1797
+ type: "ArrayPattern";
1798
+ decorators?: [];
1799
+ elements: Array<BindingPattern | BindingRestElement | null>;
1800
+ optional?: false;
1801
+ typeAnnotation?: null;
1802
+ parent: Node$1;
1803
+ }
1804
+ interface BindingRestElement extends Span {
1805
+ type: "RestElement";
1806
+ decorators?: [];
1807
+ argument: BindingPattern;
1808
+ optional?: false;
1809
+ typeAnnotation?: null;
1810
+ value?: null;
1811
+ parent: Node$1;
1812
+ }
1813
+ interface Function$1 extends Span {
1814
+ type: FunctionType;
1815
+ id: BindingIdentifier | null;
1816
+ generator: boolean;
1817
+ async: boolean;
1818
+ declare?: boolean;
1819
+ typeParameters?: TSTypeParameterDeclaration | null;
1820
+ params: ParamPattern[];
1821
+ returnType?: TSTypeAnnotation | null;
1822
+ body: FunctionBody | null;
1823
+ expression: false;
1824
+ parent: Node$1;
1825
+ }
1826
+ type ParamPattern = FormalParameter | TSParameterProperty | FormalParameterRest;
1827
+ type FunctionType = "FunctionDeclaration" | "FunctionExpression" | "TSDeclareFunction" | "TSEmptyBodyFunctionExpression";
1828
+ interface FormalParameterRest extends Span {
1829
+ type: "RestElement";
1830
+ argument: BindingPattern;
1831
+ decorators?: [];
1832
+ optional?: boolean;
1833
+ typeAnnotation?: TSTypeAnnotation | null;
1834
+ value?: null;
1835
+ parent: Node$1;
1836
+ }
1837
+ type FormalParameter = {
1838
+ decorators?: Array<Decorator>;
1839
+ } & BindingPattern;
1840
+ interface TSParameterProperty extends Span {
1841
+ type: "TSParameterProperty";
1842
+ accessibility: TSAccessibility | null;
1843
+ decorators: Array<Decorator>;
1844
+ override: boolean;
1845
+ parameter: FormalParameter;
1846
+ readonly: boolean;
1847
+ static: boolean;
1848
+ parent: Node$1;
1849
+ }
1850
+ interface FunctionBody extends Span {
1851
+ type: "BlockStatement";
1852
+ body: Array<Directive | Statement>;
1853
+ parent: Node$1;
1854
+ }
1855
+ interface ArrowFunctionExpression extends Span {
1856
+ type: "ArrowFunctionExpression";
1857
+ expression: boolean;
1858
+ async: boolean;
1859
+ typeParameters?: TSTypeParameterDeclaration | null;
1860
+ params: ParamPattern[];
1861
+ returnType?: TSTypeAnnotation | null;
1862
+ body: FunctionBody | Expression;
1863
+ id: null;
1864
+ generator: false;
1865
+ parent: Node$1;
1866
+ }
1867
+ interface YieldExpression extends Span {
1868
+ type: "YieldExpression";
1869
+ delegate: boolean;
1870
+ argument: Expression | null;
1871
+ parent: Node$1;
1872
+ }
1873
+ interface Class extends Span {
1874
+ type: ClassType;
1875
+ decorators: Array<Decorator>;
1876
+ id: BindingIdentifier | null;
1877
+ typeParameters?: TSTypeParameterDeclaration | null;
1878
+ superClass: Expression | null;
1879
+ superTypeArguments?: TSTypeParameterInstantiation | null;
1880
+ implements?: Array<TSClassImplements>;
1881
+ body: ClassBody;
1882
+ abstract?: boolean;
1883
+ declare?: boolean;
1884
+ parent: Node$1;
1885
+ }
1886
+ type ClassType = "ClassDeclaration" | "ClassExpression";
1887
+ interface ClassBody extends Span {
1888
+ type: "ClassBody";
1889
+ body: Array<ClassElement>;
1890
+ parent: Node$1;
1891
+ }
1892
+ type ClassElement = StaticBlock | MethodDefinition | PropertyDefinition | AccessorProperty | TSIndexSignature;
1893
+ interface MethodDefinition extends Span {
1894
+ type: MethodDefinitionType;
1895
+ decorators: Array<Decorator>;
1896
+ key: PropertyKey$1;
1897
+ value: Function$1;
1898
+ kind: MethodDefinitionKind;
1899
+ computed: boolean;
1900
+ static: boolean;
1901
+ override?: boolean;
1902
+ optional?: boolean;
1903
+ accessibility?: TSAccessibility | null;
1904
+ parent: Node$1;
1905
+ }
1906
+ type MethodDefinitionType = "MethodDefinition" | "TSAbstractMethodDefinition";
1907
+ interface PropertyDefinition extends Span {
1908
+ type: PropertyDefinitionType;
1909
+ decorators: Array<Decorator>;
1910
+ key: PropertyKey$1;
1911
+ typeAnnotation?: TSTypeAnnotation | null;
1912
+ value: Expression | null;
1913
+ computed: boolean;
1914
+ static: boolean;
1915
+ declare?: boolean;
1916
+ override?: boolean;
1917
+ optional?: boolean;
1918
+ definite?: boolean;
1919
+ readonly?: boolean;
1920
+ accessibility?: TSAccessibility | null;
1921
+ parent: Node$1;
1922
+ }
1923
+ type PropertyDefinitionType = "PropertyDefinition" | "TSAbstractPropertyDefinition";
1924
+ type MethodDefinitionKind = "constructor" | "method" | "get" | "set";
1925
+ interface PrivateIdentifier extends Span {
1926
+ type: "PrivateIdentifier";
1927
+ name: string;
1928
+ parent: Node$1;
1929
+ }
1930
+ interface StaticBlock extends Span {
1931
+ type: "StaticBlock";
1932
+ body: Array<Statement>;
1933
+ parent: Node$1;
1934
+ }
1935
+ type ModuleDeclaration = ImportDeclaration | ExportAllDeclaration | ExportDefaultDeclaration | ExportNamedDeclaration | TSExportAssignment | TSNamespaceExportDeclaration;
1936
+ type AccessorPropertyType = "AccessorProperty" | "TSAbstractAccessorProperty";
1937
+ interface AccessorProperty extends Span {
1938
+ type: AccessorPropertyType;
1939
+ decorators: Array<Decorator>;
1940
+ key: PropertyKey$1;
1941
+ typeAnnotation?: TSTypeAnnotation | null;
1942
+ value: Expression | null;
1943
+ computed: boolean;
1944
+ static: boolean;
1945
+ override?: boolean;
1946
+ definite?: boolean;
1947
+ accessibility?: TSAccessibility | null;
1948
+ declare?: false;
1949
+ optional?: false;
1950
+ readonly?: false;
1951
+ parent: Node$1;
1952
+ }
1953
+ interface ImportExpression extends Span {
1954
+ type: "ImportExpression";
1955
+ source: Expression;
1956
+ options: Expression | null;
1957
+ phase: ImportPhase | null;
1958
+ parent: Node$1;
1959
+ }
1960
+ interface ImportDeclaration extends Span {
1961
+ type: "ImportDeclaration";
1962
+ specifiers: Array<ImportDeclarationSpecifier>;
1963
+ source: StringLiteral;
1964
+ phase: ImportPhase | null;
1965
+ attributes: Array<ImportAttribute>;
1966
+ importKind?: ImportOrExportKind;
1967
+ parent: Node$1;
1968
+ }
1969
+ type ImportPhase = "source" | "defer";
1970
+ type ImportDeclarationSpecifier = ImportSpecifier | ImportDefaultSpecifier | ImportNamespaceSpecifier;
1971
+ interface ImportSpecifier extends Span {
1972
+ type: "ImportSpecifier";
1973
+ imported: ModuleExportName;
1974
+ local: BindingIdentifier;
1975
+ importKind?: ImportOrExportKind;
1976
+ parent: Node$1;
1977
+ }
1978
+ interface ImportDefaultSpecifier extends Span {
1979
+ type: "ImportDefaultSpecifier";
1980
+ local: BindingIdentifier;
1981
+ parent: Node$1;
1982
+ }
1983
+ interface ImportNamespaceSpecifier extends Span {
1984
+ type: "ImportNamespaceSpecifier";
1985
+ local: BindingIdentifier;
1986
+ parent: Node$1;
1987
+ }
1988
+ interface ImportAttribute extends Span {
1989
+ type: "ImportAttribute";
1990
+ key: ImportAttributeKey;
1991
+ value: StringLiteral;
1992
+ parent: Node$1;
1993
+ }
1994
+ type ImportAttributeKey = IdentifierName | StringLiteral;
1995
+ interface ExportNamedDeclaration extends Span {
1996
+ type: "ExportNamedDeclaration";
1997
+ declaration: Declaration | null;
1998
+ specifiers: Array<ExportSpecifier>;
1999
+ source: StringLiteral | null;
2000
+ exportKind?: ImportOrExportKind;
2001
+ attributes: Array<ImportAttribute>;
2002
+ parent: Node$1;
2003
+ }
2004
+ interface ExportDefaultDeclaration extends Span {
2005
+ type: "ExportDefaultDeclaration";
2006
+ declaration: ExportDefaultDeclarationKind;
2007
+ exportKind?: "value";
2008
+ parent: Node$1;
2009
+ }
2010
+ interface ExportAllDeclaration extends Span {
2011
+ type: "ExportAllDeclaration";
2012
+ exported: ModuleExportName | null;
2013
+ source: StringLiteral;
2014
+ attributes: Array<ImportAttribute>;
2015
+ exportKind?: ImportOrExportKind;
2016
+ parent: Node$1;
2017
+ }
2018
+ interface ExportSpecifier extends Span {
2019
+ type: "ExportSpecifier";
2020
+ local: ModuleExportName;
2021
+ exported: ModuleExportName;
2022
+ exportKind?: ImportOrExportKind;
2023
+ parent: Node$1;
2024
+ }
2025
+ type ExportDefaultDeclarationKind = Function$1 | Class | TSInterfaceDeclaration | Expression;
2026
+ type ModuleExportName = IdentifierName | IdentifierReference | StringLiteral;
2027
+ interface V8IntrinsicExpression extends Span {
2028
+ type: "V8IntrinsicExpression";
2029
+ name: IdentifierName;
2030
+ arguments: Array<Argument>;
2031
+ parent: Node$1;
2032
+ }
2033
+ interface BooleanLiteral extends Span {
2034
+ type: "Literal";
2035
+ value: boolean;
2036
+ raw: string | null;
2037
+ parent: Node$1;
2038
+ }
2039
+ interface NullLiteral extends Span {
2040
+ type: "Literal";
2041
+ value: null;
2042
+ raw: "null" | null;
2043
+ parent: Node$1;
2044
+ }
2045
+ interface NumericLiteral extends Span {
2046
+ type: "Literal";
2047
+ value: number;
2048
+ raw: string | null;
2049
+ parent: Node$1;
2050
+ }
2051
+ interface StringLiteral extends Span {
2052
+ type: "Literal";
2053
+ value: string;
2054
+ raw: string | null;
2055
+ parent: Node$1;
2056
+ }
2057
+ interface BigIntLiteral extends Span {
2058
+ type: "Literal";
2059
+ value: bigint;
2060
+ raw: string | null;
2061
+ bigint: string;
2062
+ parent: Node$1;
2063
+ }
2064
+ interface RegExpLiteral extends Span {
2065
+ type: "Literal";
2066
+ value: RegExp | null;
2067
+ raw: string | null;
2068
+ regex: {
2069
+ pattern: string;
2070
+ flags: string;
2071
+ };
2072
+ parent: Node$1;
2073
+ }
2074
+ interface JSXElement extends Span {
2075
+ type: "JSXElement";
2076
+ openingElement: JSXOpeningElement;
2077
+ children: Array<JSXChild>;
2078
+ closingElement: JSXClosingElement | null;
2079
+ parent: Node$1;
2080
+ }
2081
+ interface JSXOpeningElement extends Span {
2082
+ type: "JSXOpeningElement";
2083
+ name: JSXElementName;
2084
+ typeArguments?: TSTypeParameterInstantiation | null;
2085
+ attributes: Array<JSXAttributeItem>;
2086
+ selfClosing: boolean;
2087
+ parent: Node$1;
2088
+ }
2089
+ interface JSXClosingElement extends Span {
2090
+ type: "JSXClosingElement";
2091
+ name: JSXElementName;
2092
+ parent: Node$1;
2093
+ }
2094
+ interface JSXFragment extends Span {
2095
+ type: "JSXFragment";
2096
+ openingFragment: JSXOpeningFragment;
2097
+ children: Array<JSXChild>;
2098
+ closingFragment: JSXClosingFragment;
2099
+ parent: Node$1;
2100
+ }
2101
+ interface JSXOpeningFragment extends Span {
2102
+ type: "JSXOpeningFragment";
2103
+ attributes?: [];
2104
+ selfClosing?: false;
2105
+ parent: Node$1;
2106
+ }
2107
+ interface JSXClosingFragment extends Span {
2108
+ type: "JSXClosingFragment";
2109
+ parent: Node$1;
2110
+ }
2111
+ type JSXElementName = JSXIdentifier | JSXNamespacedName | JSXMemberExpression;
2112
+ interface JSXNamespacedName extends Span {
2113
+ type: "JSXNamespacedName";
2114
+ namespace: JSXIdentifier;
2115
+ name: JSXIdentifier;
2116
+ parent: Node$1;
2117
+ }
2118
+ interface JSXMemberExpression extends Span {
2119
+ type: "JSXMemberExpression";
2120
+ object: JSXMemberExpressionObject;
2121
+ property: JSXIdentifier;
2122
+ parent: Node$1;
2123
+ }
2124
+ type JSXMemberExpressionObject = JSXIdentifier | JSXMemberExpression;
2125
+ interface JSXExpressionContainer extends Span {
2126
+ type: "JSXExpressionContainer";
2127
+ expression: JSXExpression;
2128
+ parent: Node$1;
2129
+ }
2130
+ type JSXExpression = JSXEmptyExpression | Expression;
2131
+ interface JSXEmptyExpression extends Span {
2132
+ type: "JSXEmptyExpression";
2133
+ parent: Node$1;
2134
+ }
2135
+ type JSXAttributeItem = JSXAttribute | JSXSpreadAttribute;
2136
+ interface JSXAttribute extends Span {
2137
+ type: "JSXAttribute";
2138
+ name: JSXAttributeName;
2139
+ value: JSXAttributeValue | null;
2140
+ parent: Node$1;
2141
+ }
2142
+ interface JSXSpreadAttribute extends Span {
2143
+ type: "JSXSpreadAttribute";
2144
+ argument: Expression;
2145
+ parent: Node$1;
2146
+ }
2147
+ type JSXAttributeName = JSXIdentifier | JSXNamespacedName;
2148
+ type JSXAttributeValue = StringLiteral | JSXExpressionContainer | JSXElement | JSXFragment;
2149
+ interface JSXIdentifier extends Span {
2150
+ type: "JSXIdentifier";
2151
+ name: string;
2152
+ parent: Node$1;
2153
+ }
2154
+ type JSXChild = JSXText | JSXElement | JSXFragment | JSXExpressionContainer | JSXSpreadChild;
2155
+ interface JSXSpreadChild extends Span {
2156
+ type: "JSXSpreadChild";
2157
+ expression: Expression;
2158
+ parent: Node$1;
2159
+ }
2160
+ interface JSXText extends Span {
2161
+ type: "JSXText";
2162
+ value: string;
2163
+ raw: string | null;
2164
+ parent: Node$1;
2165
+ }
2166
+ interface TSThisParameter extends Span {
2167
+ type: "Identifier";
2168
+ decorators: [];
2169
+ name: "this";
2170
+ optional: false;
2171
+ typeAnnotation: TSTypeAnnotation | null;
2172
+ parent: Node$1;
2173
+ }
2174
+ interface TSEnumDeclaration extends Span {
2175
+ type: "TSEnumDeclaration";
2176
+ id: BindingIdentifier;
2177
+ body: TSEnumBody;
2178
+ const: boolean;
2179
+ declare: boolean;
2180
+ parent: Node$1;
2181
+ }
2182
+ interface TSEnumBody extends Span {
2183
+ type: "TSEnumBody";
2184
+ members: Array<TSEnumMember>;
2185
+ parent: Node$1;
2186
+ }
2187
+ interface TSEnumMember extends Span {
2188
+ type: "TSEnumMember";
2189
+ id: TSEnumMemberName;
2190
+ initializer: Expression | null;
2191
+ computed: boolean;
2192
+ parent: Node$1;
2193
+ }
2194
+ type TSEnumMemberName = IdentifierName | StringLiteral | TemplateLiteral;
2195
+ interface TSTypeAnnotation extends Span {
2196
+ type: "TSTypeAnnotation";
2197
+ typeAnnotation: TSType;
2198
+ parent: Node$1;
2199
+ }
2200
+ interface TSLiteralType extends Span {
2201
+ type: "TSLiteralType";
2202
+ literal: TSLiteral;
2203
+ parent: Node$1;
2204
+ }
2205
+ type TSLiteral = BooleanLiteral | NumericLiteral | BigIntLiteral | StringLiteral | TemplateLiteral | UnaryExpression;
2206
+ type TSType = TSAnyKeyword | TSBigIntKeyword | TSBooleanKeyword | TSIntrinsicKeyword | TSNeverKeyword | TSNullKeyword | TSNumberKeyword | TSObjectKeyword | TSStringKeyword | TSSymbolKeyword | TSUndefinedKeyword | TSUnknownKeyword | TSVoidKeyword | TSArrayType | TSConditionalType | TSConstructorType | TSFunctionType | TSImportType | TSIndexedAccessType | TSInferType | TSIntersectionType | TSLiteralType | TSMappedType | TSNamedTupleMember | TSTemplateLiteralType | TSThisType | TSTupleType | TSTypeLiteral | TSTypeOperator | TSTypePredicate | TSTypeQuery | TSTypeReference | TSUnionType | TSParenthesizedType | JSDocNullableType | JSDocNonNullableType | JSDocUnknownType;
2207
+ interface TSConditionalType extends Span {
2208
+ type: "TSConditionalType";
2209
+ checkType: TSType;
2210
+ extendsType: TSType;
2211
+ trueType: TSType;
2212
+ falseType: TSType;
2213
+ parent: Node$1;
2214
+ }
2215
+ interface TSUnionType extends Span {
2216
+ type: "TSUnionType";
2217
+ types: Array<TSType>;
2218
+ parent: Node$1;
2219
+ }
2220
+ interface TSIntersectionType extends Span {
2221
+ type: "TSIntersectionType";
2222
+ types: Array<TSType>;
2223
+ parent: Node$1;
2224
+ }
2225
+ interface TSParenthesizedType extends Span {
2226
+ type: "TSParenthesizedType";
2227
+ typeAnnotation: TSType;
2228
+ parent: Node$1;
2229
+ }
2230
+ interface TSTypeOperator extends Span {
2231
+ type: "TSTypeOperator";
2232
+ operator: TSTypeOperatorOperator;
2233
+ typeAnnotation: TSType;
2234
+ parent: Node$1;
2235
+ }
2236
+ type TSTypeOperatorOperator = "keyof" | "unique" | "readonly";
2237
+ interface TSArrayType extends Span {
2238
+ type: "TSArrayType";
2239
+ elementType: TSType;
2240
+ parent: Node$1;
2241
+ }
2242
+ interface TSIndexedAccessType extends Span {
2243
+ type: "TSIndexedAccessType";
2244
+ objectType: TSType;
2245
+ indexType: TSType;
2246
+ parent: Node$1;
2247
+ }
2248
+ interface TSTupleType extends Span {
2249
+ type: "TSTupleType";
2250
+ elementTypes: Array<TSTupleElement>;
2251
+ parent: Node$1;
2252
+ }
2253
+ interface TSNamedTupleMember extends Span {
2254
+ type: "TSNamedTupleMember";
2255
+ label: IdentifierName;
2256
+ elementType: TSTupleElement;
2257
+ optional: boolean;
2258
+ parent: Node$1;
2259
+ }
2260
+ interface TSOptionalType extends Span {
2261
+ type: "TSOptionalType";
2262
+ typeAnnotation: TSType;
2263
+ parent: Node$1;
2264
+ }
2265
+ interface TSRestType extends Span {
2266
+ type: "TSRestType";
2267
+ typeAnnotation: TSType;
2268
+ parent: Node$1;
2269
+ }
2270
+ type TSTupleElement = TSOptionalType | TSRestType | TSType;
2271
+ interface TSAnyKeyword extends Span {
2272
+ type: "TSAnyKeyword";
2273
+ parent: Node$1;
2274
+ }
2275
+ interface TSStringKeyword extends Span {
2276
+ type: "TSStringKeyword";
2277
+ parent: Node$1;
2278
+ }
2279
+ interface TSBooleanKeyword extends Span {
2280
+ type: "TSBooleanKeyword";
2281
+ parent: Node$1;
2282
+ }
2283
+ interface TSNumberKeyword extends Span {
2284
+ type: "TSNumberKeyword";
2285
+ parent: Node$1;
2286
+ }
2287
+ interface TSNeverKeyword extends Span {
2288
+ type: "TSNeverKeyword";
2289
+ parent: Node$1;
2290
+ }
2291
+ interface TSIntrinsicKeyword extends Span {
2292
+ type: "TSIntrinsicKeyword";
2293
+ parent: Node$1;
2294
+ }
2295
+ interface TSUnknownKeyword extends Span {
2296
+ type: "TSUnknownKeyword";
2297
+ parent: Node$1;
2298
+ }
2299
+ interface TSNullKeyword extends Span {
2300
+ type: "TSNullKeyword";
2301
+ parent: Node$1;
2302
+ }
2303
+ interface TSUndefinedKeyword extends Span {
2304
+ type: "TSUndefinedKeyword";
2305
+ parent: Node$1;
2306
+ }
2307
+ interface TSVoidKeyword extends Span {
2308
+ type: "TSVoidKeyword";
2309
+ parent: Node$1;
2310
+ }
2311
+ interface TSSymbolKeyword extends Span {
2312
+ type: "TSSymbolKeyword";
2313
+ parent: Node$1;
2314
+ }
2315
+ interface TSThisType extends Span {
2316
+ type: "TSThisType";
2317
+ parent: Node$1;
2318
+ }
2319
+ interface TSObjectKeyword extends Span {
2320
+ type: "TSObjectKeyword";
2321
+ parent: Node$1;
2322
+ }
2323
+ interface TSBigIntKeyword extends Span {
2324
+ type: "TSBigIntKeyword";
2325
+ parent: Node$1;
2326
+ }
2327
+ interface TSTypeReference extends Span {
2328
+ type: "TSTypeReference";
2329
+ typeName: TSTypeName;
2330
+ typeArguments: TSTypeParameterInstantiation | null;
2331
+ parent: Node$1;
2332
+ }
2333
+ type TSTypeName = IdentifierReference | TSQualifiedName | ThisExpression;
2334
+ interface TSQualifiedName extends Span {
2335
+ type: "TSQualifiedName";
2336
+ left: TSTypeName;
2337
+ right: IdentifierName;
2338
+ parent: Node$1;
2339
+ }
2340
+ interface TSTypeParameterInstantiation extends Span {
2341
+ type: "TSTypeParameterInstantiation";
2342
+ params: Array<TSType>;
2343
+ parent: Node$1;
2344
+ }
2345
+ interface TSTypeParameter extends Span {
2346
+ type: "TSTypeParameter";
2347
+ name: BindingIdentifier;
2348
+ constraint: TSType | null;
2349
+ default: TSType | null;
2350
+ in: boolean;
2351
+ out: boolean;
2352
+ const: boolean;
2353
+ parent: Node$1;
2354
+ }
2355
+ interface TSTypeParameterDeclaration extends Span {
2356
+ type: "TSTypeParameterDeclaration";
2357
+ params: Array<TSTypeParameter>;
2358
+ parent: Node$1;
2359
+ }
2360
+ interface TSTypeAliasDeclaration extends Span {
2361
+ type: "TSTypeAliasDeclaration";
2362
+ id: BindingIdentifier;
2363
+ typeParameters: TSTypeParameterDeclaration | null;
2364
+ typeAnnotation: TSType;
2365
+ declare: boolean;
2366
+ parent: Node$1;
2367
+ }
2368
+ type TSAccessibility = "private" | "protected" | "public";
2369
+ interface TSClassImplements extends Span {
2370
+ type: "TSClassImplements";
2371
+ expression: IdentifierReference | ThisExpression | MemberExpression;
2372
+ typeArguments: TSTypeParameterInstantiation | null;
2373
+ parent: Node$1;
2374
+ }
2375
+ interface TSInterfaceDeclaration extends Span {
2376
+ type: "TSInterfaceDeclaration";
2377
+ id: BindingIdentifier;
2378
+ typeParameters: TSTypeParameterDeclaration | null;
2379
+ extends: Array<TSInterfaceHeritage>;
2380
+ body: TSInterfaceBody;
2381
+ declare: boolean;
2382
+ parent: Node$1;
2383
+ }
2384
+ interface TSInterfaceBody extends Span {
2385
+ type: "TSInterfaceBody";
2386
+ body: Array<TSSignature>;
2387
+ parent: Node$1;
2388
+ }
2389
+ interface TSPropertySignature extends Span {
2390
+ type: "TSPropertySignature";
2391
+ computed: boolean;
2392
+ optional: boolean;
2393
+ readonly: boolean;
2394
+ key: PropertyKey$1;
2395
+ typeAnnotation: TSTypeAnnotation | null;
2396
+ accessibility: null;
2397
+ static: false;
2398
+ parent: Node$1;
2399
+ }
2400
+ type TSSignature = TSIndexSignature | TSPropertySignature | TSCallSignatureDeclaration | TSConstructSignatureDeclaration | TSMethodSignature;
2401
+ interface TSIndexSignature extends Span {
2402
+ type: "TSIndexSignature";
2403
+ parameters: Array<TSIndexSignatureName>;
2404
+ typeAnnotation: TSTypeAnnotation;
2405
+ readonly: boolean;
2406
+ static: boolean;
2407
+ accessibility: null;
2408
+ parent: Node$1;
2409
+ }
2410
+ interface TSCallSignatureDeclaration extends Span {
2411
+ type: "TSCallSignatureDeclaration";
2412
+ typeParameters: TSTypeParameterDeclaration | null;
2413
+ params: ParamPattern[];
2414
+ returnType: TSTypeAnnotation | null;
2415
+ parent: Node$1;
2416
+ }
2417
+ type TSMethodSignatureKind = "method" | "get" | "set";
2418
+ interface TSMethodSignature extends Span {
2419
+ type: "TSMethodSignature";
2420
+ key: PropertyKey$1;
2421
+ computed: boolean;
2422
+ optional: boolean;
2423
+ kind: TSMethodSignatureKind;
2424
+ typeParameters: TSTypeParameterDeclaration | null;
2425
+ params: ParamPattern[];
2426
+ returnType: TSTypeAnnotation | null;
2427
+ accessibility: null;
2428
+ readonly: false;
2429
+ static: false;
2430
+ parent: Node$1;
2431
+ }
2432
+ interface TSConstructSignatureDeclaration extends Span {
2433
+ type: "TSConstructSignatureDeclaration";
2434
+ typeParameters: TSTypeParameterDeclaration | null;
2435
+ params: ParamPattern[];
2436
+ returnType: TSTypeAnnotation | null;
2437
+ parent: Node$1;
2438
+ }
2439
+ interface TSIndexSignatureName extends Span {
2440
+ type: "Identifier";
2441
+ decorators: [];
2442
+ name: string;
2443
+ optional: false;
2444
+ typeAnnotation: TSTypeAnnotation;
2445
+ parent: Node$1;
2446
+ }
2447
+ interface TSInterfaceHeritage extends Span {
2448
+ type: "TSInterfaceHeritage";
2449
+ expression: Expression;
2450
+ typeArguments: TSTypeParameterInstantiation | null;
2451
+ parent: Node$1;
2452
+ }
2453
+ interface TSTypePredicate extends Span {
2454
+ type: "TSTypePredicate";
2455
+ parameterName: TSTypePredicateName;
2456
+ asserts: boolean;
2457
+ typeAnnotation: TSTypeAnnotation | null;
2458
+ parent: Node$1;
2459
+ }
2460
+ type TSTypePredicateName = IdentifierName | TSThisType;
2461
+ interface TSModuleDeclaration extends Span {
2462
+ type: "TSModuleDeclaration";
2463
+ id: BindingIdentifier | StringLiteral | TSQualifiedName;
2464
+ body: TSModuleBlock | null;
2465
+ kind: TSModuleDeclarationKind;
2466
+ declare: boolean;
2467
+ global: false;
2468
+ parent: Node$1;
2469
+ }
2470
+ type TSModuleDeclarationKind = "module" | "namespace";
2471
+ interface TSGlobalDeclaration extends Span {
2472
+ type: "TSModuleDeclaration";
2473
+ id: IdentifierName;
2474
+ body: TSModuleBlock;
2475
+ kind: "global";
2476
+ declare: boolean;
2477
+ global: true;
2478
+ parent: Node$1;
2479
+ }
2480
+ interface TSModuleBlock extends Span {
2481
+ type: "TSModuleBlock";
2482
+ body: Array<Directive | Statement>;
2483
+ parent: Node$1;
2484
+ }
2485
+ interface TSTypeLiteral extends Span {
2486
+ type: "TSTypeLiteral";
2487
+ members: Array<TSSignature>;
2488
+ parent: Node$1;
2489
+ }
2490
+ interface TSInferType extends Span {
2491
+ type: "TSInferType";
2492
+ typeParameter: TSTypeParameter;
2493
+ parent: Node$1;
2494
+ }
2495
+ interface TSTypeQuery extends Span {
2496
+ type: "TSTypeQuery";
2497
+ exprName: TSTypeQueryExprName;
2498
+ typeArguments: TSTypeParameterInstantiation | null;
2499
+ parent: Node$1;
2500
+ }
2501
+ type TSTypeQueryExprName = TSImportType | TSTypeName;
2502
+ interface TSImportType extends Span {
2503
+ type: "TSImportType";
2504
+ source: StringLiteral;
2505
+ options: ObjectExpression | null;
2506
+ qualifier: TSImportTypeQualifier | null;
2507
+ typeArguments: TSTypeParameterInstantiation | null;
2508
+ parent: Node$1;
2509
+ }
2510
+ type TSImportTypeQualifier = IdentifierName | TSImportTypeQualifiedName;
2511
+ interface TSImportTypeQualifiedName extends Span {
2512
+ type: "TSQualifiedName";
2513
+ left: TSImportTypeQualifier;
2514
+ right: IdentifierName;
2515
+ parent: Node$1;
2516
+ }
2517
+ interface TSFunctionType extends Span {
2518
+ type: "TSFunctionType";
2519
+ typeParameters: TSTypeParameterDeclaration | null;
2520
+ params: ParamPattern[];
2521
+ returnType: TSTypeAnnotation;
2522
+ parent: Node$1;
2523
+ }
2524
+ interface TSConstructorType extends Span {
2525
+ type: "TSConstructorType";
2526
+ abstract: boolean;
2527
+ typeParameters: TSTypeParameterDeclaration | null;
2528
+ params: ParamPattern[];
2529
+ returnType: TSTypeAnnotation;
2530
+ parent: Node$1;
2531
+ }
2532
+ interface TSMappedType extends Span {
2533
+ type: "TSMappedType";
2534
+ key: BindingIdentifier;
2535
+ constraint: TSType;
2536
+ nameType: TSType | null;
2537
+ typeAnnotation: TSType | null;
2538
+ optional: TSMappedTypeModifierOperator | false;
2539
+ readonly: TSMappedTypeModifierOperator | null;
2540
+ parent: Node$1;
2541
+ }
2542
+ type TSMappedTypeModifierOperator = true | "+" | "-";
2543
+ interface TSTemplateLiteralType extends Span {
2544
+ type: "TSTemplateLiteralType";
2545
+ quasis: Array<TemplateElement>;
2546
+ types: Array<TSType>;
2547
+ parent: Node$1;
2548
+ }
2549
+ interface TSAsExpression extends Span {
2550
+ type: "TSAsExpression";
2551
+ expression: Expression;
2552
+ typeAnnotation: TSType;
2553
+ parent: Node$1;
2554
+ }
2555
+ interface TSSatisfiesExpression extends Span {
2556
+ type: "TSSatisfiesExpression";
2557
+ expression: Expression;
2558
+ typeAnnotation: TSType;
2559
+ parent: Node$1;
2560
+ }
2561
+ interface TSTypeAssertion extends Span {
2562
+ type: "TSTypeAssertion";
2563
+ typeAnnotation: TSType;
2564
+ expression: Expression;
2565
+ parent: Node$1;
2566
+ }
2567
+ interface TSImportEqualsDeclaration extends Span {
2568
+ type: "TSImportEqualsDeclaration";
2569
+ id: BindingIdentifier;
2570
+ moduleReference: TSModuleReference;
2571
+ importKind: ImportOrExportKind;
2572
+ parent: Node$1;
2573
+ }
2574
+ type TSModuleReference = TSExternalModuleReference | IdentifierReference | TSQualifiedName;
2575
+ interface TSExternalModuleReference extends Span {
2576
+ type: "TSExternalModuleReference";
2577
+ expression: StringLiteral;
2578
+ parent: Node$1;
2579
+ }
2580
+ interface TSNonNullExpression extends Span {
2581
+ type: "TSNonNullExpression";
2582
+ expression: Expression;
2583
+ parent: Node$1;
2584
+ }
2585
+ interface Decorator extends Span {
2586
+ type: "Decorator";
2587
+ expression: Expression;
2588
+ parent: Node$1;
2589
+ }
2590
+ interface TSExportAssignment extends Span {
2591
+ type: "TSExportAssignment";
2592
+ expression: Expression;
2593
+ parent: Node$1;
2594
+ }
2595
+ interface TSNamespaceExportDeclaration extends Span {
2596
+ type: "TSNamespaceExportDeclaration";
2597
+ id: IdentifierName;
2598
+ parent: Node$1;
2599
+ }
2600
+ interface TSInstantiationExpression extends Span {
2601
+ type: "TSInstantiationExpression";
2602
+ expression: Expression;
2603
+ typeArguments: TSTypeParameterInstantiation;
2604
+ parent: Node$1;
2605
+ }
2606
+ type ImportOrExportKind = "value" | "type";
2607
+ interface JSDocNullableType extends Span {
2608
+ type: "TSJSDocNullableType";
2609
+ typeAnnotation: TSType;
2610
+ postfix: boolean;
2611
+ parent: Node$1;
2612
+ }
2613
+ interface JSDocNonNullableType extends Span {
2614
+ type: "TSJSDocNonNullableType";
2615
+ typeAnnotation: TSType;
2616
+ postfix: boolean;
2617
+ parent: Node$1;
2618
+ }
2619
+ interface JSDocUnknownType extends Span {
2620
+ type: "TSJSDocUnknownType";
2621
+ parent: Node$1;
2622
+ }
2623
+ type AssignmentOperator = "=" | "+=" | "-=" | "*=" | "/=" | "%=" | "**=" | "<<=" | ">>=" | ">>>=" | "|=" | "^=" | "&=" | "||=" | "&&=" | "??=";
2624
+ type BinaryOperator = "==" | "!=" | "===" | "!==" | "<" | "<=" | ">" | ">=" | "+" | "-" | "*" | "/" | "%" | "**" | "<<" | ">>" | ">>>" | "|" | "^" | "&" | "in" | "instanceof";
2625
+ type LogicalOperator = "||" | "&&" | "??";
2626
+ type UnaryOperator = "+" | "-" | "!" | "~" | "typeof" | "void" | "delete";
2627
+ type UpdateOperator = "++" | "--";
2628
+ type ModuleKind = "script" | "module" | "commonjs";
2629
+ type Node$1 = Program | IdentifierName | IdentifierReference | BindingIdentifier | LabelIdentifier | ThisExpression | ArrayExpression | ObjectExpression | ObjectProperty | TemplateLiteral | TaggedTemplateExpression | TemplateElement | ComputedMemberExpression | StaticMemberExpression | PrivateFieldExpression | CallExpression | NewExpression | MetaProperty | SpreadElement | UpdateExpression | UnaryExpression | BinaryExpression | PrivateInExpression | LogicalExpression | ConditionalExpression | AssignmentExpression | ArrayAssignmentTarget | ObjectAssignmentTarget | AssignmentTargetRest | AssignmentTargetWithDefault | AssignmentTargetPropertyIdentifier | AssignmentTargetPropertyProperty | SequenceExpression | Super | AwaitExpression | ChainExpression | ParenthesizedExpression | Directive | Hashbang | BlockStatement | VariableDeclaration | VariableDeclarator | EmptyStatement | ExpressionStatement | IfStatement | DoWhileStatement | WhileStatement | ForStatement | ForInStatement | ForOfStatement | ContinueStatement | BreakStatement | ReturnStatement | WithStatement | SwitchStatement | SwitchCase | LabeledStatement | ThrowStatement | TryStatement | CatchClause | DebuggerStatement | AssignmentPattern | ObjectPattern | BindingProperty | ArrayPattern | BindingRestElement | Function$1 | FunctionBody | ArrowFunctionExpression | YieldExpression | Class | ClassBody | MethodDefinition | PropertyDefinition | PrivateIdentifier | StaticBlock | AccessorProperty | ImportExpression | ImportDeclaration | ImportSpecifier | ImportDefaultSpecifier | ImportNamespaceSpecifier | ImportAttribute | ExportNamedDeclaration | ExportDefaultDeclaration | ExportAllDeclaration | ExportSpecifier | V8IntrinsicExpression | BooleanLiteral | NullLiteral | NumericLiteral | StringLiteral | BigIntLiteral | RegExpLiteral | JSXElement | JSXOpeningElement | JSXClosingElement | JSXFragment | JSXOpeningFragment | JSXClosingFragment | JSXNamespacedName | JSXMemberExpression | JSXExpressionContainer | JSXEmptyExpression | JSXAttribute | JSXSpreadAttribute | JSXIdentifier | JSXSpreadChild | JSXText | TSThisParameter | TSEnumDeclaration | TSEnumBody | TSEnumMember | TSTypeAnnotation | TSLiteralType | TSConditionalType | TSUnionType | TSIntersectionType | TSParenthesizedType | TSTypeOperator | TSArrayType | TSIndexedAccessType | TSTupleType | TSNamedTupleMember | TSOptionalType | TSRestType | TSAnyKeyword | TSStringKeyword | TSBooleanKeyword | TSNumberKeyword | TSNeverKeyword | TSIntrinsicKeyword | TSUnknownKeyword | TSNullKeyword | TSUndefinedKeyword | TSVoidKeyword | TSSymbolKeyword | TSThisType | TSObjectKeyword | TSBigIntKeyword | TSTypeReference | TSQualifiedName | TSTypeParameterInstantiation | TSTypeParameter | TSTypeParameterDeclaration | TSTypeAliasDeclaration | TSClassImplements | TSInterfaceDeclaration | TSInterfaceBody | TSPropertySignature | TSIndexSignature | TSCallSignatureDeclaration | TSMethodSignature | TSConstructSignatureDeclaration | TSIndexSignatureName | TSInterfaceHeritage | TSTypePredicate | TSModuleDeclaration | TSGlobalDeclaration | TSModuleBlock | TSTypeLiteral | TSInferType | TSTypeQuery | TSImportType | TSImportTypeQualifiedName | TSFunctionType | TSConstructorType | TSMappedType | TSTemplateLiteralType | TSAsExpression | TSSatisfiesExpression | TSTypeAssertion | TSImportEqualsDeclaration | TSExternalModuleReference | TSNonNullExpression | Decorator | TSExportAssignment | TSNamespaceExportDeclaration | TSInstantiationExpression | JSDocNullableType | JSDocNonNullableType | JSDocUnknownType | ParamPattern;
2630
+ //#endregion
2631
+ //#region src-js/generated/visitor.d.ts
2632
+ interface VisitorObject {
2633
+ DebuggerStatement?: (node: DebuggerStatement) => void;
2634
+ "DebuggerStatement:exit"?: (node: DebuggerStatement) => void;
2635
+ EmptyStatement?: (node: EmptyStatement) => void;
2636
+ "EmptyStatement:exit"?: (node: EmptyStatement) => void;
2637
+ Literal?: (node: BooleanLiteral | NullLiteral | NumericLiteral | StringLiteral | BigIntLiteral | RegExpLiteral) => void;
2638
+ "Literal:exit"?: (node: BooleanLiteral | NullLiteral | NumericLiteral | StringLiteral | BigIntLiteral | RegExpLiteral) => void;
2639
+ PrivateIdentifier?: (node: PrivateIdentifier) => void;
2640
+ "PrivateIdentifier:exit"?: (node: PrivateIdentifier) => void;
2641
+ Super?: (node: Super) => void;
2642
+ "Super:exit"?: (node: Super) => void;
2643
+ TemplateElement?: (node: TemplateElement) => void;
2644
+ "TemplateElement:exit"?: (node: TemplateElement) => void;
2645
+ ThisExpression?: (node: ThisExpression) => void;
2646
+ "ThisExpression:exit"?: (node: ThisExpression) => void;
2647
+ JSXClosingFragment?: (node: JSXClosingFragment) => void;
2648
+ "JSXClosingFragment:exit"?: (node: JSXClosingFragment) => void;
2649
+ JSXEmptyExpression?: (node: JSXEmptyExpression) => void;
2650
+ "JSXEmptyExpression:exit"?: (node: JSXEmptyExpression) => void;
2651
+ JSXIdentifier?: (node: JSXIdentifier) => void;
2652
+ "JSXIdentifier:exit"?: (node: JSXIdentifier) => void;
2653
+ JSXOpeningFragment?: (node: JSXOpeningFragment) => void;
2654
+ "JSXOpeningFragment:exit"?: (node: JSXOpeningFragment) => void;
2655
+ JSXText?: (node: JSXText) => void;
2656
+ "JSXText:exit"?: (node: JSXText) => void;
2657
+ TSAnyKeyword?: (node: TSAnyKeyword) => void;
2658
+ "TSAnyKeyword:exit"?: (node: TSAnyKeyword) => void;
2659
+ TSBigIntKeyword?: (node: TSBigIntKeyword) => void;
2660
+ "TSBigIntKeyword:exit"?: (node: TSBigIntKeyword) => void;
2661
+ TSBooleanKeyword?: (node: TSBooleanKeyword) => void;
2662
+ "TSBooleanKeyword:exit"?: (node: TSBooleanKeyword) => void;
2663
+ TSIntrinsicKeyword?: (node: TSIntrinsicKeyword) => void;
2664
+ "TSIntrinsicKeyword:exit"?: (node: TSIntrinsicKeyword) => void;
2665
+ TSJSDocUnknownType?: (node: JSDocUnknownType) => void;
2666
+ "TSJSDocUnknownType:exit"?: (node: JSDocUnknownType) => void;
2667
+ TSNeverKeyword?: (node: TSNeverKeyword) => void;
2668
+ "TSNeverKeyword:exit"?: (node: TSNeverKeyword) => void;
2669
+ TSNullKeyword?: (node: TSNullKeyword) => void;
2670
+ "TSNullKeyword:exit"?: (node: TSNullKeyword) => void;
2671
+ TSNumberKeyword?: (node: TSNumberKeyword) => void;
2672
+ "TSNumberKeyword:exit"?: (node: TSNumberKeyword) => void;
2673
+ TSObjectKeyword?: (node: TSObjectKeyword) => void;
2674
+ "TSObjectKeyword:exit"?: (node: TSObjectKeyword) => void;
2675
+ TSStringKeyword?: (node: TSStringKeyword) => void;
2676
+ "TSStringKeyword:exit"?: (node: TSStringKeyword) => void;
2677
+ TSSymbolKeyword?: (node: TSSymbolKeyword) => void;
2678
+ "TSSymbolKeyword:exit"?: (node: TSSymbolKeyword) => void;
2679
+ TSThisType?: (node: TSThisType) => void;
2680
+ "TSThisType:exit"?: (node: TSThisType) => void;
2681
+ TSUndefinedKeyword?: (node: TSUndefinedKeyword) => void;
2682
+ "TSUndefinedKeyword:exit"?: (node: TSUndefinedKeyword) => void;
2683
+ TSUnknownKeyword?: (node: TSUnknownKeyword) => void;
2684
+ "TSUnknownKeyword:exit"?: (node: TSUnknownKeyword) => void;
2685
+ TSVoidKeyword?: (node: TSVoidKeyword) => void;
2686
+ "TSVoidKeyword:exit"?: (node: TSVoidKeyword) => void;
2687
+ AccessorProperty?: (node: AccessorProperty) => void;
2688
+ "AccessorProperty:exit"?: (node: AccessorProperty) => void;
2689
+ ArrayExpression?: (node: ArrayExpression) => void;
2690
+ "ArrayExpression:exit"?: (node: ArrayExpression) => void;
2691
+ ArrayPattern?: (node: ArrayPattern) => void;
2692
+ "ArrayPattern:exit"?: (node: ArrayPattern) => void;
2693
+ ArrowFunctionExpression?: (node: ArrowFunctionExpression) => void;
2694
+ "ArrowFunctionExpression:exit"?: (node: ArrowFunctionExpression) => void;
2695
+ AssignmentExpression?: (node: AssignmentExpression) => void;
2696
+ "AssignmentExpression:exit"?: (node: AssignmentExpression) => void;
2697
+ AssignmentPattern?: (node: AssignmentPattern) => void;
2698
+ "AssignmentPattern:exit"?: (node: AssignmentPattern) => void;
2699
+ AwaitExpression?: (node: AwaitExpression) => void;
2700
+ "AwaitExpression:exit"?: (node: AwaitExpression) => void;
2701
+ BinaryExpression?: (node: BinaryExpression) => void;
2702
+ "BinaryExpression:exit"?: (node: BinaryExpression) => void;
2703
+ BlockStatement?: (node: BlockStatement) => void;
2704
+ "BlockStatement:exit"?: (node: BlockStatement) => void;
2705
+ BreakStatement?: (node: BreakStatement) => void;
2706
+ "BreakStatement:exit"?: (node: BreakStatement) => void;
2707
+ CallExpression?: (node: CallExpression) => void;
2708
+ "CallExpression:exit"?: (node: CallExpression) => void;
2709
+ CatchClause?: (node: CatchClause) => void;
2710
+ "CatchClause:exit"?: (node: CatchClause) => void;
2711
+ ChainExpression?: (node: ChainExpression) => void;
2712
+ "ChainExpression:exit"?: (node: ChainExpression) => void;
2713
+ ClassBody?: (node: ClassBody) => void;
2714
+ "ClassBody:exit"?: (node: ClassBody) => void;
2715
+ ClassDeclaration?: (node: Class) => void;
2716
+ "ClassDeclaration:exit"?: (node: Class) => void;
2717
+ ClassExpression?: (node: Class) => void;
2718
+ "ClassExpression:exit"?: (node: Class) => void;
2719
+ ConditionalExpression?: (node: ConditionalExpression) => void;
2720
+ "ConditionalExpression:exit"?: (node: ConditionalExpression) => void;
2721
+ ContinueStatement?: (node: ContinueStatement) => void;
2722
+ "ContinueStatement:exit"?: (node: ContinueStatement) => void;
2723
+ Decorator?: (node: Decorator) => void;
2724
+ "Decorator:exit"?: (node: Decorator) => void;
2725
+ DoWhileStatement?: (node: DoWhileStatement) => void;
2726
+ "DoWhileStatement:exit"?: (node: DoWhileStatement) => void;
2727
+ ExportAllDeclaration?: (node: ExportAllDeclaration) => void;
2728
+ "ExportAllDeclaration:exit"?: (node: ExportAllDeclaration) => void;
2729
+ ExportDefaultDeclaration?: (node: ExportDefaultDeclaration) => void;
2730
+ "ExportDefaultDeclaration:exit"?: (node: ExportDefaultDeclaration) => void;
2731
+ ExportNamedDeclaration?: (node: ExportNamedDeclaration) => void;
2732
+ "ExportNamedDeclaration:exit"?: (node: ExportNamedDeclaration) => void;
2733
+ ExportSpecifier?: (node: ExportSpecifier) => void;
2734
+ "ExportSpecifier:exit"?: (node: ExportSpecifier) => void;
2735
+ ExpressionStatement?: (node: ExpressionStatement) => void;
2736
+ "ExpressionStatement:exit"?: (node: ExpressionStatement) => void;
2737
+ ForInStatement?: (node: ForInStatement) => void;
2738
+ "ForInStatement:exit"?: (node: ForInStatement) => void;
2739
+ ForOfStatement?: (node: ForOfStatement) => void;
2740
+ "ForOfStatement:exit"?: (node: ForOfStatement) => void;
2741
+ ForStatement?: (node: ForStatement) => void;
2742
+ "ForStatement:exit"?: (node: ForStatement) => void;
2743
+ FunctionDeclaration?: (node: Function$1) => void;
2744
+ "FunctionDeclaration:exit"?: (node: Function$1) => void;
2745
+ FunctionExpression?: (node: Function$1) => void;
2746
+ "FunctionExpression:exit"?: (node: Function$1) => void;
2747
+ Identifier?: (node: IdentifierName | IdentifierReference | BindingIdentifier | LabelIdentifier | TSThisParameter | TSIndexSignatureName) => void;
2748
+ "Identifier:exit"?: (node: IdentifierName | IdentifierReference | BindingIdentifier | LabelIdentifier | TSThisParameter | TSIndexSignatureName) => void;
2749
+ IfStatement?: (node: IfStatement) => void;
2750
+ "IfStatement:exit"?: (node: IfStatement) => void;
2751
+ ImportAttribute?: (node: ImportAttribute) => void;
2752
+ "ImportAttribute:exit"?: (node: ImportAttribute) => void;
2753
+ ImportDeclaration?: (node: ImportDeclaration) => void;
2754
+ "ImportDeclaration:exit"?: (node: ImportDeclaration) => void;
2755
+ ImportDefaultSpecifier?: (node: ImportDefaultSpecifier) => void;
2756
+ "ImportDefaultSpecifier:exit"?: (node: ImportDefaultSpecifier) => void;
2757
+ ImportExpression?: (node: ImportExpression) => void;
2758
+ "ImportExpression:exit"?: (node: ImportExpression) => void;
2759
+ ImportNamespaceSpecifier?: (node: ImportNamespaceSpecifier) => void;
2760
+ "ImportNamespaceSpecifier:exit"?: (node: ImportNamespaceSpecifier) => void;
2761
+ ImportSpecifier?: (node: ImportSpecifier) => void;
2762
+ "ImportSpecifier:exit"?: (node: ImportSpecifier) => void;
2763
+ LabeledStatement?: (node: LabeledStatement) => void;
2764
+ "LabeledStatement:exit"?: (node: LabeledStatement) => void;
2765
+ LogicalExpression?: (node: LogicalExpression) => void;
2766
+ "LogicalExpression:exit"?: (node: LogicalExpression) => void;
2767
+ MemberExpression?: (node: MemberExpression) => void;
2768
+ "MemberExpression:exit"?: (node: MemberExpression) => void;
2769
+ MetaProperty?: (node: MetaProperty) => void;
2770
+ "MetaProperty:exit"?: (node: MetaProperty) => void;
2771
+ MethodDefinition?: (node: MethodDefinition) => void;
2772
+ "MethodDefinition:exit"?: (node: MethodDefinition) => void;
2773
+ NewExpression?: (node: NewExpression) => void;
2774
+ "NewExpression:exit"?: (node: NewExpression) => void;
2775
+ ObjectExpression?: (node: ObjectExpression) => void;
2776
+ "ObjectExpression:exit"?: (node: ObjectExpression) => void;
2777
+ ObjectPattern?: (node: ObjectPattern) => void;
2778
+ "ObjectPattern:exit"?: (node: ObjectPattern) => void;
2779
+ ParenthesizedExpression?: (node: ParenthesizedExpression) => void;
2780
+ "ParenthesizedExpression:exit"?: (node: ParenthesizedExpression) => void;
2781
+ Program?: (node: Program) => void;
2782
+ "Program:exit"?: (node: Program) => void;
2783
+ Property?: (node: ObjectProperty | AssignmentTargetProperty | AssignmentTargetPropertyProperty | BindingProperty) => void;
2784
+ "Property:exit"?: (node: ObjectProperty | AssignmentTargetProperty | AssignmentTargetPropertyProperty | BindingProperty) => void;
2785
+ PropertyDefinition?: (node: PropertyDefinition) => void;
2786
+ "PropertyDefinition:exit"?: (node: PropertyDefinition) => void;
2787
+ RestElement?: (node: AssignmentTargetRest | BindingRestElement | FormalParameterRest) => void;
2788
+ "RestElement:exit"?: (node: AssignmentTargetRest | BindingRestElement | FormalParameterRest) => void;
2789
+ ReturnStatement?: (node: ReturnStatement) => void;
2790
+ "ReturnStatement:exit"?: (node: ReturnStatement) => void;
2791
+ SequenceExpression?: (node: SequenceExpression) => void;
2792
+ "SequenceExpression:exit"?: (node: SequenceExpression) => void;
2793
+ SpreadElement?: (node: SpreadElement) => void;
2794
+ "SpreadElement:exit"?: (node: SpreadElement) => void;
2795
+ StaticBlock?: (node: StaticBlock) => void;
2796
+ "StaticBlock:exit"?: (node: StaticBlock) => void;
2797
+ SwitchCase?: (node: SwitchCase) => void;
2798
+ "SwitchCase:exit"?: (node: SwitchCase) => void;
2799
+ SwitchStatement?: (node: SwitchStatement) => void;
2800
+ "SwitchStatement:exit"?: (node: SwitchStatement) => void;
2801
+ TaggedTemplateExpression?: (node: TaggedTemplateExpression) => void;
2802
+ "TaggedTemplateExpression:exit"?: (node: TaggedTemplateExpression) => void;
2803
+ TemplateLiteral?: (node: TemplateLiteral) => void;
2804
+ "TemplateLiteral:exit"?: (node: TemplateLiteral) => void;
2805
+ ThrowStatement?: (node: ThrowStatement) => void;
2806
+ "ThrowStatement:exit"?: (node: ThrowStatement) => void;
2807
+ TryStatement?: (node: TryStatement) => void;
2808
+ "TryStatement:exit"?: (node: TryStatement) => void;
2809
+ UnaryExpression?: (node: UnaryExpression) => void;
2810
+ "UnaryExpression:exit"?: (node: UnaryExpression) => void;
2811
+ UpdateExpression?: (node: UpdateExpression) => void;
2812
+ "UpdateExpression:exit"?: (node: UpdateExpression) => void;
2813
+ V8IntrinsicExpression?: (node: V8IntrinsicExpression) => void;
2814
+ "V8IntrinsicExpression:exit"?: (node: V8IntrinsicExpression) => void;
2815
+ VariableDeclaration?: (node: VariableDeclaration) => void;
2816
+ "VariableDeclaration:exit"?: (node: VariableDeclaration) => void;
2817
+ VariableDeclarator?: (node: VariableDeclarator) => void;
2818
+ "VariableDeclarator:exit"?: (node: VariableDeclarator) => void;
2819
+ WhileStatement?: (node: WhileStatement) => void;
2820
+ "WhileStatement:exit"?: (node: WhileStatement) => void;
2821
+ WithStatement?: (node: WithStatement) => void;
2822
+ "WithStatement:exit"?: (node: WithStatement) => void;
2823
+ YieldExpression?: (node: YieldExpression) => void;
2824
+ "YieldExpression:exit"?: (node: YieldExpression) => void;
2825
+ JSXAttribute?: (node: JSXAttribute) => void;
2826
+ "JSXAttribute:exit"?: (node: JSXAttribute) => void;
2827
+ JSXClosingElement?: (node: JSXClosingElement) => void;
2828
+ "JSXClosingElement:exit"?: (node: JSXClosingElement) => void;
2829
+ JSXElement?: (node: JSXElement) => void;
2830
+ "JSXElement:exit"?: (node: JSXElement) => void;
2831
+ JSXExpressionContainer?: (node: JSXExpressionContainer) => void;
2832
+ "JSXExpressionContainer:exit"?: (node: JSXExpressionContainer) => void;
2833
+ JSXFragment?: (node: JSXFragment) => void;
2834
+ "JSXFragment:exit"?: (node: JSXFragment) => void;
2835
+ JSXMemberExpression?: (node: JSXMemberExpression) => void;
2836
+ "JSXMemberExpression:exit"?: (node: JSXMemberExpression) => void;
2837
+ JSXNamespacedName?: (node: JSXNamespacedName) => void;
2838
+ "JSXNamespacedName:exit"?: (node: JSXNamespacedName) => void;
2839
+ JSXOpeningElement?: (node: JSXOpeningElement) => void;
2840
+ "JSXOpeningElement:exit"?: (node: JSXOpeningElement) => void;
2841
+ JSXSpreadAttribute?: (node: JSXSpreadAttribute) => void;
2842
+ "JSXSpreadAttribute:exit"?: (node: JSXSpreadAttribute) => void;
2843
+ JSXSpreadChild?: (node: JSXSpreadChild) => void;
2844
+ "JSXSpreadChild:exit"?: (node: JSXSpreadChild) => void;
2845
+ TSAbstractAccessorProperty?: (node: AccessorProperty) => void;
2846
+ "TSAbstractAccessorProperty:exit"?: (node: AccessorProperty) => void;
2847
+ TSAbstractMethodDefinition?: (node: MethodDefinition) => void;
2848
+ "TSAbstractMethodDefinition:exit"?: (node: MethodDefinition) => void;
2849
+ TSAbstractPropertyDefinition?: (node: PropertyDefinition) => void;
2850
+ "TSAbstractPropertyDefinition:exit"?: (node: PropertyDefinition) => void;
2851
+ TSArrayType?: (node: TSArrayType) => void;
2852
+ "TSArrayType:exit"?: (node: TSArrayType) => void;
2853
+ TSAsExpression?: (node: TSAsExpression) => void;
2854
+ "TSAsExpression:exit"?: (node: TSAsExpression) => void;
2855
+ TSCallSignatureDeclaration?: (node: TSCallSignatureDeclaration) => void;
2856
+ "TSCallSignatureDeclaration:exit"?: (node: TSCallSignatureDeclaration) => void;
2857
+ TSClassImplements?: (node: TSClassImplements) => void;
2858
+ "TSClassImplements:exit"?: (node: TSClassImplements) => void;
2859
+ TSConditionalType?: (node: TSConditionalType) => void;
2860
+ "TSConditionalType:exit"?: (node: TSConditionalType) => void;
2861
+ TSConstructSignatureDeclaration?: (node: TSConstructSignatureDeclaration) => void;
2862
+ "TSConstructSignatureDeclaration:exit"?: (node: TSConstructSignatureDeclaration) => void;
2863
+ TSConstructorType?: (node: TSConstructorType) => void;
2864
+ "TSConstructorType:exit"?: (node: TSConstructorType) => void;
2865
+ TSDeclareFunction?: (node: Function$1) => void;
2866
+ "TSDeclareFunction:exit"?: (node: Function$1) => void;
2867
+ TSEmptyBodyFunctionExpression?: (node: Function$1) => void;
2868
+ "TSEmptyBodyFunctionExpression:exit"?: (node: Function$1) => void;
2869
+ TSEnumBody?: (node: TSEnumBody) => void;
2870
+ "TSEnumBody:exit"?: (node: TSEnumBody) => void;
2871
+ TSEnumDeclaration?: (node: TSEnumDeclaration) => void;
2872
+ "TSEnumDeclaration:exit"?: (node: TSEnumDeclaration) => void;
2873
+ TSEnumMember?: (node: TSEnumMember) => void;
2874
+ "TSEnumMember:exit"?: (node: TSEnumMember) => void;
2875
+ TSExportAssignment?: (node: TSExportAssignment) => void;
2876
+ "TSExportAssignment:exit"?: (node: TSExportAssignment) => void;
2877
+ TSExternalModuleReference?: (node: TSExternalModuleReference) => void;
2878
+ "TSExternalModuleReference:exit"?: (node: TSExternalModuleReference) => void;
2879
+ TSFunctionType?: (node: TSFunctionType) => void;
2880
+ "TSFunctionType:exit"?: (node: TSFunctionType) => void;
2881
+ TSImportEqualsDeclaration?: (node: TSImportEqualsDeclaration) => void;
2882
+ "TSImportEqualsDeclaration:exit"?: (node: TSImportEqualsDeclaration) => void;
2883
+ TSImportType?: (node: TSImportType) => void;
2884
+ "TSImportType:exit"?: (node: TSImportType) => void;
2885
+ TSIndexSignature?: (node: TSIndexSignature) => void;
2886
+ "TSIndexSignature:exit"?: (node: TSIndexSignature) => void;
2887
+ TSIndexedAccessType?: (node: TSIndexedAccessType) => void;
2888
+ "TSIndexedAccessType:exit"?: (node: TSIndexedAccessType) => void;
2889
+ TSInferType?: (node: TSInferType) => void;
2890
+ "TSInferType:exit"?: (node: TSInferType) => void;
2891
+ TSInstantiationExpression?: (node: TSInstantiationExpression) => void;
2892
+ "TSInstantiationExpression:exit"?: (node: TSInstantiationExpression) => void;
2893
+ TSInterfaceBody?: (node: TSInterfaceBody) => void;
2894
+ "TSInterfaceBody:exit"?: (node: TSInterfaceBody) => void;
2895
+ TSInterfaceDeclaration?: (node: TSInterfaceDeclaration) => void;
2896
+ "TSInterfaceDeclaration:exit"?: (node: TSInterfaceDeclaration) => void;
2897
+ TSInterfaceHeritage?: (node: TSInterfaceHeritage) => void;
2898
+ "TSInterfaceHeritage:exit"?: (node: TSInterfaceHeritage) => void;
2899
+ TSIntersectionType?: (node: TSIntersectionType) => void;
2900
+ "TSIntersectionType:exit"?: (node: TSIntersectionType) => void;
2901
+ TSJSDocNonNullableType?: (node: JSDocNonNullableType) => void;
2902
+ "TSJSDocNonNullableType:exit"?: (node: JSDocNonNullableType) => void;
2903
+ TSJSDocNullableType?: (node: JSDocNullableType) => void;
2904
+ "TSJSDocNullableType:exit"?: (node: JSDocNullableType) => void;
2905
+ TSLiteralType?: (node: TSLiteralType) => void;
2906
+ "TSLiteralType:exit"?: (node: TSLiteralType) => void;
2907
+ TSMappedType?: (node: TSMappedType) => void;
2908
+ "TSMappedType:exit"?: (node: TSMappedType) => void;
2909
+ TSMethodSignature?: (node: TSMethodSignature) => void;
2910
+ "TSMethodSignature:exit"?: (node: TSMethodSignature) => void;
2911
+ TSModuleBlock?: (node: TSModuleBlock) => void;
2912
+ "TSModuleBlock:exit"?: (node: TSModuleBlock) => void;
2913
+ TSModuleDeclaration?: (node: TSModuleDeclaration | TSGlobalDeclaration) => void;
2914
+ "TSModuleDeclaration:exit"?: (node: TSModuleDeclaration | TSGlobalDeclaration) => void;
2915
+ TSNamedTupleMember?: (node: TSNamedTupleMember) => void;
2916
+ "TSNamedTupleMember:exit"?: (node: TSNamedTupleMember) => void;
2917
+ TSNamespaceExportDeclaration?: (node: TSNamespaceExportDeclaration) => void;
2918
+ "TSNamespaceExportDeclaration:exit"?: (node: TSNamespaceExportDeclaration) => void;
2919
+ TSNonNullExpression?: (node: TSNonNullExpression) => void;
2920
+ "TSNonNullExpression:exit"?: (node: TSNonNullExpression) => void;
2921
+ TSOptionalType?: (node: TSOptionalType) => void;
2922
+ "TSOptionalType:exit"?: (node: TSOptionalType) => void;
2923
+ TSParameterProperty?: (node: TSParameterProperty) => void;
2924
+ "TSParameterProperty:exit"?: (node: TSParameterProperty) => void;
2925
+ TSParenthesizedType?: (node: TSParenthesizedType) => void;
2926
+ "TSParenthesizedType:exit"?: (node: TSParenthesizedType) => void;
2927
+ TSPropertySignature?: (node: TSPropertySignature) => void;
2928
+ "TSPropertySignature:exit"?: (node: TSPropertySignature) => void;
2929
+ TSQualifiedName?: (node: TSQualifiedName) => void;
2930
+ "TSQualifiedName:exit"?: (node: TSQualifiedName) => void;
2931
+ TSRestType?: (node: TSRestType) => void;
2932
+ "TSRestType:exit"?: (node: TSRestType) => void;
2933
+ TSSatisfiesExpression?: (node: TSSatisfiesExpression) => void;
2934
+ "TSSatisfiesExpression:exit"?: (node: TSSatisfiesExpression) => void;
2935
+ TSTemplateLiteralType?: (node: TSTemplateLiteralType) => void;
2936
+ "TSTemplateLiteralType:exit"?: (node: TSTemplateLiteralType) => void;
2937
+ TSTupleType?: (node: TSTupleType) => void;
2938
+ "TSTupleType:exit"?: (node: TSTupleType) => void;
2939
+ TSTypeAliasDeclaration?: (node: TSTypeAliasDeclaration) => void;
2940
+ "TSTypeAliasDeclaration:exit"?: (node: TSTypeAliasDeclaration) => void;
2941
+ TSTypeAnnotation?: (node: TSTypeAnnotation) => void;
2942
+ "TSTypeAnnotation:exit"?: (node: TSTypeAnnotation) => void;
2943
+ TSTypeAssertion?: (node: TSTypeAssertion) => void;
2944
+ "TSTypeAssertion:exit"?: (node: TSTypeAssertion) => void;
2945
+ TSTypeLiteral?: (node: TSTypeLiteral) => void;
2946
+ "TSTypeLiteral:exit"?: (node: TSTypeLiteral) => void;
2947
+ TSTypeOperator?: (node: TSTypeOperator) => void;
2948
+ "TSTypeOperator:exit"?: (node: TSTypeOperator) => void;
2949
+ TSTypeParameter?: (node: TSTypeParameter) => void;
2950
+ "TSTypeParameter:exit"?: (node: TSTypeParameter) => void;
2951
+ TSTypeParameterDeclaration?: (node: TSTypeParameterDeclaration) => void;
2952
+ "TSTypeParameterDeclaration:exit"?: (node: TSTypeParameterDeclaration) => void;
2953
+ TSTypeParameterInstantiation?: (node: TSTypeParameterInstantiation) => void;
2954
+ "TSTypeParameterInstantiation:exit"?: (node: TSTypeParameterInstantiation) => void;
2955
+ TSTypePredicate?: (node: TSTypePredicate) => void;
2956
+ "TSTypePredicate:exit"?: (node: TSTypePredicate) => void;
2957
+ TSTypeQuery?: (node: TSTypeQuery) => void;
2958
+ "TSTypeQuery:exit"?: (node: TSTypeQuery) => void;
2959
+ TSTypeReference?: (node: TSTypeReference) => void;
2960
+ "TSTypeReference:exit"?: (node: TSTypeReference) => void;
2961
+ TSUnionType?: (node: TSUnionType) => void;
2962
+ "TSUnionType:exit"?: (node: TSUnionType) => void;
2963
+ [key: string]: (node: Node$1) => void;
2964
+ }
2965
+ //#endregion
2966
+ //#region src-js/plugins/types.d.ts
2967
+ type BeforeHook = () => boolean | void;
2968
+ type AfterHook = () => void;
2969
+ type VisitorWithHooks = VisitorObject & {
2970
+ before?: BeforeHook;
2971
+ after?: AfterHook;
2972
+ };
2973
+ interface Node extends Span {}
2974
+ type NodeOrToken = Node | Token | Comment;
2975
+ interface Comment extends Span {
2976
+ type: "Line" | "Block" | "Shebang";
2977
+ value: string;
2978
+ }
2979
+ //#endregion
2980
+ //#region src-js/plugins/location.d.ts
2981
+ /**
2982
+ * Range of source offsets.
2983
+ */
2984
+ type Range = [number, number];
2985
+ /**
2986
+ * Interface for any type which has `range` field.
2987
+ */
2988
+ interface Ranged {
2989
+ range: Range;
2990
+ }
2991
+ /**
2992
+ * Interface for any type which has location properties.
2993
+ */
2994
+ interface Span extends Ranged {
2995
+ start: number;
2996
+ end: number;
2997
+ loc: Location;
2998
+ }
2999
+ /**
3000
+ * Source code location.
3001
+ */
3002
+ interface Location {
3003
+ start: LineColumn;
3004
+ end: LineColumn;
3005
+ }
3006
+ /**
3007
+ * Line number + column number pair.
3008
+ * `line` is 1-indexed, `column` is 0-indexed.
3009
+ */
3010
+ interface LineColumn {
3011
+ line: number;
3012
+ column: number;
3013
+ }
3014
+ /**
3015
+ * Convert a source text index into a (line, column) pair.
3016
+ * @param offset - The index of a character in a file.
3017
+ * @returns `{line, column}` location object with 1-indexed line and 0-indexed column.
3018
+ * @throws {TypeError|RangeError} If non-numeric `offset`, or `offset` out of range.
3019
+ */
3020
+ declare function getLineColumnFromOffset(offset: number): LineColumn;
3021
+ /**
3022
+ * Convert a `{ line, column }` pair into a range index.
3023
+ * @param loc - A line/column location.
3024
+ * @returns The character index of the location in the file.
3025
+ * @throws {TypeError|RangeError} If `loc` is not an object with a numeric `line` and `column`,
3026
+ * or if the `line` is less than or equal to zero, or the line or column is out of the expected range.
3027
+ */
3028
+ declare function getOffsetFromLineColumn(loc: LineColumn): number;
3029
+ /**
3030
+ * Get the range of the given node or token.
3031
+ * @param nodeOrToken - Node or token to get the range of
3032
+ * @returns Range of the node or token
3033
+ */
3034
+ declare function getRange(nodeOrToken: NodeOrToken): Range;
3035
+ /**
3036
+ * Get the location of the given node or token.
3037
+ * @param nodeOrToken - Node or token to get the location of
3038
+ * @returns Location of the node or token
3039
+ */
3040
+ declare function getLoc(nodeOrToken: NodeOrToken): Location;
3041
+ /**
3042
+ * Get the deepest node containing a range index.
3043
+ * @param offset - Range index of the desired node
3044
+ * @returns The node if found, or `null` if not found
3045
+ */
3046
+ declare function getNodeByRangeIndex(offset: number): Node$1 | null;
3047
+ //#endregion
3048
+ //#region src-js/plugins/fix.d.ts
3049
+ type FixFn = (fixer: Fixer) => Fix | Array<Fix | null | undefined> | IterableIterator<Fix | null | undefined> | null | undefined;
3050
+ type Fix = {
3051
+ range: Range;
3052
+ text: string;
3053
+ };
3054
+ declare const FIXER: Readonly<{
3055
+ insertTextBefore(nodeOrToken: Ranged, text: string): Fix;
3056
+ insertTextBeforeRange(range: Range, text: string): Fix;
3057
+ insertTextAfter(nodeOrToken: Ranged, text: string): Fix;
3058
+ insertTextAfterRange(range: Range, text: string): Fix;
3059
+ remove(nodeOrToken: Ranged): Fix;
3060
+ removeRange(range: Range): Fix;
3061
+ replaceText(nodeOrToken: Ranged, text: string): Fix;
3062
+ replaceTextRange(range: Range, text: string): Fix;
3063
+ }>;
3064
+ type Fixer = typeof FIXER;
3065
+ //#endregion
3066
+ //#region src-js/plugins/report.d.ts
3067
+ /**
3068
+ * Diagnostic object.
3069
+ * Passed to `Context#report()`.
3070
+ *
3071
+ * - Either `message` or `messageId` property must be provided.
3072
+ * - Either `node` or `loc` property must be provided.
3073
+ */
3074
+ type Diagnostic = RequireAtLeastOne<RequireAtLeastOne<DiagnosticBase, "node" | "loc">, "message" | "messageId">;
3075
+ interface DiagnosticBase {
3076
+ message?: string | null | undefined;
3077
+ messageId?: string | null | undefined;
3078
+ node?: Ranged;
3079
+ loc?: LocationWithOptionalEnd | LineColumn;
3080
+ data?: DiagnosticData | null | undefined;
3081
+ fix?: FixFn;
3082
+ suggest?: Suggestion[];
3083
+ }
3084
+ /**
3085
+ * Location with `end` property optional.
3086
+ */
3087
+ interface LocationWithOptionalEnd {
3088
+ start: LineColumn;
3089
+ end?: LineColumn | null | undefined;
3090
+ }
3091
+ /**
3092
+ * Data to interpolate into a diagnostic message.
3093
+ */
3094
+ type DiagnosticData = Record<string, string | number | boolean | bigint | null | undefined>;
3095
+ /**
3096
+ * Suggested fix.
3097
+ * NOT IMPLEMENTED YET.
3098
+ */
3099
+ type Suggestion = RequireAtLeastOne<SuggestionBase, "desc" | "messageId">;
3100
+ interface SuggestionBase {
3101
+ desc?: string;
3102
+ messageId?: string;
3103
+ fix: FixFn;
3104
+ data?: DiagnosticData | null | undefined;
3105
+ }
3106
+ //#endregion
3107
+ //#region src-js/plugins/settings.d.ts
3108
+ /**
3109
+ * Settings for the file being linted.
3110
+ *
3111
+ * Settings are deserialized from JSON, so can only contain JSON-compatible values.
3112
+ */
3113
+ type Settings = JsonObject;
3114
+ //#endregion
3115
+ //#region src-js/plugins/comments.d.ts
3116
+ /**
3117
+ * Retrieve an array containing all comments in the source code.
3118
+ * @returns Array of `Comment`s in order they appear in source.
3119
+ */
3120
+ declare function getAllComments(): Comment[];
3121
+ /**
3122
+ * Get all comments directly before the given node or token.
3123
+ *
3124
+ * "Directly before" means only comments before this node, and after the preceding token.
3125
+ *
3126
+ * ```js
3127
+ * // Define `x`
3128
+ * const x = 1;
3129
+ * // Define `y`
3130
+ * const y = 2;
3131
+ * ```
3132
+ *
3133
+ * `sourceCode.getCommentsBefore(varDeclY)` will only return "Define `y`" comment, not also "Define `x`".
3134
+ *
3135
+ * @param nodeOrToken - The AST node or token to check for adjacent comment tokens.
3136
+ * @returns Array of `Comment`s in occurrence order.
3137
+ */
3138
+ declare function getCommentsBefore(nodeOrToken: NodeOrToken): Comment[];
3139
+ /**
3140
+ * Get all comment tokens directly after the given node or token.
3141
+ *
3142
+ * "Directly after" means only comments between end of this node, and the next token following it.
3143
+ *
3144
+ * ```js
3145
+ * const x = 1;
3146
+ * // Define `y`
3147
+ * const y = 2;
3148
+ * // Define `z`
3149
+ * const z = 3;
3150
+ * ```
3151
+ *
3152
+ * `sourceCode.getCommentsAfter(varDeclX)` will only return "Define `y`" comment, not also "Define `z`".
3153
+ *
3154
+ * @param nodeOrToken - The AST node or token to check for adjacent comment tokens.
3155
+ * @returns Array of `Comment`s in occurrence order.
3156
+ */
3157
+ declare function getCommentsAfter(nodeOrToken: NodeOrToken): Comment[];
3158
+ /**
3159
+ * Get all comment tokens inside the given node.
3160
+ * @param node - The AST node to get the comments for.
3161
+ * @returns Array of `Comment`s in occurrence order.
3162
+ */
3163
+ declare function getCommentsInside(node: Node): Comment[];
3164
+ /**
3165
+ * Check whether any comments exist or not between the given 2 nodes.
3166
+ * @param nodeOrToken1 - Start node/token.
3167
+ * @param nodeOrToken2 - End node/token.
3168
+ * @returns `true` if one or more comments exist between the two.
3169
+ */
3170
+ declare function commentsExistBetween(nodeOrToken1: NodeOrToken, nodeOrToken2: NodeOrToken): boolean;
3171
+ /**
3172
+ * Retrieve the JSDoc comment for a given node.
3173
+ *
3174
+ * @deprecated
3175
+ *
3176
+ * @param node - The AST node to get the comment for.
3177
+ * @returns The JSDoc comment for the given node, or `null` if not found.
3178
+ */
3179
+ declare function getJSDocComment(node: Node): Comment | null;
3180
+ //#endregion
3181
+ //#region src-js/plugins/scope.d.ts
3182
+ interface Scope {
3183
+ type: ScopeType;
3184
+ isStrict: boolean;
3185
+ upper: Scope | null;
3186
+ childScopes: Scope[];
3187
+ variableScope: Scope;
3188
+ block: Node$1;
3189
+ variables: Variable[];
3190
+ set: Map<string, Variable>;
3191
+ references: Reference[];
3192
+ through: Reference[];
3193
+ functionExpressionScope: boolean;
3194
+ implicit?: {
3195
+ variables: Variable[];
3196
+ set: Map<string, Variable>;
3197
+ };
3198
+ }
3199
+ type ScopeType = "block" | "catch" | "class" | "class-field-initializer" | "class-static-block" | "for" | "function" | "function-expression-name" | "global" | "module" | "switch" | "with";
3200
+ interface Variable {
3201
+ name: string;
3202
+ scope: Scope;
3203
+ identifiers: Identifier[];
3204
+ references: Reference[];
3205
+ defs: Definition[];
3206
+ }
3207
+ interface Reference {
3208
+ identifier: Identifier;
3209
+ from: Scope;
3210
+ resolved: Variable | null;
3211
+ writeExpr: Expression | null;
3212
+ init: boolean;
3213
+ isWrite(): boolean;
3214
+ isRead(): boolean;
3215
+ isReadOnly(): boolean;
3216
+ isWriteOnly(): boolean;
3217
+ isReadWrite(): boolean;
3218
+ }
3219
+ interface Definition {
3220
+ type: DefinitionType;
3221
+ name: Identifier;
3222
+ node: Node$1;
3223
+ parent: Node$1 | null;
3224
+ }
3225
+ type DefinitionType = "CatchClause" | "ClassName" | "FunctionName" | "ImplicitGlobalVariable" | "ImportBinding" | "Parameter" | "Variable";
3226
+ type Identifier = IdentifierName | IdentifierReference | BindingIdentifier | LabelIdentifier | TSThisParameter | TSIndexSignatureName;
3227
+ /**
3228
+ * Discard TS-ESLint `ScopeManager`, to free memory.
3229
+ */
3230
+ /**
3231
+ * @see https://eslint.org/docs/latest/developer-guide/scope-manager-interface#scopemanager-interface
3232
+ */
3233
+ declare const SCOPE_MANAGER: Readonly<{
3234
+ /**
3235
+ * All scopes.
3236
+ */
3237
+ readonly scopes: Scope[];
3238
+ /**
3239
+ * The root scope.
3240
+ */
3241
+ readonly globalScope: Scope | null;
3242
+ /**
3243
+ * Get the variables that a given AST node defines.
3244
+ * The returned variables' `def[].node` / `def[].parent` property is the node.
3245
+ * If the node does not define any variable, this returns an empty array.
3246
+ * @param node AST node to get variables of.
3247
+ */
3248
+ getDeclaredVariables(node: Node$1): Variable[];
3249
+ /**
3250
+ * Get the scope of a given AST node. The returned scope's `block` property is the node.
3251
+ * This method never returns `function-expression-name` scope.
3252
+ * If the node does not have a scope, returns `null`.
3253
+ *
3254
+ * @param node An AST node to get their scope.
3255
+ * @param inner If the node has multiple scopes, this returns the outermost scope normally.
3256
+ * If `inner` is `true` then this returns the innermost scope.
3257
+ */
3258
+ acquire(node: Node$1, inner?: boolean): Scope | null;
3259
+ }>;
3260
+ type ScopeManager = typeof SCOPE_MANAGER;
3261
+ /**
3262
+ * Determine whether the given identifier node is a reference to a global variable.
3263
+ * @param node - `Identifier` node to check.
3264
+ * @returns `true` if the identifier is a reference to a global variable.
3265
+ */
3266
+ declare function isGlobalReference(node: Node$1): boolean;
3267
+ /**
3268
+ * Get the variables that `node` defines.
3269
+ * This is a convenience method that passes through to the same method on the `ScopeManager`.
3270
+ * @param node - The node for which the variables are obtained.
3271
+ * @returns An array of variable nodes representing the variables that `node` defines.
3272
+ */
3273
+ declare function getDeclaredVariables(node: Node$1): Variable[];
3274
+ /**
3275
+ * Get the scope for the given node.
3276
+ * @param node - The node to get the scope of.
3277
+ * @returns The scope information for this node.
3278
+ */
3279
+ declare function getScope(node: Node$1): Scope;
3280
+ /**
3281
+ * Marks as used a variable with the given name in a scope indicated by the given reference node.
3282
+ * This affects the `no-unused-vars` rule.
3283
+ * @param name - Variable name
3284
+ * @param refNode - Reference node
3285
+ * @returns `true` if a variable with the given name was found and marked as used, otherwise `false`
3286
+ */
3287
+ declare function markVariableAsUsed(name: string, refNode: Node$1): boolean;
3288
+ //#endregion
3289
+ //#region src-js/plugins/source_code.d.ts
3290
+ declare const SOURCE_CODE: Readonly<{
3291
+ /**
3292
+ * Source text.
3293
+ */
3294
+ readonly text: string;
3295
+ /**
3296
+ * `true` if file has Unicode BOM.
3297
+ */
3298
+ readonly hasBOM: boolean;
3299
+ /**
3300
+ * AST of the file.
3301
+ */
3302
+ readonly ast: Program;
3303
+ /**
3304
+ * `true` if the AST is in ESTree format.
3305
+ */
3306
+ isESTree: true;
3307
+ /**
3308
+ * `ScopeManager` for the file.
3309
+ */
3310
+ readonly scopeManager: ScopeManager;
3311
+ /**
3312
+ * Visitor keys to traverse this AST.
3313
+ */
3314
+ readonly visitorKeys: Readonly<Record<string, readonly string[]>>;
3315
+ /**
3316
+ * Parser services for the file.
3317
+ *
3318
+ * Oxlint does not offer any parser services.
3319
+ */
3320
+ parserServices: Readonly<Record<string, unknown>>;
3321
+ /**
3322
+ * Source text as array of lines, split according to specification's definition of line breaks.
3323
+ */
3324
+ readonly lines: string[];
3325
+ /**
3326
+ * Character offset of the first character of each line in source text,
3327
+ * split according to specification's definition of line breaks.
3328
+ */
3329
+ readonly lineStartIndices: number[];
3330
+ /**
3331
+ * Array of all tokens and comments in the file, in source order.
3332
+ */
3333
+ readonly tokensAndComments: (Token | Comment)[];
3334
+ /**
3335
+ * Get the source code for the given node.
3336
+ * @param node? - The AST node to get the text for.
3337
+ * @param beforeCount? - The number of characters before the node to retrieve.
3338
+ * @param afterCount? - The number of characters after the node to retrieve.
3339
+ * @returns Source text representing the AST node.
3340
+ */
3341
+ getText(node?: Ranged | null, beforeCount?: number | null, afterCount?: number | null): string;
3342
+ /**
3343
+ * Get all the ancestors of a given node.
3344
+ * @param node - AST node
3345
+ * @returns All the ancestor nodes in the AST, not including the provided node,
3346
+ * starting from the root node at index 0 and going inwards to the parent node.
3347
+ */
3348
+ getAncestors(node: Node): Node[];
3349
+ /**
3350
+ * Get source text as array of lines, split according to specification's definition of line breaks.
3351
+ */
3352
+ getLines(): string[];
3353
+ getRange: typeof getRange;
3354
+ getLoc: typeof getLoc;
3355
+ getNodeByRangeIndex: typeof getNodeByRangeIndex;
3356
+ getLocFromIndex: typeof getLineColumnFromOffset;
3357
+ getIndexFromLoc: typeof getOffsetFromLineColumn;
3358
+ getAllComments: typeof getAllComments;
3359
+ getCommentsBefore: typeof getCommentsBefore;
3360
+ getCommentsAfter: typeof getCommentsAfter;
3361
+ getCommentsInside: typeof getCommentsInside;
3362
+ commentsExistBetween: typeof commentsExistBetween;
3363
+ getJSDocComment: typeof getJSDocComment;
3364
+ isGlobalReference: typeof isGlobalReference;
3365
+ getDeclaredVariables: typeof getDeclaredVariables;
3366
+ getScope: typeof getScope;
3367
+ markVariableAsUsed: typeof markVariableAsUsed;
3368
+ getTokens: typeof getTokens;
3369
+ getFirstToken: typeof getFirstToken;
3370
+ getFirstTokens: typeof getFirstTokens;
3371
+ getLastToken: typeof getLastToken;
3372
+ getLastTokens: typeof getLastTokens;
3373
+ getTokenBefore: typeof getTokenBefore;
3374
+ getTokenOrCommentBefore: typeof getTokenOrCommentBefore;
3375
+ getTokensBefore: typeof getTokensBefore;
3376
+ getTokenAfter: typeof getTokenAfter;
3377
+ getTokenOrCommentAfter: typeof getTokenOrCommentAfter;
3378
+ getTokensAfter: typeof getTokensAfter;
3379
+ getTokensBetween: typeof getTokensBetween;
3380
+ getFirstTokenBetween: typeof getFirstTokenBetween;
3381
+ getFirstTokensBetween: typeof getFirstTokensBetween;
3382
+ getLastTokenBetween: typeof getLastTokenBetween;
3383
+ getLastTokensBetween: typeof getLastTokensBetween;
3384
+ getTokenByRangeStart: typeof getTokenByRangeStart;
3385
+ isSpaceBetween: typeof isSpaceBetween;
3386
+ isSpaceBetweenTokens: typeof isSpaceBetweenTokens;
3387
+ }>;
3388
+ type SourceCode = typeof SOURCE_CODE;
3389
+ //#endregion
3390
+ //#region src-js/plugins/context.d.ts
3391
+ declare const LANGUAGE_OPTIONS: {
3392
+ /**
3393
+ * Source type of the file being linted.
3394
+ */
3395
+ readonly sourceType: ModuleKind;
3396
+ /**
3397
+ * ECMAScript version of the file being linted.
3398
+ */
3399
+ ecmaVersion: number;
3400
+ /**
3401
+ * Parser used to parse the file being linted.
3402
+ */
3403
+ parser: Readonly<{
3404
+ /**
3405
+ * Parser name.
3406
+ */
3407
+ name: "oxc";
3408
+ /**
3409
+ * Parser version.
3410
+ */
3411
+ version: "0.0.0";
3412
+ /**
3413
+ * Parse code into an AST.
3414
+ * @param code - Code to parse
3415
+ * @param options? - Parser options
3416
+ * @returns AST
3417
+ */
3418
+ parse(code: string, options?: Record<string, unknown>): Program;
3419
+ /**
3420
+ * Visitor keys for AST nodes.
3421
+ */
3422
+ VisitorKeys: Readonly<{
3423
+ DebuggerStatement: readonly never[];
3424
+ EmptyStatement: readonly never[];
3425
+ Literal: readonly never[];
3426
+ PrivateIdentifier: readonly never[];
3427
+ Super: readonly never[];
3428
+ TemplateElement: readonly never[];
3429
+ ThisExpression: readonly never[];
3430
+ JSXClosingFragment: readonly never[];
3431
+ JSXEmptyExpression: readonly never[];
3432
+ JSXIdentifier: readonly never[];
3433
+ JSXOpeningFragment: readonly never[];
3434
+ JSXText: readonly never[];
3435
+ TSAnyKeyword: readonly never[];
3436
+ TSBigIntKeyword: readonly never[];
3437
+ TSBooleanKeyword: readonly never[];
3438
+ TSIntrinsicKeyword: readonly never[];
3439
+ TSJSDocUnknownType: readonly never[];
3440
+ TSNeverKeyword: readonly never[];
3441
+ TSNullKeyword: readonly never[];
3442
+ TSNumberKeyword: readonly never[];
3443
+ TSObjectKeyword: readonly never[];
3444
+ TSStringKeyword: readonly never[];
3445
+ TSSymbolKeyword: readonly never[];
3446
+ TSThisType: readonly never[];
3447
+ TSUndefinedKeyword: readonly never[];
3448
+ TSUnknownKeyword: readonly never[];
3449
+ TSVoidKeyword: readonly never[];
3450
+ AccessorProperty: readonly string[];
3451
+ ArrayExpression: readonly string[];
3452
+ ArrayPattern: readonly string[];
3453
+ ArrowFunctionExpression: readonly string[];
3454
+ AssignmentExpression: readonly string[];
3455
+ AssignmentPattern: readonly string[];
3456
+ AwaitExpression: readonly string[];
3457
+ BinaryExpression: readonly string[];
3458
+ BlockStatement: readonly string[];
3459
+ BreakStatement: readonly string[];
3460
+ CallExpression: readonly string[];
3461
+ CatchClause: readonly string[];
3462
+ ChainExpression: readonly string[];
3463
+ ClassBody: readonly string[];
3464
+ ClassDeclaration: readonly string[];
3465
+ ClassExpression: readonly string[];
3466
+ ConditionalExpression: readonly string[];
3467
+ ContinueStatement: readonly string[];
3468
+ Decorator: readonly string[];
3469
+ DoWhileStatement: readonly string[];
3470
+ ExportAllDeclaration: readonly string[];
3471
+ ExportDefaultDeclaration: readonly string[];
3472
+ ExportNamedDeclaration: readonly string[];
3473
+ ExportSpecifier: readonly string[];
3474
+ ExpressionStatement: readonly string[];
3475
+ ForInStatement: readonly string[];
3476
+ ForOfStatement: readonly string[];
3477
+ ForStatement: readonly string[];
3478
+ FunctionDeclaration: readonly string[];
3479
+ FunctionExpression: readonly string[];
3480
+ Identifier: readonly string[];
3481
+ IfStatement: readonly string[];
3482
+ ImportAttribute: readonly string[];
3483
+ ImportDeclaration: readonly string[];
3484
+ ImportDefaultSpecifier: readonly string[];
3485
+ ImportExpression: readonly string[];
3486
+ ImportNamespaceSpecifier: readonly string[];
3487
+ ImportSpecifier: readonly string[];
3488
+ LabeledStatement: readonly string[];
3489
+ LogicalExpression: readonly string[];
3490
+ MemberExpression: readonly string[];
3491
+ MetaProperty: readonly string[];
3492
+ MethodDefinition: readonly string[];
3493
+ NewExpression: readonly string[];
3494
+ ObjectExpression: readonly string[];
3495
+ ObjectPattern: readonly string[];
3496
+ ParenthesizedExpression: readonly string[];
3497
+ Program: readonly string[];
3498
+ Property: readonly string[];
3499
+ PropertyDefinition: readonly string[];
3500
+ RestElement: readonly string[];
3501
+ ReturnStatement: readonly string[];
3502
+ SequenceExpression: readonly string[];
3503
+ SpreadElement: readonly string[];
3504
+ StaticBlock: readonly string[];
3505
+ SwitchCase: readonly string[];
3506
+ SwitchStatement: readonly string[];
3507
+ TaggedTemplateExpression: readonly string[];
3508
+ TemplateLiteral: readonly string[];
3509
+ ThrowStatement: readonly string[];
3510
+ TryStatement: readonly string[];
3511
+ UnaryExpression: readonly string[];
3512
+ UpdateExpression: readonly string[];
3513
+ V8IntrinsicExpression: readonly string[];
3514
+ VariableDeclaration: readonly string[];
3515
+ VariableDeclarator: readonly string[];
3516
+ WhileStatement: readonly string[];
3517
+ WithStatement: readonly string[];
3518
+ YieldExpression: readonly string[];
3519
+ JSXAttribute: readonly string[];
3520
+ JSXClosingElement: readonly string[];
3521
+ JSXElement: readonly string[];
3522
+ JSXExpressionContainer: readonly string[];
3523
+ JSXFragment: readonly string[];
3524
+ JSXMemberExpression: readonly string[];
3525
+ JSXNamespacedName: readonly string[];
3526
+ JSXOpeningElement: readonly string[];
3527
+ JSXSpreadAttribute: readonly string[];
3528
+ JSXSpreadChild: readonly string[];
3529
+ TSAbstractAccessorProperty: readonly string[];
3530
+ TSAbstractMethodDefinition: readonly string[];
3531
+ TSAbstractPropertyDefinition: readonly string[];
3532
+ TSArrayType: readonly string[];
3533
+ TSAsExpression: readonly string[];
3534
+ TSCallSignatureDeclaration: readonly string[];
3535
+ TSClassImplements: readonly string[];
3536
+ TSConditionalType: readonly string[];
3537
+ TSConstructSignatureDeclaration: readonly string[];
3538
+ TSConstructorType: readonly string[];
3539
+ TSDeclareFunction: readonly string[];
3540
+ TSEmptyBodyFunctionExpression: readonly string[];
3541
+ TSEnumBody: readonly string[];
3542
+ TSEnumDeclaration: readonly string[];
3543
+ TSEnumMember: readonly string[];
3544
+ TSExportAssignment: readonly string[];
3545
+ TSExternalModuleReference: readonly string[];
3546
+ TSFunctionType: readonly string[];
3547
+ TSImportEqualsDeclaration: readonly string[];
3548
+ TSImportType: readonly string[];
3549
+ TSIndexSignature: readonly string[];
3550
+ TSIndexedAccessType: readonly string[];
3551
+ TSInferType: readonly string[];
3552
+ TSInstantiationExpression: readonly string[];
3553
+ TSInterfaceBody: readonly string[];
3554
+ TSInterfaceDeclaration: readonly string[];
3555
+ TSInterfaceHeritage: readonly string[];
3556
+ TSIntersectionType: readonly string[];
3557
+ TSJSDocNonNullableType: readonly string[];
3558
+ TSJSDocNullableType: readonly string[];
3559
+ TSLiteralType: readonly string[];
3560
+ TSMappedType: readonly string[];
3561
+ TSMethodSignature: readonly string[];
3562
+ TSModuleBlock: readonly string[];
3563
+ TSModuleDeclaration: readonly string[];
3564
+ TSNamedTupleMember: readonly string[];
3565
+ TSNamespaceExportDeclaration: readonly string[];
3566
+ TSNonNullExpression: readonly string[];
3567
+ TSOptionalType: readonly string[];
3568
+ TSParameterProperty: readonly string[];
3569
+ TSParenthesizedType: readonly string[];
3570
+ TSPropertySignature: readonly string[];
3571
+ TSQualifiedName: readonly string[];
3572
+ TSRestType: readonly string[];
3573
+ TSSatisfiesExpression: readonly string[];
3574
+ TSTemplateLiteralType: readonly string[];
3575
+ TSTupleType: readonly string[];
3576
+ TSTypeAliasDeclaration: readonly string[];
3577
+ TSTypeAnnotation: readonly string[];
3578
+ TSTypeAssertion: readonly string[];
3579
+ TSTypeLiteral: readonly string[];
3580
+ TSTypeOperator: readonly string[];
3581
+ TSTypeParameter: readonly string[];
3582
+ TSTypeParameterDeclaration: readonly string[];
3583
+ TSTypeParameterInstantiation: readonly string[];
3584
+ TSTypePredicate: readonly string[];
3585
+ TSTypeQuery: readonly string[];
3586
+ TSTypeReference: readonly string[];
3587
+ TSUnionType: readonly string[];
3588
+ }>;
3589
+ /**
3590
+ * Ast node types.
3591
+ */
3592
+ readonly Syntax: Readonly<Record<string, string>>;
3593
+ /**
3594
+ * Latest ECMAScript version supported by parser.
3595
+ */
3596
+ latestEcmaVersion: 17;
3597
+ /**
3598
+ * ECMAScript versions supported by parser.
3599
+ */
3600
+ supportedEcmaVersions: readonly number[];
3601
+ }>;
3602
+ /**
3603
+ * Parser options used to parse the file being linted.
3604
+ */
3605
+ parserOptions: Readonly<{
3606
+ /**
3607
+ * Source type of the file being linted.
3608
+ */
3609
+ readonly sourceType: ModuleKind;
3610
+ /**
3611
+ * ECMA features.
3612
+ */
3613
+ ecmaFeatures: Readonly<{
3614
+ /**
3615
+ * `true` if file was parsed as JSX.
3616
+ */
3617
+ readonly jsx: boolean;
3618
+ /**
3619
+ * `true` if file was parsed with top-level `return` statements allowed.
3620
+ */
3621
+ readonly globalReturn: boolean;
3622
+ /**
3623
+ * `true` if file was parsed as strict mode code.
3624
+ */
3625
+ readonly impliedStrict: boolean;
3626
+ }>;
3627
+ }>;
3628
+ /**
3629
+ * Globals defined for the file being linted.
3630
+ */
3631
+ readonly globals: Readonly<Globals>;
3632
+ /**
3633
+ * Environments defined for the file being linted.
3634
+ */
3635
+ readonly env: Readonly<Envs>;
3636
+ };
3637
+ /**
3638
+ * Language options used when parsing a file.
3639
+ */
3640
+ type LanguageOptions = Readonly<typeof LANGUAGE_OPTIONS>;
3641
+ declare const FILE_CONTEXT: Readonly<{
3642
+ /**
3643
+ * Absolute path of the file being linted.
3644
+ */
3645
+ readonly filename: string;
3646
+ /**
3647
+ * Get absolute path of the file being linted.
3648
+ * @returns Absolute path of the file being linted.
3649
+ * @deprecated Use `context.filename` property instead.
3650
+ */
3651
+ getFilename(): string;
3652
+ /**
3653
+ * Physical absolute path of the file being linted.
3654
+ */
3655
+ readonly physicalFilename: string;
3656
+ /**
3657
+ * Get physical absolute path of the file being linted.
3658
+ * @returns Physical absolute path of the file being linted.
3659
+ * @deprecated Use `context.physicalFilename` property instead.
3660
+ */
3661
+ getPhysicalFilename(): string;
3662
+ /**
3663
+ * Current working directory.
3664
+ */
3665
+ readonly cwd: string;
3666
+ /**
3667
+ * Get current working directory.
3668
+ * @returns The current working directory.
3669
+ * @deprecated Use `context.cwd` property instead.
3670
+ */
3671
+ getCwd(): string;
3672
+ /**
3673
+ * Source code of the file being linted.
3674
+ */
3675
+ readonly sourceCode: SourceCode;
3676
+ /**
3677
+ * Get source code of the file being linted.
3678
+ * @returns Source code of the file being linted.
3679
+ * @deprecated Use `context.sourceCode` property instead.
3680
+ */
3681
+ getSourceCode(): SourceCode;
3682
+ /**
3683
+ * Language options used when parsing this file.
3684
+ */
3685
+ readonly languageOptions: LanguageOptions;
3686
+ /**
3687
+ * Settings for the file being linted.
3688
+ */
3689
+ readonly settings: Readonly<Settings>;
3690
+ /**
3691
+ * Create a new object with the current object as the prototype and
3692
+ * the specified properties as its own properties.
3693
+ * @param extension - The properties to add to the new object.
3694
+ * @returns A new object with the current object as the prototype
3695
+ * and the specified properties as its own properties.
3696
+ */
3697
+ extend(this: FileContext, extension: Record<string | number | symbol, unknown>): FileContext;
3698
+ /**
3699
+ * Parser options used to parse the file being linted.
3700
+ * @deprecated Use `languageOptions.parserOptions` instead.
3701
+ */
3702
+ readonly parserOptions: Record<string, unknown>;
3703
+ /**
3704
+ * The path to the parser used to parse this file.
3705
+ * @deprecated No longer supported.
3706
+ */
3707
+ readonly parserPath: string | undefined;
3708
+ }>;
3709
+ /**
3710
+ * Context object for a file.
3711
+ * Is the prototype for `Context` objects for each rule.
3712
+ */
3713
+ type FileContext = typeof FILE_CONTEXT;
3714
+ /**
3715
+ * Context object for a rule.
3716
+ * Passed to `create` and `createOnce` functions.
3717
+ */
3718
+ interface Context extends FileContext {
3719
+ /**
3720
+ * Rule ID, in form `<plugin>/<rule>`.
3721
+ */
3722
+ id: string;
3723
+ /**
3724
+ * Rule options for this rule on this file.
3725
+ */
3726
+ options: Readonly<Options>;
3727
+ /**
3728
+ * Report an error/warning.
3729
+ */
3730
+ report(this: void, diagnostic: Diagnostic): void;
3731
+ }
3732
+ //#endregion
3733
+ //#region src-js/plugins/rule_meta.d.ts
3734
+ /**
3735
+ * Rule metadata.
3736
+ * `meta` property of `Rule`.
3737
+ */
3738
+ interface RuleMeta {
3739
+ /**
3740
+ * Type of rule.
3741
+ *
3742
+ * - `problem`: The rule is identifying code that either will cause an error or may cause a confusing behavior.
3743
+ * Developers should consider this a high priority to resolve.
3744
+ * - `suggestion`: The rule is identifying something that could be done in a better way but no errors will occur
3745
+ * if the code isn’t changed.
3746
+ * - `layout`: The rule cares primarily about whitespace, semicolons, commas, and parentheses, all the parts
3747
+ * of the program that determine how the code looks rather than how it executes.
3748
+ * These rules work on parts of the code that aren’t specified in the AST.
3749
+ */
3750
+ type?: "problem" | "suggestion" | "layout";
3751
+ /**
3752
+ * Rule documentation.
3753
+ */
3754
+ docs?: RuleDocs;
3755
+ /**
3756
+ * Templates for error/warning messages.
3757
+ */
3758
+ messages?: Record<string, string>;
3759
+ /**
3760
+ * Type of fixes that the rule provides.
3761
+ * Must be `'code'` or `'whitespace'` if the rule provides fixes.
3762
+ */
3763
+ fixable?: "code" | "whitespace";
3764
+ /**
3765
+ * Specifies whether rule can return suggestions.
3766
+ * Must be `true` if the rule provides suggestions.
3767
+ * @default false
3768
+ */
3769
+ hasSuggestions?: boolean;
3770
+ /**
3771
+ * Shape of options for the rule.
3772
+ * Mandatory if the rule has options.
3773
+ */
3774
+ schema?: RuleOptionsSchema;
3775
+ /**
3776
+ * Default options for the rule.
3777
+ * If present, any user-provided options in their config will be merged on top of them recursively.
3778
+ */
3779
+ defaultOptions?: Options;
3780
+ /**
3781
+ * Indicates whether the rule has been deprecated, and info about the deprecation and possible replacements.
3782
+ */
3783
+ deprecated?: boolean | RuleDeprecatedInfo;
3784
+ /**
3785
+ * Information about available replacements for the rule.
3786
+ * This may be an empty array to explicitly state there is no replacement.
3787
+ * @deprecated Use `deprecated.replacedBy` instead.
3788
+ */
3789
+ replacedBy?: RuleReplacedByInfo[];
3790
+ }
3791
+ /**
3792
+ * Rule documentation.
3793
+ * `docs` property of `RuleMeta`.
3794
+ *
3795
+ * Often used for documentation generation and tooling.
3796
+ */
3797
+ interface RuleDocs {
3798
+ /**
3799
+ * Short description of the rule.
3800
+ */
3801
+ description?: string;
3802
+ /**
3803
+ * Typically a boolean, representing whether the rule is enabled by the recommended config.
3804
+ */
3805
+ recommended?: unknown;
3806
+ /**
3807
+ * URL for rule documentation.
3808
+ */
3809
+ url?: string;
3810
+ /**
3811
+ * Other arbitrary user-defined properties.
3812
+ */
3813
+ [key: string]: unknown;
3814
+ }
3815
+ /**
3816
+ * Info about deprecation of a rule, and possible replacements.
3817
+ * `deprecated` property of `RuleMeta`.
3818
+ */
3819
+ interface RuleDeprecatedInfo {
3820
+ /**
3821
+ * General message presentable to the user. May contain why this rule is deprecated or how to replace the rule.
3822
+ */
3823
+ message?: string;
3824
+ /**
3825
+ * URL with more information about this rule deprecation.
3826
+ */
3827
+ url?: string;
3828
+ /**
3829
+ * Information about available replacements for the rule.
3830
+ * This may be an empty array to explicitly state there is no replacement.
3831
+ */
3832
+ replacedBy?: RuleReplacedByInfo[];
3833
+ /**
3834
+ * Version (as semver string) deprecating the rule.
3835
+ */
3836
+ deprecatedSince?: string;
3837
+ /**
3838
+ * Version (as semver string) likely to remove the rule.
3839
+ * e.g. the next major version.
3840
+ *
3841
+ * The special value `null` means the rule will no longer be changed, but will be kept available indefinitely.
3842
+ */
3843
+ availableUntil?: string | null;
3844
+ }
3845
+ /**
3846
+ * Info about a possible replacement for a rule.
3847
+ */
3848
+ interface RuleReplacedByInfo {
3849
+ /**
3850
+ * A general message about this rule replacement.
3851
+ */
3852
+ message?: string;
3853
+ /**
3854
+ * A URL with more information about this rule replacement.
3855
+ */
3856
+ url?: string;
3857
+ /**
3858
+ * Which plugin has the replacement rule.
3859
+ *
3860
+ * The `name` property should be the package name, and should be:
3861
+ * - `"oxlint"` if the replacement is an Oxlint core rule.
3862
+ * - `"eslint"` if the replacement is an ESLint core rule.
3863
+ *
3864
+ * This property should be omitted if the replacement rule is in the same plugin.
3865
+ */
3866
+ plugin?: RuleReplacedByExternalSpecifier;
3867
+ /**
3868
+ * Name of replacement rule.
3869
+ * May be omitted if the plugin only contains a single rule, or has the same name as the rule.
3870
+ */
3871
+ rule?: RuleReplacedByExternalSpecifier;
3872
+ }
3873
+ /**
3874
+ * Details about a plugin or rule that replaces a deprecated rule.
3875
+ */
3876
+ interface RuleReplacedByExternalSpecifier {
3877
+ /**
3878
+ * For a plugin, the package name.
3879
+ * For a rule, the rule name.
3880
+ */
3881
+ name?: string;
3882
+ /**
3883
+ * URL pointing to documentation for the plugin / rule.
3884
+ */
3885
+ url?: string;
3886
+ }
3887
+ //#endregion
3888
+ //#region src-js/plugins/load.d.ts
3889
+ /**
3890
+ * Linter plugin, comprising multiple rules
3891
+ */
3892
+ interface Plugin {
3893
+ meta?: {
3894
+ name?: string;
3895
+ };
3896
+ rules: Record<string, Rule>;
3897
+ }
3898
+ /**
3899
+ * Linter rule.
3900
+ *
3901
+ * `Rule` can have either `create` method, or `createOnce` method.
3902
+ * If `createOnce` method is present, `create` is ignored.
3903
+ *
3904
+ * If defining the rule with `createOnce`, and you want the rule to work with ESLint too,
3905
+ * you need to wrap the plugin containing the rule with `eslintCompatPlugin`.
3906
+ */
3907
+ type Rule = CreateRule | CreateOnceRule;
3908
+ interface CreateRule {
3909
+ meta?: RuleMeta;
3910
+ create: (context: Context) => VisitorObject;
3911
+ }
3912
+ interface CreateOnceRule {
3913
+ meta?: RuleMeta;
3914
+ create?: (context: Context) => VisitorObject;
3915
+ createOnce: (context: Context) => VisitorWithHooks;
3916
+ }
3917
+ //#endregion
3918
+ //#region src-js/package/define.d.ts
3919
+ /**
3920
+ * Define a plugin.
3921
+ *
3922
+ * No-op function, just to provide type safety. Input is passed through unchanged.
3923
+ *
3924
+ * @param plugin - Plugin to define
3925
+ * @returns Same plugin as passed in
3926
+ */
3927
+ declare function definePlugin(plugin: Plugin): Plugin;
3928
+ /**
3929
+ * Define a rule.
3930
+ *
3931
+ * No-op function, just to provide type safety. Input is passed through unchanged.
3932
+ *
3933
+ * @param rule - Rule to define
3934
+ * @returns Same rule as passed in
3935
+ */
3936
+ declare function defineRule(rule: Rule): Rule;
3937
+ //#endregion
3938
+ //#region src-js/package/compat.d.ts
3939
+ /**
3940
+ * Convert a plugin which used Oxlint's `createOnce` API to also work with ESLint.
3941
+ *
3942
+ * If any of the plugin's rules use the Oxlint alternative `createOnce` API,
3943
+ * add ESLint-compatible `create` methods to those rules, which delegate to `createOnce`.
3944
+ * This makes the plugin compatible with ESLint.
3945
+ *
3946
+ * The `plugin` object passed in is mutated in-place.
3947
+ *
3948
+ * @param plugin - Plugin to convert
3949
+ * @returns Plugin with all rules having `create` method
3950
+ * @throws {Error} If `plugin` is not an object, or `plugin.rules` is not an object
3951
+ */
3952
+ declare function eslintCompatPlugin(plugin: Plugin): Plugin;
3953
+ //#endregion
3954
+ export { type AfterHook, type BeforeHook, type BooleanToken, type Comment, type Context, type CountOptions, type CreateOnceRule, type CreateRule, type Definition, type DefinitionType, type Diagnostic, type DiagnosticData, type types_d_exports as ESTree, type Envs, type FilterFn, type Fix, type FixFn, type Fixer, type Globals, type IdentifierToken, type JSXIdentifierToken, type JSXTextToken, type KeywordToken, type LanguageOptions, type LineColumn, type Location, type Node, type NullToken, type NumericToken, type Options, type Plugin, type PrivateIdentifierToken, type PunctuatorToken, type Range, type RangeOptions, type Ranged, type Reference, type RegularExpressionToken, type Rule, type RuleDeprecatedInfo, type RuleDocs, type RuleMeta, type RuleOptionsSchema, type RuleReplacedByExternalSpecifier, type RuleReplacedByInfo, type Scope, type ScopeManager, type ScopeType, type Settings, type SkipOptions, type SourceCode, type Span, type StringToken, type Suggestion, type TemplateToken, type Token, type Variable, type VisitorObject as Visitor, type VisitorWithHooks, definePlugin, defineRule, eslintCompatPlugin };