ast-types 0.14.0 → 0.15.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (48) hide show
  1. package/.github/workflows/main.yml +1 -1
  2. package/README.md +1 -1
  3. package/def/babel-core.js +19 -4
  4. package/def/babel.js +15 -2
  5. package/def/core.js +7 -6
  6. package/def/es-proposals.js +32 -4
  7. package/def/es2016.js +6 -12
  8. package/def/es2017.js +3 -3
  9. package/def/es2018.js +3 -3
  10. package/def/es2019.js +3 -3
  11. package/def/es2020.js +23 -12
  12. package/def/{es7.d.ts → es2021.d.ts} +0 -0
  13. package/def/es2021.js +13 -0
  14. package/def/es2022.d.ts +2 -0
  15. package/def/es2022.js +16 -0
  16. package/def/es6.js +3 -3
  17. package/def/esprima.js +4 -4
  18. package/def/flow.js +17 -8
  19. package/def/jsx.js +4 -4
  20. package/def/operators/core.d.ts +5 -0
  21. package/def/operators/core.js +25 -0
  22. package/def/operators/es2016.d.ts +5 -0
  23. package/def/operators/es2016.js +19 -0
  24. package/def/operators/es2020.d.ts +5 -0
  25. package/def/operators/es2020.js +15 -0
  26. package/def/operators/es2021.d.ts +5 -0
  27. package/def/operators/es2021.js +18 -0
  28. package/def/type-annotations.js +2 -2
  29. package/def/typescript.js +11 -4
  30. package/fork.js +5 -5
  31. package/gen/builders.d.ts +194 -70
  32. package/gen/kinds.d.ts +28 -15
  33. package/gen/namedTypes.d.ts +132 -46
  34. package/gen/visitor.d.ts +18 -5
  35. package/lib/equiv.js +1 -1
  36. package/lib/node-path.js +3 -3
  37. package/lib/path-visitor.js +2 -2
  38. package/lib/path.d.ts +3 -3
  39. package/lib/path.js +1 -1
  40. package/lib/scope.d.ts +3 -2
  41. package/lib/scope.js +63 -26
  42. package/lib/shared.js +1 -1
  43. package/lib/types.js +6 -6
  44. package/main.js +9 -25
  45. package/package.json +15 -15
  46. package/def/core-operators.d.ts +0 -3
  47. package/def/core-operators.js +0 -20
  48. package/def/es7.js +0 -34
@@ -220,11 +220,14 @@ export declare namespace namedTypes {
220
220
  }
221
221
  interface AssignmentExpression extends Omit<Expression, "type"> {
222
222
  type: "AssignmentExpression";
223
- operator: "=" | "+=" | "-=" | "*=" | "/=" | "%=" | "<<=" | ">>=" | ">>>=" | "|=" | "^=" | "&=" | "**=";
223
+ operator: "=" | "+=" | "-=" | "*=" | "/=" | "%=" | "<<=" | ">>=" | ">>>=" | "|=" | "^=" | "&=" | "**=" | "||=" | "&&=" | "??=";
224
224
  left: K.PatternKind | K.MemberExpressionKind;
225
225
  right: K.ExpressionKind;
226
226
  }
