oxlint-react-compiler-experimental 0.0.7 → 0.1.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.
@@ -1,4 +1,4 @@
1
- //#region ../../node_modules/.pnpm/type-fest@5.4.4/node_modules/type-fest/source/is-any.d.ts
1
+ //#region ../../node_modules/.pnpm/type-fest@5.6.0/node_modules/type-fest/source/is-any.d.ts
2
2
  /**
3
3
  Returns a boolean for whether the given type is `any`.
4
4
 
@@ -29,7 +29,7 @@ const anyA = get(anyObject, 'a');
29
29
  */
30
30
  type IsAny<T> = 0 extends 1 & NoInfer<T> ? true : false;
31
31
  //#endregion
32
- //#region ../../node_modules/.pnpm/type-fest@5.4.4/node_modules/type-fest/source/is-optional-key-of.d.ts
32
+ //#region ../../node_modules/.pnpm/type-fest@5.6.0/node_modules/type-fest/source/is-optional-key-of.d.ts
33
33
  /**
34
34
  Returns a boolean for whether the given key is an optional key of type.
35
35
 
@@ -72,7 +72,7 @@ type T5 = IsOptionalKeyOf<User | Admin, 'surname'>;
72
72
  */
73
73
  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;
74
74
  //#endregion
75
- //#region ../../node_modules/.pnpm/type-fest@5.4.4/node_modules/type-fest/source/optional-keys-of.d.ts
75
+ //#region ../../node_modules/.pnpm/type-fest@5.6.0/node_modules/type-fest/source/optional-keys-of.d.ts
76
76
  /**
77
77
  Extract all optional keys from the given type.
78
78
 
@@ -110,7 +110,7 @@ type OptionalKeysOf<Type extends object> = Type extends unknown // For distribut
110
110
  ? (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`
111
111
  : never;
112
112
  //#endregion
113
- //#region ../../node_modules/.pnpm/type-fest@5.4.4/node_modules/type-fest/source/required-keys-of.d.ts
113
+ //#region ../../node_modules/.pnpm/type-fest@5.6.0/node_modules/type-fest/source/required-keys-of.d.ts
114
114
  /**
115
115
  Extract all required keys from the given type.
116
116
 
@@ -144,7 +144,7 @@ const validator3 = createValidation<User>('luckyNumber', value => value > 0);
144
144
  type RequiredKeysOf<Type extends object> = Type extends unknown // For distributing `Type`
145
145
  ? Exclude<keyof Type, OptionalKeysOf<Type>> : never;
146
146
  //#endregion
147
- //#region ../../node_modules/.pnpm/type-fest@5.4.4/node_modules/type-fest/source/is-never.d.ts
147
+ //#region ../../node_modules/.pnpm/type-fest@5.6.0/node_modules/type-fest/source/is-never.d.ts
148
148
  /**
149
149
  Returns a boolean for whether the given type is `never`.
150
150
 
@@ -200,7 +200,7 @@ type B = IsTrueFixed<never>;
200
200
  */
201
201
  type IsNever<T> = [T] extends [never] ? true : false;
202
202
  //#endregion
203
- //#region ../../node_modules/.pnpm/type-fest@5.4.4/node_modules/type-fest/source/if.d.ts
203
+ //#region ../../node_modules/.pnpm/type-fest@5.6.0/node_modules/type-fest/source/if.d.ts
204
204
  /**
205
205
  An if-else-like type that resolves depending on whether the given `boolean` type is `true` or `false`.
206
206
 
@@ -295,7 +295,7 @@ type Works = IncludesWithoutIf<HundredZeroes, '1'>;
295
295
  */
296
296
  type If<Type extends boolean, IfBranch, ElseBranch> = IsNever<Type> extends true ? ElseBranch : Type extends true ? IfBranch : ElseBranch;
297
297
  //#endregion
298
- //#region ../../node_modules/.pnpm/type-fest@5.4.4/node_modules/type-fest/source/internal/type.d.ts
298
+ //#region ../../node_modules/.pnpm/type-fest@5.6.0/node_modules/type-fest/source/internal/type.d.ts
299
299
  /**
300
300
  An if-else-like type that resolves depending on whether the given type is `any` or `never`.
301
301
 
@@ -342,7 +342,7 @@ type T2 = TrimLeftOptimised<NineHundredNinetyNineSpaces>;
342
342
  */
343
343
  type IfNotAnyOrNever<T, IfNotAnyOrNever, IfAny = any, IfNever = never> = If<IsAny<T>, IfAny, If<IsNever<T>, IfNever, IfNotAnyOrNever>>;
344
344
  //#endregion
345
- //#region ../../node_modules/.pnpm/type-fest@5.4.4/node_modules/type-fest/source/simplify.d.ts
345
+ //#region ../../node_modules/.pnpm/type-fest@5.6.0/node_modules/type-fest/source/simplify.d.ts
346
346
  /**
347
347
  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.
348
348
 
@@ -403,7 +403,7 @@ fn(someInterface as Simplify<SomeInterface>); // Good: transform an `interface`
403
403
  */
404
404
  type Simplify<T> = { [KeyType in keyof T]: T[KeyType] } & {};
405
405
  //#endregion
406
- //#region ../../node_modules/.pnpm/type-fest@5.4.4/node_modules/type-fest/source/is-equal.d.ts
406
+ //#region ../../node_modules/.pnpm/type-fest@5.6.0/node_modules/type-fest/source/is-equal.d.ts
407
407
  /**
408
408
  Returns a boolean for whether the two given types are equal.
409
409
 
@@ -434,7 +434,7 @@ type IsEqual<A, B> = [A] extends [B] ? [B] extends [A] ? _IsEqual<A, B> : false
434
434
  // This version fails the `equalWrappedTupleIntersectionToBeNeverAndNeverExpanded` test in `test-d/is-equal.ts`.
435
435
  type _IsEqual<A, B> = (<G>() => G extends A & G | G ? 1 : 2) extends (<G>() => G extends B & G | G ? 1 : 2) ? true : false;
436
436
  //#endregion
437
- //#region ../../node_modules/.pnpm/type-fest@5.4.4/node_modules/type-fest/source/omit-index-signature.d.ts
437
+ //#region ../../node_modules/.pnpm/type-fest@5.6.0/node_modules/type-fest/source/omit-index-signature.d.ts
438
438
  /**
439
439
  Omit any index signatures from the given object type, leaving only explicitly defined properties.
440
440
 
@@ -528,7 +528,7 @@ type ExampleWithoutIndexSignatures = OmitIndexSignature<Example>;
528
528
  */
529
529
  type OmitIndexSignature<ObjectType> = { [KeyType in keyof ObjectType as {} extends Record<KeyType, unknown> ? never : KeyType]: ObjectType[KeyType] };
530
530
  //#endregion
531
- //#region ../../node_modules/.pnpm/type-fest@5.4.4/node_modules/type-fest/source/pick-index-signature.d.ts
531
+ //#region ../../node_modules/.pnpm/type-fest@5.6.0/node_modules/type-fest/source/pick-index-signature.d.ts
532
532
  /**
533
533
  Pick only index signatures from the given object type, leaving out all explicitly defined properties.
534
534
 
@@ -576,12 +576,37 @@ type ExampleIndexSignature = PickIndexSignature<Example>;
576
576
  */
577
577
  type PickIndexSignature<ObjectType> = { [KeyType in keyof ObjectType as {} extends Record<KeyType, unknown> ? KeyType : never]: ObjectType[KeyType] };
578
578
  //#endregion
579
- //#region ../../node_modules/.pnpm/type-fest@5.4.4/node_modules/type-fest/source/merge.d.ts
579
+ //#region ../../node_modules/.pnpm/type-fest@5.6.0/node_modules/type-fest/source/merge.d.ts
580
580
  // Merges two objects without worrying about index signatures.
581
581
  type SimpleMerge<Destination, Source> = Simplify<{ [Key in keyof Destination as Key extends keyof Source ? never : Key]: Destination[Key] } & Source>;
582
582
  /**
583
583
  Merge two types into a new type. Keys of the second type overrides keys of the first type.
584
584
 
585
+ 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`.
586
+
587
+ @example
588
+ ```
589
+ import type {Merge} from 'type-fest';
590
+
591
+ type Foo = {
592
+ a: string;
593
+ b: number;
594
+ };
595
+
596
+ type Bar = {
597
+ a: number; // Conflicts with Foo['a']
598
+ c: boolean;
599
+ };
600
+
601
+ // With `&`, `a` becomes `string & number` which is `never`. Not what you want.
602
+ type WithIntersection = (Foo & Bar)['a'];
603
+ //=> never
604
+
605
+ // With `Merge`, `a` is cleanly overridden to `number`.
606
+ type WithMerge = Merge<Foo, Bar>['a'];
607
+ //=> number
608
+ ```
609
+
585
610
  @example
586
611
  ```
587
612
  import type {Merge} from 'type-fest';
@@ -623,7 +648,7 @@ type Merge<Destination, Source> = Destination extends unknown // For distributin
623
648
  // Should never happen
624
649
  type _Merge<Destination, Source> = Simplify<SimpleMerge<PickIndexSignature<Destination>, PickIndexSignature<Source>> & SimpleMerge<OmitIndexSignature<Destination>, OmitIndexSignature<Source>>>;
625
650
  //#endregion
626
- //#region ../../node_modules/.pnpm/type-fest@5.4.4/node_modules/type-fest/source/internal/object.d.ts
651
+ //#region ../../node_modules/.pnpm/type-fest@5.6.0/node_modules/type-fest/source/internal/object.d.ts
627
652
  /**
628
653
  Merges user specified options with default options.
629
654
 
@@ -678,7 +703,7 @@ type Result = ApplyDefaultOptions<PathsOptions, DefaultPathsOptions, SpecifiedOp
678
703
  */
679
704
  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>>>>;
680
705
  //#endregion
681
- //#region ../../node_modules/.pnpm/type-fest@5.4.4/node_modules/type-fest/source/except.d.ts
706
+ //#region ../../node_modules/.pnpm/type-fest@5.6.0/node_modules/type-fest/source/except.d.ts
682
707
  /**
683
708
  Filter out keys from an object.
684
709
 
@@ -776,9 +801,9 @@ type PostPayloadFixed = Except<UserData, 'email'>;
776
801
  type Except<ObjectType, KeysType extends keyof ObjectType, Options extends ExceptOptions = {}> = _Except<ObjectType, KeysType, ApplyDefaultOptions<ExceptOptions, DefaultExceptOptions, Options>>;
777
802
  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>> : {});
778
803
  //#endregion
779
- //#region ../../node_modules/.pnpm/type-fest@5.4.4/node_modules/type-fest/source/require-at-least-one.d.ts
804
+ //#region ../../node_modules/.pnpm/type-fest@5.6.0/node_modules/type-fest/source/require-at-least-one.d.ts
780
805
  /**
781
- Create a type that requires at least one of the given keys. The remaining keys are kept as is.
806
+ Create a type that requires at least one of the given keys, while keeping the remaining keys as is.
782
807
 
783
808
  @example
784
809
  ```
@@ -800,264 +825,21 @@ const responder: RequireAtLeastOne<Responder, 'text' | 'json'> = {
800
825
  */
801
826
  type RequireAtLeastOne<ObjectType, KeysType extends keyof ObjectType = keyof ObjectType> = IfNotAnyOrNever<ObjectType, If<IsNever<KeysType>, never, _RequireAtLeastOne<ObjectType, If<IsAny<KeysType>, keyof ObjectType, KeysType>>>>;
802
827
  type _RequireAtLeastOne<ObjectType, KeysType extends keyof ObjectType> = { // For each `Key` in `KeysType` make a mapped type:
803
- [Key in KeysType]-?: Required<Pick<ObjectType, Key>> & // 1. Make `Key`'s type required
804
- // 2. Make all other keys in `KeysType` optional
805
- Partial<Pick<ObjectType, Exclude<KeysType, Key>>> }[KeysType] & // 3. Add the remaining keys not in `KeysType`
806
- Except<ObjectType, KeysType>;
807
- //#endregion
808
- //#region src-js/plugins/globals.d.ts
809
- /**
810
- * Globals for the file being linted.
811
- *
812
- * Globals are deserialized from JSON, so can only contain JSON-compatible values.
813
- * Each global variable maps to "readonly", "writable", or "off".
814
- */
815
- type Globals$1 = Record<string, "readonly" | "writable" | "off">;
816
- /**
817
- * Environments for the file being linted.
818
- *
819
- * Only includes environments that are enabled, so all properties are `true`.
820
- */
821
- type Envs$1 = Record<string, true>;
828
+ // 2. Make all other keys in `KeysType` optional
829
+ [Key in KeysType]-?: Required<Pick<ObjectType, Key>> // 1. Make `Key`'s type required
830
+ & Partial<Pick<ObjectType, Exclude<KeysType, Key>>> }[KeysType] & Except<ObjectType, KeysType>; // 3. Add the remaining keys not in `KeysType`
822
831
  //#endregion
823
- //#region ../../node_modules/.pnpm/@types+json-schema@7.0.15/node_modules/@types/json-schema/index.d.ts
824
- // ==================================================================================================
825
- // JSON Schema Draft 04
826
- // ==================================================================================================
827
- /**
828
- * @see https://tools.ietf.org/html/draft-zyp-json-schema-03#section-5.1
829
- */
830
- type JSONSchema4TypeName = "string" //
831
- | "number" | "integer" | "boolean" | "object" | "array" | "null" | "any";
832
+ //#region src-js/plugins/tokens.d.ts
832
833
  /**
833
- * @see https://tools.ietf.org/html/draft-zyp-json-schema-04#section-3.5
834
+ * AST token type.
834
835
  */
