hook-o-gnese 0.0.1

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