oxlint 1.63.0 → 1.64.0

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