835
- type JSONSchema4Type = string //
836
- | number | boolean | JSONSchema4Object | JSONSchema4Array | null;
837
- // Workaround for infinite type recursion
838
- interface JSONSchema4Object {
839
- [key: string]: JSONSchema4Type;
836
+ type TokenType = BooleanToken | IdentifierToken | JSXIdentifierToken | JSXTextToken | KeywordToken | NullToken | NumericToken | PrivateIdentifierToken | PunctuatorToken | RegularExpressionToken | StringToken | TemplateToken;
837
+ interface BaseToken extends Span {
838
+ value: string;
839
+ regex: undefined;
840
840
  }
841
- // Workaround for infinite type recursion
842
- // https://github.com/Microsoft/TypeScript/issues/3496#issuecomment-128553540
843
- interface JSONSchema4Array extends Array<JSONSchema4Type> {}
844
- /**
845
- * Meta schema
846
- *
847
- * Recommended values:
848
- * - 'http://json-schema.org/schema#'
849
- * - 'http://json-schema.org/hyper-schema#'
850
- * - 'http://json-schema.org/draft-04/schema#'
851
- * - 'http://json-schema.org/draft-04/hyper-schema#'
852
- * - 'http://json-schema.org/draft-03/schema#'
853
- * - 'http://json-schema.org/draft-03/hyper-schema#'
854
- *
855
- * @see https://tools.ietf.org/html/draft-handrews-json-schema-validation-01#section-5
856
- */
857
- type JSONSchema4Version = string;
858
- /**
859
- * JSON Schema V4
860
- * @see https://tools.ietf.org/html/draft-zyp-json-schema-04
861
- */
862
- interface JSONSchema4 {
863
- id?: string | undefined;
864
- $ref?: string | undefined;
865
- $schema?: JSONSchema4Version | undefined;
866
- /**
867
- * This attribute is a string that provides a short description of the
868
- * instance property.
869
- *
870
- * @see https://tools.ietf.org/html/draft-zyp-json-schema-03#section-5.21
871
- */
872
- title?: string | undefined;
873
- /**
874
- * This attribute is a string that provides a full description of the of
875
- * purpose the instance property.
876
- *
877
- * @see https://tools.ietf.org/html/draft-zyp-json-schema-03#section-5.22
878
- */
879
- description?: string | undefined;
880
- default?: JSONSchema4Type | undefined;
881
- multipleOf?: number | undefined;
882
- maximum?: number | undefined;
883
- exclusiveMaximum?: boolean | undefined;
884
- minimum?: number | undefined;
885
- exclusiveMinimum?: boolean | undefined;
886
- maxLength?: number | undefined;
887
- minLength?: number | undefined;
888
- pattern?: string | undefined;
889
- /**
890
- * May only be defined when "items" is defined, and is a tuple of JSONSchemas.
891
- *
892
- * This provides a definition for additional items in an array instance
893
- * when tuple definitions of the items is provided. This can be false
894
- * to indicate additional items in the array are not allowed, or it can
895
- * be a schema that defines the schema of the additional items.
896
- *
897
- * @see https://tools.ietf.org/html/draft-zyp-json-schema-03#section-5.6
898
- */
899
- additionalItems?: boolean | JSONSchema4 | undefined;
900
- /**
901
- * This attribute defines the allowed items in an instance array, and
902
- * MUST be a schema or an array of schemas. The default value is an
903
- * empty schema which allows any value for items in the instance array.
904
- *
905
- * When this attribute value is a schema and the instance value is an
906
- * array, then all the items in the array MUST be valid according to the
907
- * schema.
908
- *
909
- * When this attribute value is an array of schemas and the instance
910
- * value is an array, each position in the instance array MUST conform
911
- * to the schema in the corresponding position for this array. This
912
- * called tuple typing. When tuple typing is used, additional items are
913
- * allowed, disallowed, or constrained by the "additionalItems"
914
- * (Section 5.6) attribute using the same rules as
915
- * "additionalProperties" (Section 5.4) for objects.
916
- *
917
- * @see https://tools.ietf.org/html/draft-zyp-json-schema-03#section-5.5
918
- */
919
- items?: JSONSchema4 | JSONSchema4[] | undefined;
920
- maxItems?: number | undefined;
921
- minItems?: number | undefined;
922
- uniqueItems?: boolean | undefined;
923
- maxProperties?: number | undefined;
924
- minProperties?: number | undefined;
925
- /**
926
- * This attribute indicates if the instance must have a value, and not
927
- * be undefined. This is false by default, making the instance
928
- * optional.
929
- *
930
- * @see https://tools.ietf.org/html/draft-zyp-json-schema-03#section-5.7
931
- */
932
- required?: boolean | string[] | undefined;
933
- /**
934
- * This attribute defines a schema for all properties that are not
935
- * explicitly defined in an object type definition. If specified, the
936
- * value MUST be a schema or a boolean. If false is provided, no
937
- * additional properties are allowed beyond the properties defined in
938
- * the schema. The default value is an empty schema which allows any
939
- * value for additional properties.
940
- *
941
- * @see https://tools.ietf.org/html/draft-zyp-json-schema-03#section-5.4
942
- */
943
- additionalProperties?: boolean | JSONSchema4 | undefined;
944
- definitions?: {
945
- [k: string]: JSONSchema4;
946
- } | undefined;
947
- /**
948
- * This attribute is an object with property definitions that define the
949
- * valid values of instance object property values. When the instance
950
- * value is an object, the property values of the instance object MUST
951
- * conform to the property definitions in this object. In this object,
952
- * each property definition's value MUST be a schema, and the property's
953
- * name MUST be the name of the instance property that it defines. The
954
- * instance property value MUST be valid according to the schema from
955
- * the property definition. Properties are considered unordered, the
956
- * order of the instance properties MAY be in any order.
957
- *
958
- * @see https://tools.ietf.org/html/draft-zyp-json-schema-03#section-5.2
959
- */
960
- properties?: {
961
- [k: string]: JSONSchema4;
962
- } | undefined;
963
- /**
964
- * This attribute is an object that defines the schema for a set of
965
- * property names of an object instance. The name of each property of
966
- * this attribute's object is a regular expression pattern in the ECMA
967
- * 262/Perl 5 format, while the value is a schema. If the pattern
968
- * matches the name of a property on the instance object, the value of
969
- * the instance's property MUST be valid against the pattern name's
970
- * schema value.
971
- *
972
- * @see https://tools.ietf.org/html/draft-zyp-json-schema-03#section-5.3
973
- */
974
- patternProperties?: {
975
- [k: string]: JSONSchema4;
976
- } | undefined;
977
- dependencies?: {
978
- [k: string]: JSONSchema4 | string[];
979
- } | undefined;
980
- /**
981
- * This provides an enumeration of all possible values that are valid
982
- * for the instance property. This MUST be an array, and each item in
983
- * the array represents a possible value for the instance value. If
984
- * this attribute is defined, the instance value MUST be one of the
985
- * values in the array in order for the schema to be valid.
986
- *
987
- * @see https://tools.ietf.org/html/draft-zyp-json-schema-03#section-5.19
988
- */
989
- enum?: JSONSchema4Type[] | undefined;
990
- /**
991
- * A single type, or a union of simple types
992
- */
993
- type?: JSONSchema4TypeName | JSONSchema4TypeName[] | undefined;
994
- allOf?: JSONSchema4[] | undefined;
995
- anyOf?: JSONSchema4[] | undefined;
996
- oneOf?: JSONSchema4[] | undefined;
997
- not?: JSONSchema4 | undefined;
998
- /**
999
- * The value of this property MUST be another schema which will provide
1000
- * a base schema which the current schema will inherit from. The
1001
- * inheritance rules are such that any instance that is valid according
1002
- * to the current schema MUST be valid according to the referenced
1003
- * schema. This MAY also be an array, in which case, the instance MUST
1004
- * be valid for all the schemas in the array. A schema that extends
1005
- * another schema MAY define additional attributes, constrain existing
1006
- * attributes, or add other constraints.
1007
- *
1008
- * Conceptually, the behavior of extends can be seen as validating an
1009
- * instance against all constraints in the extending schema as well as
1010
- * the extended schema(s).
1011
- *
1012
- * @see https://tools.ietf.org/html/draft-zyp-json-schema-03#section-5.26
1013
- */
1014
- extends?: string | string[] | undefined;
1015
- /**
1016
- * @see https://tools.ietf.org/html/draft-zyp-json-schema-04#section-5.6
1017
- */
1018
- [k: string]: any;
1019
- format?: string | undefined;
1020
- }
1021
- //#endregion
1022
- //#region src-js/plugins/json.d.ts
1023
- /**
1024
- * A JSON value.
1025
- */
1026
- type JsonValue = JsonObject | JsonValue[] | string | number | boolean | null;
1027
- /**
1028
- * A JSON object.
1029
- */
1030
- type JsonObject = {
1031
- [key: string]: JsonValue;
1032
- };
1033
- //#endregion
1034
- //#region src-js/plugins/options.d.ts
1035
- /**
1036
- * Options for a rule on a file.
1037
- */
1038
- type Options = JsonValue[];
1039
- /**
1040
- * Schema describing valid options for a rule.
1041
- * `schema` property of `RuleMeta`.
1042
- *
1043
- * Can be one of:
1044
- * - `JSONSchema4` - Full JSON Schema object (must have `type: "array"` at root).
1045
- * - `JSONSchema4[]` - Array shorthand where each element describes corresponding options element.
1046
- * - `false` - Opts out of schema validation (not recommended).
1047
- */
1048
- type RuleOptionsSchema = JSONSchema4 | JSONSchema4[] | false;
1049
- //#endregion
1050
- //#region src-js/plugins/tokens.d.ts
1051
- /**
1052
- * AST token type.
1053
- */
1054
- type TokenType = BooleanToken | IdentifierToken | JSXIdentifierToken | JSXTextToken | KeywordToken | NullToken | NumericToken | PrivateIdentifierToken | PunctuatorToken | RegularExpressionToken | StringToken | TemplateToken;
1055
- interface BaseToken extends Span {
1056
- value: string;
1057
- regex: undefined;
1058
- }
1059
- interface BooleanToken extends BaseToken {
1060
- type: "Boolean";
841
+ interface BooleanToken extends BaseToken {
842
+ type: "Boolean";
1061
843
  }
1062
844
  interface IdentifierToken extends BaseToken {
1063
845
  type: "Identifier";
@@ -1097,1301 +879,6 @@ interface StringToken extends BaseToken {
1097
879
  interface TemplateToken extends BaseToken {
1098
880
  type: "Template";
1099
881
  }
1100
- type TokenOrComment = TokenType | Comment;
1101
- //#endregion
1102
- //#region src-js/generated/types.d.ts
1103
- interface Program extends Span {
1104
- type: "Program";
1105
- body: Array<Directive | Statement>;
1106
- sourceType: ModuleKind;
1107
- hashbang: Hashbang | null;
1108
- comments: Comment[];
1109
- tokens: TokenType[];
1110
- parent: null;
1111
- }
1112
- 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;
1113
- interface IdentifierName extends Span {
1114
- type: "Identifier";
1115
- decorators?: [];
1116
- name: string;
1117
- optional?: false;
1118
- typeAnnotation?: null;
1119
- parent: Node$1;
1120
- }
1121
- interface IdentifierReference extends Span {
1122
- type: "Identifier";
1123
- decorators?: [];
1124
- name: string;
1125
- optional?: false;
1126
- typeAnnotation?: null;
1127
- parent: Node$1;
1128
- }
1129
- interface BindingIdentifier extends Span {
1130
- type: "Identifier";
1131
- decorators?: [];
1132
- name: string;
1133
- optional?: false;
1134
- typeAnnotation?: null;
1135
- parent: Node$1;
1136
- }
1137
- interface LabelIdentifier extends Span {
1138
- type: "Identifier";
1139
- decorators?: [];
1140
- name: string;
1141
- optional?: false;
1142
- typeAnnotation?: null;
1143
- parent: Node$1;
1144
- }
1145
- interface ThisExpression extends Span {
1146
- type: "ThisExpression";
1147
- parent: Node$1;
1148
- }
1149
- interface ArrayExpression extends Span {
1150
- type: "ArrayExpression";
1151
- elements: Array<ArrayExpressionElement>;
1152
- parent: Node$1;
1153
- }
1154
- type ArrayExpressionElement = SpreadElement | null | Expression;
1155
- interface ObjectExpression extends Span {
1156
- type: "ObjectExpression";
1157
- properties: Array<ObjectPropertyKind>;
1158
- parent: Node$1;
1159
- }
1160
- type ObjectPropertyKind = ObjectProperty | SpreadElement;
1161
- interface ObjectProperty extends Span {
1162
- type: "Property";
1163
- kind: PropertyKind;
1164
- key: PropertyKey$1;
1165
- value: Expression;
1166
- method: boolean;
1167
- shorthand: boolean;
1168
- computed: boolean;
1169
- optional?: false;
1170
- parent: Node$1;
1171
- }
1172
- type PropertyKey$1 = IdentifierName | PrivateIdentifier | Expression;
1173
- type PropertyKind = "init" | "get" | "set";
1174
- interface TemplateLiteral extends Span {
1175
- type: "TemplateLiteral";
1176
- quasis: Array<TemplateElement>;
1177
- expressions: Array<Expression>;
1178
- parent: Node$1;
1179
- }
1180
- interface TaggedTemplateExpression extends Span {
1181
- type: "TaggedTemplateExpression";
1182
- tag: Expression;
1183
- typeArguments?: TSTypeParameterInstantiation | null;
1184
- quasi: TemplateLiteral;
1185
- parent: Node$1;
1186
- }
1187
- interface TemplateElement extends Span {
1188
- type: "TemplateElement";
1189
- value: TemplateElementValue;
1190
- tail: boolean;
1191
- parent: Node$1;
1192
- }
1193
- interface TemplateElementValue {
1194
- raw: string;
1195
- cooked: string | null;
1196
- }
1197
- type MemberExpression = ComputedMemberExpression | StaticMemberExpression | PrivateFieldExpression;
1198
- interface ComputedMemberExpression extends Span {
1199
- type: "MemberExpression";
1200
- object: Expression;
1201
- property: Expression;
1202
- optional: boolean;
1203
- computed: true;
1204
- parent: Node$1;
1205
- }
1206
- interface StaticMemberExpression extends Span {
1207
- type: "MemberExpression";
1208
- object: Expression;
1209
- property: IdentifierName;
1210
- optional: boolean;
1211
- computed: false;
1212
- parent: Node$1;
1213
- }
1214
- interface PrivateFieldExpression extends Span {
1215
- type: "MemberExpression";
1216
- object: Expression;
1217
- property: PrivateIdentifier;
1218
- optional: boolean;
1219
- computed: false;
1220
- parent: Node$1;
1221
- }
1222
- interface CallExpression extends Span {
1223
- type: "CallExpression";
1224
- callee: Expression;
1225
- typeArguments?: TSTypeParameterInstantiation | null;
1226
- arguments: Array<Argument>;
1227
- optional: boolean;
1228
- parent: Node$1;
1229
- }
1230
- interface NewExpression extends Span {
1231
- type: "NewExpression";
1232
- callee: Expression;
1233
- typeArguments?: TSTypeParameterInstantiation | null;
1234
- arguments: Array<Argument>;
1235
- parent: Node$1;
1236
- }
1237
- interface MetaProperty extends Span {
1238
- type: "MetaProperty";
1239
- meta: IdentifierName;
1240
- property: IdentifierName;
1241
- parent: Node$1;
1242
- }
1243
- interface SpreadElement extends Span {
1244
- type: "SpreadElement";
1245
- argument: Expression;
1246
- parent: Node$1;
1247
- }
1248
- type Argument = SpreadElement | Expression;
1249
- interface UpdateExpression extends Span {
1250
- type: "UpdateExpression";
1251
- operator: UpdateOperator;
1252
- prefix: boolean;
1253
- argument: SimpleAssignmentTarget;
1254
- parent: Node$1;
1255
- }
1256
- interface UnaryExpression extends Span {
1257
- type: "UnaryExpression";
1258
- operator: UnaryOperator;
1259
- argument: Expression;
1260
- prefix: true;
1261
- parent: Node$1;
1262
- }
1263
- interface BinaryExpression extends Span {
1264
- type: "BinaryExpression";
1265
- left: Expression;
1266
- operator: BinaryOperator;
1267
- right: Expression;
1268
- parent: Node$1;
1269
- }
1270
- interface PrivateInExpression extends Span {
1271
- type: "BinaryExpression";
1272
- left: PrivateIdentifier;
1273
- operator: "in";
1274
- right: Expression;
1275
- parent: Node$1;
1276
- }
1277
- interface LogicalExpression extends Span {
1278
- type: "LogicalExpression";
1279
- left: Expression;
1280
- operator: LogicalOperator;
1281
- right: Expression;
1282
- parent: Node$1;
1283
- }
1284
- interface ConditionalExpression extends Span {
1285
- type: "ConditionalExpression";
1286
- test: Expression;
1287
- consequent: Expression;
1288
- alternate: Expression;
1289
- parent: Node$1;
1290
- }
1291
- interface AssignmentExpression extends Span {
1292
- type: "AssignmentExpression";
1293
- operator: AssignmentOperator;
1294
- left: AssignmentTarget;
1295
- right: Expression;
1296
- parent: Node$1;
1297
- }
1298
- type AssignmentTarget = SimpleAssignmentTarget | AssignmentTargetPattern;
1299
- type SimpleAssignmentTarget = IdentifierReference | TSAsExpression | TSSatisfiesExpression | TSNonNullExpression | TSTypeAssertion | MemberExpression;
1300
- type AssignmentTargetPattern = ArrayAssignmentTarget | ObjectAssignmentTarget;
1301
- interface ArrayAssignmentTarget extends Span {
1302
- type: "ArrayPattern";
1303
- decorators?: [];
1304
- elements: Array<AssignmentTargetMaybeDefault | AssignmentTargetRest | null>;
1305
- optional?: false;
1306
- typeAnnotation?: null;
1307
- parent: Node$1;
1308
- }
1309
- interface ObjectAssignmentTarget extends Span {
1310
- type: "ObjectPattern";
1311
- decorators?: [];
1312
- properties: Array<AssignmentTargetProperty | AssignmentTargetRest>;
1313
- optional?: false;
1314
- typeAnnotation?: null;
1315
- parent: Node$1;
1316
- }
1317
- interface AssignmentTargetRest extends Span {
1318
- type: "RestElement";
1319
- decorators?: [];
1320
- argument: AssignmentTarget;
1321
- optional?: false;
1322
- typeAnnotation?: null;
1323
- value?: null;
1324
- parent: Node$1;
1325
- }
1326
- type AssignmentTargetMaybeDefault = AssignmentTargetWithDefault | AssignmentTarget;
1327
- interface AssignmentTargetWithDefault extends Span {
1328
- type: "AssignmentPattern";
1329
- decorators?: [];
1330
- left: AssignmentTarget;
1331
- right: Expression;
1332
- optional?: false;
1333
- typeAnnotation?: null;
1334
- parent: Node$1;
1335
- }
1336
- type AssignmentTargetProperty = AssignmentTargetPropertyIdentifier | AssignmentTargetPropertyProperty;
1337
- interface AssignmentTargetPropertyIdentifier extends Span {
1338
- type: "Property";
1339
- kind: "init";
1340
- key: IdentifierReference;
1341
- value: IdentifierReference | AssignmentTargetWithDefault;
1342
- method: false;
1343
- shorthand: true;
1344
- computed: false;
1345
- optional?: false;
1346
- parent: Node$1;
1347
- }
1348
- interface AssignmentTargetPropertyProperty extends Span {
1349
- type: "Property";
1350
- kind: "init";
1351
- key: PropertyKey$1;
1352
- value: AssignmentTargetMaybeDefault;
1353
- method: false;
1354
- shorthand: false;
1355
- computed: boolean;
1356
- optional?: false;
1357
- parent: Node$1;
1358
- }
1359
- interface SequenceExpression extends Span {
1360
- type: "SequenceExpression";
1361
- expressions: Array<Expression>;
1362
- parent: Node$1;
1363
- }
1364
- interface Super extends Span {
1365
- type: "Super";
1366
- parent: Node$1;
1367
- }
1368
- interface AwaitExpression extends Span {
1369
- type: "AwaitExpression";
1370
- argument: Expression;
1371
- parent: Node$1;
1372
- }
1373
- interface ChainExpression extends Span {
1374
- type: "ChainExpression";
1375
- expression: ChainElement;
1376
- parent: Node$1;
1377
- }
1378
- type ChainElement = CallExpression | TSNonNullExpression | MemberExpression;
1379
- interface ParenthesizedExpression extends Span {
1380
- type: "ParenthesizedExpression";
1381
- expression: Expression;
1382
- parent: Node$1;
1383
- }
1384
- type Statement = BlockStatement | BreakStatement | ContinueStatement | DebuggerStatement | DoWhileStatement | EmptyStatement | ExpressionStatement | ForInStatement | ForOfStatement | ForStatement | IfStatement | LabeledStatement | ReturnStatement | SwitchStatement | ThrowStatement | TryStatement | WhileStatement | WithStatement | Declaration | ModuleDeclaration;
1385
- interface Directive extends Span {
1386
- type: "ExpressionStatement";
1387
- expression: StringLiteral;
1388
- directive: string;
1389
- parent: Node$1;
1390
- }
1391
- interface Hashbang extends Span {
1392
- type: "Hashbang";
1393
- value: string;
1394
- parent: Node$1;
1395
- }
1396
- interface BlockStatement extends Span {
1397
- type: "BlockStatement";
1398
- body: Array<Statement>;
1399
- parent: Node$1;
1400
- }
1401
- type Declaration = VariableDeclaration | Function$1 | Class | TSTypeAliasDeclaration | TSInterfaceDeclaration | TSEnumDeclaration | TSModuleDeclaration | TSGlobalDeclaration | TSImportEqualsDeclaration;
1402
- interface VariableDeclaration extends Span {
1403
- type: "VariableDeclaration";
1404
- kind: VariableDeclarationKind;
1405
- declarations: Array<VariableDeclarator>;
1406
- declare?: boolean;
1407
- parent: Node$1;
1408
- }
1409
- type VariableDeclarationKind = "var" | "let" | "const" | "using" | "await using";
1410
- interface VariableDeclarator extends Span {
1411
- type: "VariableDeclarator";
1412
- id: BindingPattern;
1413
- init: Expression | null;
1414
- definite?: boolean;
1415
- parent: Node$1;
1416
- }
1417
- interface EmptyStatement extends Span {
1418
- type: "EmptyStatement";
1419
- parent: Node$1;
1420
- }
1421
- interface ExpressionStatement extends Span {
1422
- type: "ExpressionStatement";
1423
- expression: Expression;
1424
- directive?: string | null;
1425
- parent: Node$1;
1426
- }
1427
- interface IfStatement extends Span {
1428
- type: "IfStatement";
1429
- test: Expression;
1430
- consequent: Statement;
1431
- alternate: Statement | null;
1432
- parent: Node$1;
1433
- }
1434
- interface DoWhileStatement extends Span {
1435
- type: "DoWhileStatement";
1436
- body: Statement;
1437
- test: Expression;
1438
- parent: Node$1;
1439
- }
1440
- interface WhileStatement extends Span {
1441
- type: "WhileStatement";
1442
- test: Expression;
1443
- body: Statement;
1444
- parent: Node$1;
1445
- }
1446
- interface ForStatement extends Span {
1447
- type: "ForStatement";
1448
- init: ForStatementInit | null;
1449
- test: Expression | null;
1450
- update: Expression | null;
1451
- body: Statement;
1452
- parent: Node$1;
1453
- }
1454
- type ForStatementInit = VariableDeclaration | Expression;
1455
- interface ForInStatement extends Span {
1456
- type: "ForInStatement";
1457
- left: ForStatementLeft;
1458
- right: Expression;
1459
- body: Statement;
1460
- parent: Node$1;
1461
- }
1462
- type ForStatementLeft = VariableDeclaration | AssignmentTarget;
1463
- interface ForOfStatement extends Span {
1464
- type: "ForOfStatement";
1465
- await: boolean;
1466
- left: ForStatementLeft;
1467
- right: Expression;
1468
- body: Statement;
1469
- parent: Node$1;
1470
- }
1471
- interface ContinueStatement extends Span {
1472
- type: "ContinueStatement";
1473
- label: LabelIdentifier | null;
1474
- parent: Node$1;
1475
- }
1476
- interface BreakStatement extends Span {
1477
- type: "BreakStatement";
1478
- label: LabelIdentifier | null;
1479
- parent: Node$1;
1480
- }
1481
- interface ReturnStatement extends Span {
1482
- type: "ReturnStatement";
1483
- argument: Expression | null;
1484
- parent: Node$1;
1485
- }
1486
- interface WithStatement extends Span {
1487
- type: "WithStatement";
1488
- object: Expression;
1489
- body: Statement;
1490
- parent: Node$1;
1491
- }
1492
- interface SwitchStatement extends Span {
1493
- type: "SwitchStatement";
1494
- discriminant: Expression;
1495
- cases: Array<SwitchCase>;
1496
- parent: Node$1;
1497
- }
1498
- interface SwitchCase extends Span {
1499
- type: "SwitchCase";
1500
- test: Expression | null;
1501
- consequent: Array<Statement>;
1502
- parent: Node$1;
1503
- }
1504
- interface LabeledStatement extends Span {
1505
- type: "LabeledStatement";
1506
- label: LabelIdentifier;
1507
- body: Statement;
1508
- parent: Node$1;
1509
- }
1510
- interface ThrowStatement extends Span {
1511
- type: "ThrowStatement";
1512
- argument: Expression;
1513
- parent: Node$1;
1514
- }
1515
- interface TryStatement extends Span {
1516
- type: "TryStatement";
1517
- block: BlockStatement;
1518
- handler: CatchClause | null;
1519
- finalizer: BlockStatement | null;
1520
- parent: Node$1;
1521
- }
1522
- interface CatchClause extends Span {
1523
- type: "CatchClause";
1524
- param: BindingPattern | null;
1525
- body: BlockStatement;
1526
- parent: Node$1;
1527
- }
1528
- interface DebuggerStatement extends Span {
1529
- type: "DebuggerStatement";
1530
- parent: Node$1;
1531
- }
1532
- type BindingPattern = BindingIdentifier | ObjectPattern | ArrayPattern | AssignmentPattern;
1533
- interface AssignmentPattern extends Span {
1534
- type: "AssignmentPattern";
1535
- decorators?: [];
1536
- left: BindingPattern;
1537
- right: Expression;
1538
- optional?: false;
1539
- typeAnnotation?: null;
1540
- parent: Node$1;
1541
- }
1542
- interface ObjectPattern extends Span {
1543
- type: "ObjectPattern";
1544
- decorators?: [];
1545
- properties: Array<BindingProperty | BindingRestElement>;
1546
- optional?: false;
1547
- typeAnnotation?: null;
1548
- parent: Node$1;
1549
- }
1550
- interface BindingProperty extends Span {
1551
- type: "Property";
1552
- kind: "init";
1553
- key: PropertyKey$1;
1554
- value: BindingPattern;
1555
- method: false;
1556
- shorthand: boolean;
1557
- computed: boolean;
1558
- optional?: false;
1559
- parent: Node$1;
1560
- }
1561
- interface ArrayPattern extends Span {
1562
- type: "ArrayPattern";
1563
- decorators?: [];
1564
- elements: Array<BindingPattern | BindingRestElement | null>;
1565
- optional?: false;
1566
- typeAnnotation?: null;
1567
- parent: Node$1;
1568
- }
1569
- interface BindingRestElement extends Span {
1570
- type: "RestElement";
1571
- decorators?: [];
1572
- argument: BindingPattern;
1573
- optional?: false;
1574
- typeAnnotation?: null;
1575
- value?: null;
1576
- parent: Node$1;
1577
- }
1578
- interface Function$1 extends Span {
1579
- type: FunctionType;
1580
- id: BindingIdentifier | null;
1581
- generator: boolean;
1582
- async: boolean;
1583
- declare?: boolean;
1584
- typeParameters?: TSTypeParameterDeclaration | null;
1585
- params: ParamPattern[];
1586
- returnType?: TSTypeAnnotation | null;
1587
- body: FunctionBody | null;
1588
- expression: false;
1589
- parent: Node$1;
1590
- }
1591
- type ParamPattern = FormalParameter | TSParameterProperty | FormalParameterRest;
1592
- type FunctionType = "FunctionDeclaration" | "FunctionExpression" | "TSDeclareFunction" | "TSEmptyBodyFunctionExpression";
1593
- interface FormalParameterRest extends Span {
1594
- type: "RestElement";
1595
- argument: BindingPattern;
1596
- decorators?: [];
1597
- optional?: boolean;
1598
- typeAnnotation?: TSTypeAnnotation | null;
1599
- value?: null;
1600
- parent: Node$1;
1601
- }
1602
- type FormalParameter = {
1603
- decorators?: Array<Decorator>;
1604
- } & BindingPattern;
1605
- interface TSParameterProperty extends Span {
1606
- type: "TSParameterProperty";
1607
- accessibility: TSAccessibility | null;
1608
- decorators: Array<Decorator>;
1609
- override: boolean;
1610
- parameter: FormalParameter;
1611
- readonly: boolean;
1612
- static: boolean;
1613
- parent: Node$1;
1614
- }
1615
- interface FunctionBody extends Span {
1616
- type: "BlockStatement";
1617
- body: Array<Directive | Statement>;
1618
- parent: Node$1;
1619
- }
1620
- interface ArrowFunctionExpression extends Span {
1621
- type: "ArrowFunctionExpression";
1622
- expression: boolean;
1623
- async: boolean;
1624
- typeParameters?: TSTypeParameterDeclaration | null;
1625
- params: ParamPattern[];
1626
- returnType?: TSTypeAnnotation | null;
1627
- body: FunctionBody | Expression;
1628
- id: null;
1629
- generator: false;
1630
- parent: Node$1;
1631
- }
1632
- interface YieldExpression extends Span {
1633
- type: "YieldExpression";
1634
- delegate: boolean;
1635
- argument: Expression | null;
1636
- parent: Node$1;
1637
- }
1638
- interface Class extends Span {
1639
- type: ClassType;
1640
- decorators: Array<Decorator>;
1641
- id: BindingIdentifier | null;
1642
- typeParameters?: TSTypeParameterDeclaration | null;
1643
- superClass: Expression | null;
1644
- superTypeArguments?: TSTypeParameterInstantiation | null;
1645
- implements?: Array<TSClassImplements>;
1646
- body: ClassBody;
1647
- abstract?: boolean;
1648
- declare?: boolean;
1649
- parent: Node$1;
1650
- }
1651
- type ClassType = "ClassDeclaration" | "ClassExpression";
1652
- interface ClassBody extends Span {
1653
- type: "ClassBody";
1654
- body: Array<ClassElement>;
1655
- parent: Node$1;
1656
- }
1657
- type ClassElement = StaticBlock | MethodDefinition | PropertyDefinition | AccessorProperty | TSIndexSignature;
1658
- interface MethodDefinition extends Span {
1659
- type: MethodDefinitionType;
1660
- decorators: Array<Decorator>;
1661
- key: PropertyKey$1;
1662
- value: Function$1;
1663
- kind: MethodDefinitionKind;
1664
- computed: boolean;
1665
- static: boolean;
1666
- override?: boolean;
1667
- optional?: boolean;
1668
- accessibility?: TSAccessibility | null;
1669
- parent: Node$1;
1670
- }
1671
- type MethodDefinitionType = "MethodDefinition" | "TSAbstractMethodDefinition";
1672
- interface PropertyDefinition extends Span {
1673
- type: PropertyDefinitionType;
1674
- decorators: Array<Decorator>;
1675
- key: PropertyKey$1;
1676
- typeAnnotation?: TSTypeAnnotation | null;
1677
- value: Expression | null;
1678
- computed: boolean;
1679
- static: boolean;
1680
- declare?: boolean;
1681
- override?: boolean;
1682
- optional?: boolean;
1683
- definite?: boolean;
1684
- readonly?: boolean;
1685
- accessibility?: TSAccessibility | null;
1686
- parent: Node$1;
1687
- }
1688
- type PropertyDefinitionType = "PropertyDefinition" | "TSAbstractPropertyDefinition";
1689
- type MethodDefinitionKind = "constructor" | "method" | "get" | "set";
1690
- interface PrivateIdentifier extends Span {
1691
- type: "PrivateIdentifier";
1692
- name: string;
1693
- parent: Node$1;
1694
- }
1695
- interface StaticBlock extends Span {
1696
- type: "StaticBlock";
1697
- body: Array<Statement>;
1698
- parent: Node$1;
1699
- }
1700
- type ModuleDeclaration = ImportDeclaration | ExportAllDeclaration | ExportDefaultDeclaration | ExportNamedDeclaration | TSExportAssignment | TSNamespaceExportDeclaration;
1701
- type AccessorPropertyType = "AccessorProperty" | "TSAbstractAccessorProperty";
1702
- interface AccessorProperty extends Span {
1703
- type: AccessorPropertyType;
1704
- decorators: Array<Decorator>;
1705
- key: PropertyKey$1;
1706
- typeAnnotation?: TSTypeAnnotation | null;
1707
- value: Expression | null;
1708
- computed: boolean;
1709
- static: boolean;
1710
- override?: boolean;
1711
- definite?: boolean;
1712
- accessibility?: TSAccessibility | null;
1713
- declare?: false;
1714
- optional?: false;
1715
- readonly?: false;
1716
- parent: Node$1;
1717
- }
1718
- interface ImportExpression extends Span {
1719
- type: "ImportExpression";
1720
- source: Expression;
1721
- options: Expression | null;
1722
- phase: ImportPhase | null;
1723
- parent: Node$1;
1724
- }
1725
- interface ImportDeclaration extends Span {
1726
- type: "ImportDeclaration";
1727
- specifiers: Array<ImportDeclarationSpecifier>;
1728
- source: StringLiteral;
1729
- phase: ImportPhase | null;
1730
- attributes: Array<ImportAttribute>;
1731
- importKind?: ImportOrExportKind;
1732
- parent: Node$1;
1733
- }
1734
- type ImportPhase = "source" | "defer";
1735
- type ImportDeclarationSpecifier = ImportSpecifier | ImportDefaultSpecifier | ImportNamespaceSpecifier;
1736
- interface ImportSpecifier extends Span {
1737
- type: "ImportSpecifier";
1738
- imported: ModuleExportName;
1739
- local: BindingIdentifier;
1740
- importKind?: ImportOrExportKind;
1741
- parent: Node$1;
1742
- }
1743
- interface ImportDefaultSpecifier extends Span {
1744
- type: "ImportDefaultSpecifier";
1745
- local: BindingIdentifier;
1746
- parent: Node$1;
1747
- }
1748
- interface ImportNamespaceSpecifier extends Span {
1749
- type: "ImportNamespaceSpecifier";
1750
- local: BindingIdentifier;
1751
- parent: Node$1;
1752
- }
1753
- interface ImportAttribute extends Span {
1754
- type: "ImportAttribute";
1755
- key: ImportAttributeKey;
1756
- value: StringLiteral;
1757
- parent: Node$1;
1758
- }
1759
- type ImportAttributeKey = IdentifierName | StringLiteral;
1760
- interface ExportNamedDeclaration extends Span {
1761
- type: "ExportNamedDeclaration";
1762
- declaration: Declaration | null;
1763
- specifiers: Array<ExportSpecifier>;
1764
- source: StringLiteral | null;
1765
- exportKind?: ImportOrExportKind;
1766
- attributes: Array<ImportAttribute>;
1767
- parent: Node$1;
1768
- }
1769
- interface ExportDefaultDeclaration extends Span {
1770
- type: "ExportDefaultDeclaration";
1771
- declaration: ExportDefaultDeclarationKind;
1772
- exportKind?: "value";
1773
- parent: Node$1;
1774
- }
1775
- interface ExportAllDeclaration extends Span {
1776
- type: "ExportAllDeclaration";
1777
- exported: ModuleExportName | null;
1778
- source: StringLiteral;
1779
- attributes: Array<ImportAttribute>;
1780
- exportKind?: ImportOrExportKind;
1781
- parent: Node$1;
1782
- }
1783
- interface ExportSpecifier extends Span {
1784
- type: "ExportSpecifier";
1785
- local: ModuleExportName;
1786
- exported: ModuleExportName;
1787
- exportKind?: ImportOrExportKind;
1788
- parent: Node$1;
1789
- }
1790
- type ExportDefaultDeclarationKind = Function$1 | Class | TSInterfaceDeclaration | Expression;
1791
- type ModuleExportName = IdentifierName | IdentifierReference | StringLiteral;
1792
- interface V8IntrinsicExpression extends Span {
1793
- type: "V8IntrinsicExpression";
1794
- name: IdentifierName;
1795
- arguments: Array<Argument>;
1796
- parent: Node$1;
1797
- }
1798
- interface BooleanLiteral extends Span {
1799
- type: "Literal";
1800
- value: boolean;
1801
- raw: string | null;
1802
- parent: Node$1;
1803
- }
1804
- interface NullLiteral extends Span {
1805
- type: "Literal";
1806
- value: null;
1807
- raw: "null" | null;
1808
- parent: Node$1;
1809
- }
1810
- interface NumericLiteral extends Span {
1811
- type: "Literal";
1812
- value: number;
1813
- raw: string | null;
1814
- parent: Node$1;
1815
- }
1816
- interface StringLiteral extends Span {
1817
- type: "Literal";
1818
- value: string;
1819
- raw: string | null;
1820
- parent: Node$1;
1821
- }
1822
- interface BigIntLiteral extends Span {
1823
- type: "Literal";
1824
- value: bigint;
1825
- raw: string | null;
1826
- bigint: string;
1827
- parent: Node$1;
1828
- }
1829
- interface RegExpLiteral extends Span {
1830
- type: "Literal";
1831
- value: RegExp | null;
1832
- raw: string | null;
1833
- regex: {
1834
- pattern: string;
1835
- flags: string;
1836
- };
1837
- parent: Node$1;
1838
- }
1839
- interface JSXElement extends Span {
1840
- type: "JSXElement";
1841
- openingElement: JSXOpeningElement;
1842
- children: Array<JSXChild>;
1843
- closingElement: JSXClosingElement | null;
1844
- parent: Node$1;
1845
- }
1846
- interface JSXOpeningElement extends Span {
1847
- type: "JSXOpeningElement";
1848
- name: JSXElementName;
1849
- typeArguments?: TSTypeParameterInstantiation | null;
1850
- attributes: Array<JSXAttributeItem>;
1851
- selfClosing: boolean;
1852
- parent: Node$1;
1853
- }
1854
- interface JSXClosingElement extends Span {
1855
- type: "JSXClosingElement";
1856
- name: JSXElementName;
1857
- parent: Node$1;
1858
- }
1859
- interface JSXFragment extends Span {
1860
- type: "JSXFragment";
1861
- openingFragment: JSXOpeningFragment;
1862
- children: Array<JSXChild>;
1863
- closingFragment: JSXClosingFragment;
1864
- parent: Node$1;
1865
- }
1866
- interface JSXOpeningFragment extends Span {
1867
- type: "JSXOpeningFragment";
1868
- attributes?: [];
1869
- selfClosing?: false;
1870
- parent: Node$1;
1871
- }
1872
- interface JSXClosingFragment extends Span {
1873
- type: "JSXClosingFragment";
1874
- parent: Node$1;
1875
- }
1876
- type JSXElementName = JSXIdentifier | JSXNamespacedName | JSXMemberExpression;
1877
- interface JSXNamespacedName extends Span {
1878
- type: "JSXNamespacedName";
1879
- namespace: JSXIdentifier;
1880
- name: JSXIdentifier;
1881
- parent: Node$1;
1882
- }
1883
- interface JSXMemberExpression extends Span {
1884
- type: "JSXMemberExpression";
1885
- object: JSXMemberExpressionObject;
1886
- property: JSXIdentifier;
1887
- parent: Node$1;
1888
- }
1889
- type JSXMemberExpressionObject = JSXIdentifier | JSXMemberExpression;
1890
- interface JSXExpressionContainer extends Span {
1891
- type: "JSXExpressionContainer";
1892
- expression: JSXExpression;
1893
- parent: Node$1;
1894
- }
1895
- type JSXExpression = JSXEmptyExpression | Expression;
1896
- interface JSXEmptyExpression extends Span {
1897
- type: "JSXEmptyExpression";
1898
- parent: Node$1;
1899
- }
1900
- type JSXAttributeItem = JSXAttribute | JSXSpreadAttribute;
1901
- interface JSXAttribute extends Span {
1902
- type: "JSXAttribute";
1903
- name: JSXAttributeName;
1904
- value: JSXAttributeValue | null;
1905
- parent: Node$1;
1906
- }
1907
- interface JSXSpreadAttribute extends Span {
1908
- type: "JSXSpreadAttribute";
1909
- argument: Expression;
1910
- parent: Node$1;
1911
- }
1912
- type JSXAttributeName = JSXIdentifier | JSXNamespacedName;
1913
- type JSXAttributeValue = StringLiteral | JSXExpressionContainer | JSXElement | JSXFragment;
1914
- interface JSXIdentifier extends Span {
1915
- type: "JSXIdentifier";
1916
- name: string;
1917
- parent: Node$1;
1918
- }
1919
- type JSXChild = JSXText | JSXElement | JSXFragment | JSXExpressionContainer | JSXSpreadChild;
1920
- interface JSXSpreadChild extends Span {
1921
- type: "JSXSpreadChild";
1922
- expression: Expression;
1923
- parent: Node$1;
1924
- }
1925
- interface JSXText extends Span {
1926
- type: "JSXText";
1927
- value: string;
1928
- raw: string | null;
1929
- parent: Node$1;
1930
- }
1931
- interface TSThisParameter extends Span {
1932
- type: "Identifier";
1933
- decorators: [];
1934
- name: "this";
1935
- optional: false;
1936
- typeAnnotation: TSTypeAnnotation | null;
1937
- parent: Node$1;
1938
- }
1939
- interface TSEnumDeclaration extends Span {
1940
- type: "TSEnumDeclaration";
1941
- id: BindingIdentifier;
1942
- body: TSEnumBody;
1943
- const: boolean;
1944
- declare: boolean;
1945
- parent: Node$1;
1946
- }
1947
- interface TSEnumBody extends Span {
1948
- type: "TSEnumBody";
1949
- members: Array<TSEnumMember>;
1950
- parent: Node$1;
1951
- }
1952
- interface TSEnumMember extends Span {
1953
- type: "TSEnumMember";
1954
- id: TSEnumMemberName;
1955
- initializer: Expression | null;
1956
- computed: boolean;
1957
- parent: Node$1;
1958
- }
1959
- type TSEnumMemberName = IdentifierName | StringLiteral | TemplateLiteral;
1960
- interface TSTypeAnnotation extends Span {
1961
- type: "TSTypeAnnotation";
1962
- typeAnnotation: TSType;
1963
- parent: Node$1;
1964
- }
1965
- interface TSLiteralType extends Span {
1966
- type: "TSLiteralType";
1967
- literal: TSLiteral;
1968
- parent: Node$1;
1969
- }
1970
- type TSLiteral = BooleanLiteral | NumericLiteral | BigIntLiteral | StringLiteral | TemplateLiteral | UnaryExpression;
1971
- 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;
1972
- interface TSConditionalType extends Span {
1973
- type: "TSConditionalType";
1974
- checkType: TSType;
1975
- extendsType: TSType;
1976
- trueType: TSType;
1977
- falseType: TSType;
1978
- parent: Node$1;
1979
- }
1980
- interface TSUnionType extends Span {
1981
- type: "TSUnionType";
1982
- types: Array<TSType>;
1983
- parent: Node$1;
1984
- }
1985
- interface TSIntersectionType extends Span {
1986
- type: "TSIntersectionType";
1987
- types: Array<TSType>;
1988
- parent: Node$1;
1989
- }
1990
- interface TSParenthesizedType extends Span {
1991
- type: "TSParenthesizedType";
1992
- typeAnnotation: TSType;
1993
- parent: Node$1;
1994
- }
1995
- interface TSTypeOperator extends Span {
1996
- type: "TSTypeOperator";
1997
- operator: TSTypeOperatorOperator;
1998
- typeAnnotation: TSType;
1999
- parent: Node$1;
2000
- }
2001
- type TSTypeOperatorOperator = "keyof" | "unique" | "readonly";
2002
- interface TSArrayType extends Span {
2003
- type: "TSArrayType";
2004
- elementType: TSType;
2005
- parent: Node$1;
2006
- }
2007
- interface TSIndexedAccessType extends Span {
2008
- type: "TSIndexedAccessType";
2009
- objectType: TSType;
2010
- indexType: TSType;
2011
- parent: Node$1;
2012
- }
2013
- interface TSTupleType extends Span {
2014
- type: "TSTupleType";
2015
- elementTypes: Array<TSTupleElement>;
2016
- parent: Node$1;
2017
- }
2018
- interface TSNamedTupleMember extends Span {
2019
- type: "TSNamedTupleMember";
2020
- label: IdentifierName;
2021
- elementType: TSTupleElement;
2022
- optional: boolean;
2023
- parent: Node$1;
2024
- }
2025
- interface TSOptionalType extends Span {
2026
- type: "TSOptionalType";
2027
- typeAnnotation: TSType;
2028
- parent: Node$1;
2029
- }
2030
- interface TSRestType extends Span {
2031
- type: "TSRestType";
2032
- typeAnnotation: TSType;
2033
- parent: Node$1;
2034
- }
2035
- type TSTupleElement = TSOptionalType | TSRestType | TSType;
2036
- interface TSAnyKeyword extends Span {
2037
- type: "TSAnyKeyword";
2038
- parent: Node$1;
2039
- }
2040
- interface TSStringKeyword extends Span {
2041
- type: "TSStringKeyword";
2042
- parent: Node$1;
2043
- }
2044
- interface TSBooleanKeyword extends Span {
2045
- type: "TSBooleanKeyword";
2046
- parent: Node$1;
2047
- }
2048
- interface TSNumberKeyword extends Span {
2049
- type: "TSNumberKeyword";
2050
- parent: Node$1;
2051
- }
2052
- interface TSNeverKeyword extends Span {
2053
- type: "TSNeverKeyword";
2054
- parent: Node$1;
2055
- }
2056
- interface TSIntrinsicKeyword extends Span {
2057
- type: "TSIntrinsicKeyword";
2058
- parent: Node$1;
2059
- }
2060
- interface TSUnknownKeyword extends Span {
2061
- type: "TSUnknownKeyword";
2062
- parent: Node$1;
2063
- }
2064
- interface TSNullKeyword extends Span {
2065
- type: "TSNullKeyword";
2066
- parent: Node$1;
2067
- }
2068
- interface TSUndefinedKeyword extends Span {
2069
- type: "TSUndefinedKeyword";
2070
- parent: Node$1;
2071
- }
2072
- interface TSVoidKeyword extends Span {
2073
- type: "TSVoidKeyword";
2074
- parent: Node$1;
2075
- }
2076
- interface TSSymbolKeyword extends Span {
2077
- type: "TSSymbolKeyword";
2078
- parent: Node$1;
2079
- }
2080
- interface TSThisType extends Span {
2081
- type: "TSThisType";
2082
- parent: Node$1;
2083
- }
2084
- interface TSObjectKeyword extends Span {
2085
- type: "TSObjectKeyword";
2086
- parent: Node$1;
2087
- }
2088
- interface TSBigIntKeyword extends Span {
2089
- type: "TSBigIntKeyword";
2090
- parent: Node$1;
2091
- }
2092
- interface TSTypeReference extends Span {
2093
- type: "TSTypeReference";
2094
- typeName: TSTypeName;
2095
- typeArguments: TSTypeParameterInstantiation | null;
2096
- parent: Node$1;
2097
- }
2098
- type TSTypeName = IdentifierReference | TSQualifiedName | ThisExpression;
2099
- interface TSQualifiedName extends Span {
2100
- type: "TSQualifiedName";
2101
- left: TSTypeName;
2102
- right: IdentifierName;
2103
- parent: Node$1;
2104
- }
2105
- interface TSTypeParameterInstantiation extends Span {
2106
- type: "TSTypeParameterInstantiation";
2107
- params: Array<TSType>;
2108
- parent: Node$1;
2109
- }
2110
- interface TSTypeParameter extends Span {
2111
- type: "TSTypeParameter";
2112
- name: BindingIdentifier;
2113
- constraint: TSType | null;
2114
- default: TSType | null;
2115
- in: boolean;
2116
- out: boolean;
2117
- const: boolean;
2118
- parent: Node$1;
2119
- }
2120
- interface TSTypeParameterDeclaration extends Span {
2121
- type: "TSTypeParameterDeclaration";
2122
- params: Array<TSTypeParameter>;
2123
- parent: Node$1;
2124
- }
2125
- interface TSTypeAliasDeclaration extends Span {
2126
- type: "TSTypeAliasDeclaration";
2127
- id: BindingIdentifier;
2128
- typeParameters: TSTypeParameterDeclaration | null;
2129
- typeAnnotation: TSType;
2130
- declare: boolean;
2131
- parent: Node$1;
2132
- }
2133
- type TSAccessibility = "private" | "protected" | "public";
2134
- interface TSClassImplements extends Span {
2135
- type: "TSClassImplements";
2136
- expression: IdentifierReference | ThisExpression | MemberExpression;
2137
- typeArguments: TSTypeParameterInstantiation | null;
2138
- parent: Node$1;
2139
- }
2140
- interface TSInterfaceDeclaration extends Span {
2141
- type: "TSInterfaceDeclaration";
2142
- id: BindingIdentifier;
2143
- typeParameters: TSTypeParameterDeclaration | null;
2144
- extends: Array<TSInterfaceHeritage>;
2145
- body: TSInterfaceBody;
2146
- declare: boolean;
2147
- parent: Node$1;
2148
- }
2149
- interface TSInterfaceBody extends Span {
2150
- type: "TSInterfaceBody";
2151
- body: Array<TSSignature>;
2152
- parent: Node$1;
2153
- }
2154
- interface TSPropertySignature extends Span {
2155
- type: "TSPropertySignature";
2156
- computed: boolean;
2157
- optional: boolean;
2158
- readonly: boolean;
2159
- key: PropertyKey$1;
2160
- typeAnnotation: TSTypeAnnotation | null;
2161
- accessibility: null;
2162
- static: false;
2163
- parent: Node$1;
2164
- }
2165
- type TSSignature = TSIndexSignature | TSPropertySignature | TSCallSignatureDeclaration | TSConstructSignatureDeclaration | TSMethodSignature;
2166
- interface TSIndexSignature extends Span {
2167
- type: "TSIndexSignature";
2168
- parameters: Array<TSIndexSignatureName>;
2169
- typeAnnotation: TSTypeAnnotation;
2170
- readonly: boolean;
2171
- static: boolean;
2172
- accessibility: null;
2173
- parent: Node$1;
2174
- }
2175
- interface TSCallSignatureDeclaration extends Span {
2176
- type: "TSCallSignatureDeclaration";
2177
- typeParameters: TSTypeParameterDeclaration | null;
2178
- params: ParamPattern[];
2179
- returnType: TSTypeAnnotation | null;
2180
- parent: Node$1;
2181
- }
2182
- type TSMethodSignatureKind = "method" | "get" | "set";
2183
- interface TSMethodSignature extends Span {
2184
- type: "TSMethodSignature";
2185
- key: PropertyKey$1;
2186
- computed: boolean;
2187
- optional: boolean;
2188
- kind: TSMethodSignatureKind;
2189
- typeParameters: TSTypeParameterDeclaration | null;
2190
- params: ParamPattern[];
2191
- returnType: TSTypeAnnotation | null;
2192
- accessibility: null;
2193
- readonly: false;
2194
- static: false;
2195
- parent: Node$1;
2196
- }
2197
- interface TSConstructSignatureDeclaration extends Span {
2198
- type: "TSConstructSignatureDeclaration";
2199
- typeParameters: TSTypeParameterDeclaration | null;
2200
- params: ParamPattern[];
2201
- returnType: TSTypeAnnotation | null;
2202
- parent: Node$1;
2203
- }
2204
- interface TSIndexSignatureName extends Span {
2205
- type: "Identifier";
2206
- decorators: [];
2207
- name: string;
2208
- optional: false;
2209
- typeAnnotation: TSTypeAnnotation;
2210
- parent: Node$1;
2211
- }
2212
- interface TSInterfaceHeritage extends Span {
2213
- type: "TSInterfaceHeritage";
2214
- expression: Expression;
2215
- typeArguments: TSTypeParameterInstantiation | null;
2216
- parent: Node$1;
2217
- }
2218
- interface TSTypePredicate extends Span {
2219
- type: "TSTypePredicate";
2220
- parameterName: TSTypePredicateName;
2221
- asserts: boolean;
2222
- typeAnnotation: TSTypeAnnotation | null;
2223
- parent: Node$1;
2224
- }
2225
- type TSTypePredicateName = IdentifierName | TSThisType;
2226
- interface TSModuleDeclaration extends Span {
2227
- type: "TSModuleDeclaration";
2228
- id: BindingIdentifier | StringLiteral | TSQualifiedName;
2229
- body: TSModuleBlock | null;
2230
- kind: TSModuleDeclarationKind;
2231
- declare: boolean;
2232
- global: false;
2233
- parent: Node$1;
2234
- }
2235
- type TSModuleDeclarationKind = "module" | "namespace";
2236
- interface TSGlobalDeclaration extends Span {
2237
- type: "TSModuleDeclaration";
2238
- id: IdentifierName;
2239
- body: TSModuleBlock;
2240
- kind: "global";
2241
- declare: boolean;
2242
- global: true;
2243
- parent: Node$1;
2244
- }
2245
- interface TSModuleBlock extends Span {
2246
- type: "TSModuleBlock";
2247
- body: Array<Directive | Statement>;
2248
- parent: Node$1;
2249
- }
2250
- interface TSTypeLiteral extends Span {
2251
- type: "TSTypeLiteral";
2252
- members: Array<TSSignature>;
2253
- parent: Node$1;
2254
- }
2255
- interface TSInferType extends Span {
2256
- type: "TSInferType";
2257
- typeParameter: TSTypeParameter;
2258
- parent: Node$1;
2259
- }
2260
- interface TSTypeQuery extends Span {
2261
- type: "TSTypeQuery";
2262
- exprName: TSTypeQueryExprName;
2263
- typeArguments: TSTypeParameterInstantiation | null;
2264
- parent: Node$1;
2265
- }
2266
- type TSTypeQueryExprName = TSImportType | TSTypeName;
2267
- interface TSImportType extends Span {
2268
- type: "TSImportType";
2269
- source: StringLiteral;
2270
- options: ObjectExpression | null;
2271
- qualifier: TSImportTypeQualifier | null;
2272
- typeArguments: TSTypeParameterInstantiation | null;
2273
- parent: Node$1;
2274
- }
2275
- type TSImportTypeQualifier = IdentifierName | TSImportTypeQualifiedName;
2276
- interface TSImportTypeQualifiedName extends Span {
2277
- type: "TSQualifiedName";
2278
- left: TSImportTypeQualifier;
2279
- right: IdentifierName;
2280
- parent: Node$1;
2281
- }
2282
- interface TSFunctionType extends Span {
2283
- type: "TSFunctionType";
2284
- typeParameters: TSTypeParameterDeclaration | null;
2285
- params: ParamPattern[];
2286
- returnType: TSTypeAnnotation;
2287
- parent: Node$1;
2288
- }
2289
- interface TSConstructorType extends Span {
2290
- type: "TSConstructorType";
2291
- abstract: boolean;
2292
- typeParameters: TSTypeParameterDeclaration | null;
2293
- params: ParamPattern[];
2294
- returnType: TSTypeAnnotation;
2295
- parent: Node$1;
2296
- }
2297
- interface TSMappedType extends Span {
2298
- type: "TSMappedType";
2299
- key: BindingIdentifier;
2300
- constraint: TSType;
2301
- nameType: TSType | null;
2302
- typeAnnotation: TSType | null;
2303
- optional: TSMappedTypeModifierOperator | false;
2304
- readonly: TSMappedTypeModifierOperator | null;
2305
- parent: Node$1;
2306
- }
2307
- type TSMappedTypeModifierOperator = true | "+" | "-";
2308
- interface TSTemplateLiteralType extends Span {
2309
- type: "TSTemplateLiteralType";
2310
- quasis: Array<TemplateElement>;
2311
- types: Array<TSType>;
2312
- parent: Node$1;
2313
- }
2314
- interface TSAsExpression extends Span {
2315
- type: "TSAsExpression";
2316
- expression: Expression;
2317
- typeAnnotation: TSType;
2318
- parent: Node$1;
2319
- }
2320
- interface TSSatisfiesExpression extends Span {
2321
- type: "TSSatisfiesExpression";
2322
- expression: Expression;
2323
- typeAnnotation: TSType;
2324
- parent: Node$1;
2325
- }
2326
- interface TSTypeAssertion extends Span {
2327
- type: "TSTypeAssertion";
2328
- typeAnnotation: TSType;
2329
- expression: Expression;
2330
- parent: Node$1;
2331
- }
2332
- interface TSImportEqualsDeclaration extends Span {
2333
- type: "TSImportEqualsDeclaration";
2334
- id: BindingIdentifier;
2335
- moduleReference: TSModuleReference;
2336
- importKind: ImportOrExportKind;
2337
- parent: Node$1;
2338
- }
2339
- type TSModuleReference = TSExternalModuleReference | IdentifierReference | TSQualifiedName;
2340
- interface TSExternalModuleReference extends Span {
2341
- type: "TSExternalModuleReference";
2342
- expression: StringLiteral;
2343
- parent: Node$1;
2344
- }
2345
- interface TSNonNullExpression extends Span {
2346
- type: "TSNonNullExpression";
2347
- expression: Expression;
2348
- parent: Node$1;
2349
- }
2350
- interface Decorator extends Span {
2351
- type: "Decorator";
2352
- expression: Expression;
2353
- parent: Node$1;
2354
- }
2355
- interface TSExportAssignment extends Span {
2356
- type: "TSExportAssignment";
2357
- expression: Expression;
2358
- parent: Node$1;
2359
- }
2360
- interface TSNamespaceExportDeclaration extends Span {
2361
- type: "TSNamespaceExportDeclaration";
2362
- id: IdentifierName;
2363
- parent: Node$1;
2364
- }
2365
- interface TSInstantiationExpression extends Span {
2366
- type: "TSInstantiationExpression";
2367
- expression: Expression;
2368
- typeArguments: TSTypeParameterInstantiation;
2369
- parent: Node$1;
2370
- }
2371
- type ImportOrExportKind = "value" | "type";
2372
- interface JSDocNullableType extends Span {
2373
- type: "TSJSDocNullableType";
2374
- typeAnnotation: TSType;
2375
- postfix: boolean;
2376
- parent: Node$1;
2377
- }
2378
- interface JSDocNonNullableType extends Span {
2379
- type: "TSJSDocNonNullableType";
2380
- typeAnnotation: TSType;
2381
- postfix: boolean;
2382
- parent: Node$1;
2383
- }
2384
- interface JSDocUnknownType extends Span {
2385
- type: "TSJSDocUnknownType";
2386
- parent: Node$1;
2387
- }
2388
- type AssignmentOperator = "=" | "+=" | "-=" | "*=" | "/=" | "%=" | "**=" | "<<=" | ">>=" | ">>>=" | "|=" | "^=" | "&=" | "||=" | "&&=" | "??=";
2389
- type BinaryOperator = "==" | "!=" | "===" | "!==" | "<" | "<=" | ">" | ">=" | "+" | "-" | "*" | "/" | "%" | "**" | "<<" | ">>" | ">>>" | "|" | "^" | "&" | "in" | "instanceof";
2390
- type LogicalOperator = "||" | "&&" | "??";
2391
- type UnaryOperator = "+" | "-" | "!" | "~" | "typeof" | "void" | "delete";
2392
- type UpdateOperator = "++" | "--";
2393
- type ModuleKind = "script" | "module" | "commonjs";
2394
- type Node$1 = Program | IdentifierName | IdentifierReference | BindingIdentifier | LabelIdentifier | ThisExpression | ArrayExpression | ObjectExpression | ObjectProperty | TemplateLiteral | TaggedTemplateExpression | TemplateElement | ComputedMemberExpression | StaticMemberExpression | PrivateFieldExpression | CallExpression | NewExpression | MetaProperty | SpreadElement | UpdateExpression | UnaryExpression | BinaryExpression | PrivateInExpression | LogicalExpression | ConditionalExpression | AssignmentExpression | ArrayAssignmentTarget | ObjectAssignmentTarget | AssignmentTargetRest | AssignmentTargetWithDefault | AssignmentTargetPropertyIdentifier | AssignmentTargetPropertyProperty | SequenceExpression | Super | AwaitExpression | ChainExpression | ParenthesizedExpression | Directive | Hashbang | BlockStatement | VariableDeclaration | VariableDeclarator | EmptyStatement | ExpressionStatement | IfStatement | DoWhileStatement | WhileStatement | ForStatement | ForInStatement | ForOfStatement | ContinueStatement | BreakStatement | ReturnStatement | WithStatement | SwitchStatement | SwitchCase | LabeledStatement | ThrowStatement | TryStatement | CatchClause | DebuggerStatement | AssignmentPattern | ObjectPattern | BindingProperty | ArrayPattern | BindingRestElement | Function$1 | FunctionBody | ArrowFunctionExpression | YieldExpression | Class | ClassBody | MethodDefinition | PropertyDefinition | PrivateIdentifier | StaticBlock | AccessorProperty | ImportExpression | ImportDeclaration | ImportSpecifier | ImportDefaultSpecifier | ImportNamespaceSpecifier | ImportAttribute | ExportNamedDeclaration | ExportDefaultDeclaration | ExportAllDeclaration | ExportSpecifier | V8IntrinsicExpression | BooleanLiteral | NullLiteral | NumericLiteral | StringLiteral | BigIntLiteral | RegExpLiteral | JSXElement | JSXOpeningElement | JSXClosingElement | JSXFragment | JSXOpeningFragment | JSXClosingFragment | JSXNamespacedName | JSXMemberExpression | JSXExpressionContainer | JSXEmptyExpression | JSXAttribute | JSXSpreadAttribute | JSXIdentifier | JSXSpreadChild | JSXText | TSThisParameter | TSEnumDeclaration | TSEnumBody | TSEnumMember | TSTypeAnnotation | TSLiteralType | TSConditionalType | TSUnionType | TSIntersectionType | TSParenthesizedType | TSTypeOperator | TSArrayType | TSIndexedAccessType | TSTupleType | TSNamedTupleMember | TSOptionalType | TSRestType | TSAnyKeyword | TSStringKeyword | TSBooleanKeyword | TSNumberKeyword | TSNeverKeyword | TSIntrinsicKeyword | TSUnknownKeyword | TSNullKeyword | TSUndefinedKeyword | TSVoidKeyword | TSSymbolKeyword | TSThisType | TSObjectKeyword | TSBigIntKeyword | TSTypeReference | TSQualifiedName | TSTypeParameterInstantiation | TSTypeParameter | TSTypeParameterDeclaration | TSTypeAliasDeclaration | TSClassImplements | TSInterfaceDeclaration | TSInterfaceBody | TSPropertySignature | TSIndexSignature | TSCallSignatureDeclaration | TSMethodSignature | TSConstructSignatureDeclaration | TSIndexSignatureName | TSInterfaceHeritage | TSTypePredicate | TSModuleDeclaration | TSGlobalDeclaration | TSModuleBlock | TSTypeLiteral | TSInferType | TSTypeQuery | TSImportType | TSImportTypeQualifiedName | TSFunctionType | TSConstructorType | TSMappedType | TSTemplateLiteralType | TSAsExpression | TSSatisfiesExpression | TSTypeAssertion | TSImportEqualsDeclaration | TSExternalModuleReference | TSNonNullExpression | Decorator | TSExportAssignment | TSNamespaceExportDeclaration | TSInstantiationExpression | JSDocNullableType | JSDocNonNullableType | JSDocUnknownType | ParamPattern;
2395
882
  //#endregion
2396
883
  //#region src-js/generated/visitor.d.ts
2397
884
  // To understand why we need the "Bivariance hack", see: https://github.com/DefinitelyTyped/DefinitelyTyped/pull/20219
@@ -2731,233 +1218,1387 @@ interface StrictVisitorObject {
2731
1218
  TSUnionType?: (node: TSUnionType) => void;
2732
1219
  "TSUnionType:exit"?: (node: TSUnionType) => void;
2733
1220
  }
2734
- type VisitorObject = { [K in keyof StrictVisitorObject]?: BivarianceHackHandler<Exclude<StrictVisitorObject[K], undefined>> | undefined } & Record<string, BivarianceHackHandler<(node: Node$1) => void> | undefined>;
2735
- //#endregion
2736
- //#region src-js/plugins/types.d.ts
2737
- type BeforeHook = () => boolean | void;
2738
- type AfterHook = () => void;
2739
- type VisitorWithHooks = VisitorObject & {
2740
- before?: BeforeHook;
2741
- after?: AfterHook;
2742
- };
2743
- interface Node extends Span {}
2744
- type NodeOrToken = Node | TokenType | Comment;
2745
- interface Comment extends Span {
2746
- type: "Line" | "Block" | "Shebang";
2747
- value: string;
1221
+ type VisitorObject = { [K in keyof StrictVisitorObject]?: BivarianceHackHandler<Exclude<StrictVisitorObject[K], undefined>> | undefined } & Record<string, BivarianceHackHandler<(node: Node) => void> | undefined>;
1222
+ //#endregion
1223
+ //#region src-js/plugins/types.d.ts
1224
+ type BeforeHook = () => boolean | void;
1225
+ type AfterHook = () => void;
1226
+ type VisitorWithHooks = VisitorObject & {
1227
+ before?: BeforeHook;
1228
+ after?: AfterHook;
1229
+ };
1230
+ interface Node$1 extends Span {}
1231
+ type NodeOrToken = Node$1 | TokenType | CommentType;
1232
+ //#endregion
1233
+ //#region src-js/plugins/location.d.ts
1234
+ /**
1235
+ * Range of source offsets.
1236
+ */
1237
+ type Range = [number, number];
1238
+ /**
1239
+ * Interface for any type which has `range` field.
1240
+ */
1241
+ interface Ranged {
1242
+ range: Range;
1243
+ }
1244
+ /**
1245
+ * Interface for any type which has location properties.
1246
+ */
1247
+ interface Span extends Ranged {
1248
+ start: number;
1249
+ end: number;
1250
+ loc: Location;
1251
+ }
1252
+ /**
1253
+ * Source code location.
1254
+ */
1255
+ interface Location {
1256
+ start: LineColumn;
1257
+ end: LineColumn;
1258
+ }
1259
+ /**
1260
+ * Line number + column number pair.
1261
+ * `line` is 1-indexed, `column` is 0-indexed.
1262
+ */
1263
+ interface LineColumn {
1264
+ line: number;
1265
+ column: number;
1266
+ }
1267
+ /**
1268
+ * Convert a source text index into a (line, column) pair.
1269
+ * @param offset - The index of a character in a file.
1270
+ * @returns `{line, column}` location object with 1-indexed line and 0-indexed column.
1271
+ * @throws {TypeError|RangeError} If non-numeric `offset`, or `offset` out of range.
1272
+ */
1273
+ declare function getLineColumnFromOffset(offset: number): LineColumn;
1274
+ /**
1275
+ * Convert a `{ line, column }` pair into a range index.
1276
+ * @param loc - A line/column location.
1277
+ * @returns The character index of the location in the file.
1278
+ * @throws {TypeError|RangeError} If `loc` is not an object with a numeric `line` and `column`,
1279
+ * or if the `line` is less than or equal to zero, or the line or column is out of the expected range.
1280
+ */
1281
+ declare function getOffsetFromLineColumn(loc: LineColumn): number;
1282
+ /**
1283
+ * Get the range of the given node or token.
1284
+ * @param nodeOrToken - Node or token to get the range of
1285
+ * @returns Range of the node or token
1286
+ */
1287
+ declare function getRange(nodeOrToken: NodeOrToken): Range;
1288
+ /**
1289
+ * Get the location of the given node or token.
1290
+ * @param nodeOrToken - Node or token to get the location of
1291
+ * @returns Location of the node or token
1292
+ */
1293
+ declare function getLoc(nodeOrToken: NodeOrToken): Location;
1294
+ /**
1295
+ * Get the deepest node containing a range index.
1296
+ * @param offset - Range index of the desired node
1297
+ * @returns The node if found, or `null` if not found
1298
+ */
1299
+ declare function getNodeByRangeIndex(offset: number): Node | null;
1300
+ //#endregion
1301
+ //#region src-js/plugins/comments.d.ts
1302
+ /**
1303
+ * Comment.
1304
+ */
1305
+ interface CommentType extends Span {
1306
+ type: "Line" | "Block" | "Shebang";
1307
+ value: string;
1308
+ }
1309
+ //#endregion
1310
+ //#region src-js/generated/types.d.ts
1311
+ interface Program extends Span {
1312
+ type: "Program";
1313
+ body: Array<Directive$1 | Statement>;
1314
+ sourceType: ModuleKind;
1315
+ comments: CommentType[];
1316
+ tokens: TokenType[];
1317
+ parent: null;
1318
+ }
1319
+ 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;
1320
+ interface IdentifierName extends Span {
1321
+ type: "Identifier";
1322
+ decorators?: [];
1323
+ name: string;
1324
+ optional?: false;
1325
+ typeAnnotation?: null;
1326
+ parent: Node;
1327
+ }
1328
+ interface IdentifierReference extends Span {
1329
+ type: "Identifier";
1330
+ decorators?: [];
1331
+ name: string;
1332
+ optional?: false;
1333
+ typeAnnotation?: null;
1334
+ parent: Node;
1335
+ }
1336
+ interface BindingIdentifier extends Span {
1337
+ type: "Identifier";
1338
+ decorators?: [];
1339
+ name: string;
1340
+ optional?: false;
1341
+ typeAnnotation?: null;
1342
+ parent: Node;
1343
+ }
1344
+ interface LabelIdentifier extends Span {
1345
+ type: "Identifier";
1346
+ decorators?: [];
1347
+ name: string;
1348
+ optional?: false;
1349
+ typeAnnotation?: null;
1350
+ parent: Node;
1351
+ }
1352
+ interface ThisExpression extends Span {
1353
+ type: "ThisExpression";
1354
+ parent: Node;
1355
+ }
1356
+ interface ArrayExpression extends Span {
1357
+ type: "ArrayExpression";
1358
+ elements: Array<ArrayExpressionElement>;
1359
+ parent: Node;
1360
+ }
1361
+ type ArrayExpressionElement = SpreadElement | null | Expression;
1362
+ interface ObjectExpression extends Span {
1363
+ type: "ObjectExpression";
1364
+ properties: Array<ObjectPropertyKind>;
1365
+ parent: Node;
1366
+ }
1367
+ type ObjectPropertyKind = ObjectProperty | SpreadElement;
1368
+ interface ObjectProperty extends Span {
1369
+ type: "Property";
1370
+ kind: PropertyKind;
1371
+ key: PropertyKey$1;
1372
+ value: Expression;
1373
+ method: boolean;
1374
+ shorthand: boolean;
1375
+ computed: boolean;
1376
+ optional?: false;
1377
+ parent: Node;
1378
+ }
1379
+ type PropertyKey$1 = IdentifierName | PrivateIdentifier | Expression;
1380
+ type PropertyKind = "init" | "get" | "set";
1381
+ interface TemplateLiteral extends Span {
1382
+ type: "TemplateLiteral";
1383
+ quasis: Array<TemplateElement>;
1384
+ expressions: Array<Expression>;
1385
+ parent: Node;
1386
+ }
1387
+ interface TaggedTemplateExpression extends Span {
1388
+ type: "TaggedTemplateExpression";
1389
+ tag: Expression;
1390
+ typeArguments?: TSTypeParameterInstantiation | null;
1391
+ quasi: TemplateLiteral;
1392
+ parent: Node;
1393
+ }
1394
+ interface TemplateElement extends Span {
1395
+ type: "TemplateElement";
1396
+ value: TemplateElementValue;
1397
+ tail: boolean;
1398
+ parent: Node;
1399
+ }
1400
+ interface TemplateElementValue {
1401
+ raw: string;
1402
+ cooked: string | null;
1403
+ }
1404
+ type MemberExpression = ComputedMemberExpression | StaticMemberExpression | PrivateFieldExpression;
1405
+ interface ComputedMemberExpression extends Span {
1406
+ type: "MemberExpression";
1407
+ object: Expression;
1408
+ property: Expression;
1409
+ optional: boolean;
1410
+ computed: true;
1411
+ parent: Node;
1412
+ }
1413
+ interface StaticMemberExpression extends Span {
1414
+ type: "MemberExpression";
1415
+ object: Expression;
1416
+ property: IdentifierName;
1417
+ optional: boolean;
1418
+ computed: false;
1419
+ parent: Node;
1420
+ }
1421
+ interface PrivateFieldExpression extends Span {
1422
+ type: "MemberExpression";
1423
+ object: Expression;
1424
+ property: PrivateIdentifier;
1425
+ optional: boolean;
1426
+ computed: false;
1427
+ parent: Node;
1428
+ }
1429
+ interface CallExpression extends Span {
1430
+ type: "CallExpression";
1431
+ callee: Expression;
1432
+ typeArguments?: TSTypeParameterInstantiation | null;
1433
+ arguments: Array<Argument>;
1434
+ optional: boolean;
1435
+ parent: Node;
1436
+ }
1437
+ interface NewExpression extends Span {
1438
+ type: "NewExpression";
1439
+ callee: Expression;
1440
+ typeArguments?: TSTypeParameterInstantiation | null;
1441
+ arguments: Array<Argument>;
1442
+ parent: Node;
1443
+ }
1444
+ interface MetaProperty extends Span {
1445
+ type: "MetaProperty";
1446
+ meta: IdentifierName;
1447
+ property: IdentifierName;
1448
+ parent: Node;
1449
+ }
1450
+ interface SpreadElement extends Span {
1451
+ type: "SpreadElement";
1452
+ argument: Expression;
1453
+ parent: Node;
1454
+ }
1455
+ type Argument = SpreadElement | Expression;
1456
+ interface UpdateExpression extends Span {
1457
+ type: "UpdateExpression";
1458
+ operator: UpdateOperator;
1459
+ prefix: boolean;
1460
+ argument: SimpleAssignmentTarget;
1461
+ parent: Node;
1462
+ }
1463
+ interface UnaryExpression extends Span {
1464
+ type: "UnaryExpression";
1465
+ operator: UnaryOperator;
1466
+ argument: Expression;
1467
+ prefix: true;
1468
+ parent: Node;
1469
+ }
1470
+ interface BinaryExpression extends Span {
1471
+ type: "BinaryExpression";
1472
+ left: Expression;
1473
+ operator: BinaryOperator;
1474
+ right: Expression;
1475
+ parent: Node;
1476
+ }
1477
+ interface PrivateInExpression extends Span {
1478
+ type: "BinaryExpression";
1479
+ left: PrivateIdentifier;
1480
+ operator: "in";
1481
+ right: Expression;
1482
+ parent: Node;
1483
+ }
1484
+ interface LogicalExpression extends Span {
1485
+ type: "LogicalExpression";
1486
+ left: Expression;
1487
+ operator: LogicalOperator;
1488
+ right: Expression;
1489
+ parent: Node;
1490
+ }
1491
+ interface ConditionalExpression extends Span {
1492
+ type: "ConditionalExpression";
1493
+ test: Expression;
1494
+ consequent: Expression;
1495
+ alternate: Expression;
1496
+ parent: Node;
1497
+ }
1498
+ interface AssignmentExpression extends Span {
1499
+ type: "AssignmentExpression";
1500
+ operator: AssignmentOperator;
1501
+ left: AssignmentTarget;
1502
+ right: Expression;
1503
+ parent: Node;
1504
+ }
1505
+ type AssignmentTarget = SimpleAssignmentTarget | AssignmentTargetPattern;
1506
+ type SimpleAssignmentTarget = IdentifierReference | TSAsExpression | TSSatisfiesExpression | TSNonNullExpression | TSTypeAssertion | MemberExpression;
1507
+ type AssignmentTargetPattern = ArrayAssignmentTarget | ObjectAssignmentTarget;
1508
+ interface ArrayAssignmentTarget extends Span {
1509
+ type: "ArrayPattern";
1510
+ decorators?: [];
1511
+ elements: Array<AssignmentTargetMaybeDefault | AssignmentTargetRest | null>;
1512
+ optional?: false;
1513
+ typeAnnotation?: null;
1514
+ parent: Node;
1515
+ }
1516
+ interface ObjectAssignmentTarget extends Span {
1517
+ type: "ObjectPattern";
1518
+ decorators?: [];
1519
+ properties: Array<AssignmentTargetProperty | AssignmentTargetRest>;
1520
+ optional?: false;
1521
+ typeAnnotation?: null;
1522
+ parent: Node;
1523
+ }
1524
+ interface AssignmentTargetRest extends Span {
1525
+ type: "RestElement";
1526
+ decorators?: [];
1527
+ argument: AssignmentTarget;
1528
+ optional?: false;
1529
+ typeAnnotation?: null;
1530
+ value?: null;
1531
+ parent: Node;
1532
+ }
1533
+ type AssignmentTargetMaybeDefault = AssignmentTargetWithDefault | AssignmentTarget;
1534
+ interface AssignmentTargetWithDefault extends Span {
1535
+ type: "AssignmentPattern";
1536
+ decorators?: [];
1537
+ left: AssignmentTarget;
1538
+ right: Expression;
1539
+ optional?: false;
1540
+ typeAnnotation?: null;
1541
+ parent: Node;
1542
+ }
1543
+ type AssignmentTargetProperty = AssignmentTargetPropertyIdentifier | AssignmentTargetPropertyProperty;
1544
+ interface AssignmentTargetPropertyIdentifier extends Span {
1545
+ type: "Property";
1546
+ kind: "init";
1547
+ key: IdentifierReference;
1548
+ value: IdentifierReference | AssignmentTargetWithDefault;
1549
+ method: false;
1550
+ shorthand: true;
1551
+ computed: false;
1552
+ optional?: false;
1553
+ parent: Node;
1554
+ }
1555
+ interface AssignmentTargetPropertyProperty extends Span {
1556
+ type: "Property";
1557
+ kind: "init";
1558
+ key: PropertyKey$1;
1559
+ value: AssignmentTargetMaybeDefault;
1560
+ method: false;
1561
+ shorthand: false;
1562
+ computed: boolean;
1563
+ optional?: false;
1564
+ parent: Node;
1565
+ }
1566
+ interface SequenceExpression extends Span {
1567
+ type: "SequenceExpression";
1568
+ expressions: Array<Expression>;
1569
+ parent: Node;
1570
+ }
1571
+ interface Super extends Span {
1572
+ type: "Super";
1573
+ parent: Node;
1574
+ }
1575
+ interface AwaitExpression extends Span {
1576
+ type: "AwaitExpression";
1577
+ argument: Expression;
1578
+ parent: Node;
1579
+ }
1580
+ interface ChainExpression extends Span {
1581
+ type: "ChainExpression";
1582
+ expression: ChainElement;
1583
+ parent: Node;
1584
+ }
1585
+ type ChainElement = CallExpression | TSNonNullExpression | MemberExpression;
1586
+ interface ParenthesizedExpression extends Span {
1587
+ type: "ParenthesizedExpression";
1588
+ expression: Expression;
1589
+ parent: Node;
1590
+ }
1591
+ type Statement = BlockStatement | BreakStatement | ContinueStatement | DebuggerStatement | DoWhileStatement | EmptyStatement | ExpressionStatement | ForInStatement | ForOfStatement | ForStatement | IfStatement | LabeledStatement | ReturnStatement | SwitchStatement | ThrowStatement | TryStatement | WhileStatement | WithStatement | Declaration | ModuleDeclaration;
1592
+ interface Directive$1 extends Span {
1593
+ type: "ExpressionStatement";
1594
+ expression: StringLiteral;
1595
+ directive: string;
1596
+ parent: Node;
1597
+ }
1598
+ interface Hashbang extends Span {
1599
+ type: "Hashbang";
1600
+ value: string;
1601
+ parent: Node;
1602
+ }
1603
+ interface BlockStatement extends Span {
1604
+ type: "BlockStatement";
1605
+ body: Array<Statement>;
1606
+ parent: Node;
1607
+ }
1608
+ type Declaration = VariableDeclaration | Function$1 | Class | TSTypeAliasDeclaration | TSInterfaceDeclaration | TSEnumDeclaration | TSModuleDeclaration | TSGlobalDeclaration | TSImportEqualsDeclaration;
1609
+ interface VariableDeclaration extends Span {
1610
+ type: "VariableDeclaration";
1611
+ kind: VariableDeclarationKind;
1612
+ declarations: Array<VariableDeclarator>;
1613
+ declare?: boolean;
1614
+ parent: Node;
1615
+ }
1616
+ type VariableDeclarationKind = "var" | "let" | "const" | "using" | "await using";
1617
+ interface VariableDeclarator extends Span {
1618
+ type: "VariableDeclarator";
1619
+ id: BindingPattern;
1620
+ init: Expression | null;
1621
+ definite?: boolean;
1622
+ parent: Node;
1623
+ }
1624
+ interface EmptyStatement extends Span {
1625
+ type: "EmptyStatement";
1626
+ parent: Node;
1627
+ }
1628
+ interface ExpressionStatement extends Span {
1629
+ type: "ExpressionStatement";
1630
+ expression: Expression;
1631
+ directive?: string | null;
1632
+ parent: Node;
1633
+ }
1634
+ interface IfStatement extends Span {
1635
+ type: "IfStatement";
1636
+ test: Expression;
1637
+ consequent: Statement;
1638
+ alternate: Statement | null;
1639
+ parent: Node;
1640
+ }
1641
+ interface DoWhileStatement extends Span {
1642
+ type: "DoWhileStatement";
1643
+ body: Statement;
1644
+ test: Expression;
1645
+ parent: Node;
1646
+ }
1647
+ interface WhileStatement extends Span {
1648
+ type: "WhileStatement";
1649
+ test: Expression;
1650
+ body: Statement;
1651
+ parent: Node;
1652
+ }
1653
+ interface ForStatement extends Span {
1654
+ type: "ForStatement";
1655
+ init: ForStatementInit | null;
1656
+ test: Expression | null;
1657
+ update: Expression | null;
1658
+ body: Statement;
1659
+ parent: Node;
1660
+ }
1661
+ type ForStatementInit = VariableDeclaration | Expression;
1662
+ interface ForInStatement extends Span {
1663
+ type: "ForInStatement";
1664
+ left: ForStatementLeft;
1665
+ right: Expression;
1666
+ body: Statement;
1667
+ parent: Node;
1668
+ }
1669
+ type ForStatementLeft = VariableDeclaration | AssignmentTarget;
1670
+ interface ForOfStatement extends Span {
1671
+ type: "ForOfStatement";
1672
+ await: boolean;
1673
+ left: ForStatementLeft;
1674
+ right: Expression;
1675
+ body: Statement;
1676
+ parent: Node;
1677
+ }
1678
+ interface ContinueStatement extends Span {
1679
+ type: "ContinueStatement";
1680
+ label: LabelIdentifier | null;
1681
+ parent: Node;
1682
+ }
1683
+ interface BreakStatement extends Span {
1684
+ type: "BreakStatement";
1685
+ label: LabelIdentifier | null;
1686
+ parent: Node;
1687
+ }
1688
+ interface ReturnStatement extends Span {
1689
+ type: "ReturnStatement";
1690
+ argument: Expression | null;
1691
+ parent: Node;
1692
+ }
1693
+ interface WithStatement extends Span {
1694
+ type: "WithStatement";
1695
+ object: Expression;
1696
+ body: Statement;
1697
+ parent: Node;
1698
+ }
1699
+ interface SwitchStatement extends Span {
1700
+ type: "SwitchStatement";
1701
+ discriminant: Expression;
1702
+ cases: Array<SwitchCase>;
1703
+ parent: Node;
1704
+ }
1705
+ interface SwitchCase extends Span {
1706
+ type: "SwitchCase";
1707
+ test: Expression | null;
1708
+ consequent: Array<Statement>;
1709
+ parent: Node;
1710
+ }
1711
+ interface LabeledStatement extends Span {
1712
+ type: "LabeledStatement";
1713
+ label: LabelIdentifier;
1714
+ body: Statement;
1715
+ parent: Node;
1716
+ }
1717
+ interface ThrowStatement extends Span {
1718
+ type: "ThrowStatement";
1719
+ argument: Expression;
1720
+ parent: Node;
1721
+ }
1722
+ interface TryStatement extends Span {
1723
+ type: "TryStatement";
1724
+ block: BlockStatement;
1725
+ handler: CatchClause | null;
1726
+ finalizer: BlockStatement | null;
1727
+ parent: Node;
1728
+ }
1729
+ interface CatchClause extends Span {
1730
+ type: "CatchClause";
1731
+ param: BindingPattern | null;
1732
+ body: BlockStatement;
1733
+ parent: Node;
1734
+ }
1735
+ interface DebuggerStatement extends Span {
1736
+ type: "DebuggerStatement";
1737
+ parent: Node;
1738
+ }
1739
+ type BindingPattern = BindingIdentifier | ObjectPattern | ArrayPattern | AssignmentPattern;
1740
+ interface AssignmentPattern extends Span {
1741
+ type: "AssignmentPattern";
1742
+ decorators?: [];
1743
+ left: BindingPattern;
1744
+ right: Expression;
1745
+ optional?: false;
1746
+ typeAnnotation?: null;
1747
+ parent: Node;
1748
+ }
1749
+ interface ObjectPattern extends Span {
1750
+ type: "ObjectPattern";
1751
+ decorators?: [];
1752
+ properties: Array<BindingProperty | BindingRestElement>;
1753
+ optional?: false;
1754
+ typeAnnotation?: null;
1755
+ parent: Node;
1756
+ }
1757
+ interface BindingProperty extends Span {
1758
+ type: "Property";
1759
+ kind: "init";
1760
+ key: PropertyKey$1;
1761
+ value: BindingPattern;
1762
+ method: false;
1763
+ shorthand: boolean;
1764
+ computed: boolean;
1765
+ optional?: false;
1766
+ parent: Node;
1767
+ }
1768
+ interface ArrayPattern extends Span {
1769
+ type: "ArrayPattern";
1770
+ decorators?: [];
1771
+ elements: Array<BindingPattern | BindingRestElement | null>;
1772
+ optional?: false;
1773
+ typeAnnotation?: null;
1774
+ parent: Node;
1775
+ }
1776
+ interface BindingRestElement extends Span {
1777
+ type: "RestElement";
1778
+ decorators?: [];
1779
+ argument: BindingPattern;
1780
+ optional?: false;
1781
+ typeAnnotation?: null;
1782
+ value?: null;
1783
+ parent: Node;
1784
+ }
1785
+ interface Function$1 extends Span {
1786
+ type: FunctionType;
1787
+ id: BindingIdentifier | null;
1788
+ generator: boolean;
1789
+ async: boolean;
1790
+ declare?: boolean;
1791
+ typeParameters?: TSTypeParameterDeclaration | null;
1792
+ params: ParamPattern[];
1793
+ returnType?: TSTypeAnnotation | null;
1794
+ body: FunctionBody | null;
1795
+ expression: false;
1796
+ parent: Node;
1797
+ }
1798
+ type ParamPattern = FormalParameter | TSParameterProperty | FormalParameterRest;
1799
+ type FunctionType = "FunctionDeclaration" | "FunctionExpression" | "TSDeclareFunction" | "TSEmptyBodyFunctionExpression";
1800
+ interface FormalParameterRest extends Span {
1801
+ type: "RestElement";
1802
+ argument: BindingPattern;
1803
+ decorators?: [];
1804
+ optional?: boolean;
1805
+ typeAnnotation?: TSTypeAnnotation | null;
1806
+ value?: null;
1807
+ parent: Node;
1808
+ }
1809
+ type FormalParameter = {
1810
+ decorators?: Array<Decorator>;
1811
+ } & BindingPattern;
1812
+ interface TSParameterProperty extends Span {
1813
+ type: "TSParameterProperty";
1814
+ accessibility: TSAccessibility | null;
1815
+ decorators: Array<Decorator>;
1816
+ override: boolean;
1817
+ parameter: FormalParameter;
1818
+ readonly: boolean;
1819
+ static: boolean;
1820
+ parent: Node;
1821
+ }
1822
+ interface FunctionBody extends Span {
1823
+ type: "BlockStatement";
1824
+ body: Array<Directive$1 | Statement>;
1825
+ parent: Node;
1826
+ }
1827
+ interface ArrowFunctionExpression extends Span {
1828
+ type: "ArrowFunctionExpression";
1829
+ expression: boolean;
1830
+ async: boolean;
1831
+ typeParameters?: TSTypeParameterDeclaration | null;
1832
+ params: ParamPattern[];
1833
+ returnType?: TSTypeAnnotation | null;
1834
+ body: FunctionBody | Expression;
1835
+ id: null;
1836
+ generator: false;
1837
+ parent: Node;
1838
+ }
1839
+ interface YieldExpression extends Span {
1840
+ type: "YieldExpression";
1841
+ delegate: boolean;
1842
+ argument: Expression | null;
1843
+ parent: Node;
1844
+ }
1845
+ interface Class extends Span {
1846
+ type: ClassType;
1847
+ decorators: Array<Decorator>;
1848
+ id: BindingIdentifier | null;
1849
+ typeParameters?: TSTypeParameterDeclaration | null;
1850
+ superClass: Expression | null;
1851
+ superTypeArguments?: TSTypeParameterInstantiation | null;
1852
+ implements?: Array<TSClassImplements>;
1853
+ body: ClassBody;
1854
+ abstract?: boolean;
1855
+ declare?: boolean;
1856
+ parent: Node;
1857
+ }
1858
+ type ClassType = "ClassDeclaration" | "ClassExpression";
1859
+ interface ClassBody extends Span {
1860
+ type: "ClassBody";
1861
+ body: Array<ClassElement>;
1862
+ parent: Node;
1863
+ }
1864
+ type ClassElement = StaticBlock | MethodDefinition | PropertyDefinition | AccessorProperty | TSIndexSignature;
1865
+ interface MethodDefinition extends Span {
1866
+ type: MethodDefinitionType;
1867
+ decorators: Array<Decorator>;
1868
+ key: PropertyKey$1;
1869
+ value: Function$1;
1870
+ kind: MethodDefinitionKind;
1871
+ computed: boolean;
1872
+ static: boolean;
1873
+ override?: boolean;
1874
+ optional?: boolean;
1875
+ accessibility?: TSAccessibility | null;
1876
+ parent: Node;
1877
+ }
1878
+ type MethodDefinitionType = "MethodDefinition" | "TSAbstractMethodDefinition";
1879
+ interface PropertyDefinition extends Span {
1880
+ type: PropertyDefinitionType;
1881
+ decorators: Array<Decorator>;
1882
+ key: PropertyKey$1;
1883
+ typeAnnotation?: TSTypeAnnotation | null;
1884
+ value: Expression | null;
1885
+ computed: boolean;
1886
+ static: boolean;
1887
+ declare?: boolean;
1888
+ override?: boolean;
1889
+ optional?: boolean;
1890
+ definite?: boolean;
1891
+ readonly?: boolean;
1892
+ accessibility?: TSAccessibility | null;
1893
+ parent: Node;
1894
+ }
1895
+ type PropertyDefinitionType = "PropertyDefinition" | "TSAbstractPropertyDefinition";
1896
+ type MethodDefinitionKind = "constructor" | "method" | "get" | "set";
1897
+ interface PrivateIdentifier extends Span {
1898
+ type: "PrivateIdentifier";
1899
+ name: string;
1900
+ parent: Node;
1901
+ }
1902
+ interface StaticBlock extends Span {
1903
+ type: "StaticBlock";
1904
+ body: Array<Statement>;
1905
+ parent: Node;
1906
+ }
1907
+ type ModuleDeclaration = ImportDeclaration | ExportAllDeclaration | ExportDefaultDeclaration | ExportNamedDeclaration | TSExportAssignment | TSNamespaceExportDeclaration;
1908
+ type AccessorPropertyType = "AccessorProperty" | "TSAbstractAccessorProperty";
1909
+ interface AccessorProperty extends Span {
1910
+ type: AccessorPropertyType;
1911
+ decorators: Array<Decorator>;
1912
+ key: PropertyKey$1;
1913
+ typeAnnotation?: TSTypeAnnotation | null;
1914
+ value: Expression | null;
1915
+ computed: boolean;
1916
+ static: boolean;
1917
+ override?: boolean;
1918
+ definite?: boolean;
1919
+ accessibility?: TSAccessibility | null;
1920
+ declare?: false;
1921
+ optional?: false;
1922
+ readonly?: false;
1923
+ parent: Node;
1924
+ }
1925
+ interface ImportExpression extends Span {
1926
+ type: "ImportExpression";
1927
+ source: Expression;
1928
+ options: Expression | null;
1929
+ phase: ImportPhase | null;
1930
+ parent: Node;
1931
+ }
1932
+ interface ImportDeclaration extends Span {
1933
+ type: "ImportDeclaration";
1934
+ specifiers: Array<ImportDeclarationSpecifier>;
1935
+ source: StringLiteral;
1936
+ phase: ImportPhase | null;
1937
+ attributes: Array<ImportAttribute>;
1938
+ importKind?: ImportOrExportKind;
1939
+ parent: Node;
1940
+ }
1941
+ type ImportPhase = "source" | "defer";
1942
+ type ImportDeclarationSpecifier = ImportSpecifier | ImportDefaultSpecifier | ImportNamespaceSpecifier;
1943
+ interface ImportSpecifier extends Span {
1944
+ type: "ImportSpecifier";
1945
+ imported: ModuleExportName;
1946
+ local: BindingIdentifier;
1947
+ importKind?: ImportOrExportKind;
1948
+ parent: Node;
1949
+ }
1950
+ interface ImportDefaultSpecifier extends Span {
1951
+ type: "ImportDefaultSpecifier";
1952
+ local: BindingIdentifier;
1953
+ parent: Node;
1954
+ }
1955
+ interface ImportNamespaceSpecifier extends Span {
1956
+ type: "ImportNamespaceSpecifier";
1957
+ local: BindingIdentifier;
1958
+ parent: Node;
1959
+ }
1960
+ interface ImportAttribute extends Span {
1961
+ type: "ImportAttribute";
1962
+ key: ImportAttributeKey;
1963
+ value: StringLiteral;
1964
+ parent: Node;
1965
+ }
1966
+ type ImportAttributeKey = IdentifierName | StringLiteral;
1967
+ interface ExportNamedDeclaration extends Span {
1968
+ type: "ExportNamedDeclaration";
1969
+ declaration: Declaration | null;
1970
+ specifiers: Array<ExportSpecifier>;
1971
+ source: StringLiteral | null;
1972
+ exportKind?: ImportOrExportKind;
1973
+ attributes: Array<ImportAttribute>;
1974
+ parent: Node;
1975
+ }
1976
+ interface ExportDefaultDeclaration extends Span {
1977
+ type: "ExportDefaultDeclaration";
1978
+ declaration: ExportDefaultDeclarationKind;
1979
+ exportKind?: "value";
1980
+ parent: Node;
1981
+ }
1982
+ interface ExportAllDeclaration extends Span {
1983
+ type: "ExportAllDeclaration";
1984
+ exported: ModuleExportName | null;
1985
+ source: StringLiteral;
1986
+ attributes: Array<ImportAttribute>;
1987
+ exportKind?: ImportOrExportKind;
1988
+ parent: Node;
1989
+ }
1990
+ interface ExportSpecifier extends Span {
1991
+ type: "ExportSpecifier";
1992
+ local: ModuleExportName;
1993
+ exported: ModuleExportName;
1994
+ exportKind?: ImportOrExportKind;
1995
+ parent: Node;
1996
+ }
1997
+ type ExportDefaultDeclarationKind = Function$1 | Class | TSInterfaceDeclaration | Expression;
1998
+ type ModuleExportName = IdentifierName | IdentifierReference | StringLiteral;
1999
+ interface V8IntrinsicExpression extends Span {
2000
+ type: "V8IntrinsicExpression";
2001
+ name: IdentifierName;
2002
+ arguments: Array<Argument>;
2003
+ parent: Node;
2004
+ }
2005
+ interface BooleanLiteral extends Span {
2006
+ type: "Literal";
2007
+ value: boolean;
2008
+ raw: string | null;
2009
+ parent: Node;
2010
+ }
2011
+ interface NullLiteral extends Span {
2012
+ type: "Literal";
2013
+ value: null;
2014
+ raw: "null" | null;
2015
+ parent: Node;
2016
+ }
2017
+ interface NumericLiteral extends Span {
2018
+ type: "Literal";
2019
+ value: number;
2020
+ raw: string | null;
2021
+ parent: Node;
2022
+ }
2023
+ interface StringLiteral extends Span {
2024
+ type: "Literal";
2025
+ value: string;
2026
+ raw: string | null;
2027
+ parent: Node;
2028
+ }
2029
+ interface BigIntLiteral extends Span {
2030
+ type: "Literal";
2031
+ value: bigint;
2032
+ raw: string | null;
2033
+ bigint: string;
2034
+ parent: Node;
2035
+ }
2036
+ interface RegExpLiteral extends Span {
2037
+ type: "Literal";
2038
+ value: RegExp | null;
2039
+ raw: string | null;
2040
+ regex: {
2041
+ pattern: string;
2042
+ flags: string;
2043
+ };
2044
+ parent: Node;
2045
+ }
2046
+ interface JSXElement extends Span {
2047
+ type: "JSXElement";
2048
+ openingElement: JSXOpeningElement;
2049
+ children: Array<JSXChild>;
2050
+ closingElement: JSXClosingElement | null;
2051
+ parent: Node;
2052
+ }
2053
+ interface JSXOpeningElement extends Span {
2054
+ type: "JSXOpeningElement";
2055
+ name: JSXElementName;
2056
+ typeArguments?: TSTypeParameterInstantiation | null;
2057
+ attributes: Array<JSXAttributeItem>;
2058
+ selfClosing: boolean;
2059
+ parent: Node;
2060
+ }
2061
+ interface JSXClosingElement extends Span {
2062
+ type: "JSXClosingElement";
2063
+ name: JSXElementName;
2064
+ parent: Node;
2065
+ }
2066
+ interface JSXFragment extends Span {
2067
+ type: "JSXFragment";
2068
+ openingFragment: JSXOpeningFragment;
2069
+ children: Array<JSXChild>;
2070
+ closingFragment: JSXClosingFragment;
2071
+ parent: Node;
2072
+ }
2073
+ interface JSXOpeningFragment extends Span {
2074
+ type: "JSXOpeningFragment";
2075
+ attributes?: [];
2076
+ selfClosing?: false;
2077
+ parent: Node;
2078
+ }
2079
+ interface JSXClosingFragment extends Span {
2080
+ type: "JSXClosingFragment";
2081
+ parent: Node;
2082
+ }
2083
+ type JSXElementName = JSXIdentifier | JSXNamespacedName | JSXMemberExpression;
2084
+ interface JSXNamespacedName extends Span {
2085
+ type: "JSXNamespacedName";
2086
+ namespace: JSXIdentifier;
2087
+ name: JSXIdentifier;
2088
+ parent: Node;
2089
+ }
2090
+ interface JSXMemberExpression extends Span {
2091
+ type: "JSXMemberExpression";
2092
+ object: JSXMemberExpressionObject;
2093
+ property: JSXIdentifier;
2094
+ parent: Node;
2095
+ }
2096
+ type JSXMemberExpressionObject = JSXIdentifier | JSXMemberExpression;
2097
+ interface JSXExpressionContainer extends Span {
2098
+ type: "JSXExpressionContainer";
2099
+ expression: JSXExpression;
2100
+ parent: Node;
2101
+ }
2102
+ type JSXExpression = JSXEmptyExpression | Expression;
2103
+ interface JSXEmptyExpression extends Span {
2104
+ type: "JSXEmptyExpression";
2105
+ parent: Node;
2106
+ }
2107
+ type JSXAttributeItem = JSXAttribute | JSXSpreadAttribute;
2108
+ interface JSXAttribute extends Span {
2109
+ type: "JSXAttribute";
2110
+ name: JSXAttributeName;
2111
+ value: JSXAttributeValue | null;
2112
+ parent: Node;
2113
+ }
2114
+ interface JSXSpreadAttribute extends Span {
2115
+ type: "JSXSpreadAttribute";
2116
+ argument: Expression;
2117
+ parent: Node;
2118
+ }
2119
+ type JSXAttributeName = JSXIdentifier | JSXNamespacedName;
2120
+ type JSXAttributeValue = StringLiteral | JSXExpressionContainer | JSXElement | JSXFragment;
2121
+ interface JSXIdentifier extends Span {
2122
+ type: "JSXIdentifier";
2123
+ name: string;
2124
+ parent: Node;
2125
+ }
2126
+ type JSXChild = JSXText | JSXElement | JSXFragment | JSXExpressionContainer | JSXSpreadChild;
2127
+ interface JSXSpreadChild extends Span {
2128
+ type: "JSXSpreadChild";
2129
+ expression: Expression;
2130
+ parent: Node;
2131
+ }
2132
+ interface JSXText extends Span {
2133
+ type: "JSXText";
2134
+ value: string;
2135
+ raw: string | null;
2136
+ parent: Node;
2137
+ }
2138
+ interface TSThisParameter extends Span {
2139
+ type: "Identifier";
2140
+ decorators: [];
2141
+ name: "this";
2142
+ optional: false;
2143
+ typeAnnotation: TSTypeAnnotation | null;
2144
+ parent: Node;
2145
+ }
2146
+ interface TSEnumDeclaration extends Span {
2147
+ type: "TSEnumDeclaration";
2148
+ id: BindingIdentifier;
2149
+ body: TSEnumBody;
2150
+ const: boolean;
2151
+ declare: boolean;
2152
+ parent: Node;
2153
+ }
2154
+ interface TSEnumBody extends Span {
2155
+ type: "TSEnumBody";
2156
+ members: Array<TSEnumMember>;
2157
+ parent: Node;
2158
+ }
2159
+ interface TSEnumMember extends Span {
2160
+ type: "TSEnumMember";
2161
+ id: TSEnumMemberName;
2162
+ initializer: Expression | null;
2163
+ computed: boolean;
2164
+ parent: Node;
2165
+ }
2166
+ type TSEnumMemberName = IdentifierName | StringLiteral | TemplateLiteral;
2167
+ interface TSTypeAnnotation extends Span {
2168
+ type: "TSTypeAnnotation";
2169
+ typeAnnotation: TSType;
2170
+ parent: Node;
2171
+ }
2172
+ interface TSLiteralType extends Span {
2173
+ type: "TSLiteralType";
2174
+ literal: TSLiteral;
2175
+ parent: Node;
2176
+ }
2177
+ type TSLiteral = BooleanLiteral | NumericLiteral | BigIntLiteral | StringLiteral | TemplateLiteral | UnaryExpression;
2178
+ 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;
2179
+ interface TSConditionalType extends Span {
2180
+ type: "TSConditionalType";
2181
+ checkType: TSType;
2182
+ extendsType: TSType;
2183
+ trueType: TSType;
2184
+ falseType: TSType;
2185
+ parent: Node;
2186
+ }
2187
+ interface TSUnionType extends Span {
2188
+ type: "TSUnionType";
2189
+ types: Array<TSType>;
2190
+ parent: Node;
2191
+ }
2192
+ interface TSIntersectionType extends Span {
2193
+ type: "TSIntersectionType";
2194
+ types: Array<TSType>;
2195
+ parent: Node;
2196
+ }
2197
+ interface TSParenthesizedType extends Span {
2198
+ type: "TSParenthesizedType";
2199
+ typeAnnotation: TSType;
2200
+ parent: Node;
2201
+ }
2202
+ interface TSTypeOperator extends Span {
2203
+ type: "TSTypeOperator";
2204
+ operator: TSTypeOperatorOperator;
2205
+ typeAnnotation: TSType;
2206
+ parent: Node;
2207
+ }
2208
+ type TSTypeOperatorOperator = "keyof" | "unique" | "readonly";
2209
+ interface TSArrayType extends Span {
2210
+ type: "TSArrayType";
2211
+ elementType: TSType;
2212
+ parent: Node;
2213
+ }
2214
+ interface TSIndexedAccessType extends Span {
2215
+ type: "TSIndexedAccessType";
2216
+ objectType: TSType;
2217
+ indexType: TSType;
2218
+ parent: Node;
2219
+ }
2220
+ interface TSTupleType extends Span {
2221
+ type: "TSTupleType";
2222
+ elementTypes: Array<TSTupleElement>;
2223
+ parent: Node;
2224
+ }
2225
+ interface TSNamedTupleMember extends Span {
2226
+ type: "TSNamedTupleMember";
2227
+ label: IdentifierName;
2228
+ elementType: TSTupleElement;
2229
+ optional: boolean;
2230
+ parent: Node;
2231
+ }
2232
+ interface TSOptionalType extends Span {
2233
+ type: "TSOptionalType";
2234
+ typeAnnotation: TSType;
2235
+ parent: Node;
2236
+ }
2237
+ interface TSRestType extends Span {
2238
+ type: "TSRestType";
2239
+ typeAnnotation: TSType;
2240
+ parent: Node;
2241
+ }
2242
+ type TSTupleElement = TSOptionalType | TSRestType | TSType;
2243
+ interface TSAnyKeyword extends Span {
2244
+ type: "TSAnyKeyword";
2245
+ parent: Node;
2246
+ }
2247
+ interface TSStringKeyword extends Span {
2248
+ type: "TSStringKeyword";
2249
+ parent: Node;
2250
+ }
2251
+ interface TSBooleanKeyword extends Span {
2252
+ type: "TSBooleanKeyword";
2253
+ parent: Node;
2254
+ }
2255
+ interface TSNumberKeyword extends Span {
2256
+ type: "TSNumberKeyword";
2257
+ parent: Node;
2258
+ }
2259
+ interface TSNeverKeyword extends Span {
2260
+ type: "TSNeverKeyword";
2261
+ parent: Node;
2262
+ }
2263
+ interface TSIntrinsicKeyword extends Span {
2264
+ type: "TSIntrinsicKeyword";
2265
+ parent: Node;
2266
+ }
2267
+ interface TSUnknownKeyword extends Span {
2268
+ type: "TSUnknownKeyword";
2269
+ parent: Node;
2270
+ }
2271
+ interface TSNullKeyword extends Span {
2272
+ type: "TSNullKeyword";
2273
+ parent: Node;
2274
+ }
2275
+ interface TSUndefinedKeyword extends Span {
2276
+ type: "TSUndefinedKeyword";
2277
+ parent: Node;
2278
+ }
2279
+ interface TSVoidKeyword extends Span {
2280
+ type: "TSVoidKeyword";
2281
+ parent: Node;
2282
+ }
2283
+ interface TSSymbolKeyword extends Span {
2284
+ type: "TSSymbolKeyword";
2285
+ parent: Node;
2286
+ }
2287
+ interface TSThisType extends Span {
2288
+ type: "TSThisType";
2289
+ parent: Node;
2290
+ }
2291
+ interface TSObjectKeyword extends Span {
2292
+ type: "TSObjectKeyword";
2293
+ parent: Node;
2294
+ }
2295
+ interface TSBigIntKeyword extends Span {
2296
+ type: "TSBigIntKeyword";
2297
+ parent: Node;
2298
+ }
2299
+ interface TSTypeReference extends Span {
2300
+ type: "TSTypeReference";
2301
+ typeName: TSTypeName;
2302
+ typeArguments: TSTypeParameterInstantiation | null;
2303
+ parent: Node;
2304
+ }
2305
+ type TSTypeName = IdentifierReference | TSQualifiedName | ThisExpression;
2306
+ interface TSQualifiedName extends Span {
2307
+ type: "TSQualifiedName";
2308
+ left: TSTypeName;
2309
+ right: IdentifierName;
2310
+ parent: Node;
2311
+ }
2312
+ interface TSTypeParameterInstantiation extends Span {
2313
+ type: "TSTypeParameterInstantiation";
2314
+ params: Array<TSType>;
2315
+ parent: Node;
2316
+ }
2317
+ interface TSTypeParameter extends Span {
2318
+ type: "TSTypeParameter";
2319
+ name: BindingIdentifier;
2320
+ constraint: TSType | null;
2321
+ default: TSType | null;
2322
+ in: boolean;
2323
+ out: boolean;
2324
+ const: boolean;
2325
+ parent: Node;
2326
+ }
2327
+ interface TSTypeParameterDeclaration extends Span {
2328
+ type: "TSTypeParameterDeclaration";
2329
+ params: Array<TSTypeParameter>;
2330
+ parent: Node;
2331
+ }
2332
+ interface TSTypeAliasDeclaration extends Span {
2333
+ type: "TSTypeAliasDeclaration";
2334
+ id: BindingIdentifier;
2335
+ typeParameters: TSTypeParameterDeclaration | null;
2336
+ typeAnnotation: TSType;
2337
+ declare: boolean;
2338
+ parent: Node;
2339
+ }
2340
+ type TSAccessibility = "private" | "protected" | "public";
2341
+ interface TSClassImplements extends Span {
2342
+ type: "TSClassImplements";
2343
+ expression: IdentifierReference | ThisExpression | MemberExpression;
2344
+ typeArguments: TSTypeParameterInstantiation | null;
2345
+ parent: Node;
2346
+ }
2347
+ interface TSInterfaceDeclaration extends Span {
2348
+ type: "TSInterfaceDeclaration";
2349
+ id: BindingIdentifier;
2350
+ typeParameters: TSTypeParameterDeclaration | null;
2351
+ extends: Array<TSInterfaceHeritage>;
2352
+ body: TSInterfaceBody;
2353
+ declare: boolean;
2354
+ parent: Node;
2355
+ }
2356
+ interface TSInterfaceBody extends Span {
2357
+ type: "TSInterfaceBody";
2358
+ body: Array<TSSignature>;
2359
+ parent: Node;
2360
+ }
2361
+ interface TSPropertySignature extends Span {
2362
+ type: "TSPropertySignature";
2363
+ computed: boolean;
2364
+ optional: boolean;
2365
+ readonly: boolean;
2366
+ key: PropertyKey$1;
2367
+ typeAnnotation: TSTypeAnnotation | null;
2368
+ accessibility: null;
2369
+ static: false;
2370
+ parent: Node;
2371
+ }
2372
+ type TSSignature = TSIndexSignature | TSPropertySignature | TSCallSignatureDeclaration | TSConstructSignatureDeclaration | TSMethodSignature;
2373
+ interface TSIndexSignature extends Span {
2374
+ type: "TSIndexSignature";
2375
+ parameters: Array<TSIndexSignatureName>;
2376
+ typeAnnotation: TSTypeAnnotation;
2377
+ readonly: boolean;
2378
+ static: boolean;
2379
+ accessibility: null;
2380
+ parent: Node;
2381
+ }
2382
+ interface TSCallSignatureDeclaration extends Span {
2383
+ type: "TSCallSignatureDeclaration";
2384
+ typeParameters: TSTypeParameterDeclaration | null;
2385
+ params: ParamPattern[];
2386
+ returnType: TSTypeAnnotation | null;
2387
+ parent: Node;
2388
+ }
2389
+ type TSMethodSignatureKind = "method" | "get" | "set";
2390
+ interface TSMethodSignature extends Span {
2391
+ type: "TSMethodSignature";
2392
+ key: PropertyKey$1;
2393
+ computed: boolean;
2394
+ optional: boolean;
2395
+ kind: TSMethodSignatureKind;
2396
+ typeParameters: TSTypeParameterDeclaration | null;
2397
+ params: ParamPattern[];
2398
+ returnType: TSTypeAnnotation | null;
2399
+ accessibility: null;
2400
+ readonly: false;
2401
+ static: false;
2402
+ parent: Node;
2403
+ }
2404
+ interface TSConstructSignatureDeclaration extends Span {
2405
+ type: "TSConstructSignatureDeclaration";
2406
+ typeParameters: TSTypeParameterDeclaration | null;
2407
+ params: ParamPattern[];
2408
+ returnType: TSTypeAnnotation | null;
2409
+ parent: Node;
2410
+ }
2411
+ interface TSIndexSignatureName extends Span {
2412
+ type: "Identifier";
2413
+ decorators: [];
2414
+ name: string;
2415
+ optional: false;
2416
+ typeAnnotation: TSTypeAnnotation;
2417
+ parent: Node;
2418
+ }
2419
+ interface TSInterfaceHeritage extends Span {
2420
+ type: "TSInterfaceHeritage";
2421
+ expression: Expression;
2422
+ typeArguments: TSTypeParameterInstantiation | null;
2423
+ parent: Node;
2424
+ }
2425
+ interface TSTypePredicate extends Span {
2426
+ type: "TSTypePredicate";
2427
+ parameterName: TSTypePredicateName;
2428
+ asserts: boolean;
2429
+ typeAnnotation: TSTypeAnnotation | null;
2430
+ parent: Node;
2431
+ }
2432
+ type TSTypePredicateName = IdentifierName | TSThisType;
2433
+ interface TSModuleDeclaration extends Span {
2434
+ type: "TSModuleDeclaration";
2435
+ id: BindingIdentifier | StringLiteral | TSQualifiedName;
2436
+ body: TSModuleBlock | null;
2437
+ kind: TSModuleDeclarationKind;
2438
+ declare: boolean;
2439
+ global: false;
2440
+ parent: Node;
2441
+ }
2442
+ type TSModuleDeclarationKind = "module" | "namespace";
2443
+ interface TSGlobalDeclaration extends Span {
2444
+ type: "TSModuleDeclaration";
2445
+ id: IdentifierName;
2446
+ body: TSModuleBlock;
2447
+ kind: "global";
2448
+ declare: boolean;
2449
+ global: true;
2450
+ parent: Node;
2451
+ }
2452
+ interface TSModuleBlock extends Span {
2453
+ type: "TSModuleBlock";
2454
+ body: Array<Directive$1 | Statement>;
2455
+ parent: Node;
2456
+ }
2457
+ interface TSTypeLiteral extends Span {
2458
+ type: "TSTypeLiteral";
2459
+ members: Array<TSSignature>;
2460
+ parent: Node;
2461
+ }
2462
+ interface TSInferType extends Span {
2463
+ type: "TSInferType";
2464
+ typeParameter: TSTypeParameter;
2465
+ parent: Node;
2466
+ }
2467
+ interface TSTypeQuery extends Span {
2468
+ type: "TSTypeQuery";
2469
+ exprName: TSTypeQueryExprName;
2470
+ typeArguments: TSTypeParameterInstantiation | null;
2471
+ parent: Node;
2472
+ }
2473
+ type TSTypeQueryExprName = TSImportType | TSTypeName;
2474
+ interface TSImportType extends Span {
2475
+ type: "TSImportType";
2476
+ source: StringLiteral;
2477
+ options: ObjectExpression | null;
2478
+ qualifier: TSImportTypeQualifier | null;
2479
+ typeArguments: TSTypeParameterInstantiation | null;
2480
+ parent: Node;
2481
+ }
2482
+ type TSImportTypeQualifier = IdentifierName | TSImportTypeQualifiedName;
2483
+ interface TSImportTypeQualifiedName extends Span {
2484
+ type: "TSQualifiedName";
2485
+ left: TSImportTypeQualifier;
2486
+ right: IdentifierName;
2487
+ parent: Node;
2488
+ }
2489
+ interface TSFunctionType extends Span {
2490
+ type: "TSFunctionType";
2491
+ typeParameters: TSTypeParameterDeclaration | null;
2492
+ params: ParamPattern[];
2493
+ returnType: TSTypeAnnotation;
2494
+ parent: Node;
2495
+ }
2496
+ interface TSConstructorType extends Span {
2497
+ type: "TSConstructorType";
2498
+ abstract: boolean;
2499
+ typeParameters: TSTypeParameterDeclaration | null;
2500
+ params: ParamPattern[];
2501
+ returnType: TSTypeAnnotation;
2502
+ parent: Node;
2503
+ }
2504
+ interface TSMappedType extends Span {
2505
+ type: "TSMappedType";
2506
+ key: BindingIdentifier;
2507
+ constraint: TSType;
2508
+ nameType: TSType | null;
2509
+ typeAnnotation: TSType | null;
2510
+ optional: TSMappedTypeModifierOperator | false;
2511
+ readonly: TSMappedTypeModifierOperator | null;
2512
+ parent: Node;
2513
+ }
2514
+ type TSMappedTypeModifierOperator = true | "+" | "-";
2515
+ interface TSTemplateLiteralType extends Span {
2516
+ type: "TSTemplateLiteralType";
2517
+ quasis: Array<TemplateElement>;
2518
+ types: Array<TSType>;
2519
+ parent: Node;
2748
2520
  }
2749
- //#endregion
2750
- //#region src-js/plugins/location.d.ts
2751
- /**
2752
- * Range of source offsets.
2753
- */
2754
- type Range = [number, number];
2755
- /**
2756
- * Interface for any type which has `range` field.
2757
- */
2758
- interface Ranged {
2759
- range: Range;
2521
+ interface TSAsExpression extends Span {
2522
+ type: "TSAsExpression";
2523
+ expression: Expression;
2524
+ typeAnnotation: TSType;
2525
+ parent: Node;
2760
2526
  }
2761
- /**
2762
- * Interface for any type which has location properties.
2763
- */
2764
- interface Span extends Ranged {
2765
- start: number;
2766
- end: number;
2767
- loc: Location;
2527
+ interface TSSatisfiesExpression extends Span {
2528
+ type: "TSSatisfiesExpression";
2529
+ expression: Expression;
2530
+ typeAnnotation: TSType;
2531
+ parent: Node;
2768
2532
  }
2769
- /**
2770
- * Source code location.
2771
- */
2772
- interface Location {
2773
- start: LineColumn;
2774
- end: LineColumn;
2533
+ interface TSTypeAssertion extends Span {
2534
+ type: "TSTypeAssertion";
2535
+ typeAnnotation: TSType;
2536
+ expression: Expression;
2537
+ parent: Node;
2775
2538
  }
2776
- /**
2777
- * Line number + column number pair.
2778
- * `line` is 1-indexed, `column` is 0-indexed.
2779
- */
2780
- interface LineColumn {
2781
- line: number;
2782
- column: number;
2539
+ interface TSImportEqualsDeclaration extends Span {
2540
+ type: "TSImportEqualsDeclaration";
2541
+ id: BindingIdentifier;
2542
+ moduleReference: TSModuleReference;
2543
+ importKind: ImportOrExportKind;
2544
+ parent: Node;
2783
2545
  }
2784
- /**
2785
- * Convert a source text index into a (line, column) pair.
2786
- * @param offset - The index of a character in a file.
2787
- * @returns `{line, column}` location object with 1-indexed line and 0-indexed column.
2788
- * @throws {TypeError|RangeError} If non-numeric `offset`, or `offset` out of range.
2789
- */
2790
- declare function getLineColumnFromOffset(offset: number): LineColumn;
2791
- /**
2792
- * Convert a `{ line, column }` pair into a range index.
2793
- * @param loc - A line/column location.
2794
- * @returns The character index of the location in the file.
2795
- * @throws {TypeError|RangeError} If `loc` is not an object with a numeric `line` and `column`,
2796
- * or if the `line` is less than or equal to zero, or the line or column is out of the expected range.
2797
- */
2798
- declare function getOffsetFromLineColumn(loc: LineColumn): number;
2799
- /**
2800
- * Get the range of the given node or token.
2801
- * @param nodeOrToken - Node or token to get the range of
2802
- * @returns Range of the node or token
2803
- */
2804
- declare function getRange(nodeOrToken: NodeOrToken): Range;
2805
- /**
2806
- * Get the location of the given node or token.
2807
- * @param nodeOrToken - Node or token to get the location of
2808
- * @returns Location of the node or token
2809
- */
2810
- declare function getLoc(nodeOrToken: NodeOrToken): Location;
2811
- /**
2812
- * Get the deepest node containing a range index.
2813
- * @param offset - Range index of the desired node
2814
- * @returns The node if found, or `null` if not found
2815
- */
2816
- declare function getNodeByRangeIndex(offset: number): Node$1 | null;
2817
- //#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;
2546
+ type TSModuleReference = TSExternalModuleReference | IdentifierReference | TSQualifiedName;
2547
+ interface TSExternalModuleReference extends Span {
2548
+ type: "TSExternalModuleReference";
2549
+ expression: StringLiteral;
2550
+ parent: Node;
2832
2551
  }
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;
2844
- //#endregion
2845
- //#region src-js/plugins/report.d.ts
2846
- /**
2847
- * Diagnostic object.
2848
- * Passed to `Context#report()`.
2849
- *
2850
- * - Either `message` or `messageId` property must be provided.
2851
- * - Either `node` or `loc` property must be provided.
2852
- */
2853
- type Diagnostic = RequireAtLeastOne<RequireAtLeastOne<DiagnosticBase, "node" | "loc">, "message" | "messageId">;
2854
- interface DiagnosticBase {
2855
- message?: string | null | undefined;
2856
- messageId?: string | null | undefined;
2857
- node?: Ranged;
2858
- loc?: LocationWithOptionalEnd | LineColumn;
2859
- data?: DiagnosticData | null | undefined;
2860
- fix?: FixFn;
2861
- suggest?: Suggestion[] | null | undefined;
2552
+ interface TSNonNullExpression extends Span {
2553
+ type: "TSNonNullExpression";
2554
+ expression: Expression;
2555
+ parent: Node;
2862
2556
  }
2863
- /**
2864
- * Location with `end` property optional.
2865
- */
2866
- interface LocationWithOptionalEnd {
2867
- start: LineColumn;
2868
- end?: LineColumn | null | undefined;
2557
+ interface Decorator extends Span {
2558
+ type: "Decorator";
2559
+ expression: Expression;
2560
+ parent: Node;
2869
2561
  }
2870
- /**
2871
- * Data to interpolate into a diagnostic message.
2872
- */
2873
- type DiagnosticData = Record<string, string | number | boolean | bigint | null | undefined>;
2874
- /**
2875
- * Suggested fix.
2876
- */
2877
- type Suggestion = RequireAtLeastOne<SuggestionBase, "desc" | "messageId">;
2878
- interface SuggestionBase {
2879
- desc?: string;
2880
- messageId?: string;
2881
- data?: DiagnosticData | null | undefined;
2882
- fix: FixFn;
2562
+ interface TSExportAssignment extends Span {
2563
+ type: "TSExportAssignment";
2564
+ expression: Expression;
2565
+ parent: Node;
2883
2566
  }
2884
- /**
2885
- * Suggested fix in form sent to Rust.
2886
- */
2887
- //#endregion
2888
- //#region src-js/plugins/settings.d.ts
2889
- /**
2890
- * Settings for the file being linted.
2891
- *
2892
- * Settings are deserialized from JSON, so can only contain JSON-compatible values.
2893
- */
2894
- type Settings = JsonObject;
2895
- //#endregion
2896
- //#region src-js/plugins/comments.d.ts
2897
- /**
2898
- * Retrieve an array containing all comments in the source code.
2899
- * @returns Array of `Comment`s in order they appear in source.
2900
- */
2901
- declare function getAllComments(): Comment[];
2902
- /**
2903
- * Get all comments directly before the given node or token.
2904
- *
2905
- * "Directly before" means only comments before this node, and after the preceding token.
2906
- *
2907
- * ```js
2908
- * // Define `x`
2909
- * const x = 1;
2910
- * // Define `y`
2911
- * const y = 2;
2912
- * ```
2913
- *
2914
- * `sourceCode.getCommentsBefore(varDeclY)` will only return "Define `y`" comment, not also "Define `x`".
2915
- *
2916
- * @param nodeOrToken - The AST node or token to check for adjacent comment tokens.
2917
- * @returns Array of `Comment`s in occurrence order.
2918
- */
2919
- declare function getCommentsBefore(nodeOrToken: NodeOrToken): Comment[];
2920
- /**
2921
- * Get all comment tokens directly after the given node or token.
2922
- *
2923
- * "Directly after" means only comments between end of this node, and the next token following it.
2924
- *
2925
- * ```js
2926
- * const x = 1;
2927
- * // Define `y`
2928
- * const y = 2;
2929
- * // Define `z`
2930
- * const z = 3;
2931
- * ```
2932
- *
2933
- * `sourceCode.getCommentsAfter(varDeclX)` will only return "Define `y`" comment, not also "Define `z`".
2934
- *
2935
- * @param nodeOrToken - The AST node or token to check for adjacent comment tokens.
2936
- * @returns Array of `Comment`s in occurrence order.
2937
- */
2938
- declare function getCommentsAfter(nodeOrToken: NodeOrToken): Comment[];
2939
- /**
2940
- * Get all comment tokens inside the given node.
2941
- * @param node - The AST node to get the comments for.
2942
- * @returns Array of `Comment`s in occurrence order.
2943
- */
2944
- declare function getCommentsInside(node: Node): Comment[];
2945
- /**
2946
- * Check whether any comments exist or not between the given 2 nodes.
2947
- * @param nodeOrToken1 - Start node/token.
2948
- * @param nodeOrToken2 - End node/token.
2949
- * @returns `true` if one or more comments exist between the two.
2950
- */
2951
- declare function commentsExistBetween(nodeOrToken1: NodeOrToken, nodeOrToken2: NodeOrToken): boolean;
2952
- /**
2953
- * Retrieve the JSDoc comment for a given node.
2954
- *
2955
- * @deprecated
2956
- *
2957
- * @param node - The AST node to get the comment for.
2958
- * @returns The JSDoc comment for the given node, or `null` if not found.
2959
- */
2960
- declare function getJSDocComment(node: Node): Comment | null;
2567
+ interface TSNamespaceExportDeclaration extends Span {
2568
+ type: "TSNamespaceExportDeclaration";
2569
+ id: IdentifierName;
2570
+ parent: Node;
2571
+ }
2572
+ interface TSInstantiationExpression extends Span {
2573
+ type: "TSInstantiationExpression";
2574
+ expression: Expression;
2575
+ typeArguments: TSTypeParameterInstantiation;
2576
+ parent: Node;
2577
+ }
2578
+ type ImportOrExportKind = "value" | "type";
2579
+ interface JSDocNullableType extends Span {
2580
+ type: "TSJSDocNullableType";
2581
+ typeAnnotation: TSType;
2582
+ postfix: boolean;
2583
+ parent: Node;
2584
+ }
2585
+ interface JSDocNonNullableType extends Span {
2586
+ type: "TSJSDocNonNullableType";
2587
+ typeAnnotation: TSType;
2588
+ postfix: boolean;
2589
+ parent: Node;
2590
+ }
2591
+ interface JSDocUnknownType extends Span {
2592
+ type: "TSJSDocUnknownType";
2593
+ parent: Node;
2594
+ }
2595
+ type ModuleKind = "script" | "module" | "commonjs";
2596
+ type AssignmentOperator = "=" | "+=" | "-=" | "*=" | "/=" | "%=" | "**=" | "<<=" | ">>=" | ">>>=" | "|=" | "^=" | "&=" | "||=" | "&&=" | "??=";
2597
+ type BinaryOperator = "==" | "!=" | "===" | "!==" | "<" | "<=" | ">" | ">=" | "+" | "-" | "*" | "/" | "%" | "**" | "<<" | ">>" | ">>>" | "|" | "^" | "&" | "in" | "instanceof";
2598
+ type LogicalOperator = "||" | "&&" | "??";
2599
+ type UnaryOperator = "+" | "-" | "!" | "~" | "typeof" | "void" | "delete";
2600
+ type UpdateOperator = "++" | "--";
2601
+ type Node = 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;
2961
2602
  //#endregion
2962
2603
  //#region src-js/plugins/scope.d.ts
2963
2604
  interface Scope {
@@ -2966,7 +2607,7 @@ interface Scope {
2966
2607
  upper: Scope | null;
2967
2608
  childScopes: Scope[];
2968
2609
  variableScope: Scope;
2969
- block: Node$1;
2610
+ block: Node;
2970
2611
  variables: Variable[];
2971
2612
  set: Map<string, Variable>;
2972
2613
  references: Reference[];
@@ -3000,69 +2641,115 @@ interface Reference {
3000
2641
  interface Definition {
3001
2642
  type: DefinitionType;
3002
2643
  name: Identifier;
3003
- node: Node$1;
3004
- parent: Node$1 | null;
2644
+ node: Node;
2645
+ parent: Node | null;
3005
2646
  }
3006
2647
  type DefinitionType = "CatchClause" | "ClassName" | "FunctionName" | "ImplicitGlobalVariable" | "ImportBinding" | "Parameter" | "Variable";
3007
2648
  type Identifier = IdentifierName | IdentifierReference | BindingIdentifier | LabelIdentifier | TSThisParameter | TSIndexSignatureName;
3008
2649
  /**
3009
2650
  * Discard TS-ESLint `ScopeManager`, to free memory.
3010
2651
  */
3011
- declare const SCOPE_MANAGER: Readonly<{
3012
- /**
3013
- * All scopes.
3014
- */
3015
- readonly scopes: Scope[];
3016
- /**
3017
- * The root scope.
3018
- */
3019
- readonly globalScope: Scope | null;
3020
- /**
3021
- * Get the variables that a given AST node defines.
3022
- * The returned variables' `def[].node` / `def[].parent` property is the node.
3023
- * If the node does not define any variable, this returns an empty array.
3024
- * @param node AST node to get variables of.
3025
- */
3026
- getDeclaredVariables(node: Node$1): Variable[];
3027
- /**
3028
- * Get the scope of a given AST node. The returned scope's `block` property is the node.
3029
- * This method never returns `function-expression-name` scope.
3030
- * If the node does not have a scope, returns `null`.
3031
- *
3032
- * @param node An AST node to get their scope.
3033
- * @param inner If the node has multiple scopes, this returns the outermost scope normally.
3034
- * If `inner` is `true` then this returns the innermost scope.
3035
- */
3036
- acquire(node: Node$1, inner?: boolean): Scope | null;
3037
- }>;
3038
- type ScopeManager = typeof SCOPE_MANAGER;
3039
2652
  /**
3040
2653
  * Determine whether the given identifier node is a reference to a global variable.
3041
2654
  * @param node - `Identifier` node to check.
3042
2655
  * @returns `true` if the identifier is a reference to a global variable.
3043
2656
  */
3044
- declare function isGlobalReference(node: Node$1): boolean;
2657
+ declare function isGlobalReference(node: Node): boolean;
3045
2658
  /**
3046
2659
  * Get the variables that `node` defines.
3047
2660
  * This is a convenience method that passes through to the same method on the `ScopeManager`.
3048
2661
  * @param node - The node for which the variables are obtained.
3049
2662
  * @returns An array of variable nodes representing the variables that `node` defines.
3050
2663
  */
3051
- declare function getDeclaredVariables(node: Node$1): Variable[];
2664
+ declare function getDeclaredVariables(node: Node): Variable[];
3052
2665
  /**
3053
2666
  * Get the scope for the given node.
3054
2667
  * @param node - The node to get the scope of.
3055
2668
  * @returns The scope information for this node.
3056
2669
  */
3057
- declare function getScope(node: Node$1): Scope;
2670
+ declare function getScope(node: Node): Scope;
3058
2671
  /**
3059
2672
  * Marks as used a variable with the given name in a scope indicated by the given reference node.
3060
- * This affects the `no-unused-vars` rule.
2673
+ *
2674
+ * IMPORTANT: At present marking variables as used only affects other JS plugins.
2675
+ * It does *not* get communicated to Oxlint's rules which are implemented on Rust side e.g. `no-unused-vars`.
2676
+ * This is a known shortcoming, and will be addressed in a future release.
2677
+ * https://github.com/oxc-project/oxc/issues/20350
2678
+ *
3061
2679
  * @param name - Variable name
3062
- * @param refNode - Reference node
2680
+ * @param refNode - Reference node. Defaults to `Program` node if not provided.
3063
2681
  * @returns `true` if a variable with the given name was found and marked as used, otherwise `false`
3064
2682
  */
3065
- declare function markVariableAsUsed(name: string, refNode: Node$1): boolean;
2683
+ declare function markVariableAsUsed(name: string, refNode?: Node): boolean;
2684
+ //#endregion
2685
+ //#region src-js/plugins/comments_methods.d.ts
2686
+ /**
2687
+ * Retrieve an array containing all comments in the source code.
2688
+ * @returns Array of `Comment`s in order they appear in source.
2689
+ */
2690
+ declare function getAllComments(): CommentType[];
2691
+ /**
2692
+ * Get all comments directly before the given node or token.
2693
+ *
2694
+ * "Directly before" means only comments before this node, and after the preceding token.
2695
+ *
2696
+ * ```js
2697
+ * // Define `x`
2698
+ * const x = 1;
2699
+ * // Define `y`
2700
+ * const y = 2;
2701
+ * ```
2702
+ *
2703
+ * `sourceCode.getCommentsBefore(varDeclY)` will only return "Define `y`" comment, not also "Define `x`".
2704
+ *
2705
+ * @param nodeOrToken - The AST node or token to check for adjacent comment tokens.
2706
+ * @returns Array of `Comment`s in occurrence order.
2707
+ */
2708
+ declare function getCommentsBefore(nodeOrToken: NodeOrToken): CommentType[];
2709
+ /**
2710
+ * Get all comment tokens directly after the given node or token.
2711
+ *
2712
+ * "Directly after" means only comments between end of this node, and the next token following it.
2713
+ *
2714
+ * ```js
2715
+ * const x = 1;
2716
+ * // Define `y`
2717
+ * const y = 2;
2718
+ * // Define `z`
2719
+ * const z = 3;
2720
+ * ```
2721
+ *
2722
+ * `sourceCode.getCommentsAfter(varDeclX)` will only return "Define `y`" comment, not also "Define `z`".
2723
+ *
2724
+ * @param nodeOrToken - The AST node or token to check for adjacent comment tokens.
2725
+ * @returns Array of `Comment`s in occurrence order.
2726
+ */
2727
+ declare function getCommentsAfter(nodeOrToken: NodeOrToken): CommentType[];
2728
+ /**
2729
+ * Get all comment tokens inside the given node.
2730
+ * @param node - The AST node to get the comments for.
2731
+ * @returns Array of `Comment`s in occurrence order.
2732
+ */
2733
+ declare function getCommentsInside(node: Node$1): CommentType[];
2734
+ /**
2735
+ * Check whether any comments exist or not between the given 2 nodes.
2736
+ * @param nodeOrToken1 - Start node/token.
2737
+ * @param nodeOrToken2 - End node/token.
2738
+ * @returns `true` if one or more comments exist between the two.
2739
+ */
2740
+ declare function commentsExistBetween(nodeOrToken1: NodeOrToken, nodeOrToken2: NodeOrToken): boolean;
2741
+ /**
2742
+ * Retrieve the JSDoc comment for a given node.
2743
+ *
2744
+ * @deprecated
2745
+ *
2746
+ * @param node - The AST node to get the comment for.
2747
+ * @returns The JSDoc comment for the given node, or `null` if not found.
2748
+ */
2749
+ declare function getJSDocComment(node: Node$1): CommentType | null;
2750
+ //#endregion
2751
+ //#region src-js/plugins/tokens_and_comments.d.ts
2752
+ type TokenOrComment = TokenType | CommentType;
3066
2753
  //#endregion
3067
2754
  //#region src-js/plugins/tokens_methods.d.ts
3068
2755
  /**
@@ -3123,7 +2810,7 @@ type TokenResult<Options> = MayIncludeComments<Options> extends true ? TokenOrCo
3123
2810
  * @param afterCount? - The number of tokens after the node to retrieve.
3124
2811
  * @returns Array of `Token`s, or array of `Token | Comment`s if `includeComments` is `true`.
3125
2812
  */
3126
- declare function getTokens<Options extends CountOptions | number | FilterFn | null | undefined>(node: Node, countOptions?: Options, afterCount?: number | null): TokenResult<Options>[];
2813
+ declare function getTokens<Options extends CountOptions | number | FilterFn | null | undefined>(node: Node$1, countOptions?: Options, afterCount?: number | null): TokenResult<Options>[];
3127
2814
  /**
3128
2815
  * Get the first token of the given node.
3129
2816
  * @param node - The AST node.
@@ -3132,7 +2819,7 @@ declare function getTokens<Options extends CountOptions | number | FilterFn | nu
3132
2819
  * If is a function, equivalent to `{ filter: fn }`.
3133
2820
  * @returns `Token` (or `Token | Comment` if `includeComments` is `true`), or `null` if none found.
3134
2821
  */
3135
- declare function getFirstToken<Options extends SkipOptions | number | FilterFn | null | undefined>(node: Node, skipOptions?: Options): TokenResult<Options> | null;
2822
+ declare function getFirstToken<Options extends SkipOptions | number | FilterFn | null | undefined>(node: Node$1, skipOptions?: Options): TokenResult<Options> | null;
3136
2823
  /**
3137
2824
  * Get the first tokens of the given node.
3138
2825
  * @param node - The AST node.
@@ -3141,179 +2828,509 @@ declare function getFirstToken<Options extends SkipOptions | number | FilterFn |
3141
2828
  * If is a function, equivalent to `{ filter: fn }`.
3142
2829
  * @returns Array of `Token`s, or array of `Token | Comment`s if `includeComments` is `true`.
3143
2830
  */
3144
- declare function getFirstTokens<Options extends CountOptions | number | FilterFn | null | undefined>(node: Node, countOptions?: Options): TokenResult<Options>[];
2831
+ declare function getFirstTokens<Options extends CountOptions | number | FilterFn | null | undefined>(node: Node$1, countOptions?: Options): TokenResult<Options>[];
2832
+ /**
2833
+ * Get the last token of the given node.
2834
+ * @param node - The AST node.
2835
+ * @param skipOptions? - Options object.
2836
+ * If is a number, equivalent to `{ skip: n }`.
2837
+ * If is a function, equivalent to `{ filter: fn }`.
2838
+ * @returns `Token` (or `Token | Comment` if `includeComments` is `true`), or `null` if none found.
2839
+ */
2840
+ declare function getLastToken<Options extends SkipOptions | number | FilterFn | null | undefined>(node: Node$1, skipOptions?: Options): TokenResult<Options> | null;
2841
+ /**
2842
+ * Get the last tokens of the given node.
2843
+ * @param node - The AST node.
2844
+ * @param countOptions? - Options object.
2845
+ * If is a number, equivalent to `{ count: n }`.
2846
+ * If is a function, equivalent to `{ filter: fn }`.
2847
+ * @returns Array of `Token`s, or array of `Token | Comment`s if `includeComments` is `true`.
2848
+ */
2849
+ declare function getLastTokens<Options extends CountOptions | number | FilterFn | null | undefined>(node: Node$1, countOptions?: Options): TokenResult<Options>[];
2850
+ /**
2851
+ * Get the token that precedes a given node or token.
2852
+ * @param nodeOrToken - The AST node or token.
2853
+ * @param skipOptions? - Options object.
2854
+ * If is a number, equivalent to `{ skip: n }`.
2855
+ * If is a function, equivalent to `{ filter: fn }`.
2856
+ * @returns `Token` (or `Token | Comment` if `includeComments` is `true`), or `null` if none found.
2857
+ */
2858
+ declare function getTokenBefore<Options extends SkipOptions | number | FilterFn | null | undefined>(nodeOrToken: NodeOrToken, skipOptions?: Options): TokenResult<Options> | null;
2859
+ /**
2860
+ * Get the token that precedes a given node or token.
2861
+ *
2862
+ * @deprecated Use `sourceCode.getTokenBefore` with `includeComments: true` instead.
2863
+ *
2864
+ * @param nodeOrToken The AST node or token.
2865
+ * @param skip - Number of tokens to skip.
2866
+ * @returns `TokenOrComment | null`.
2867
+ */
2868
+ declare function getTokenOrCommentBefore(nodeOrToken: NodeOrToken, skip?: number): TokenOrComment | null;
2869
+ /**
2870
+ * Get the tokens that precede a given node or token.
2871
+ * @param nodeOrToken - The AST node or token.
2872
+ * @param countOptions? - Options object.
2873
+ * If is a number, equivalent to `{ count: n }`.
2874
+ * If is a function, equivalent to `{ filter: fn }`.
2875
+ * @returns Array of `Token`s, or array of `Token | Comment`s if `includeComments` is `true`.
2876
+ */
2877
+ declare function getTokensBefore<Options extends CountOptions | number | FilterFn | null | undefined>(nodeOrToken: NodeOrToken, countOptions?: Options): TokenResult<Options>[];
2878
+ /**
2879
+ * Get the token that follows a given node or token.
2880
+ * @param nodeOrToken - The AST node or token.
2881
+ * @param skipOptions? - Options object.
2882
+ * If is a number, equivalent to `{ skip: n }`.
2883
+ * If is a function, equivalent to `{ filter: fn }`.
2884
+ * @returns `Token` (or `Token | Comment` if `includeComments` is `true`), or `null` if none found.
2885
+ */
2886
+ declare function getTokenAfter<Options extends SkipOptions | number | FilterFn | null | undefined>(nodeOrToken: NodeOrToken, skipOptions?: Options): TokenResult<Options> | null;
2887
+ /**
2888
+ * Get the token that follows a given node or token.
2889
+ *
2890
+ * @deprecated Use `sourceCode.getTokenAfter` with `includeComments: true` instead.
2891
+ *
2892
+ * @param nodeOrToken The AST node or token.
2893
+ * @param skip - Number of tokens to skip.
2894
+ * @returns `TokenOrComment | null`.
2895
+ */
2896
+ declare function getTokenOrCommentAfter(nodeOrToken: NodeOrToken, skip?: number): TokenOrComment | null;
2897
+ /**
2898
+ * Get the tokens that follow a given node or token.
2899
+ * @param nodeOrToken - The AST node or token.
2900
+ * @param countOptions? - Options object.
2901
+ * If is a number, equivalent to `{ count: n }`.
2902
+ * If is a function, equivalent to `{ filter: fn }`.
2903
+ * @returns Array of `Token`s, or array of `Token | Comment`s if `includeComments` is `true`.
2904
+ */
2905
+ declare function getTokensAfter<Options extends CountOptions | number | FilterFn | null | undefined>(nodeOrToken: NodeOrToken, countOptions?: Options): TokenResult<Options>[];
2906
+ /**
2907
+ * Get all of the tokens between two non-overlapping nodes.
2908
+ * @param left - Node or token before the desired token range.
2909
+ * @param right - Node or token after the desired token range.
2910
+ * @param countOptions? - Options object. If is a function, equivalent to `{ filter: fn }`.
2911
+ * @returns Array of `Token`s, or array of `Token | Comment`s if `includeComments` is `true`.
2912
+ */
2913
+ /**
2914
+ * Get all of the tokens between two non-overlapping nodes.
2915
+ * @param left - Node or token before the desired token range.
2916
+ * @param right - Node or token after the desired token range.
2917
+ * @param padding - Number of extra tokens on either side of center.
2918
+ * @returns Array of `Token`s, or array of `Token | Comment`s if `includeComments` is `true`.
2919
+ */
2920
+ declare function getTokensBetween<Options extends CountOptions | number | FilterFn | null | undefined>(left: NodeOrToken, right: NodeOrToken, countOptions?: Options): TokenResult<Options>[];
2921
+ /**
2922
+ * Get the first token between two non-overlapping nodes.
2923
+ * @param left - Node or token before the desired token range.
2924
+ * @param right - Node or token after the desired token range.
2925
+ * @param skipOptions? - Options object.
2926
+ * If is a number, equivalent to `{ skip: n }`.
2927
+ * If is a function, equivalent to `{ filter: fn }`.
2928
+ * @returns `Token` (or `Token | Comment` if `includeComments` is `true`), or `null` if none found.
2929
+ */
2930
+ declare function getFirstTokenBetween<Options extends SkipOptions | number | FilterFn | null | undefined>(left: NodeOrToken, right: NodeOrToken, skipOptions?: Options): TokenResult<Options> | null;
2931
+ /**
2932
+ * Get the first tokens between two non-overlapping nodes.
2933
+ * @param left - Node or token before the desired token range.
2934
+ * @param right - Node or token after the desired token range.
2935
+ * @param countOptions? - Options object.
2936
+ * If is a number, equivalent to `{ count: n }`.
2937
+ * If is a function, equivalent to `{ filter: fn }`.
2938
+ * @returns Array of `Token`s, or array of `Token | Comment`s if `includeComments` is `true`.
2939
+ */
2940
+ declare function getFirstTokensBetween<Options extends CountOptions | number | FilterFn | null | undefined>(left: NodeOrToken, right: NodeOrToken, countOptions?: Options): TokenResult<Options>[];
2941
+ /**
2942
+ * Get the last token between two non-overlapping nodes.
2943
+ * @param left - Node or token before the desired token range.
2944
+ * @param right - Node or token after the desired token range.
2945
+ * @param skipOptions? - Options object.
2946
+ * If is a number, equivalent to `{ skip: n }`.
2947
+ * If is a function, equivalent to `{ filter: fn }`.
2948
+ * @returns `Token` (or `Token | Comment` if `includeComments` is `true`), or `null` if none found.
2949
+ */
2950
+ declare function getLastTokenBetween<Options extends SkipOptions | number | FilterFn | null | undefined>(left: NodeOrToken, right: NodeOrToken, skipOptions?: Options): TokenResult<Options> | null;
2951
+ /**
2952
+ * Get the last tokens between two non-overlapping nodes.
2953
+ * @param left - Node or token before the desired token range.
2954
+ * @param right - Node or token after the desired token range.
2955
+ * @param countOptions? - Options object.
2956
+ * If is a number, equivalent to `{ count: n }`.
2957
+ * If is a function, equivalent to `{ filter: fn }`.
2958
+ * @returns Array of `Token`s, or array of `Token | Comment`s if `includeComments` is `true`.
2959
+ */
2960
+ declare function getLastTokensBetween<Options extends CountOptions | number | FilterFn | null | undefined>(left: NodeOrToken, right: NodeOrToken, countOptions?: Options): TokenResult<Options>[];
2961
+ /**
2962
+ * Get the token starting at the specified index.
2963
+ * @param offset - Start offset of the token.
2964
+ * @param rangeOptions - Options object.
2965
+ * @returns `Token` (or `Token | Comment` if `includeComments` is `true`), or `null` if none found.
2966
+ */
2967
+ declare function getTokenByRangeStart<Options extends RangeOptions | null | undefined>(offset: number, rangeOptions?: Options): TokenResult<Options> | null;
2968
+ /**
2969
+ * Determine if two nodes or tokens have at least one whitespace character between them.
2970
+ * Order does not matter.
2971
+ *
2972
+ * Returns `false` if the given nodes or tokens overlap.
2973
+ *
2974
+ * Checks for whitespace *between tokens*, not including whitespace *inside tokens*.
2975
+ * e.g. Returns `false` for `isSpaceBetween(x, y)` in `x+" "+y`.
2976
+ *
2977
+ * @param first - The first node or token to check between.
2978
+ * @param second - The second node or token to check between.
2979
+ * @returns `true` if there is a whitespace character between
2980
+ * any of the tokens found between the two given nodes or tokens.
2981
+ */
2982
+ declare function isSpaceBetween(first: NodeOrToken, second: NodeOrToken): boolean;
2983
+ /**
2984
+ * Determine if two nodes or tokens have at least one whitespace character between them.
2985
+ * Order does not matter.
2986
+ *
2987
+ * Returns `false` if the given nodes or tokens overlap.
2988
+ *
2989
+ * Checks for whitespace *between tokens*, not including whitespace *inside tokens*.
2990
+ * e.g. Returns `false` for `isSpaceBetween(x, y)` in `x+" "+y`.
2991
+ *
2992
+ * Unlike `SourceCode#isSpaceBetween`, this function does return `true` if there is a `JSText` token between the two
2993
+ * input tokens, and it contains whitespace.
2994
+ * e.g. Returns `true` for `isSpaceBetweenTokens(x, slash)` in `<X>a b</X>`.
2995
+ *
2996
+ * @deprecated Use `sourceCode.isSpaceBetween` instead.
2997
+ *
2998
+ * @param first - The first node or token to check between.
2999
+ * @param second - The second node or token to check between.
3000
+ * @returns `true` if there is a whitespace character between
3001
+ * any of the tokens found between the two given nodes or tokens.
3002
+ */
3003
+ declare function isSpaceBetweenTokens(first: NodeOrToken, second: NodeOrToken): boolean;
3004
+ //#endregion
3005
+ //#region src-js/plugins/directives.d.ts
3006
+ interface Problem {
3007
+ ruleId: string | null;
3008
+ message: string;
3009
+ loc: Location;
3010
+ }
3011
+ type DirectiveType = "disable" | "enable" | "disable-line" | "disable-next-line";
3012
+ interface Directive {
3013
+ type: DirectiveType;
3014
+ node: CommentType;
3015
+ value: string;
3016
+ justification?: string;
3017
+ }
3018
+ declare function getDisableDirectives(): {
3019
+ problems: Problem[];
3020
+ directives: Directive[];
3021
+ };
3022
+ //#endregion
3023
+ //#region src-js/plugins/json.d.ts
3145
3024
  /**
3146
- * Get the last token of the given node.
3147
- * @param node - The AST node.
3148
- * @param skipOptions? - Options object.
3149
- * If is a number, equivalent to `{ skip: n }`.
3150
- * If is a function, equivalent to `{ filter: fn }`.
3151
- * @returns `Token` (or `Token | Comment` if `includeComments` is `true`), or `null` if none found.
3025
+ * A JSON value.
3152
3026
  */
3153
- declare function getLastToken<Options extends SkipOptions | number | FilterFn | null | undefined>(node: Node, skipOptions?: Options): TokenResult<Options> | null;
3027
+ type JsonValue = JsonObject | JsonValue[] | string | number | boolean | null;
3154
3028
  /**
3155
- * Get the last tokens of the given node.
3156
- * @param node - The AST node.
3157
- * @param countOptions? - Options object.
3158
- * If is a number, equivalent to `{ count: n }`.
3159
- * If is a function, equivalent to `{ filter: fn }`.
3160
- * @returns Array of `Token`s, or array of `Token | Comment`s if `includeComments` is `true`.
3029
+ * A JSON object.
3161
3030
  */
3162
- declare function getLastTokens<Options extends CountOptions | number | FilterFn | null | undefined>(node: Node, countOptions?: Options): TokenResult<Options>[];
3031
+ type JsonObject = {
3032
+ [key: string]: JsonValue;
3033
+ };
3034
+ //#endregion
3035
+ //#region src-js/plugins/globals.d.ts
3163
3036
  /**
3164
- * Get the token that precedes a given node or token.
3165
- * @param nodeOrToken - The AST node or token.
3166
- * @param skipOptions? - Options object.
3167
- * If is a number, equivalent to `{ skip: n }`.
3168
- * If is a function, equivalent to `{ filter: fn }`.
3169
- * @returns `Token` (or `Token | Comment` if `includeComments` is `true`), or `null` if none found.
3037
+ * Globals for the file being linted.
3038
+ *
3039
+ * Globals are deserialized from JSON, so can only contain JSON-compatible values.
3040
+ * Each global variable maps to "readonly", "writable", or "off".
3170
3041
  */
3171
- declare function getTokenBefore<Options extends SkipOptions | number | FilterFn | null | undefined>(nodeOrToken: NodeOrToken, skipOptions?: Options): TokenResult<Options> | null;
3042
+ type Globals$1 = Record<string, "readonly" | "writable" | "off">;
3172
3043
  /**
3173
- * Get the token that precedes a given node or token.
3174
- *
3175
- * @deprecated Use `sourceCode.getTokenBefore` with `includeComments: true` instead.
3044
+ * Environments for the file being linted.
3176
3045
  *
3177
- * @param nodeOrToken The AST node or token.
3178
- * @param skip - Number of tokens to skip.
3179
- * @returns `TokenOrComment | null`.
3046
+ * Only includes environments that are enabled, so all properties are `true`.
3180
3047
  */
3181
- declare function getTokenOrCommentBefore(nodeOrToken: NodeOrToken, skip?: number): TokenOrComment | null;
3048
+ type Envs$1 = Record<string, true>;
3049
+ //#endregion
3050
+ //#region ../../node_modules/.pnpm/@types+json-schema@7.0.15/node_modules/@types/json-schema/index.d.ts
3051
+ // ==================================================================================================
3052
+ // JSON Schema Draft 04
3053
+ // ==================================================================================================
3182
3054
  /**
3183
- * Get the tokens that precede a given node or token.
3184
- * @param nodeOrToken - The AST node or token.
3185
- * @param countOptions? - Options object.
3186
- * If is a number, equivalent to `{ count: n }`.
3187
- * If is a function, equivalent to `{ filter: fn }`.
3188
- * @returns Array of `Token`s, or array of `Token | Comment`s if `includeComments` is `true`.
3055
+ * @see https://tools.ietf.org/html/draft-zyp-json-schema-03#section-5.1
3189
3056
  */
3190
- declare function getTokensBefore<Options extends CountOptions | number | FilterFn | null | undefined>(nodeOrToken: NodeOrToken, countOptions?: Options): TokenResult<Options>[];
3057
+ type JSONSchema4TypeName = "string" //
3058
+ | "number" | "integer" | "boolean" | "object" | "array" | "null" | "any";
3191
3059
  /**
3192
- * Get the token that follows a given node or token.
3193
- * @param nodeOrToken - The AST node or token.
3194
- * @param skipOptions? - Options object.
3195
- * If is a number, equivalent to `{ skip: n }`.
3196
- * If is a function, equivalent to `{ filter: fn }`.
3197
- * @returns `Token` (or `Token | Comment` if `includeComments` is `true`), or `null` if none found.
3060
+ * @see https://tools.ietf.org/html/draft-zyp-json-schema-04#section-3.5
3198
3061
  */
3199
- declare function getTokenAfter<Options extends SkipOptions | number | FilterFn | null | undefined>(nodeOrToken: NodeOrToken, skipOptions?: Options): TokenResult<Options> | null;
3062
+ type JSONSchema4Type = string //
3063
+ | number | boolean | JSONSchema4Object | JSONSchema4Array | null;
3064
+ // Workaround for infinite type recursion
3065
+ interface JSONSchema4Object {
3066
+ [key: string]: JSONSchema4Type;
3067
+ }
3068
+ // Workaround for infinite type recursion
3069
+ // https://github.com/Microsoft/TypeScript/issues/3496#issuecomment-128553540
3070
+ interface JSONSchema4Array extends Array<JSONSchema4Type> {}
3200
3071
  /**
3201
- * Get the token that follows a given node or token.
3072
+ * Meta schema
3202
3073
  *
3203
- * @deprecated Use `sourceCode.getTokenAfter` with `includeComments: true` instead.
3074
+ * Recommended values:
3075
+ * - 'http://json-schema.org/schema#'
3076
+ * - 'http://json-schema.org/hyper-schema#'
3077
+ * - 'http://json-schema.org/draft-04/schema#'
3078
+ * - 'http://json-schema.org/draft-04/hyper-schema#'
3079
+ * - 'http://json-schema.org/draft-03/schema#'
3080
+ * - 'http://json-schema.org/draft-03/hyper-schema#'
3204
3081
  *
3205
- * @param nodeOrToken The AST node or token.
3206
- * @param skip - Number of tokens to skip.
3207
- * @returns `TokenOrComment | null`.
3208
- */
3209
- declare function getTokenOrCommentAfter(nodeOrToken: NodeOrToken, skip?: number): TokenOrComment | null;
3210
- /**
3211
- * Get the tokens that follow a given node or token.
3212
- * @param nodeOrToken - The AST node or token.
3213
- * @param countOptions? - Options object.
3214
- * If is a number, equivalent to `{ count: n }`.
3215
- * If is a function, equivalent to `{ filter: fn }`.
3216
- * @returns Array of `Token`s, or array of `Token | Comment`s if `includeComments` is `true`.
3082
+ * @see https://tools.ietf.org/html/draft-handrews-json-schema-validation-01#section-5
3217
3083
  */
3218
- declare function getTokensAfter<Options extends CountOptions | number | FilterFn | null | undefined>(nodeOrToken: NodeOrToken, countOptions?: Options): TokenResult<Options>[];
3084
+ type JSONSchema4Version = string;
3219
3085
  /**
3220
- * Get all of the tokens between two non-overlapping nodes.
3221
- * @param left - Node or token before the desired token range.
3222
- * @param right - Node or token after the desired token range.
3223
- * @param countOptions? - Options object. If is a function, equivalent to `{ filter: fn }`.
3224
- * @returns Array of `Token`s, or array of `Token | Comment`s if `includeComments` is `true`.
3086
+ * JSON Schema V4
3087
+ * @see https://tools.ietf.org/html/draft-zyp-json-schema-04
3225
3088
  */
3089
+ interface JSONSchema4 {
3090
+ id?: string | undefined;
3091
+ $ref?: string | undefined;
3092
+ $schema?: JSONSchema4Version | undefined;
3093
+ /**
3094
+ * This attribute is a string that provides a short description of the
3095
+ * instance property.
3096
+ *
3097
+ * @see https://tools.ietf.org/html/draft-zyp-json-schema-03#section-5.21
3098
+ */
3099
+ title?: string | undefined;
3100
+ /**
3101
+ * This attribute is a string that provides a full description of the of
3102
+ * purpose the instance property.
3103
+ *
3104
+ * @see https://tools.ietf.org/html/draft-zyp-json-schema-03#section-5.22
3105
+ */
3106
+ description?: string | undefined;
3107
+ default?: JSONSchema4Type | undefined;
3108
+ multipleOf?: number | undefined;
3109
+ maximum?: number | undefined;
3110
+ exclusiveMaximum?: boolean | undefined;
3111
+ minimum?: number | undefined;
3112
+ exclusiveMinimum?: boolean | undefined;
3113
+ maxLength?: number | undefined;
3114
+ minLength?: number | undefined;
3115
+ pattern?: string | undefined;
3116
+ /**
3117
+ * May only be defined when "items" is defined, and is a tuple of JSONSchemas.
3118
+ *
3119
+ * This provides a definition for additional items in an array instance
3120
+ * when tuple definitions of the items is provided. This can be false
3121
+ * to indicate additional items in the array are not allowed, or it can
3122
+ * be a schema that defines the schema of the additional items.
3123
+ *
3124
+ * @see https://tools.ietf.org/html/draft-zyp-json-schema-03#section-5.6
3125
+ */
3126
+ additionalItems?: boolean | JSONSchema4 | undefined;
3127
+ /**
3128
+ * This attribute defines the allowed items in an instance array, and
3129
+ * MUST be a schema or an array of schemas. The default value is an
3130
+ * empty schema which allows any value for items in the instance array.
3131
+ *
3132
+ * When this attribute value is a schema and the instance value is an
3133
+ * array, then all the items in the array MUST be valid according to the
3134
+ * schema.
3135
+ *
3136
+ * When this attribute value is an array of schemas and the instance
3137
+ * value is an array, each position in the instance array MUST conform
3138
+ * to the schema in the corresponding position for this array. This
3139
+ * called tuple typing. When tuple typing is used, additional items are
3140
+ * allowed, disallowed, or constrained by the "additionalItems"
3141
+ * (Section 5.6) attribute using the same rules as
3142
+ * "additionalProperties" (Section 5.4) for objects.
3143
+ *
3144
+ * @see https://tools.ietf.org/html/draft-zyp-json-schema-03#section-5.5
3145
+ */
3146
+ items?: JSONSchema4 | JSONSchema4[] | undefined;
3147
+ maxItems?: number | undefined;
3148
+ minItems?: number | undefined;
3149
+ uniqueItems?: boolean | undefined;
3150
+ maxProperties?: number | undefined;
3151
+ minProperties?: number | undefined;
3152
+ /**
3153
+ * This attribute indicates if the instance must have a value, and not
3154
+ * be undefined. This is false by default, making the instance
3155
+ * optional.
3156
+ *
3157
+ * @see https://tools.ietf.org/html/draft-zyp-json-schema-03#section-5.7
3158
+ */
3159
+ required?: boolean | string[] | undefined;
3160
+ /**
3161
+ * This attribute defines a schema for all properties that are not
3162
+ * explicitly defined in an object type definition. If specified, the
3163
+ * value MUST be a schema or a boolean. If false is provided, no
3164
+ * additional properties are allowed beyond the properties defined in
3165
+ * the schema. The default value is an empty schema which allows any
3166
+ * value for additional properties.
3167
+ *
3168
+ * @see https://tools.ietf.org/html/draft-zyp-json-schema-03#section-5.4
3169
+ */
3170
+ additionalProperties?: boolean | JSONSchema4 | undefined;
3171
+ definitions?: {
3172
+ [k: string]: JSONSchema4;
3173
+ } | undefined;
3174
+ /**
3175
+ * This attribute is an object with property definitions that define the
3176
+ * valid values of instance object property values. When the instance
3177
+ * value is an object, the property values of the instance object MUST
3178
+ * conform to the property definitions in this object. In this object,
3179
+ * each property definition's value MUST be a schema, and the property's
3180
+ * name MUST be the name of the instance property that it defines. The
3181
+ * instance property value MUST be valid according to the schema from
3182
+ * the property definition. Properties are considered unordered, the
3183
+ * order of the instance properties MAY be in any order.
3184
+ *
3185
+ * @see https://tools.ietf.org/html/draft-zyp-json-schema-03#section-5.2
3186
+ */
3187
+ properties?: {
3188
+ [k: string]: JSONSchema4;
3189
+ } | undefined;
3190
+ /**
3191
+ * This attribute is an object that defines the schema for a set of
3192
+ * property names of an object instance. The name of each property of
3193
+ * this attribute's object is a regular expression pattern in the ECMA
3194
+ * 262/Perl 5 format, while the value is a schema. If the pattern
3195
+ * matches the name of a property on the instance object, the value of
3196
+ * the instance's property MUST be valid against the pattern name's
3197
+ * schema value.
3198
+ *
3199
+ * @see https://tools.ietf.org/html/draft-zyp-json-schema-03#section-5.3
3200
+ */
3201
+ patternProperties?: {
3202
+ [k: string]: JSONSchema4;
3203
+ } | undefined;
3204
+ dependencies?: {
3205
+ [k: string]: JSONSchema4 | string[];
3206
+ } | undefined;
3207
+ /**
3208
+ * This provides an enumeration of all possible values that are valid
3209
+ * for the instance property. This MUST be an array, and each item in
3210
+ * the array represents a possible value for the instance value. If
3211
+ * this attribute is defined, the instance value MUST be one of the
3212
+ * values in the array in order for the schema to be valid.
3213
+ *
3214
+ * @see https://tools.ietf.org/html/draft-zyp-json-schema-03#section-5.19
3215
+ */
3216
+ enum?: JSONSchema4Type[] | undefined;
3217
+ /**
3218
+ * A single type, or a union of simple types
3219
+ */
3220
+ type?: JSONSchema4TypeName | JSONSchema4TypeName[] | undefined;
3221
+ allOf?: JSONSchema4[] | undefined;
3222
+ anyOf?: JSONSchema4[] | undefined;
3223
+ oneOf?: JSONSchema4[] | undefined;
3224
+ not?: JSONSchema4 | undefined;
3225
+ /**
3226
+ * The value of this property MUST be another schema which will provide
3227
+ * a base schema which the current schema will inherit from. The
3228
+ * inheritance rules are such that any instance that is valid according
3229
+ * to the current schema MUST be valid according to the referenced
3230
+ * schema. This MAY also be an array, in which case, the instance MUST
3231
+ * be valid for all the schemas in the array. A schema that extends
3232
+ * another schema MAY define additional attributes, constrain existing
3233
+ * attributes, or add other constraints.
3234
+ *
3235
+ * Conceptually, the behavior of extends can be seen as validating an
3236
+ * instance against all constraints in the extending schema as well as
3237
+ * the extended schema(s).
3238
+ *
3239
+ * @see https://tools.ietf.org/html/draft-zyp-json-schema-03#section-5.26
3240
+ */
3241
+ extends?: string | string[] | undefined;
3242
+ /**
3243
+ * @see https://tools.ietf.org/html/draft-zyp-json-schema-04#section-5.6
3244
+ */
3245
+ [k: string]: any;
3246
+ format?: string | undefined;
3247
+ }
3248
+ //#endregion
3249
+ //#region src-js/plugins/options.d.ts
3226
3250
  /**
3227
- * Get all of the tokens between two non-overlapping nodes.
3228
- * @param left - Node or token before the desired token range.
3229
- * @param right - Node or token after the desired token range.
3230
- * @param padding - Number of extra tokens on either side of center.
3231
- * @returns Array of `Token`s, or array of `Token | Comment`s if `includeComments` is `true`.
3251
+ * Options for a rule on a file.
3232
3252
  */
3233
- declare function getTokensBetween<Options extends CountOptions | number | FilterFn | null | undefined>(left: NodeOrToken, right: NodeOrToken, countOptions?: Options): TokenResult<Options>[];
3253
+ type Options = JsonValue[];
3234
3254
  /**
3235
- * Get the first token between two non-overlapping nodes.
3236
- * @param left - Node or token before the desired token range.
3237
- * @param right - Node or token after the desired token range.
3238
- * @param skipOptions? - Options object.
3239
- * If is a number, equivalent to `{ skip: n }`.
3240
- * If is a function, equivalent to `{ filter: fn }`.
3241
- * @returns `Token` (or `Token | Comment` if `includeComments` is `true`), or `null` if none found.
3255
+ * Schema describing valid options for a rule.
3256
+ * `schema` property of `RuleMeta`.
3257
+ *
3258
+ * Can be one of:
3259
+ * - `JSONSchema4` - Full JSON Schema object (must have `type: "array"` at root).
3260
+ * - `JSONSchema4[]` - Array shorthand where each element describes corresponding options element.
3261
+ * - `false` - Opts out of schema validation (not recommended).
3242
3262
  */
3243
- declare function getFirstTokenBetween<Options extends SkipOptions | number | FilterFn | null | undefined>(left: NodeOrToken, right: NodeOrToken, skipOptions?: Options): TokenResult<Options> | null;
3263
+ type RuleOptionsSchema = JSONSchema4 | JSONSchema4[] | false;
3264
+ //#endregion
3265
+ //#region src-js/plugins/fix.d.ts
3266
+ type FixFn = (fixer: Fixer) => Fix | Array<Fix | null | undefined> | IterableIterator<Fix | null | undefined> | null | undefined;
3244
3267
  /**
3245
- * Get the first tokens between two non-overlapping nodes.
3246
- * @param left - Node or token before the desired token range.
3247
- * @param right - Node or token after the desired token range.
3248
- * @param countOptions? - Options object.
3249
- * If is a number, equivalent to `{ count: n }`.
3250
- * If is a function, equivalent to `{ filter: fn }`.
3251
- * @returns Array of `Token`s, or array of `Token | Comment`s if `includeComments` is `true`.
3268
+ * Fix, as returned by `fix` function.
3269
+ *
3270
+ * `range` offsets are relative to start of the source text.
3271
+ * When the file has a BOM, they are relative to the start of the source text *without* the BOM.
3272
+ *
3273
+ * To represent a position *before* a BOM, -1 is used to mean "before the BOM".
3274
+ * ESLint's `unicode-bom` rule produces a fix `{ range: [-1, 0], text: "" }` to remove a BOM.
3252
3275
  */
3253
- declare function getFirstTokensBetween<Options extends CountOptions | number | FilterFn | null | undefined>(left: NodeOrToken, right: NodeOrToken, countOptions?: Options): TokenResult<Options>[];
3276
+ interface Fix {
3277
+ range: Range;
3278
+ text: string;
3279
+ }
3280
+ declare const FIXER: Readonly<{
3281
+ insertTextBefore(nodeOrToken: Ranged, text: string): Fix;
3282
+ insertTextBeforeRange(range: Range, text: string): Fix;
3283
+ insertTextAfter(nodeOrToken: Ranged, text: string): Fix;
3284
+ insertTextAfterRange(range: Range, text: string): Fix;
3285
+ remove(nodeOrToken: Ranged): Fix;
3286
+ removeRange(range: Range): Fix;
3287
+ replaceText(nodeOrToken: Ranged, text: string): Fix;
3288
+ replaceTextRange(range: Range, text: string): Fix;
3289
+ }>;
3290
+ type Fixer = typeof FIXER;
3291
+ //#endregion
3292
+ //#region src-js/plugins/report.d.ts
3254
3293
  /**
3255
- * Get the last 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.
3294
+ * Diagnostic object.
3295
+ * Passed to `Context#report()`.
3296
+ *
3297
+ * - Either `message` or `messageId` property must be provided.
3298
+ * - Either `node` or `loc` property must be provided.
3262
3299
  */
3263
- declare function getLastTokenBetween<Options extends SkipOptions | number | FilterFn | null | undefined>(left: NodeOrToken, right: NodeOrToken, skipOptions?: Options): TokenResult<Options> | null;
3300
+ type Diagnostic = RequireAtLeastOne<RequireAtLeastOne<DiagnosticBase, "node" | "loc">, "message" | "messageId">;
3301
+ interface DiagnosticBase {
3302
+ message?: string | null | undefined;
3303
+ messageId?: string | null | undefined;
3304
+ node?: Ranged;
3305
+ loc?: LocationWithOptionalEnd | LineColumn;
3306
+ data?: DiagnosticData | null | undefined;
3307
+ fix?: FixFn;
3308
+ suggest?: Suggestion[] | null | undefined;
3309
+ }
3264
3310
  /**
3265
- * Get the last 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`.
3311
+ * Location with `end` property optional.
3272
3312
  */
3273
- declare function getLastTokensBetween<Options extends CountOptions | number | FilterFn | null | undefined>(left: NodeOrToken, right: NodeOrToken, countOptions?: Options): TokenResult<Options>[];
3313
+ interface LocationWithOptionalEnd {
3314
+ start: LineColumn;
3315
+ end?: LineColumn | null | undefined;
3316
+ }
3274
3317
  /**
3275
- * Get the token starting at the specified index.
3276
- * @param index - Index of the start of the token's range.
3277
- * @param rangeOptions - Options object.
3278
- * @returns `Token` (or `Token | Comment` if `includeComments` is `true`), or `null` if none found.
3318
+ * Data to interpolate into a diagnostic message.
3279
3319
  */
3280
- declare function getTokenByRangeStart<Options extends RangeOptions | null | undefined>(index: number, rangeOptions?: Options): TokenResult<Options> | null;
3320
+ type DiagnosticData = Record<string, string | number | boolean | bigint | null | undefined>;
3281
3321
  /**
3282
- * Determine if two nodes or tokens have at least one whitespace character between them.
3283
- * Order does not matter.
3284
- *
3285
- * Returns `false` if the given nodes or tokens overlap.
3286
- *
3287
- * Checks for whitespace *between tokens*, not including whitespace *inside tokens*.
3288
- * e.g. Returns `false` for `isSpaceBetween(x, y)` in `x+" "+y`.
3289
- *
3290
- * @param first - The first node or token to check between.
3291
- * @param second - The second node or token to check between.
3292
- * @returns `true` if there is a whitespace character between
3293
- * any of the tokens found between the two given nodes or tokens.
3322
+ * Suggested fix.
3294
3323
  */
3295
- declare function isSpaceBetween(first: NodeOrToken, second: NodeOrToken): boolean;
3324
+ type Suggestion = RequireAtLeastOne<SuggestionBase, "desc" | "messageId">;
3325
+ interface SuggestionBase {
3326
+ desc?: string;
3327
+ messageId?: string;
3328
+ data?: DiagnosticData | null | undefined;
3329
+ fix: FixFn;
3330
+ }
3296
3331
  /**
3297
- * Determine if two nodes or tokens have at least one whitespace character between them.
3298
- * Order does not matter.
3299
- *
3300
- * Returns `false` if the given nodes or tokens overlap.
3301
- *
3302
- * Checks for whitespace *between tokens*, not including whitespace *inside tokens*.
3303
- * e.g. Returns `false` for `isSpaceBetween(x, y)` in `x+" "+y`.
3304
- *
3305
- * Unlike `SourceCode#isSpaceBetween`, this function does return `true` if there is a `JSText` token between the two
3306
- * input tokens, and it contains whitespace.
3307
- * e.g. Returns `true` for `isSpaceBetweenTokens(x, slash)` in `<X>a b</X>`.
3308
- *
3309
- * @deprecated Use `sourceCode.isSpaceBetween` instead.
3310
- *
3311
- * @param first - The first node or token to check between.
3312
- * @param second - The second node or token to check between.
3313
- * @returns `true` if there is a whitespace character between
3314
- * any of the tokens found between the two given nodes or tokens.
3332
+ * Suggested fix in form sent to Rust.
3315
3333
  */
3316
- declare function isSpaceBetweenTokens(first: NodeOrToken, second: NodeOrToken): boolean;
3317
3334
  //#endregion
3318
3335
  //#region src-js/plugins/source_code.d.ts
3319
3336
  declare const SOURCE_CODE: Readonly<{
@@ -3336,7 +3353,12 @@ declare const SOURCE_CODE: Readonly<{
3336
3353
  /**
3337
3354
  * `ScopeManager` for the file.
3338
3355
  */
3339
- readonly scopeManager: ScopeManager;
3356
+ readonly scopeManager: Readonly<{
3357
+ readonly scopes: Scope[];
3358
+ readonly globalScope: Scope | null;
3359
+ getDeclaredVariables(node: Node): Variable[];
3360
+ acquire(node: Node, inner?: boolean): Scope | null;
3361
+ }>;
3340
3362
  /**
3341
3363
  * Visitor keys to traverse this AST.
3342
3364
  */
@@ -3359,7 +3381,7 @@ declare const SOURCE_CODE: Readonly<{
3359
3381
  /**
3360
3382
  * Array of all tokens and comments in the file, in source order.
3361
3383
  */
3362
- readonly tokensAndComments: (TokenType | Comment)[];
3384
+ readonly tokensAndComments: (TokenType | CommentType)[];
3363
3385
  /**
3364
3386
  * Get the source code for the given node.
3365
3387
  * @param node? - The AST node to get the text for.
@@ -3374,7 +3396,7 @@ declare const SOURCE_CODE: Readonly<{
3374
3396
  * @returns All the ancestor nodes in the AST, not including the provided node,
3375
3397
  * starting from the root node at index 0 and going inwards to the parent node.
3376
3398
  */
3377
- getAncestors(node: Node): Node[];
3399
+ getAncestors(node: Node$1): Node$1[];
3378
3400
  /**
3379
3401
  * Get source text as array of lines, split according to specification's definition of line breaks.
3380
3402
  */
@@ -3413,260 +3435,11 @@ declare const SOURCE_CODE: Readonly<{
3413
3435
  getTokenByRangeStart: typeof getTokenByRangeStart;
3414
3436
  isSpaceBetween: typeof isSpaceBetween;
3415
3437
  isSpaceBetweenTokens: typeof isSpaceBetweenTokens;
3438
+ getDisableDirectives: typeof getDisableDirectives;
3416
3439
  }>;
3417
3440
  type SourceCode = typeof SOURCE_CODE;
3418
3441
  //#endregion
3419
3442
  //#region src-js/plugins/context.d.ts
3420
- declare const LANGUAGE_OPTIONS: {
3421
- /**
3422
- * Source type of the file being linted.
3423
- */
3424
- readonly sourceType: ModuleKind;
3425
- /**
3426
- * ECMAScript version of the file being linted.
3427
- */
3428
- ecmaVersion: number;
3429
- /**
3430
- * Parser used to parse the file being linted.
3431
- */
3432
- parser: Readonly<{
3433
- /**
3434
- * Parser name.
3435
- */
3436
- name: "oxlint";
3437
- /**
3438
- * Parser version.
3439
- */
3440
- version: string;
3441
- /**
3442
- * Parse code into an AST.
3443
- * @param code - Code to parse
3444
- * @param options? - Parser options
3445
- * @returns AST
3446
- */
3447
- parse(code: string, options?: Record<string, unknown>): Program;
3448
- /**
3449
- * Visitor keys for AST nodes.
3450
- */
3451
- VisitorKeys: Readonly<{
3452
- DebuggerStatement: readonly never[];
3453
- EmptyStatement: readonly never[];
3454
- Literal: readonly never[];
3455
- PrivateIdentifier: readonly never[];
3456
- Super: readonly never[];
3457
- TemplateElement: readonly never[];
3458
- ThisExpression: readonly never[];
3459
- JSXClosingFragment: readonly never[];
3460
- JSXEmptyExpression: readonly never[];
3461
- JSXIdentifier: readonly never[];
3462
- JSXOpeningFragment: readonly never[];
3463
- JSXText: readonly never[];
3464
- TSAnyKeyword: readonly never[];
3465
- TSBigIntKeyword: readonly never[];
3466
- TSBooleanKeyword: readonly never[];
3467
- TSIntrinsicKeyword: readonly never[];
3468
- TSJSDocUnknownType: readonly never[];
3469
- TSNeverKeyword: readonly never[];
3470
- TSNullKeyword: readonly never[];
3471
- TSNumberKeyword: readonly never[];
3472
- TSObjectKeyword: readonly never[];
3473
- TSStringKeyword: readonly never[];
3474
- TSSymbolKeyword: readonly never[];
3475
- TSThisType: readonly never[];
3476
- TSUndefinedKeyword: readonly never[];
3477
- TSUnknownKeyword: readonly never[];
3478
- TSVoidKeyword: readonly never[];
3479
- AccessorProperty: readonly string[];
3480
- ArrayExpression: readonly string[];
3481
- ArrayPattern: readonly string[];
3482
- ArrowFunctionExpression: readonly string[];
3483
- AssignmentExpression: readonly string[];
3484
- AssignmentPattern: readonly string[];
3485
- AwaitExpression: readonly string[];
3486
- BinaryExpression: readonly string[];
3487
- BlockStatement: readonly string[];
3488
- BreakStatement: readonly string[];
3489
- CallExpression: readonly string[];
3490
- CatchClause: readonly string[];
3491
- ChainExpression: readonly string[];
3492
- ClassBody: readonly string[];
3493
- ClassDeclaration: readonly string[];
3494
- ClassExpression: readonly string[];
3495
- ConditionalExpression: readonly string[];
3496
- ContinueStatement: readonly string[];
3497
- Decorator: readonly string[];
3498
- DoWhileStatement: readonly string[];
3499
- ExportAllDeclaration: readonly string[];
3500
- ExportDefaultDeclaration: readonly string[];
3501
- ExportNamedDeclaration: readonly string[];
3502
- ExportSpecifier: readonly string[];
3503
- ExpressionStatement: readonly string[];
3504
- ForInStatement: readonly string[];
3505
- ForOfStatement: readonly string[];
3506
- ForStatement: readonly string[];
3507
- FunctionDeclaration: readonly string[];
3508
- FunctionExpression: readonly string[];
3509
- Identifier: readonly string[];
3510
- IfStatement: readonly string[];
3511
- ImportAttribute: readonly string[];
3512
- ImportDeclaration: readonly string[];
3513
- ImportDefaultSpecifier: readonly string[];
3514
- ImportExpression: readonly string[];
3515
- ImportNamespaceSpecifier: readonly string[];
3516
- ImportSpecifier: readonly string[];
3517
- LabeledStatement: readonly string[];
3518
- LogicalExpression: readonly string[];
3519
- MemberExpression: readonly string[];
3520
- MetaProperty: readonly string[];
3521
- MethodDefinition: readonly string[];
3522
- NewExpression: readonly string[];
3523
- ObjectExpression: readonly string[];
3524
- ObjectPattern: readonly string[];
3525
- ParenthesizedExpression: readonly string[];
3526
- Program: readonly string[];
3527
- Property: readonly string[];
3528
- PropertyDefinition: readonly string[];
3529
- RestElement: readonly string[];
3530
- ReturnStatement: readonly string[];
3531
- SequenceExpression: readonly string[];
3532
- SpreadElement: readonly string[];
3533
- StaticBlock: readonly string[];
3534
- SwitchCase: readonly string[];
3535
- SwitchStatement: readonly string[];
3536
- TaggedTemplateExpression: readonly string[];
3537
- TemplateLiteral: readonly string[];
3538
- ThrowStatement: readonly string[];
3539
- TryStatement: readonly string[];
3540
- UnaryExpression: readonly string[];
3541
- UpdateExpression: readonly string[];
3542
- V8IntrinsicExpression: readonly string[];
3543
- VariableDeclaration: readonly string[];
3544
- VariableDeclarator: readonly string[];
3545
- WhileStatement: readonly string[];
3546
- WithStatement: readonly string[];
3547
- YieldExpression: readonly string[];
3548
- JSXAttribute: readonly string[];
3549
- JSXClosingElement: readonly string[];
3550
- JSXElement: readonly string[];
3551
- JSXExpressionContainer: readonly string[];
3552
- JSXFragment: readonly string[];
3553
- JSXMemberExpression: readonly string[];
3554
- JSXNamespacedName: readonly string[];
3555
- JSXOpeningElement: readonly string[];
3556
- JSXSpreadAttribute: readonly string[];
3557
- JSXSpreadChild: readonly string[];
3558
- TSAbstractAccessorProperty: readonly string[];
3559
- TSAbstractMethodDefinition: readonly string[];
3560
- TSAbstractPropertyDefinition: readonly string[];
3561
- TSArrayType: readonly string[];
3562
- TSAsExpression: readonly string[];
3563
- TSCallSignatureDeclaration: readonly string[];
3564
- TSClassImplements: readonly string[];
3565
- TSConditionalType: readonly string[];
3566
- TSConstructSignatureDeclaration: readonly string[];
3567
- TSConstructorType: readonly string[];
3568
- TSDeclareFunction: readonly string[];
3569
- TSEmptyBodyFunctionExpression: readonly string[];
3570
- TSEnumBody: readonly string[];
3571
- TSEnumDeclaration: readonly string[];
3572
- TSEnumMember: readonly string[];
3573
- TSExportAssignment: readonly string[];
3574
- TSExternalModuleReference: readonly string[];
3575
- TSFunctionType: readonly string[];
3576
- TSImportEqualsDeclaration: readonly string[];
3577
- TSImportType: readonly string[];
3578
- TSIndexSignature: readonly string[];
3579
- TSIndexedAccessType: readonly string[];
3580
- TSInferType: readonly string[];
3581
- TSInstantiationExpression: readonly string[];
3582
- TSInterfaceBody: readonly string[];
3583
- TSInterfaceDeclaration: readonly string[];
3584
- TSInterfaceHeritage: readonly string[];
3585
- TSIntersectionType: readonly string[];
3586
- TSJSDocNonNullableType: readonly string[];
3587
- TSJSDocNullableType: readonly string[];
3588
- TSLiteralType: readonly string[];
3589
- TSMappedType: readonly string[];
3590
- TSMethodSignature: readonly string[];
3591
- TSModuleBlock: readonly string[];
3592
- TSModuleDeclaration: readonly string[];
3593
- TSNamedTupleMember: readonly string[];
3594
- TSNamespaceExportDeclaration: readonly string[];
3595
- TSNonNullExpression: readonly string[];
3596
- TSOptionalType: readonly string[];
3597
- TSParameterProperty: readonly string[];
3598
- TSParenthesizedType: readonly string[];
3599
- TSPropertySignature: readonly string[];
3600
- TSQualifiedName: readonly string[];
3601
- TSRestType: readonly string[];
3602
- TSSatisfiesExpression: readonly string[];
3603
- TSTemplateLiteralType: readonly string[];
3604
- TSTupleType: readonly string[];
3605
- TSTypeAliasDeclaration: readonly string[];
3606
- TSTypeAnnotation: readonly string[];
3607
- TSTypeAssertion: readonly string[];
3608
- TSTypeLiteral: readonly string[];
3609
- TSTypeOperator: readonly string[];
3610
- TSTypeParameter: readonly string[];
3611
- TSTypeParameterDeclaration: readonly string[];
3612
- TSTypeParameterInstantiation: readonly string[];
3613
- TSTypePredicate: readonly string[];
3614
- TSTypeQuery: readonly string[];
3615
- TSTypeReference: readonly string[];
3616
- TSUnionType: readonly string[];
3617
- }>;
3618
- /**
3619
- * Ast node types.
3620
- */
3621
- readonly Syntax: Readonly<Record<string, string>>;
3622
- /**
3623
- * Latest ECMAScript version supported by parser.
3624
- */
3625
- latestEcmaVersion: 17;
3626
- /**
3627
- * ECMAScript versions supported by parser.
3628
- */
3629
- supportedEcmaVersions: readonly number[];
3630
- }>;
3631
- /**
3632
- * Parser options used to parse the file being linted.
3633
- */
3634
- parserOptions: Readonly<{
3635
- /**
3636
- * Source type of the file being linted.
3637
- */
3638
- readonly sourceType: ModuleKind;
3639
- /**
3640
- * ECMA features.
3641
- */
3642
- ecmaFeatures: Readonly<{
3643
- /**
3644
- * `true` if file was parsed as JSX.
3645
- */
3646
- readonly jsx: boolean;
3647
- /**
3648
- * `true` if file was parsed with top-level `return` statements allowed.
3649
- */
3650
- readonly globalReturn: boolean;
3651
- /**
3652
- * `true` if file was parsed as strict mode code.
3653
- */
3654
- readonly impliedStrict: boolean;
3655
- }>;
3656
- }>;
3657
- /**
3658
- * Globals defined for the file being linted.
3659
- */
3660
- readonly globals: Readonly<Globals$1>;
3661
- /**
3662
- * Environments defined for the file being linted.
3663
- */
3664
- readonly env: Readonly<Envs$1>;
3665
- };
3666
- /**
3667
- * Language options used when parsing a file.
3668
- */
3669
- type LanguageOptions$1 = Readonly<typeof LANGUAGE_OPTIONS>;
3670
3443
  declare const FILE_CONTEXT: Readonly<{
3671
3444
  /**
3672
3445
  * Absolute path of the file being linted.
@@ -3701,7 +3474,61 @@ declare const FILE_CONTEXT: Readonly<{
3701
3474
  /**
3702
3475
  * Source code of the file being linted.
3703
3476
  */
3704
- readonly sourceCode: SourceCode;
3477
+ readonly sourceCode: Readonly<{
3478
+ readonly text: string;
3479
+ readonly hasBOM: boolean;
3480
+ readonly ast: Program;
3481
+ isESTree: true;
3482
+ readonly scopeManager: Readonly<{
3483
+ readonly scopes: Scope[];
3484
+ readonly globalScope: Scope | null;
3485
+ getDeclaredVariables(node: Node): Variable[];
3486
+ acquire(node: Node, inner?: boolean): Scope | null;
3487
+ }>;
3488
+ readonly visitorKeys: Readonly<Record<string, readonly string[]>>;
3489
+ parserServices: Readonly<Record<string, unknown>>;
3490
+ readonly lines: string[];
3491
+ readonly lineStartIndices: number[];
3492
+ readonly tokensAndComments: (TokenType | CommentType)[];
3493
+ getText(node?: Ranged | null, beforeCount?: number | null, afterCount?: number | null): string;
3494
+ getAncestors(node: Node$1): Node$1[];
3495
+ getLines(): string[];
3496
+ getRange: typeof getRange;
3497
+ getLoc: typeof getLoc;
3498
+ getNodeByRangeIndex: typeof getNodeByRangeIndex;
3499
+ getLocFromIndex: typeof getLineColumnFromOffset;
3500
+ getIndexFromLoc: typeof getOffsetFromLineColumn;
3501
+ getAllComments: typeof getAllComments;
3502
+ getCommentsBefore: typeof getCommentsBefore;
3503
+ getCommentsAfter: typeof getCommentsAfter;
3504
+ getCommentsInside: typeof getCommentsInside;
3505
+ commentsExistBetween: typeof commentsExistBetween;
3506
+ getJSDocComment: typeof getJSDocComment;
3507
+ isGlobalReference: typeof isGlobalReference;
3508
+ getDeclaredVariables: typeof getDeclaredVariables;
3509
+ getScope: typeof getScope;
3510
+ markVariableAsUsed: typeof markVariableAsUsed;
3511
+ getTokens: typeof getTokens;
3512
+ getFirstToken: typeof getFirstToken;
3513
+ getFirstTokens: typeof getFirstTokens;
3514
+ getLastToken: typeof getLastToken;
3515
+ getLastTokens: typeof getLastTokens;
3516
+ getTokenBefore: typeof getTokenBefore;
3517
+ getTokenOrCommentBefore: typeof getTokenOrCommentBefore;
3518
+ getTokensBefore: typeof getTokensBefore;
3519
+ getTokenAfter: typeof getTokenAfter;
3520
+ getTokenOrCommentAfter: typeof getTokenOrCommentAfter;
3521
+ getTokensAfter: typeof getTokensAfter;
3522
+ getTokensBetween: typeof getTokensBetween;
3523
+ getFirstTokenBetween: typeof getFirstTokenBetween;
3524
+ getFirstTokensBetween: typeof getFirstTokensBetween;
3525
+ getLastTokenBetween: typeof getLastTokenBetween;
3526
+ getLastTokensBetween: typeof getLastTokensBetween;
3527
+ getTokenByRangeStart: typeof getTokenByRangeStart;
3528
+ isSpaceBetween: typeof isSpaceBetween;
3529
+ isSpaceBetweenTokens: typeof isSpaceBetweenTokens;
3530
+ getDisableDirectives: typeof getDisableDirectives;
3531
+ }>;
3705
3532
  /**
3706
3533
  * Get source code of the file being linted.
3707
3534
  * @returns Source code of the file being linted.
@@ -3711,11 +3538,256 @@ declare const FILE_CONTEXT: Readonly<{
3711
3538
  /**
3712
3539
  * Language options used when parsing this file.
3713
3540
  */
3714
- readonly languageOptions: LanguageOptions$1;
3541
+ readonly languageOptions: Readonly<{
3542
+ /**
3543
+ * Source type of the file being linted.
3544
+ */
3545
+ readonly sourceType: ModuleKind;
3546
+ /**
3547
+ * ECMAScript version of the file being linted.
3548
+ */
3549
+ ecmaVersion: number;
3550
+ /**
3551
+ * Parser used to parse the file being linted.
3552
+ */
3553
+ parser: Readonly<{
3554
+ /**
3555
+ * Parser name.
3556
+ */
3557
+ name: "oxlint";
3558
+ /**
3559
+ * Parser version.
3560
+ */
3561
+ version: string;
3562
+ /**
3563
+ * Parse code into an AST.
3564
+ * @param code - Code to parse
3565
+ * @param options? - Parser options
3566
+ * @returns AST
3567
+ */
3568
+ parse(code: string, options?: Record<string, unknown>): Program;
3569
+ /**
3570
+ * Visitor keys for AST nodes.
3571
+ */
3572
+ VisitorKeys: Readonly<{
3573
+ DebuggerStatement: readonly never[];
3574
+ EmptyStatement: readonly never[];
3575
+ Literal: readonly never[];
3576
+ PrivateIdentifier: readonly never[];
3577
+ Super: readonly never[];
3578
+ TemplateElement: readonly never[];
3579
+ ThisExpression: readonly never[];
3580
+ JSXClosingFragment: readonly never[];
3581
+ JSXEmptyExpression: readonly never[];
3582
+ JSXIdentifier: readonly never[];
3583
+ JSXOpeningFragment: readonly never[];
3584
+ JSXText: readonly never[];
3585
+ TSAnyKeyword: readonly never[];
3586
+ TSBigIntKeyword: readonly never[];
3587
+ TSBooleanKeyword: readonly never[];
3588
+ TSIntrinsicKeyword: readonly never[];
3589
+ TSJSDocUnknownType: readonly never[];
3590
+ TSNeverKeyword: readonly never[];
3591
+ TSNullKeyword: readonly never[];
3592
+ TSNumberKeyword: readonly never[];
3593
+ TSObjectKeyword: readonly never[];
3594
+ TSStringKeyword: readonly never[];
3595
+ TSSymbolKeyword: readonly never[];
3596
+ TSThisType: readonly never[];
3597
+ TSUndefinedKeyword: readonly never[];
3598
+ TSUnknownKeyword: readonly never[];
3599
+ TSVoidKeyword: readonly never[];
3600
+ AccessorProperty: readonly string[];
3601
+ ArrayExpression: readonly string[];
3602
+ ArrayPattern: readonly string[];
3603
+ ArrowFunctionExpression: readonly string[];
3604
+ AssignmentExpression: readonly string[];
3605
+ AssignmentPattern: readonly string[];
3606
+ AwaitExpression: readonly string[];
3607
+ BinaryExpression: readonly string[];
3608
+ BlockStatement: readonly string[];
3609
+ BreakStatement: readonly string[];
3610
+ CallExpression: readonly string[];
3611
+ CatchClause: readonly string[];
3612
+ ChainExpression: readonly string[];
3613
+ ClassBody: readonly string[];
3614
+ ClassDeclaration: readonly string[];
3615
+ ClassExpression: readonly string[];
3616
+ ConditionalExpression: readonly string[];
3617
+ ContinueStatement: readonly string[];
3618
+ Decorator: readonly string[];
3619
+ DoWhileStatement: readonly string[];
3620
+ ExportAllDeclaration: readonly string[];
3621
+ ExportDefaultDeclaration: readonly string[];
3622
+ ExportNamedDeclaration: readonly string[];
3623
+ ExportSpecifier: readonly string[];
3624
+ ExpressionStatement: readonly string[];
3625
+ ForInStatement: readonly string[];
3626
+ ForOfStatement: readonly string[];
3627
+ ForStatement: readonly string[];
3628
+ FunctionDeclaration: readonly string[];
3629
+ FunctionExpression: readonly string[];
3630
+ Identifier: readonly string[];
3631
+ IfStatement: readonly string[];
3632
+ ImportAttribute: readonly string[];
3633
+ ImportDeclaration: readonly string[];
3634
+ ImportDefaultSpecifier: readonly string[];
3635
+ ImportExpression: readonly string[];
3636
+ ImportNamespaceSpecifier: readonly string[];
3637
+ ImportSpecifier: readonly string[];
3638
+ LabeledStatement: readonly string[];
3639
+ LogicalExpression: readonly string[];
3640
+ MemberExpression: readonly string[];
3641
+ MetaProperty: readonly string[];
3642
+ MethodDefinition: readonly string[];
3643
+ NewExpression: readonly string[];
3644
+ ObjectExpression: readonly string[];
3645
+ ObjectPattern: readonly string[];
3646
+ ParenthesizedExpression: readonly string[];
3647
+ Program: readonly string[];
3648
+ Property: readonly string[];
3649
+ PropertyDefinition: readonly string[];
3650
+ RestElement: readonly string[];
3651
+ ReturnStatement: readonly string[];
3652
+ SequenceExpression: readonly string[];
3653
+ SpreadElement: readonly string[];
3654
+ StaticBlock: readonly string[];
3655
+ SwitchCase: readonly string[];
3656
+ SwitchStatement: readonly string[];
3657
+ TaggedTemplateExpression: readonly string[];
3658
+ TemplateLiteral: readonly string[];
3659
+ ThrowStatement: readonly string[];
3660
+ TryStatement: readonly string[];
3661
+ UnaryExpression: readonly string[];
3662
+ UpdateExpression: readonly string[];
3663
+ V8IntrinsicExpression: readonly string[];
3664
+ VariableDeclaration: readonly string[];
3665
+ VariableDeclarator: readonly string[];
3666
+ WhileStatement: readonly string[];
3667
+ WithStatement: readonly string[];
3668
+ YieldExpression: readonly string[];
3669
+ JSXAttribute: readonly string[];
3670
+ JSXClosingElement: readonly string[];
3671
+ JSXElement: readonly string[];
3672
+ JSXExpressionContainer: readonly string[];
3673
+ JSXFragment: readonly string[];
3674
+ JSXMemberExpression: readonly string[];
3675
+ JSXNamespacedName: readonly string[];
3676
+ JSXOpeningElement: readonly string[];
3677
+ JSXSpreadAttribute: readonly string[];
3678
+ JSXSpreadChild: readonly string[];
3679
+ TSAbstractAccessorProperty: readonly string[];
3680
+ TSAbstractMethodDefinition: readonly string[];
3681
+ TSAbstractPropertyDefinition: readonly string[];
3682
+ TSArrayType: readonly string[];
3683
+ TSAsExpression: readonly string[];
3684
+ TSCallSignatureDeclaration: readonly string[];
3685
+ TSClassImplements: readonly string[];
3686
+ TSConditionalType: readonly string[];
3687
+ TSConstructSignatureDeclaration: readonly string[];
3688
+ TSConstructorType: readonly string[];
3689
+ TSDeclareFunction: readonly string[];
3690
+ TSEmptyBodyFunctionExpression: readonly string[];
3691
+ TSEnumBody: readonly string[];
3692
+ TSEnumDeclaration: readonly string[];
3693
+ TSEnumMember: readonly string[];
3694
+ TSExportAssignment: readonly string[];
3695
+ TSExternalModuleReference: readonly string[];
3696
+ TSFunctionType: readonly string[];
3697
+ TSImportEqualsDeclaration: readonly string[];
3698
+ TSImportType: readonly string[];
3699
+ TSIndexSignature: readonly string[];
3700
+ TSIndexedAccessType: readonly string[];
3701
+ TSInferType: readonly string[];
3702
+ TSInstantiationExpression: readonly string[];
3703
+ TSInterfaceBody: readonly string[];
3704
+ TSInterfaceDeclaration: readonly string[];
3705
+ TSInterfaceHeritage: readonly string[];
3706
+ TSIntersectionType: readonly string[];
3707
+ TSJSDocNonNullableType: readonly string[];
3708
+ TSJSDocNullableType: readonly string[];
3709
+ TSLiteralType: readonly string[];
3710
+ TSMappedType: readonly string[];
3711
+ TSMethodSignature: readonly string[];
3712
+ TSModuleBlock: readonly string[];
3713
+ TSModuleDeclaration: readonly string[];
3714
+ TSNamedTupleMember: readonly string[];
3715
+ TSNamespaceExportDeclaration: readonly string[];
3716
+ TSNonNullExpression: readonly string[];
3717
+ TSOptionalType: readonly string[];
3718
+ TSParameterProperty: readonly string[];
3719
+ TSParenthesizedType: readonly string[];
3720
+ TSPropertySignature: readonly string[];
3721
+ TSQualifiedName: readonly string[];
3722
+ TSRestType: readonly string[];
3723
+ TSSatisfiesExpression: readonly string[];
3724
+ TSTemplateLiteralType: readonly string[];
3725
+ TSTupleType: readonly string[];
3726
+ TSTypeAliasDeclaration: readonly string[];
3727
+ TSTypeAnnotation: readonly string[];
3728
+ TSTypeAssertion: readonly string[];
3729
+ TSTypeLiteral: readonly string[];
3730
+ TSTypeOperator: readonly string[];
3731
+ TSTypeParameter: readonly string[];
3732
+ TSTypeParameterDeclaration: readonly string[];
3733
+ TSTypeParameterInstantiation: readonly string[];
3734
+ TSTypePredicate: readonly string[];
3735
+ TSTypeQuery: readonly string[];
3736
+ TSTypeReference: readonly string[];
3737
+ TSUnionType: readonly string[];
3738
+ }>;
3739
+ /**
3740
+ * Ast node types.
3741
+ */
3742
+ readonly Syntax: Readonly<Record<string, string>>;
3743
+ /**
3744
+ * Latest ECMAScript version supported by parser.
3745
+ */
3746
+ latestEcmaVersion: 17;
3747
+ /**
3748
+ * ECMAScript versions supported by parser.
3749
+ */
3750
+ supportedEcmaVersions: readonly number[];
3751
+ }>;
3752
+ /**
3753
+ * Parser options used to parse the file being linted.
3754
+ */
3755
+ parserOptions: Readonly<{
3756
+ /**
3757
+ * Source type of the file being linted.
3758
+ */
3759
+ readonly sourceType: ModuleKind;
3760
+ /**
3761
+ * ECMA features.
3762
+ */
3763
+ ecmaFeatures: Readonly<{
3764
+ /**
3765
+ * `true` if file was parsed as JSX.
3766
+ */
3767
+ readonly jsx: boolean;
3768
+ /**
3769
+ * `true` if file was parsed with top-level `return` statements allowed.
3770
+ */
3771
+ readonly globalReturn: boolean;
3772
+ /**
3773
+ * `true` if file was parsed as strict mode code.
3774
+ */
3775
+ readonly impliedStrict: boolean;
3776
+ }>;
3777
+ }>;
3778
+ /**
3779
+ * Globals defined for the file being linted.
3780
+ */
3781
+ readonly globals: Readonly<Globals$1>;
3782
+ /**
3783
+ * Environments defined for the file being linted.
3784
+ */
3785
+ readonly env: Readonly<Envs$1>;
3786
+ }>;
3715
3787
  /**
3716
3788
  * Settings for the file being linted.
3717
3789
  */
3718
- readonly settings: Readonly<Settings>;
3790
+ readonly settings: Readonly<JsonObject>;
3719
3791
  /**
3720
3792
  * Create a new object with the current object as the prototype and
3721
3793
  * the specified properties as its own properties.
@@ -3811,11 +3883,10 @@ interface RuleMeta {
3811
3883
  */
3812
3884
  deprecated?: boolean | RuleDeprecatedInfo;
3813
3885
  /**
3814
- * Information about available replacements for the rule.
3815
- * This may be an empty array to explicitly state there is no replacement.
3886
+ * Name of the rule(s) this rule was replaced by, if it was deprecated.
3816
3887
  * @deprecated Use `deprecated.replacedBy` instead.
3817
3888
  */
3818
- replacedBy?: RuleReplacedByInfo[];
3889
+ replacedBy?: readonly string[];
3819
3890
  }
3820
3891
  /**
3821
3892
  * Rule documentation.
@@ -3935,6 +4006,14 @@ interface CreateOnceRule {
3935
4006
  createOnce: (context: Context) => VisitorWithHooks;
3936
4007
  }
3937
4008
  //#endregion
4009
+ //#region src-js/plugins/settings.d.ts
4010
+ /**
4011
+ * Settings for the file being linted.
4012
+ *
4013
+ * Settings are deserialized from JSON, so can only contain JSON-compatible values.
4014
+ */
4015
+ type Settings = JsonObject;
4016
+ //#endregion
3938
4017
  //#region src-js/package/rule_tester.d.ts
3939
4018
  type DescribeFn = (text: string, fn: () => void) => void;
3940
4019
  type ItFn = ((text: string, fn: () => void) => void) & {
@@ -3953,7 +4032,6 @@ interface Config {
3953
4032
  *
3954
4033
  * If `true`:
3955
4034
  * - Column offsets in diagnostics are incremented by 1.
3956
- * - Fixes which are adjacent to each other are considered overlapping, and only the first fix is applied.
3957
4035
  * - Defaults `sourceType` to "module" if not provided (otherwise default is "unambiguous").
3958
4036
  * - Disallows `sourceType: "unambiguous"`.
3959
4037
  * - Allows `null` as property value for `globals`.