227
- interface MemberExpression extends Omit<Expression, "type"> {
227
+ interface ChainElement extends Node {
228
+ optional?: boolean;
229
+ }
230
+ interface MemberExpression extends Omit<Expression, "type">, Omit<ChainElement, "type"> {
228
231
  type: "MemberExpression";
229
232
  object: K.ExpressionKind;
230
233
  property: K.IdentifierKind | K.ExpressionKind;
@@ -254,7 +257,7 @@ export declare namespace namedTypes {
254
257
  arguments: (K.ExpressionKind | K.SpreadElementKind)[];
255
258
  typeArguments?: null | K.TypeParameterInstantiationKind;
256
259
  }
257
- interface CallExpression extends Omit<Expression, "type"> {
260
+ interface CallExpression extends Omit<Expression, "type">, Omit<ChainElement, "type"> {
258
261
  type: "CallExpression";
259
262
  callee: K.ExpressionKind;
260
263
  arguments: (K.ExpressionKind | K.SpreadElementKind)[];
@@ -416,12 +419,14 @@ export declare namespace namedTypes {
416
419
  specifiers?: (K.ImportSpecifierKind | K.ImportNamespaceSpecifierKind | K.ImportDefaultSpecifierKind)[];
417
420
  source: K.LiteralKind;
418
421
  importKind?: "value" | "type" | "typeof";
422
+ assertions?: K.ImportAttributeKind[];
419
423
  }
420
424
  interface ExportNamedDeclaration extends Omit<Declaration, "type"> {
421
425
  type: "ExportNamedDeclaration";
422
426
  declaration: K.DeclarationKind | null;
423
427
  specifiers?: K.ExportSpecifierKind[];
424
428
  source?: K.LiteralKind | null;
429
+ assertions?: K.ImportAttributeKind[];
425
430
  }
426
431
  interface ExportSpecifier extends Omit<ModuleSpecifier, "type"> {
427
432
  type: "ExportSpecifier";
@@ -435,6 +440,7 @@ export declare namespace namedTypes {
435
440
  type: "ExportAllDeclaration";
436
441
  source: K.LiteralKind;
437
442
  exported: K.IdentifierKind | null;
443
+ assertions?: K.ImportAttributeKind[];
438
444
  }
439
445
  interface TaggedTemplateExpression extends Omit<Expression, "type"> {
440
446
  type: "TaggedTemplateExpression";
@@ -444,7 +450,7 @@ export declare namespace namedTypes {
444
450
  interface TemplateLiteral extends Omit<Expression, "type"> {
445
451
  type: "TemplateLiteral";
446
452
  quasis: K.TemplateElementKind[];
447
- expressions: K.ExpressionKind[];
453
+ expressions: K.ExpressionKind[] | K.TSTypeKind[];
448
454
  }
449
455
  interface TemplateElement extends Omit<Node, "type"> {
450
456
  type: "TemplateElement";
@@ -476,14 +482,64 @@ export declare namespace namedTypes {
476
482
  type: "ImportExpression";
477
483
  source: K.ExpressionKind;
478
484
  }
479
- interface OptionalMemberExpression extends Omit<MemberExpression, "type"> {
480
- type: "OptionalMemberExpression";
481
- optional?: boolean;
485
+ interface ChainExpression extends Omit<Expression, "type"> {
486
+ type: "ChainExpression";
487
+ expression: K.ChainElementKind;
482
488
  }
483
- interface OptionalCallExpression extends Omit<CallExpression, "type"> {
489
+ interface OptionalCallExpression extends Omit<CallExpression, "type" | "optional"> {
484
490
  type: "OptionalCallExpression";
485
491
  optional?: boolean;
486
492
  }
493
+ interface OptionalMemberExpression extends Omit<MemberExpression, "type" | "optional"> {
494
+ type: "OptionalMemberExpression";
495
+ optional?: boolean;
496
+ }
497
+ interface StaticBlock extends Omit<Declaration, "type"> {
498
+ type: "StaticBlock";
499
+ body: K.StatementKind[];
500
+ }
501
+ interface Decorator extends Omit<Node, "type"> {
502
+ type: "Decorator";
503
+ expression: K.ExpressionKind;
504
+ }
505
+ interface PrivateName extends Omit<Expression, "type">, Omit<Pattern, "type"> {
506
+ type: "PrivateName";
507
+ id: K.IdentifierKind;
508
+ }
509
+ interface ClassPrivateProperty extends Omit<ClassProperty, "type" | "key" | "value"> {
510
+ type: "ClassPrivateProperty";
511
+ key: K.PrivateNameKind;
512
+ value?: K.ExpressionKind | null;
513
+ }
514
+ interface ImportAttribute extends Omit<Node, "type"> {
515
+ type: "ImportAttribute";
516
+ key: K.IdentifierKind | K.LiteralKind;
517
+ value: K.ExpressionKind;
518
+ }
519
+ interface RecordExpression extends Omit<Expression, "type"> {
520
+ type: "RecordExpression";
521
+ properties: (K.ObjectPropertyKind | K.ObjectMethodKind | K.SpreadElementKind)[];
522
+ }
523
+ interface ObjectMethod extends Omit<Node, "type">, Omit<Function, "type" | "params" | "body" | "generator" | "async"> {
524
+ type: "ObjectMethod";
525
+ kind: "method" | "get" | "set";
526
+ key: K.LiteralKind | K.IdentifierKind | K.ExpressionKind;
527
+ params: K.PatternKind[];
528
+ body: K.BlockStatementKind;
529
+ computed?: boolean;
530
+ generator?: boolean;
531
+ async?: boolean;
532
+ accessibility?: K.LiteralKind | null;
533
+ decorators?: K.DecoratorKind[] | null;
534
+ }
535
+ interface TupleExpression extends Omit<Expression, "type"> {
536
+ type: "TupleExpression";
537
+ elements: (K.ExpressionKind | K.SpreadElementKind | null)[];
538
+ }
539
+ interface ModuleExpression extends Omit<Node, "type"> {
540
+ type: "ModuleExpression";
541
+ body: K.ProgramKind;
542
+ }
487
543
  interface JSXAttribute extends Omit<Node, "type"> {
488
544
  type: "JSXAttribute";
489
545
  name: K.JSXIdentifierKind | K.JSXNamespacedNameKind;
@@ -555,19 +611,6 @@ export declare namespace namedTypes {
555
611
  interface JSXClosingFragment extends Omit<Node, "type"> {
556
612
  type: "JSXClosingFragment";
557
613
  }
558
- interface Decorator extends Omit<Node, "type"> {
559
- type: "Decorator";
560
- expression: K.ExpressionKind;
561
- }
562
- interface PrivateName extends Omit<Expression, "type">, Omit<Pattern, "type"> {
563
- type: "PrivateName";
564
- id: K.IdentifierKind;
565
- }
566
- interface ClassPrivateProperty extends Omit<ClassProperty, "type" | "key" | "value"> {
567
- type: "ClassPrivateProperty";
568
- key: K.PrivateNameKind;
569
- value?: K.ExpressionKind | null;
570
- }
571
614
  interface TypeParameterDeclaration extends Omit<Node, "type"> {
572
615
  type: "TypeParameterDeclaration";
573
616
  params: K.TypeParameterKind[];
@@ -712,12 +755,12 @@ export declare namespace namedTypes {
712
755
  argument: K.FlowTypeKind;
713
756
  }
714
757
  interface ObjectTypeIndexer extends Omit<Node, "type"> {
715
- id: K.IdentifierKind;
716
- static: boolean;
717
758
  type: "ObjectTypeIndexer";
759
+ id: K.IdentifierKind;
718
760
  key: K.FlowTypeKind;
719
761
  value: K.FlowTypeKind;
720
762
  variance?: K.VarianceKind | "plus" | "minus" | null;
763
+ static?: boolean;
721
764
  }
722
765
  interface ObjectTypeCallProperty extends Omit<Node, "type"> {
723
766
  type: "ObjectTypeCallProperty";
@@ -751,6 +794,17 @@ export declare namespace namedTypes {
751
794
  object: K.IdentifierKind;
752
795
  property: K.MemberTypeAnnotationKind | K.GenericTypeAnnotationKind;
753
796
  }
797
+ interface IndexedAccessType extends Omit<FlowType, "type"> {
798
+ type: "IndexedAccessType";
799
+ objectType: K.FlowTypeKind;
800
+ indexType: K.FlowTypeKind;
801
+ }
802
+ interface OptionalIndexedAccessType extends Omit<FlowType, "type"> {
803
+ type: "OptionalIndexedAccessType";
804
+ objectType: K.FlowTypeKind;
805
+ indexType: K.FlowTypeKind;
806
+ optional: boolean;
807
+ }
754
808
  interface UnionTypeAnnotation extends Omit<FlowType, "type"> {
755
809
  type: "UnionTypeAnnotation";
756
810
  types: K.FlowTypeKind[];
@@ -982,6 +1036,14 @@ export declare namespace namedTypes {
982
1036
  raw: string;
983
1037
  };
984
1038
  }
1039
+ interface DecimalLiteral extends Omit<Literal, "type" | "value"> {
1040
+ type: "DecimalLiteral";
1041
+ value: string;
1042
+ extra?: {
1043
+ rawValue: string;
1044
+ raw: string;
1045
+ };
1046
+ }
985
1047
  interface NullLiteral extends Omit<Literal, "type" | "value"> {
986
1048
  type: "NullLiteral";
987
1049
  value?: null;
@@ -996,18 +1058,6 @@ export declare namespace namedTypes {
996
1058
  flags: string;
997
1059
  value?: RegExp;
998
1060
  }
999
- interface ObjectMethod extends Omit<Node, "type">, Omit<Function, "type" | "params" | "body" | "generator" | "async"> {
1000
- type: "ObjectMethod";
1001
- kind: "method" | "get" | "set";
1002
- key: K.LiteralKind | K.IdentifierKind | K.ExpressionKind;
1003
- params: K.PatternKind[];
1004
- body: K.BlockStatementKind;
1005
- computed?: boolean;
1006
- generator?: boolean;
1007
- async?: boolean;
1008
- accessibility?: K.LiteralKind | null;
1009
- decorators?: K.DecoratorKind[] | null;
1010
- }
1011
1061
  interface ClassMethod extends Omit<Declaration, "type">, Omit<Function, "type" | "body"> {
1012
1062
  type: "ClassMethod";
1013
1063
  key: K.LiteralKind | K.IdentifierKind | K.ExpressionKind;
@@ -1047,6 +1097,13 @@ export declare namespace namedTypes {
1047
1097
  interface Import extends Omit<Expression, "type"> {
1048
1098
  type: "Import";
1049
1099
  }
1100
+ interface V8IntrinsicIdentifier extends Omit<Expression, "type"> {
1101
+ type: "V8IntrinsicIdentifier";
1102
+ name: string;
1103
+ }
1104
+ interface TopicReference extends Omit<Expression, "type"> {
1105
+ type: "TopicReference";
1106
+ }
1050
1107
  interface TSQualifiedName extends Omit<Node, "type"> {
1051
1108
  type: "TSQualifiedName";
1052
1109
  left: K.IdentifierKind | K.TSQualifiedNameKind;
@@ -1110,6 +1167,9 @@ export declare namespace namedTypes {
1110
1167
  interface TSVoidKeyword extends Omit<TSType, "type"> {
1111
1168
  type: "TSVoidKeyword";
1112
1169
  }
1170
+ interface TSIntrinsicKeyword extends Omit<TSType, "type"> {
1171
+ type: "TSIntrinsicKeyword";
1172
+ }
1113
1173
  interface TSThisType extends Omit<TSType, "type"> {
1114
1174
  type: "TSThisType";
1115
1175
  }
@@ -1338,7 +1398,7 @@ export declare namespace namedTypes {
1338
1398
  readonly?: boolean;
1339
1399
  parameter: K.IdentifierKind | K.AssignmentPatternKind;
1340
1400
  }
1341
- type ASTNode = File | Program | Identifier | BlockStatement | EmptyStatement | ExpressionStatement | IfStatement | LabeledStatement | BreakStatement | ContinueStatement | WithStatement | SwitchStatement | SwitchCase | ReturnStatement | ThrowStatement | TryStatement | CatchClause | WhileStatement | DoWhileStatement | ForStatement | VariableDeclaration | ForInStatement | DebuggerStatement | FunctionDeclaration | FunctionExpression | VariableDeclarator | ThisExpression | ArrayExpression | ObjectExpression | Property | Literal | SequenceExpression | UnaryExpression | BinaryExpression | AssignmentExpression | MemberExpression | UpdateExpression | LogicalExpression | ConditionalExpression | NewExpression | CallExpression | RestElement | TypeAnnotation | TSTypeAnnotation | SpreadElementPattern | ArrowFunctionExpression | ForOfStatement | YieldExpression | GeneratorExpression | ComprehensionBlock | ComprehensionExpression | ObjectProperty | PropertyPattern | ObjectPattern | ArrayPattern | SpreadElement | AssignmentPattern | MethodDefinition | ClassPropertyDefinition | ClassProperty | ClassBody | ClassDeclaration | ClassExpression | Super | ImportSpecifier | ImportDefaultSpecifier | ImportNamespaceSpecifier | ImportDeclaration | ExportNamedDeclaration | ExportSpecifier | ExportDefaultDeclaration | ExportAllDeclaration | TaggedTemplateExpression | TemplateLiteral | TemplateElement | MetaProperty | AwaitExpression | SpreadProperty | SpreadPropertyPattern | ImportExpression | OptionalMemberExpression | OptionalCallExpression | JSXAttribute | JSXIdentifier | JSXNamespacedName | JSXExpressionContainer | JSXElement | JSXFragment | JSXMemberExpression | JSXSpreadAttribute | JSXEmptyExpression | JSXText | JSXSpreadChild | JSXOpeningElement | JSXClosingElement | JSXOpeningFragment | JSXClosingFragment | Decorator | PrivateName | ClassPrivateProperty | TypeParameterDeclaration | TSTypeParameterDeclaration | TypeParameterInstantiation | TSTypeParameterInstantiation | ClassImplements | TSExpressionWithTypeArguments | AnyTypeAnnotation | EmptyTypeAnnotation | MixedTypeAnnotation | VoidTypeAnnotation | SymbolTypeAnnotation | NumberTypeAnnotation | BigIntTypeAnnotation | NumberLiteralTypeAnnotation | NumericLiteralTypeAnnotation | BigIntLiteralTypeAnnotation | StringTypeAnnotation | StringLiteralTypeAnnotation | BooleanTypeAnnotation | BooleanLiteralTypeAnnotation | NullableTypeAnnotation | NullLiteralTypeAnnotation | NullTypeAnnotation | ThisTypeAnnotation | ExistsTypeAnnotation | ExistentialTypeParam | FunctionTypeAnnotation | FunctionTypeParam | ArrayTypeAnnotation | ObjectTypeAnnotation | ObjectTypeProperty | ObjectTypeSpreadProperty | ObjectTypeIndexer | ObjectTypeCallProperty | ObjectTypeInternalSlot | Variance | QualifiedTypeIdentifier | GenericTypeAnnotation | MemberTypeAnnotation | UnionTypeAnnotation | IntersectionTypeAnnotation | TypeofTypeAnnotation | TypeParameter | InterfaceTypeAnnotation | InterfaceExtends | InterfaceDeclaration | DeclareInterface | TypeAlias | DeclareTypeAlias | OpaqueType | DeclareOpaqueType | TypeCastExpression | TupleTypeAnnotation | DeclareVariable | DeclareFunction | DeclareClass | DeclareModule | DeclareModuleExports | DeclareExportDeclaration | ExportBatchSpecifier | DeclareExportAllDeclaration | InferredPredicate | DeclaredPredicate | EnumDeclaration | EnumBooleanBody | EnumNumberBody | EnumStringBody | EnumSymbolBody | EnumBooleanMember | EnumNumberMember | EnumStringMember | EnumDefaultedMember | ExportDeclaration | Block | Line | Noop | DoExpression | BindExpression | ParenthesizedExpression | ExportNamespaceSpecifier | ExportDefaultSpecifier | CommentBlock | CommentLine | Directive | DirectiveLiteral | InterpreterDirective | StringLiteral | NumericLiteral | BigIntLiteral | NullLiteral | BooleanLiteral | RegExpLiteral | ObjectMethod | ClassMethod | ClassPrivateMethod | RestProperty | ForAwaitStatement | Import | TSQualifiedName | TSTypeReference | TSAsExpression | TSNonNullExpression | TSAnyKeyword | TSBigIntKeyword | TSBooleanKeyword | TSNeverKeyword | TSNullKeyword | TSNumberKeyword | TSObjectKeyword | TSStringKeyword | TSSymbolKeyword | TSUndefinedKeyword | TSUnknownKeyword | TSVoidKeyword | TSThisType | TSArrayType | TSLiteralType | TSUnionType | TSIntersectionType | TSConditionalType | TSInferType | TSTypeParameter | TSParenthesizedType | TSFunctionType | TSConstructorType | TSDeclareFunction | TSDeclareMethod | TSMappedType | TSTupleType | TSNamedTupleMember | TSRestType | TSOptionalType | TSIndexedAccessType | TSTypeOperator | TSIndexSignature | TSPropertySignature | TSMethodSignature | TSTypePredicate | TSCallSignatureDeclaration | TSConstructSignatureDeclaration | TSEnumMember | TSTypeQuery | TSImportType | TSTypeLiteral | TSTypeAssertion | TSEnumDeclaration | TSTypeAliasDeclaration | TSModuleBlock | TSModuleDeclaration | TSImportEqualsDeclaration | TSExternalModuleReference | TSExportAssignment | TSNamespaceExportDeclaration | TSInterfaceBody | TSInterfaceDeclaration | TSParameterProperty;
1401
+ type ASTNode = File | Program | Identifier | BlockStatement | EmptyStatement | ExpressionStatement | IfStatement | LabeledStatement | BreakStatement | ContinueStatement | WithStatement | SwitchStatement | SwitchCase | ReturnStatement | ThrowStatement | TryStatement | CatchClause | WhileStatement | DoWhileStatement | ForStatement | VariableDeclaration | ForInStatement | DebuggerStatement | FunctionDeclaration | FunctionExpression | VariableDeclarator | ThisExpression | ArrayExpression | ObjectExpression | Property | Literal | SequenceExpression | UnaryExpression | BinaryExpression | AssignmentExpression | MemberExpression | UpdateExpression | LogicalExpression | ConditionalExpression | NewExpression | CallExpression | RestElement | TypeAnnotation | TSTypeAnnotation | SpreadElementPattern | ArrowFunctionExpression | ForOfStatement | YieldExpression | GeneratorExpression | ComprehensionBlock | ComprehensionExpression | ObjectProperty | PropertyPattern | ObjectPattern | ArrayPattern | SpreadElement | AssignmentPattern | MethodDefinition | ClassPropertyDefinition | ClassProperty | ClassBody | ClassDeclaration | ClassExpression | Super | ImportSpecifier | ImportDefaultSpecifier | ImportNamespaceSpecifier | ImportDeclaration | ExportNamedDeclaration | ExportSpecifier | ExportDefaultDeclaration | ExportAllDeclaration | TaggedTemplateExpression | TemplateLiteral | TemplateElement | MetaProperty | AwaitExpression | SpreadProperty | SpreadPropertyPattern | ImportExpression | ChainExpression | OptionalCallExpression | OptionalMemberExpression | StaticBlock | Decorator | PrivateName | ClassPrivateProperty | ImportAttribute | RecordExpression | ObjectMethod | TupleExpression | ModuleExpression | JSXAttribute | JSXIdentifier | JSXNamespacedName | JSXExpressionContainer | JSXElement | JSXFragment | JSXMemberExpression | JSXSpreadAttribute | JSXEmptyExpression | JSXText | JSXSpreadChild | JSXOpeningElement | JSXClosingElement | JSXOpeningFragment | JSXClosingFragment | TypeParameterDeclaration | TSTypeParameterDeclaration | TypeParameterInstantiation | TSTypeParameterInstantiation | ClassImplements | TSExpressionWithTypeArguments | AnyTypeAnnotation | EmptyTypeAnnotation | MixedTypeAnnotation | VoidTypeAnnotation | SymbolTypeAnnotation | NumberTypeAnnotation | BigIntTypeAnnotation | NumberLiteralTypeAnnotation | NumericLiteralTypeAnnotation | BigIntLiteralTypeAnnotation | StringTypeAnnotation | StringLiteralTypeAnnotation | BooleanTypeAnnotation | BooleanLiteralTypeAnnotation | NullableTypeAnnotation | NullLiteralTypeAnnotation | NullTypeAnnotation | ThisTypeAnnotation | ExistsTypeAnnotation | ExistentialTypeParam | FunctionTypeAnnotation | FunctionTypeParam | ArrayTypeAnnotation | ObjectTypeAnnotation | ObjectTypeProperty | ObjectTypeSpreadProperty | ObjectTypeIndexer | ObjectTypeCallProperty | ObjectTypeInternalSlot | Variance | QualifiedTypeIdentifier | GenericTypeAnnotation | MemberTypeAnnotation | IndexedAccessType | OptionalIndexedAccessType | UnionTypeAnnotation | IntersectionTypeAnnotation | TypeofTypeAnnotation | TypeParameter | InterfaceTypeAnnotation | InterfaceExtends | InterfaceDeclaration | DeclareInterface | TypeAlias | DeclareTypeAlias | OpaqueType | DeclareOpaqueType | TypeCastExpression | TupleTypeAnnotation | DeclareVariable | DeclareFunction | DeclareClass | DeclareModule | DeclareModuleExports | DeclareExportDeclaration | ExportBatchSpecifier | DeclareExportAllDeclaration | InferredPredicate | DeclaredPredicate | EnumDeclaration | EnumBooleanBody | EnumNumberBody | EnumStringBody | EnumSymbolBody | EnumBooleanMember | EnumNumberMember | EnumStringMember | EnumDefaultedMember | ExportDeclaration | Block | Line | Noop | DoExpression | BindExpression | ParenthesizedExpression | ExportNamespaceSpecifier | ExportDefaultSpecifier | CommentBlock | CommentLine | Directive | DirectiveLiteral | InterpreterDirective | StringLiteral | NumericLiteral | BigIntLiteral | DecimalLiteral | NullLiteral | BooleanLiteral | RegExpLiteral | ClassMethod | ClassPrivateMethod | RestProperty | ForAwaitStatement | Import | V8IntrinsicIdentifier | TopicReference | TSQualifiedName | TSTypeReference | TSAsExpression | TSNonNullExpression | TSAnyKeyword | TSBigIntKeyword | TSBooleanKeyword | TSNeverKeyword | TSNullKeyword | TSNumberKeyword | TSObjectKeyword | TSStringKeyword | TSSymbolKeyword | TSUndefinedKeyword | TSUnknownKeyword | TSVoidKeyword | TSIntrinsicKeyword | TSThisType | TSArrayType | TSLiteralType | TSUnionType | TSIntersectionType | TSConditionalType | TSInferType | TSTypeParameter | TSParenthesizedType | TSFunctionType | TSConstructorType | TSDeclareFunction | TSDeclareMethod | TSMappedType | TSTupleType | TSNamedTupleMember | TSRestType | TSOptionalType | TSIndexedAccessType | TSTypeOperator | TSIndexSignature | TSPropertySignature | TSMethodSignature | TSTypePredicate | TSCallSignatureDeclaration | TSConstructSignatureDeclaration | TSEnumMember | TSTypeQuery | TSImportType | TSTypeLiteral | TSTypeAssertion | TSEnumDeclaration | TSTypeAliasDeclaration | TSModuleBlock | TSModuleDeclaration | TSImportEqualsDeclaration | TSExternalModuleReference | TSExportAssignment | TSNamespaceExportDeclaration | TSInterfaceBody | TSInterfaceDeclaration | TSParameterProperty;
1342
1402
  let Printable: Type<Printable>;
1343
1403
  let SourceLocation: Type<SourceLocation>;
1344
1404
  let Node: Type<Node>;
@@ -1384,6 +1444,7 @@ export declare namespace namedTypes {
1384
1444
  let UnaryExpression: Type<UnaryExpression>;
1385
1445
  let BinaryExpression: Type<BinaryExpression>;
1386
1446
  let AssignmentExpression: Type<AssignmentExpression>;
1447
+ let ChainElement: Type<ChainElement>;
1387
1448
  let MemberExpression: Type<MemberExpression>;
1388
1449
  let UpdateExpression: Type<UpdateExpression>;
1389
1450
  let LogicalExpression: Type<LogicalExpression>;
@@ -1431,8 +1492,18 @@ export declare namespace namedTypes {
1431
1492
  let SpreadProperty: Type<SpreadProperty>;
1432
1493
  let SpreadPropertyPattern: Type<SpreadPropertyPattern>;
1433
1494
  let ImportExpression: Type<ImportExpression>;
1434
- let OptionalMemberExpression: Type<OptionalMemberExpression>;
1495
+ let ChainExpression: Type<ChainExpression>;
1435
1496
  let OptionalCallExpression: Type<OptionalCallExpression>;
1497
+ let OptionalMemberExpression: Type<OptionalMemberExpression>;
1498
+ let StaticBlock: Type<StaticBlock>;
1499
+ let Decorator: Type<Decorator>;
1500
+ let PrivateName: Type<PrivateName>;
1501
+ let ClassPrivateProperty: Type<ClassPrivateProperty>;
1502
+ let ImportAttribute: Type<ImportAttribute>;
1503
+ let RecordExpression: Type<RecordExpression>;
1504
+ let ObjectMethod: Type<ObjectMethod>;
1505
+ let TupleExpression: Type<TupleExpression>;
1506
+ let ModuleExpression: Type<ModuleExpression>;
1436
1507
  let JSXAttribute: Type<JSXAttribute>;
1437
1508
  let JSXIdentifier: Type<JSXIdentifier>;
1438
1509
  let JSXNamespacedName: Type<JSXNamespacedName>;
@@ -1448,9 +1519,6 @@ export declare namespace namedTypes {
1448
1519
  let JSXClosingElement: Type<JSXClosingElement>;
1449
1520
  let JSXOpeningFragment: Type<JSXOpeningFragment>;
1450
1521
  let JSXClosingFragment: Type<JSXClosingFragment>;
1451
- let Decorator: Type<Decorator>;
1452
- let PrivateName: Type<PrivateName>;
1453
- let ClassPrivateProperty: Type<ClassPrivateProperty>;
1454
1522
  let TypeParameterDeclaration: Type<TypeParameterDeclaration>;
1455
1523
  let TSTypeParameterDeclaration: Type<TSTypeParameterDeclaration>;
1456
1524
  let TypeParameterInstantiation: Type<TypeParameterInstantiation>;
@@ -1494,6 +1562,8 @@ export declare namespace namedTypes {
1494
1562
  let QualifiedTypeIdentifier: Type<QualifiedTypeIdentifier>;
1495
1563
  let GenericTypeAnnotation: Type<GenericTypeAnnotation>;
1496
1564
  let MemberTypeAnnotation: Type<MemberTypeAnnotation>;
1565
+ let IndexedAccessType: Type<IndexedAccessType>;
1566
+ let OptionalIndexedAccessType: Type<OptionalIndexedAccessType>;
1497
1567
  let UnionTypeAnnotation: Type<UnionTypeAnnotation>;
1498
1568
  let IntersectionTypeAnnotation: Type<IntersectionTypeAnnotation>;
1499
1569
  let TypeofTypeAnnotation: Type<TypeofTypeAnnotation>;
@@ -1545,15 +1615,17 @@ export declare namespace namedTypes {
1545
1615
  let StringLiteral: Type<StringLiteral>;
1546
1616
  let NumericLiteral: Type<NumericLiteral>;
1547
1617
  let BigIntLiteral: Type<BigIntLiteral>;
1618
+ let DecimalLiteral: Type<DecimalLiteral>;
1548
1619
  let NullLiteral: Type<NullLiteral>;
1549
1620
  let BooleanLiteral: Type<BooleanLiteral>;
1550
1621
  let RegExpLiteral: Type<RegExpLiteral>;
1551
- let ObjectMethod: Type<ObjectMethod>;
1552
1622
  let ClassMethod: Type<ClassMethod>;
1553
1623
  let ClassPrivateMethod: Type<ClassPrivateMethod>;
1554
1624
  let RestProperty: Type<RestProperty>;
1555
1625
  let ForAwaitStatement: Type<ForAwaitStatement>;
1556
1626
  let Import: Type<Import>;
1627
+ let V8IntrinsicIdentifier: Type<V8IntrinsicIdentifier>;
1628
+ let TopicReference: Type<TopicReference>;
1557
1629
  let TSQualifiedName: Type<TSQualifiedName>;
1558
1630
  let TSTypeReference: Type<TSTypeReference>;
1559
1631
  let TSHasOptionalTypeParameters: Type<TSHasOptionalTypeParameters>;
@@ -1572,6 +1644,7 @@ export declare namespace namedTypes {
1572
1644
  let TSUndefinedKeyword: Type<TSUndefinedKeyword>;
1573
1645
  let TSUnknownKeyword: Type<TSUnknownKeyword>;
1574
1646
  let TSVoidKeyword: Type<TSVoidKeyword>;
1647
+ let TSIntrinsicKeyword: Type<TSIntrinsicKeyword>;
1575
1648
  let TSThisType: Type<TSThisType>;
1576
1649
  let TSArrayType: Type<TSArrayType>;
1577
1650
  let TSLiteralType: Type<TSLiteralType>;
@@ -1661,6 +1734,7 @@ export interface NamedTypes {
1661
1734
  UnaryExpression: Type<namedTypes.UnaryExpression>;
1662
1735
  BinaryExpression: Type<namedTypes.BinaryExpression>;
1663
1736
  AssignmentExpression: Type<namedTypes.AssignmentExpression>;
1737
+ ChainElement: Type<namedTypes.ChainElement>;
1664
1738
  MemberExpression: Type<namedTypes.MemberExpression>;
1665
1739
  UpdateExpression: Type<namedTypes.UpdateExpression>;
1666
1740
  LogicalExpression: Type<namedTypes.LogicalExpression>;
@@ -1708,8 +1782,18 @@ export interface NamedTypes {
1708
1782
  SpreadProperty: Type<namedTypes.SpreadProperty>;
1709
1783
  SpreadPropertyPattern: Type<namedTypes.SpreadPropertyPattern>;
1710
1784
  ImportExpression: Type<namedTypes.ImportExpression>;
1711
- OptionalMemberExpression: Type<namedTypes.OptionalMemberExpression>;
1785
+ ChainExpression: Type<namedTypes.ChainExpression>;
1712
1786
  OptionalCallExpression: Type<namedTypes.OptionalCallExpression>;
1787
+ OptionalMemberExpression: Type<namedTypes.OptionalMemberExpression>;
1788
+ StaticBlock: Type<namedTypes.StaticBlock>;
1789
+ Decorator: Type<namedTypes.Decorator>;
1790
+ PrivateName: Type<namedTypes.PrivateName>;
1791
+ ClassPrivateProperty: Type<namedTypes.ClassPrivateProperty>;
1792
+ ImportAttribute: Type<namedTypes.ImportAttribute>;
1793
+ RecordExpression: Type<namedTypes.RecordExpression>;
1794
+ ObjectMethod: Type<namedTypes.ObjectMethod>;
1795
+ TupleExpression: Type<namedTypes.TupleExpression>;
1796
+ ModuleExpression: Type<namedTypes.ModuleExpression>;
1713
1797
  JSXAttribute: Type<namedTypes.JSXAttribute>;
1714
1798
  JSXIdentifier: Type<namedTypes.JSXIdentifier>;
1715
1799
  JSXNamespacedName: Type<namedTypes.JSXNamespacedName>;
@@ -1725,9 +1809,6 @@ export interface NamedTypes {
1725
1809
  JSXClosingElement: Type<namedTypes.JSXClosingElement>;
1726
1810
  JSXOpeningFragment: Type<namedTypes.JSXOpeningFragment>;
1727
1811
  JSXClosingFragment: Type<namedTypes.JSXClosingFragment>;
1728
- Decorator: Type<namedTypes.Decorator>;
1729
- PrivateName: Type<namedTypes.PrivateName>;
1730
- ClassPrivateProperty: Type<namedTypes.ClassPrivateProperty>;
1731
1812
  TypeParameterDeclaration: Type<namedTypes.TypeParameterDeclaration>;
1732
1813
  TSTypeParameterDeclaration: Type<namedTypes.TSTypeParameterDeclaration>;
1733
1814
  TypeParameterInstantiation: Type<namedTypes.TypeParameterInstantiation>;
@@ -1771,6 +1852,8 @@ export interface NamedTypes {
1771
1852
  QualifiedTypeIdentifier: Type<namedTypes.QualifiedTypeIdentifier>;
1772
1853
  GenericTypeAnnotation: Type<namedTypes.GenericTypeAnnotation>;
1773
1854
  MemberTypeAnnotation: Type<namedTypes.MemberTypeAnnotation>;
1855
+ IndexedAccessType: Type<namedTypes.IndexedAccessType>;
1856
+ OptionalIndexedAccessType: Type<namedTypes.OptionalIndexedAccessType>;
1774
1857
  UnionTypeAnnotation: Type<namedTypes.UnionTypeAnnotation>;
1775
1858
  IntersectionTypeAnnotation: Type<namedTypes.IntersectionTypeAnnotation>;
1776
1859
  TypeofTypeAnnotation: Type<namedTypes.TypeofTypeAnnotation>;
@@ -1822,15 +1905,17 @@ export interface NamedTypes {
1822
1905
  StringLiteral: Type<namedTypes.StringLiteral>;
1823
1906
  NumericLiteral: Type<namedTypes.NumericLiteral>;
1824
1907
  BigIntLiteral: Type<namedTypes.BigIntLiteral>;
1908
+ DecimalLiteral: Type<namedTypes.DecimalLiteral>;
1825
1909
  NullLiteral: Type<namedTypes.NullLiteral>;
1826
1910
  BooleanLiteral: Type<namedTypes.BooleanLiteral>;
1827
1911
  RegExpLiteral: Type<namedTypes.RegExpLiteral>;
1828
- ObjectMethod: Type<namedTypes.ObjectMethod>;
1829
1912
  ClassMethod: Type<namedTypes.ClassMethod>;
1830
1913
  ClassPrivateMethod: Type<namedTypes.ClassPrivateMethod>;
1831
1914
  RestProperty: Type<namedTypes.RestProperty>;
1832
1915
  ForAwaitStatement: Type<namedTypes.ForAwaitStatement>;
1833
1916
  Import: Type<namedTypes.Import>;
1917
+ V8IntrinsicIdentifier: Type<namedTypes.V8IntrinsicIdentifier>;
1918
+ TopicReference: Type<namedTypes.TopicReference>;
1834
1919
  TSQualifiedName: Type<namedTypes.TSQualifiedName>;
1835
1920
  TSTypeReference: Type<namedTypes.TSTypeReference>;
1836
1921
  TSHasOptionalTypeParameters: Type<namedTypes.TSHasOptionalTypeParameters>;
@@ -1849,6 +1934,7 @@ export interface NamedTypes {
1849
1934
  TSUndefinedKeyword: Type<namedTypes.TSUndefinedKeyword>;
1850
1935
  TSUnknownKeyword: Type<namedTypes.TSUnknownKeyword>;
1851
1936
  TSVoidKeyword: Type<namedTypes.TSVoidKeyword>;
1937
+ TSIntrinsicKeyword: Type<namedTypes.TSIntrinsicKeyword>;
1852
1938
  TSThisType: Type<namedTypes.TSThisType>;
1853
1939
  TSArrayType: Type<namedTypes.TSArrayType>;
1854
1940
  TSLiteralType: Type<namedTypes.TSLiteralType>;
package/gen/visitor.d.ts CHANGED
@@ -47,6 +47,7 @@ export interface Visitor<M = {}> {
47
47
  visitUnaryExpression?(this: Context & M, path: NodePath<namedTypes.UnaryExpression>): any;
48
48
  visitBinaryExpression?(this: Context & M, path: NodePath<namedTypes.BinaryExpression>): any;
49
49
  visitAssignmentExpression?(this: Context & M, path: NodePath<namedTypes.AssignmentExpression>): any;
50
+ visitChainElement?(this: Context & M, path: NodePath<namedTypes.ChainElement>): any;
50
51
  visitMemberExpression?(this: Context & M, path: NodePath<namedTypes.MemberExpression>): any;
51
52
  visitUpdateExpression?(this: Context & M, path: NodePath<namedTypes.UpdateExpression>): any;
52
53
  visitLogicalExpression?(this: Context & M, path: NodePath<namedTypes.LogicalExpression>): any;
@@ -94,8 +95,18 @@ export interface Visitor<M = {}> {
94
95
  visitSpreadProperty?(this: Context & M, path: NodePath<namedTypes.SpreadProperty>): any;
95
96
  visitSpreadPropertyPattern?(this: Context & M, path: NodePath<namedTypes.SpreadPropertyPattern>): any;
96
97
  visitImportExpression?(this: Context & M, path: NodePath<namedTypes.ImportExpression>): any;
97
- visitOptionalMemberExpression?(this: Context & M, path: NodePath<namedTypes.OptionalMemberExpression>): any;
98
+ visitChainExpression?(this: Context & M, path: NodePath<namedTypes.ChainExpression>): any;
98
99
  visitOptionalCallExpression?(this: Context & M, path: NodePath<namedTypes.OptionalCallExpression>): any;
100
+ visitOptionalMemberExpression?(this: Context & M, path: NodePath<namedTypes.OptionalMemberExpression>): any;
101
+ visitStaticBlock?(this: Context & M, path: NodePath<namedTypes.StaticBlock>): any;
102
+ visitDecorator?(this: Context & M, path: NodePath<namedTypes.Decorator>): any;
103
+ visitPrivateName?(this: Context & M, path: NodePath<namedTypes.PrivateName>): any;
104
+ visitClassPrivateProperty?(this: Context & M, path: NodePath<namedTypes.ClassPrivateProperty>): any;
105
+ visitImportAttribute?(this: Context & M, path: NodePath<namedTypes.ImportAttribute>): any;
106
+ visitRecordExpression?(this: Context & M, path: NodePath<namedTypes.RecordExpression>): any;
107
+ visitObjectMethod?(this: Context & M, path: NodePath<namedTypes.ObjectMethod>): any;
108
+ visitTupleExpression?(this: Context & M, path: NodePath<namedTypes.TupleExpression>): any;
109
+ visitModuleExpression?(this: Context & M, path: NodePath<namedTypes.ModuleExpression>): any;
99
110
  visitJSXAttribute?(this: Context & M, path: NodePath<namedTypes.JSXAttribute>): any;
100
111
  visitJSXIdentifier?(this: Context & M, path: NodePath<namedTypes.JSXIdentifier>): any;
101
112
  visitJSXNamespacedName?(this: Context & M, path: NodePath<namedTypes.JSXNamespacedName>): any;
@@ -111,9 +122,6 @@ export interface Visitor<M = {}> {
111
122
  visitJSXClosingElement?(this: Context & M, path: NodePath<namedTypes.JSXClosingElement>): any;
112
123
  visitJSXOpeningFragment?(this: Context & M, path: NodePath<namedTypes.JSXOpeningFragment>): any;
113
124
  visitJSXClosingFragment?(this: Context & M, path: NodePath<namedTypes.JSXClosingFragment>): any;
114
- visitDecorator?(this: Context & M, path: NodePath<namedTypes.Decorator>): any;
115
- visitPrivateName?(this: Context & M, path: NodePath<namedTypes.PrivateName>): any;
116
- visitClassPrivateProperty?(this: Context & M, path: NodePath<namedTypes.ClassPrivateProperty>): any;
117
125
  visitTypeParameterDeclaration?(this: Context & M, path: NodePath<namedTypes.TypeParameterDeclaration>): any;
118
126
  visitTSTypeParameterDeclaration?(this: Context & M, path: NodePath<namedTypes.TSTypeParameterDeclaration>): any;
119
127
  visitTypeParameterInstantiation?(this: Context & M, path: NodePath<namedTypes.TypeParameterInstantiation>): any;
@@ -157,6 +165,8 @@ export interface Visitor<M = {}> {
157
165
  visitQualifiedTypeIdentifier?(this: Context & M, path: NodePath<namedTypes.QualifiedTypeIdentifier>): any;
158
166
  visitGenericTypeAnnotation?(this: Context & M, path: NodePath<namedTypes.GenericTypeAnnotation>): any;
159
167
  visitMemberTypeAnnotation?(this: Context & M, path: NodePath<namedTypes.MemberTypeAnnotation>): any;
168
+ visitIndexedAccessType?(this: Context & M, path: NodePath<namedTypes.IndexedAccessType>): any;
169
+ visitOptionalIndexedAccessType?(this: Context & M, path: NodePath<namedTypes.OptionalIndexedAccessType>): any;
160
170
  visitUnionTypeAnnotation?(this: Context & M, path: NodePath<namedTypes.UnionTypeAnnotation>): any;
161
171
  visitIntersectionTypeAnnotation?(this: Context & M, path: NodePath<namedTypes.IntersectionTypeAnnotation>): any;
162
172
  visitTypeofTypeAnnotation?(this: Context & M, path: NodePath<namedTypes.TypeofTypeAnnotation>): any;
@@ -208,15 +218,17 @@ export interface Visitor<M = {}> {
208
218
  visitStringLiteral?(this: Context & M, path: NodePath<namedTypes.StringLiteral>): any;
209
219
  visitNumericLiteral?(this: Context & M, path: NodePath<namedTypes.NumericLiteral>): any;
210
220
  visitBigIntLiteral?(this: Context & M, path: NodePath<namedTypes.BigIntLiteral>): any;
221
+ visitDecimalLiteral?(this: Context & M, path: NodePath<namedTypes.DecimalLiteral>): any;
211
222
  visitNullLiteral?(this: Context & M, path: NodePath<namedTypes.NullLiteral>): any;
212
223
  visitBooleanLiteral?(this: Context & M, path: NodePath<namedTypes.BooleanLiteral>): any;
213
224
  visitRegExpLiteral?(this: Context & M, path: NodePath<namedTypes.RegExpLiteral>): any;
214
- visitObjectMethod?(this: Context & M, path: NodePath<namedTypes.ObjectMethod>): any;
215
225
  visitClassMethod?(this: Context & M, path: NodePath<namedTypes.ClassMethod>): any;
216
226
  visitClassPrivateMethod?(this: Context & M, path: NodePath<namedTypes.ClassPrivateMethod>): any;
217
227
  visitRestProperty?(this: Context & M, path: NodePath<namedTypes.RestProperty>): any;
218
228
  visitForAwaitStatement?(this: Context & M, path: NodePath<namedTypes.ForAwaitStatement>): any;
219
229
  visitImport?(this: Context & M, path: NodePath<namedTypes.Import>): any;
230
+ visitV8IntrinsicIdentifier?(this: Context & M, path: NodePath<namedTypes.V8IntrinsicIdentifier>): any;
231
+ visitTopicReference?(this: Context & M, path: NodePath<namedTypes.TopicReference>): any;
220
232
  visitTSQualifiedName?(this: Context & M, path: NodePath<namedTypes.TSQualifiedName>): any;
221
233
  visitTSTypeReference?(this: Context & M, path: NodePath<namedTypes.TSTypeReference>): any;
222
234
  visitTSHasOptionalTypeParameters?(this: Context & M, path: NodePath<namedTypes.TSHasOptionalTypeParameters>): any;
@@ -235,6 +247,7 @@ export interface Visitor<M = {}> {
235
247
  visitTSUndefinedKeyword?(this: Context & M, path: NodePath<namedTypes.TSUndefinedKeyword>): any;
236
248
  visitTSUnknownKeyword?(this: Context & M, path: NodePath<namedTypes.TSUnknownKeyword>): any;
237
249
  visitTSVoidKeyword?(this: Context & M, path: NodePath<namedTypes.TSVoidKeyword>): any;
250
+ visitTSIntrinsicKeyword?(this: Context & M, path: NodePath<namedTypes.TSIntrinsicKeyword>): any;
238
251
  visitTSThisType?(this: Context & M, path: NodePath<namedTypes.TSThisType>): any;
239
252
  visitTSArrayType?(this: Context & M, path: NodePath<namedTypes.TSArrayType>): any;
240
253
  visitTSLiteralType?(this: Context & M, path: NodePath<namedTypes.TSLiteralType>): any;
package/lib/equiv.js CHANGED
@@ -1,7 +1,7 @@
1
1
  "use strict";;
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  var tslib_1 = require("tslib");
4
- var types_1 = tslib_1.__importDefault(require("./types"));
4
+ var types_1 = (0, tslib_1.__importDefault)(require("./types"));
5
5
  function default_1(fork) {
6
6
  var types = fork.use(types_1.default);
7
7
  var getFieldNames = types.getFieldNames;
package/lib/node-path.js CHANGED
@@ -1,9 +1,9 @@
1
1
  "use strict";;
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  var tslib_1 = require("tslib");
4
- var types_1 = tslib_1.__importDefault(require("./types"));
5
- var path_1 = tslib_1.__importDefault(require("./path"));
6
- var scope_1 = tslib_1.__importDefault(require("./scope"));
4
+ var types_1 = (0, tslib_1.__importDefault)(require("./types"));
5
+ var path_1 = (0, tslib_1.__importDefault)(require("./path"));
6
+ var scope_1 = (0, tslib_1.__importDefault)(require("./scope"));
7
7
  function nodePathPlugin(fork) {
8
8
  var types = fork.use(types_1.default);
9
9
  var n = types.namedTypes;
@@ -1,8 +1,8 @@
1
1
  "use strict";;
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  var tslib_1 = require("tslib");
4
- var types_1 = tslib_1.__importDefault(require("./types"));
5
- var node_path_1 = tslib_1.__importDefault(require("./node-path"));
4
+ var types_1 = (0, tslib_1.__importDefault)(require("./types"));
5
+ var node_path_1 = (0, tslib_1.__importDefault)(require("./node-path"));
6
6
  var hasOwn = Object.prototype.hasOwnProperty;
7
7
  function pathVisitorPlugin(fork) {
8
8
  var types = fork.use(types_1.default);
package/lib/path.d.ts CHANGED
@@ -7,9 +7,9 @@ export interface Path<V = any> {
7
7
  __childCache: object | null;
8
8
  getValueProperty(name: any): any;
9
9
  get(...names: any[]): any;
10
- each(callback: any, context: any): any;
11
- map(callback: any, context: any): any;
12
- filter(callback: any, context: any): any;
10
+ each(callback: any, context?: any): any;
11
+ map(callback: any, context?: any): any;
12
+ filter(callback: any, context?: any): any;
13
13
  shift(): any;
14
14
  unshift(...args: any[]): any;
15
15
  push(...args: any[]): any;
package/lib/path.js CHANGED
@@ -1,7 +1,7 @@
1
1
  "use strict";;
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  var tslib_1 = require("tslib");
4
- var types_1 = tslib_1.__importDefault(require("./types"));
4
+ var types_1 = (0, tslib_1.__importDefault)(require("./types"));
5
5
  var Op = Object.prototype;
6
6
  var hasOwn = Op.hasOwnProperty;
7
7
  function pathPlugin(fork) {
package/lib/scope.d.ts CHANGED
@@ -1,6 +1,7 @@
1
1
  import { Fork } from "../types";
2
+ import { NodePath } from "./node-path";
2
3
  export interface Scope {
3
- path: any;
4
+ path: NodePath;
4
5
  node: any;
5
6
  isGlobal: boolean;
6
7
  depth: number;
@@ -20,7 +21,7 @@ export interface Scope {
20
21
  getGlobalScope(): Scope;
21
22
  }
22
23
  export interface ScopeConstructor {
23
- new (path: any, parentScope: any): Scope;
24
+ new (path: NodePath, parentScope: any): Scope;
24
25
  isEstablishedBy(node: any): any;
25
26
  }
26
27
  export default function scopePlugin(fork: Fork): ScopeConstructor;