ast-types 0.14.1 → 0.14.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/def/es2020.js +16 -4
- package/gen/builders.d.ts +20 -8
- package/gen/kinds.d.ts +6 -4
- package/gen/namedTypes.d.ts +20 -9
- package/gen/visitor.d.ts +3 -1
- package/lib/scope.js +2 -0
- package/package.json +3 -3
- package/def/es7.d.ts +0 -2
- package/def/es7.js +0 -34
package/def/es2020.js
CHANGED
|
@@ -21,14 +21,26 @@ function default_1(fork) {
|
|
|
21
21
|
.field("source", def("Literal"))
|
|
22
22
|
.field("exported", or(def("Identifier"), null));
|
|
23
23
|
// Optional chaining
|
|
24
|
-
def("
|
|
25
|
-
.bases("
|
|
26
|
-
.
|
|
27
|
-
|
|
24
|
+
def("ChainElement")
|
|
25
|
+
.bases("Node")
|
|
26
|
+
.field("optional", Boolean, defaults["false"]);
|
|
27
|
+
def("CallExpression")
|
|
28
|
+
.bases("Expression", "ChainElement");
|
|
29
|
+
def("MemberExpression")
|
|
30
|
+
.bases("Expression", "ChainElement");
|
|
31
|
+
def("ChainExpression")
|
|
32
|
+
.bases("Expression")
|
|
33
|
+
.build("expression")
|
|
34
|
+
.field("expression", def("ChainElement"));
|
|
28
35
|
def("OptionalCallExpression")
|
|
29
36
|
.bases("CallExpression")
|
|
30
37
|
.build("callee", "arguments", "optional")
|
|
31
38
|
.field("optional", Boolean, defaults["true"]);
|
|
39
|
+
// Deprecated optional chaining type, doesn't work with babelParser@7.11.0 or newer
|
|
40
|
+
def("OptionalMemberExpression")
|
|
41
|
+
.bases("MemberExpression")
|
|
42
|
+
.build("object", "property", "computed", "optional")
|
|
43
|
+
.field("optional", Boolean, defaults["true"]);
|
|
32
44
|
// Nullish coalescing
|
|
33
45
|
var LogicalOperator = or.apply(void 0, tslib_1.__spreadArrays(core_operators_1.LogicalOperators, ["??"]));
|
|
34
46
|
def("LogicalExpression")
|
package/gen/builders.d.ts
CHANGED
|
@@ -348,6 +348,7 @@ export interface MemberExpressionBuilder {
|
|
|
348
348
|
computed?: boolean;
|
|
349
349
|
loc?: K.SourceLocationKind | null;
|
|
350
350
|
object: K.ExpressionKind;
|
|
351
|
+
optional?: boolean;
|
|
351
352
|
property: K.IdentifierKind | K.ExpressionKind;
|
|
352
353
|
}): namedTypes.MemberExpression;
|
|
353
354
|
}
|
|
@@ -398,6 +399,7 @@ export interface CallExpressionBuilder {
|
|
|
398
399
|
callee: K.ExpressionKind;
|
|
399
400
|
comments?: K.CommentKind[] | null;
|
|
400
401
|
loc?: K.SourceLocationKind | null;
|
|
402
|
+
optional?: boolean;
|
|
401
403
|
typeArguments?: null | K.TypeParameterInstantiationKind;
|
|
402
404
|
}): namedTypes.CallExpression;
|
|
403
405
|
}
|
|
@@ -789,16 +791,13 @@ export interface ImportExpressionBuilder {
|
|
|
789
791
|
source: K.ExpressionKind;
|
|
790
792
|
}): namedTypes.ImportExpression;
|
|
791
793
|
}
|
|
792
|
-
export interface
|
|
793
|
-
(
|
|
794
|
+
export interface ChainExpressionBuilder {
|
|
795
|
+
(expression: K.ChainElementKind): namedTypes.ChainExpression;
|
|
794
796
|
from(params: {
|
|
795
797
|
comments?: K.CommentKind[] | null;
|
|
796
|
-
|
|
798
|
+
expression: K.ChainElementKind;
|
|
797
799
|
loc?: K.SourceLocationKind | null;
|
|
798
|
-
|
|
799
|
-
optional?: boolean;
|
|
800
|
-
property: K.IdentifierKind | K.ExpressionKind;
|
|
801
|
-
}): namedTypes.OptionalMemberExpression;
|
|
800
|
+
}): namedTypes.ChainExpression;
|
|
802
801
|
}
|
|
803
802
|
export interface OptionalCallExpressionBuilder {
|
|
804
803
|
(callee: K.ExpressionKind, argumentsParam: (K.ExpressionKind | K.SpreadElementKind)[], optional?: boolean): namedTypes.OptionalCallExpression;
|
|
@@ -811,6 +810,17 @@ export interface OptionalCallExpressionBuilder {
|
|
|
811
810
|
typeArguments?: null | K.TypeParameterInstantiationKind;
|
|
812
811
|
}): namedTypes.OptionalCallExpression;
|
|
813
812
|
}
|
|
813
|
+
export interface OptionalMemberExpressionBuilder {
|
|
814
|
+
(object: K.ExpressionKind, property: K.IdentifierKind | K.ExpressionKind, computed?: boolean, optional?: boolean): namedTypes.OptionalMemberExpression;
|
|
815
|
+
from(params: {
|
|
816
|
+
comments?: K.CommentKind[] | null;
|
|
817
|
+
computed?: boolean;
|
|
818
|
+
loc?: K.SourceLocationKind | null;
|
|
819
|
+
object: K.ExpressionKind;
|
|
820
|
+
optional?: boolean;
|
|
821
|
+
property: K.IdentifierKind | K.ExpressionKind;
|
|
822
|
+
}): namedTypes.OptionalMemberExpression;
|
|
823
|
+
}
|
|
814
824
|
export interface JSXAttributeBuilder {
|
|
815
825
|
(name: K.JSXIdentifierKind | K.JSXNamespacedNameKind, value?: K.LiteralKind | K.JSXExpressionContainerKind | K.JSXElementKind | K.JSXFragmentKind | null): namedTypes.JSXAttribute;
|
|
816
826
|
from(params: {
|
|
@@ -877,6 +887,7 @@ export interface JSXMemberExpressionBuilder {
|
|
|
877
887
|
computed?: boolean;
|
|
878
888
|
loc?: K.SourceLocationKind | null;
|
|
879
889
|
object: K.JSXIdentifierKind | K.JSXMemberExpressionKind;
|
|
890
|
+
optional?: boolean;
|
|
880
891
|
property: K.JSXIdentifierKind;
|
|
881
892
|
}): namedTypes.JSXMemberExpression;
|
|
882
893
|
}
|
|
@@ -2514,8 +2525,9 @@ export interface builders {
|
|
|
2514
2525
|
spreadProperty: SpreadPropertyBuilder;
|
|
2515
2526
|
spreadPropertyPattern: SpreadPropertyPatternBuilder;
|
|
2516
2527
|
importExpression: ImportExpressionBuilder;
|
|
2517
|
-
|
|
2528
|
+
chainExpression: ChainExpressionBuilder;
|
|
2518
2529
|
optionalCallExpression: OptionalCallExpressionBuilder;
|
|
2530
|
+
optionalMemberExpression: OptionalMemberExpressionBuilder;
|
|
2519
2531
|
jsxAttribute: JSXAttributeBuilder;
|
|
2520
2532
|
jsxIdentifier: JSXIdentifierBuilder;
|
|
2521
2533
|
jsxNamespacedName: JSXNamespacedNameBuilder;
|
package/gen/kinds.d.ts
CHANGED
|
@@ -1,14 +1,14 @@
|
|
|
1
1
|
import { namedTypes } from "./namedTypes";
|
|
2
|
-
export declare type PrintableKind = namedTypes.File | namedTypes.Program | namedTypes.Identifier | namedTypes.BlockStatement | namedTypes.EmptyStatement | namedTypes.ExpressionStatement | namedTypes.IfStatement | namedTypes.LabeledStatement | namedTypes.BreakStatement | namedTypes.ContinueStatement | namedTypes.WithStatement | namedTypes.SwitchStatement | namedTypes.SwitchCase | namedTypes.ReturnStatement | namedTypes.ThrowStatement | namedTypes.TryStatement | namedTypes.CatchClause | namedTypes.WhileStatement | namedTypes.DoWhileStatement | namedTypes.ForStatement | namedTypes.VariableDeclaration | namedTypes.ForInStatement | namedTypes.DebuggerStatement | namedTypes.FunctionDeclaration | namedTypes.FunctionExpression | namedTypes.VariableDeclarator | namedTypes.ThisExpression | namedTypes.ArrayExpression | namedTypes.ObjectExpression | namedTypes.Property | namedTypes.Literal | namedTypes.SequenceExpression | namedTypes.UnaryExpression | namedTypes.BinaryExpression | namedTypes.AssignmentExpression | namedTypes.MemberExpression | namedTypes.UpdateExpression | namedTypes.LogicalExpression | namedTypes.ConditionalExpression | namedTypes.NewExpression | namedTypes.CallExpression | namedTypes.RestElement | namedTypes.TypeAnnotation | namedTypes.TSTypeAnnotation | namedTypes.SpreadElementPattern | namedTypes.ArrowFunctionExpression | namedTypes.ForOfStatement | namedTypes.YieldExpression | namedTypes.GeneratorExpression | namedTypes.ComprehensionBlock | namedTypes.ComprehensionExpression | namedTypes.ObjectProperty | namedTypes.PropertyPattern | namedTypes.ObjectPattern | namedTypes.ArrayPattern | namedTypes.SpreadElement | namedTypes.AssignmentPattern | namedTypes.MethodDefinition | namedTypes.ClassPropertyDefinition | namedTypes.ClassProperty | namedTypes.ClassBody | namedTypes.ClassDeclaration | namedTypes.ClassExpression | namedTypes.Super | namedTypes.ImportSpecifier | namedTypes.ImportDefaultSpecifier | namedTypes.ImportNamespaceSpecifier | namedTypes.ImportDeclaration | namedTypes.ExportNamedDeclaration | namedTypes.ExportSpecifier | namedTypes.ExportDefaultDeclaration | namedTypes.ExportAllDeclaration | namedTypes.TaggedTemplateExpression | namedTypes.TemplateLiteral | namedTypes.TemplateElement | namedTypes.MetaProperty | namedTypes.AwaitExpression | namedTypes.SpreadProperty | namedTypes.SpreadPropertyPattern | namedTypes.ImportExpression | namedTypes.
|
|
2
|
+
export declare type PrintableKind = namedTypes.File | namedTypes.Program | namedTypes.Identifier | namedTypes.BlockStatement | namedTypes.EmptyStatement | namedTypes.ExpressionStatement | namedTypes.IfStatement | namedTypes.LabeledStatement | namedTypes.BreakStatement | namedTypes.ContinueStatement | namedTypes.WithStatement | namedTypes.SwitchStatement | namedTypes.SwitchCase | namedTypes.ReturnStatement | namedTypes.ThrowStatement | namedTypes.TryStatement | namedTypes.CatchClause | namedTypes.WhileStatement | namedTypes.DoWhileStatement | namedTypes.ForStatement | namedTypes.VariableDeclaration | namedTypes.ForInStatement | namedTypes.DebuggerStatement | namedTypes.FunctionDeclaration | namedTypes.FunctionExpression | namedTypes.VariableDeclarator | namedTypes.ThisExpression | namedTypes.ArrayExpression | namedTypes.ObjectExpression | namedTypes.Property | namedTypes.Literal | namedTypes.SequenceExpression | namedTypes.UnaryExpression | namedTypes.BinaryExpression | namedTypes.AssignmentExpression | namedTypes.MemberExpression | namedTypes.UpdateExpression | namedTypes.LogicalExpression | namedTypes.ConditionalExpression | namedTypes.NewExpression | namedTypes.CallExpression | namedTypes.RestElement | namedTypes.TypeAnnotation | namedTypes.TSTypeAnnotation | namedTypes.SpreadElementPattern | namedTypes.ArrowFunctionExpression | namedTypes.ForOfStatement | namedTypes.YieldExpression | namedTypes.GeneratorExpression | namedTypes.ComprehensionBlock | namedTypes.ComprehensionExpression | namedTypes.ObjectProperty | namedTypes.PropertyPattern | namedTypes.ObjectPattern | namedTypes.ArrayPattern | namedTypes.SpreadElement | namedTypes.AssignmentPattern | namedTypes.MethodDefinition | namedTypes.ClassPropertyDefinition | namedTypes.ClassProperty | namedTypes.ClassBody | namedTypes.ClassDeclaration | namedTypes.ClassExpression | namedTypes.Super | namedTypes.ImportSpecifier | namedTypes.ImportDefaultSpecifier | namedTypes.ImportNamespaceSpecifier | namedTypes.ImportDeclaration | namedTypes.ExportNamedDeclaration | namedTypes.ExportSpecifier | namedTypes.ExportDefaultDeclaration | namedTypes.ExportAllDeclaration | namedTypes.TaggedTemplateExpression | namedTypes.TemplateLiteral | namedTypes.TemplateElement | namedTypes.MetaProperty | namedTypes.AwaitExpression | namedTypes.SpreadProperty | namedTypes.SpreadPropertyPattern | namedTypes.ImportExpression | namedTypes.ChainExpression | namedTypes.OptionalCallExpression | namedTypes.OptionalMemberExpression | namedTypes.JSXAttribute | namedTypes.JSXIdentifier | namedTypes.JSXNamespacedName | namedTypes.JSXExpressionContainer | namedTypes.JSXElement | namedTypes.JSXFragment | namedTypes.JSXMemberExpression | namedTypes.JSXSpreadAttribute | namedTypes.JSXEmptyExpression | namedTypes.JSXText | namedTypes.JSXSpreadChild | namedTypes.JSXOpeningElement | namedTypes.JSXClosingElement | namedTypes.JSXOpeningFragment | namedTypes.JSXClosingFragment | namedTypes.Decorator | namedTypes.PrivateName | namedTypes.ClassPrivateProperty | namedTypes.TypeParameterDeclaration | namedTypes.TSTypeParameterDeclaration | namedTypes.TypeParameterInstantiation | namedTypes.TSTypeParameterInstantiation | namedTypes.ClassImplements | namedTypes.TSExpressionWithTypeArguments | namedTypes.AnyTypeAnnotation | namedTypes.EmptyTypeAnnotation | namedTypes.MixedTypeAnnotation | namedTypes.VoidTypeAnnotation | namedTypes.SymbolTypeAnnotation | namedTypes.NumberTypeAnnotation | namedTypes.BigIntTypeAnnotation | namedTypes.NumberLiteralTypeAnnotation | namedTypes.NumericLiteralTypeAnnotation | namedTypes.BigIntLiteralTypeAnnotation | namedTypes.StringTypeAnnotation | namedTypes.StringLiteralTypeAnnotation | namedTypes.BooleanTypeAnnotation | namedTypes.BooleanLiteralTypeAnnotation | namedTypes.NullableTypeAnnotation | namedTypes.NullLiteralTypeAnnotation | namedTypes.NullTypeAnnotation | namedTypes.ThisTypeAnnotation | namedTypes.ExistsTypeAnnotation | namedTypes.ExistentialTypeParam | namedTypes.FunctionTypeAnnotation | namedTypes.FunctionTypeParam | namedTypes.ArrayTypeAnnotation | namedTypes.ObjectTypeAnnotation | namedTypes.ObjectTypeProperty | namedTypes.ObjectTypeSpreadProperty | namedTypes.ObjectTypeIndexer | namedTypes.ObjectTypeCallProperty | namedTypes.ObjectTypeInternalSlot | namedTypes.Variance | namedTypes.QualifiedTypeIdentifier | namedTypes.GenericTypeAnnotation | namedTypes.MemberTypeAnnotation | namedTypes.UnionTypeAnnotation | namedTypes.IntersectionTypeAnnotation | namedTypes.TypeofTypeAnnotation | namedTypes.TypeParameter | namedTypes.InterfaceTypeAnnotation | namedTypes.InterfaceExtends | namedTypes.InterfaceDeclaration | namedTypes.DeclareInterface | namedTypes.TypeAlias | namedTypes.DeclareTypeAlias | namedTypes.OpaqueType | namedTypes.DeclareOpaqueType | namedTypes.TypeCastExpression | namedTypes.TupleTypeAnnotation | namedTypes.DeclareVariable | namedTypes.DeclareFunction | namedTypes.DeclareClass | namedTypes.DeclareModule | namedTypes.DeclareModuleExports | namedTypes.DeclareExportDeclaration | namedTypes.ExportBatchSpecifier | namedTypes.DeclareExportAllDeclaration | namedTypes.InferredPredicate | namedTypes.DeclaredPredicate | namedTypes.EnumDeclaration | namedTypes.ExportDeclaration | namedTypes.Block | namedTypes.Line | namedTypes.Noop | namedTypes.DoExpression | namedTypes.BindExpression | namedTypes.ParenthesizedExpression | namedTypes.ExportNamespaceSpecifier | namedTypes.ExportDefaultSpecifier | namedTypes.CommentBlock | namedTypes.CommentLine | namedTypes.Directive | namedTypes.DirectiveLiteral | namedTypes.InterpreterDirective | namedTypes.StringLiteral | namedTypes.NumericLiteral | namedTypes.BigIntLiteral | namedTypes.NullLiteral | namedTypes.BooleanLiteral | namedTypes.RegExpLiteral | namedTypes.ObjectMethod | namedTypes.ClassMethod | namedTypes.ClassPrivateMethod | namedTypes.RestProperty | namedTypes.ForAwaitStatement | namedTypes.Import | namedTypes.TSQualifiedName | namedTypes.TSTypeReference | namedTypes.TSAsExpression | namedTypes.TSNonNullExpression | namedTypes.TSAnyKeyword | namedTypes.TSBigIntKeyword | namedTypes.TSBooleanKeyword | namedTypes.TSNeverKeyword | namedTypes.TSNullKeyword | namedTypes.TSNumberKeyword | namedTypes.TSObjectKeyword | namedTypes.TSStringKeyword | namedTypes.TSSymbolKeyword | namedTypes.TSUndefinedKeyword | namedTypes.TSUnknownKeyword | namedTypes.TSVoidKeyword | namedTypes.TSThisType | namedTypes.TSArrayType | namedTypes.TSLiteralType | namedTypes.TSUnionType | namedTypes.TSIntersectionType | namedTypes.TSConditionalType | namedTypes.TSInferType | namedTypes.TSTypeParameter | namedTypes.TSParenthesizedType | namedTypes.TSFunctionType | namedTypes.TSConstructorType | namedTypes.TSDeclareFunction | namedTypes.TSDeclareMethod | namedTypes.TSMappedType | namedTypes.TSTupleType | namedTypes.TSNamedTupleMember | namedTypes.TSRestType | namedTypes.TSOptionalType | namedTypes.TSIndexedAccessType | namedTypes.TSTypeOperator | namedTypes.TSIndexSignature | namedTypes.TSPropertySignature | namedTypes.TSMethodSignature | namedTypes.TSTypePredicate | namedTypes.TSCallSignatureDeclaration | namedTypes.TSConstructSignatureDeclaration | namedTypes.TSEnumMember | namedTypes.TSTypeQuery | namedTypes.TSImportType | namedTypes.TSTypeLiteral | namedTypes.TSTypeAssertion | namedTypes.TSEnumDeclaration | namedTypes.TSTypeAliasDeclaration | namedTypes.TSModuleBlock | namedTypes.TSModuleDeclaration | namedTypes.TSImportEqualsDeclaration | namedTypes.TSExternalModuleReference | namedTypes.TSExportAssignment | namedTypes.TSNamespaceExportDeclaration | namedTypes.TSInterfaceBody | namedTypes.TSInterfaceDeclaration | namedTypes.TSParameterProperty;
|
|
3
3
|
export declare type SourceLocationKind = namedTypes.SourceLocation;
|
|
4
|
-
export declare type NodeKind = namedTypes.File | namedTypes.Program | namedTypes.Identifier | namedTypes.BlockStatement | namedTypes.EmptyStatement | namedTypes.ExpressionStatement | namedTypes.IfStatement | namedTypes.LabeledStatement | namedTypes.BreakStatement | namedTypes.ContinueStatement | namedTypes.WithStatement | namedTypes.SwitchStatement | namedTypes.SwitchCase | namedTypes.ReturnStatement | namedTypes.ThrowStatement | namedTypes.TryStatement | namedTypes.CatchClause | namedTypes.WhileStatement | namedTypes.DoWhileStatement | namedTypes.ForStatement | namedTypes.VariableDeclaration | namedTypes.ForInStatement | namedTypes.DebuggerStatement | namedTypes.FunctionDeclaration | namedTypes.FunctionExpression | namedTypes.VariableDeclarator | namedTypes.ThisExpression | namedTypes.ArrayExpression | namedTypes.ObjectExpression | namedTypes.Property | namedTypes.Literal | namedTypes.SequenceExpression | namedTypes.UnaryExpression | namedTypes.BinaryExpression | namedTypes.AssignmentExpression | namedTypes.MemberExpression | namedTypes.UpdateExpression | namedTypes.LogicalExpression | namedTypes.ConditionalExpression | namedTypes.NewExpression | namedTypes.CallExpression | namedTypes.RestElement | namedTypes.TypeAnnotation | namedTypes.TSTypeAnnotation | namedTypes.SpreadElementPattern | namedTypes.ArrowFunctionExpression | namedTypes.ForOfStatement | namedTypes.YieldExpression | namedTypes.GeneratorExpression | namedTypes.ComprehensionBlock | namedTypes.ComprehensionExpression | namedTypes.ObjectProperty | namedTypes.PropertyPattern | namedTypes.ObjectPattern | namedTypes.ArrayPattern | namedTypes.SpreadElement | namedTypes.AssignmentPattern | namedTypes.MethodDefinition | namedTypes.ClassPropertyDefinition | namedTypes.ClassProperty | namedTypes.ClassBody | namedTypes.ClassDeclaration | namedTypes.ClassExpression | namedTypes.Super | namedTypes.ImportSpecifier | namedTypes.ImportDefaultSpecifier | namedTypes.ImportNamespaceSpecifier | namedTypes.ImportDeclaration | namedTypes.ExportNamedDeclaration | namedTypes.ExportSpecifier | namedTypes.ExportDefaultDeclaration | namedTypes.ExportAllDeclaration | namedTypes.TaggedTemplateExpression | namedTypes.TemplateLiteral | namedTypes.TemplateElement | namedTypes.MetaProperty | namedTypes.AwaitExpression | namedTypes.SpreadProperty | namedTypes.SpreadPropertyPattern | namedTypes.ImportExpression | namedTypes.
|
|
4
|
+
export declare type NodeKind = namedTypes.File | namedTypes.Program | namedTypes.Identifier | namedTypes.BlockStatement | namedTypes.EmptyStatement | namedTypes.ExpressionStatement | namedTypes.IfStatement | namedTypes.LabeledStatement | namedTypes.BreakStatement | namedTypes.ContinueStatement | namedTypes.WithStatement | namedTypes.SwitchStatement | namedTypes.SwitchCase | namedTypes.ReturnStatement | namedTypes.ThrowStatement | namedTypes.TryStatement | namedTypes.CatchClause | namedTypes.WhileStatement | namedTypes.DoWhileStatement | namedTypes.ForStatement | namedTypes.VariableDeclaration | namedTypes.ForInStatement | namedTypes.DebuggerStatement | namedTypes.FunctionDeclaration | namedTypes.FunctionExpression | namedTypes.VariableDeclarator | namedTypes.ThisExpression | namedTypes.ArrayExpression | namedTypes.ObjectExpression | namedTypes.Property | namedTypes.Literal | namedTypes.SequenceExpression | namedTypes.UnaryExpression | namedTypes.BinaryExpression | namedTypes.AssignmentExpression | namedTypes.MemberExpression | namedTypes.UpdateExpression | namedTypes.LogicalExpression | namedTypes.ConditionalExpression | namedTypes.NewExpression | namedTypes.CallExpression | namedTypes.RestElement | namedTypes.TypeAnnotation | namedTypes.TSTypeAnnotation | namedTypes.SpreadElementPattern | namedTypes.ArrowFunctionExpression | namedTypes.ForOfStatement | namedTypes.YieldExpression | namedTypes.GeneratorExpression | namedTypes.ComprehensionBlock | namedTypes.ComprehensionExpression | namedTypes.ObjectProperty | namedTypes.PropertyPattern | namedTypes.ObjectPattern | namedTypes.ArrayPattern | namedTypes.SpreadElement | namedTypes.AssignmentPattern | namedTypes.MethodDefinition | namedTypes.ClassPropertyDefinition | namedTypes.ClassProperty | namedTypes.ClassBody | namedTypes.ClassDeclaration | namedTypes.ClassExpression | namedTypes.Super | namedTypes.ImportSpecifier | namedTypes.ImportDefaultSpecifier | namedTypes.ImportNamespaceSpecifier | namedTypes.ImportDeclaration | namedTypes.ExportNamedDeclaration | namedTypes.ExportSpecifier | namedTypes.ExportDefaultDeclaration | namedTypes.ExportAllDeclaration | namedTypes.TaggedTemplateExpression | namedTypes.TemplateLiteral | namedTypes.TemplateElement | namedTypes.MetaProperty | namedTypes.AwaitExpression | namedTypes.SpreadProperty | namedTypes.SpreadPropertyPattern | namedTypes.ImportExpression | namedTypes.ChainExpression | namedTypes.OptionalCallExpression | namedTypes.OptionalMemberExpression | namedTypes.JSXAttribute | namedTypes.JSXIdentifier | namedTypes.JSXNamespacedName | namedTypes.JSXExpressionContainer | namedTypes.JSXElement | namedTypes.JSXFragment | namedTypes.JSXMemberExpression | namedTypes.JSXSpreadAttribute | namedTypes.JSXEmptyExpression | namedTypes.JSXText | namedTypes.JSXSpreadChild | namedTypes.JSXOpeningElement | namedTypes.JSXClosingElement | namedTypes.JSXOpeningFragment | namedTypes.JSXClosingFragment | namedTypes.Decorator | namedTypes.PrivateName | namedTypes.ClassPrivateProperty | namedTypes.TypeParameterDeclaration | namedTypes.TSTypeParameterDeclaration | namedTypes.TypeParameterInstantiation | namedTypes.TSTypeParameterInstantiation | namedTypes.ClassImplements | namedTypes.TSExpressionWithTypeArguments | namedTypes.AnyTypeAnnotation | namedTypes.EmptyTypeAnnotation | namedTypes.MixedTypeAnnotation | namedTypes.VoidTypeAnnotation | namedTypes.SymbolTypeAnnotation | namedTypes.NumberTypeAnnotation | namedTypes.BigIntTypeAnnotation | namedTypes.NumberLiteralTypeAnnotation | namedTypes.NumericLiteralTypeAnnotation | namedTypes.BigIntLiteralTypeAnnotation | namedTypes.StringTypeAnnotation | namedTypes.StringLiteralTypeAnnotation | namedTypes.BooleanTypeAnnotation | namedTypes.BooleanLiteralTypeAnnotation | namedTypes.NullableTypeAnnotation | namedTypes.NullLiteralTypeAnnotation | namedTypes.NullTypeAnnotation | namedTypes.ThisTypeAnnotation | namedTypes.ExistsTypeAnnotation | namedTypes.ExistentialTypeParam | namedTypes.FunctionTypeAnnotation | namedTypes.FunctionTypeParam | namedTypes.ArrayTypeAnnotation | namedTypes.ObjectTypeAnnotation | namedTypes.ObjectTypeProperty | namedTypes.ObjectTypeSpreadProperty | namedTypes.ObjectTypeIndexer | namedTypes.ObjectTypeCallProperty | namedTypes.ObjectTypeInternalSlot | namedTypes.Variance | namedTypes.QualifiedTypeIdentifier | namedTypes.GenericTypeAnnotation | namedTypes.MemberTypeAnnotation | namedTypes.UnionTypeAnnotation | namedTypes.IntersectionTypeAnnotation | namedTypes.TypeofTypeAnnotation | namedTypes.TypeParameter | namedTypes.InterfaceTypeAnnotation | namedTypes.InterfaceExtends | namedTypes.InterfaceDeclaration | namedTypes.DeclareInterface | namedTypes.TypeAlias | namedTypes.DeclareTypeAlias | namedTypes.OpaqueType | namedTypes.DeclareOpaqueType | namedTypes.TypeCastExpression | namedTypes.TupleTypeAnnotation | namedTypes.DeclareVariable | namedTypes.DeclareFunction | namedTypes.DeclareClass | namedTypes.DeclareModule | namedTypes.DeclareModuleExports | namedTypes.DeclareExportDeclaration | namedTypes.ExportBatchSpecifier | namedTypes.DeclareExportAllDeclaration | namedTypes.InferredPredicate | namedTypes.DeclaredPredicate | namedTypes.EnumDeclaration | namedTypes.ExportDeclaration | namedTypes.Noop | namedTypes.DoExpression | namedTypes.BindExpression | namedTypes.ParenthesizedExpression | namedTypes.ExportNamespaceSpecifier | namedTypes.ExportDefaultSpecifier | namedTypes.Directive | namedTypes.DirectiveLiteral | namedTypes.InterpreterDirective | namedTypes.StringLiteral | namedTypes.NumericLiteral | namedTypes.BigIntLiteral | namedTypes.NullLiteral | namedTypes.BooleanLiteral | namedTypes.RegExpLiteral | namedTypes.ObjectMethod | namedTypes.ClassMethod | namedTypes.ClassPrivateMethod | namedTypes.RestProperty | namedTypes.ForAwaitStatement | namedTypes.Import | namedTypes.TSQualifiedName | namedTypes.TSTypeReference | namedTypes.TSAsExpression | namedTypes.TSNonNullExpression | namedTypes.TSAnyKeyword | namedTypes.TSBigIntKeyword | namedTypes.TSBooleanKeyword | namedTypes.TSNeverKeyword | namedTypes.TSNullKeyword | namedTypes.TSNumberKeyword | namedTypes.TSObjectKeyword | namedTypes.TSStringKeyword | namedTypes.TSSymbolKeyword | namedTypes.TSUndefinedKeyword | namedTypes.TSUnknownKeyword | namedTypes.TSVoidKeyword | namedTypes.TSThisType | namedTypes.TSArrayType | namedTypes.TSLiteralType | namedTypes.TSUnionType | namedTypes.TSIntersectionType | namedTypes.TSConditionalType | namedTypes.TSInferType | namedTypes.TSTypeParameter | namedTypes.TSParenthesizedType | namedTypes.TSFunctionType | namedTypes.TSConstructorType | namedTypes.TSDeclareFunction | namedTypes.TSDeclareMethod | namedTypes.TSMappedType | namedTypes.TSTupleType | namedTypes.TSNamedTupleMember | namedTypes.TSRestType | namedTypes.TSOptionalType | namedTypes.TSIndexedAccessType | namedTypes.TSTypeOperator | namedTypes.TSIndexSignature | namedTypes.TSPropertySignature | namedTypes.TSMethodSignature | namedTypes.TSTypePredicate | namedTypes.TSCallSignatureDeclaration | namedTypes.TSConstructSignatureDeclaration | namedTypes.TSEnumMember | namedTypes.TSTypeQuery | namedTypes.TSImportType | namedTypes.TSTypeLiteral | namedTypes.TSTypeAssertion | namedTypes.TSEnumDeclaration | namedTypes.TSTypeAliasDeclaration | namedTypes.TSModuleBlock | namedTypes.TSModuleDeclaration | namedTypes.TSImportEqualsDeclaration | namedTypes.TSExternalModuleReference | namedTypes.TSExportAssignment | namedTypes.TSNamespaceExportDeclaration | namedTypes.TSInterfaceBody | namedTypes.TSInterfaceDeclaration | namedTypes.TSParameterProperty;
|
|
5
5
|
export declare type CommentKind = namedTypes.Block | namedTypes.Line | namedTypes.CommentBlock | namedTypes.CommentLine;
|
|
6
6
|
export declare type PositionKind = namedTypes.Position;
|
|
7
7
|
export declare type FileKind = namedTypes.File;
|
|
8
8
|
export declare type ProgramKind = namedTypes.Program;
|
|
9
9
|
export declare type StatementKind = namedTypes.BlockStatement | namedTypes.EmptyStatement | namedTypes.ExpressionStatement | namedTypes.IfStatement | namedTypes.LabeledStatement | namedTypes.BreakStatement | namedTypes.ContinueStatement | namedTypes.WithStatement | namedTypes.SwitchStatement | namedTypes.ReturnStatement | namedTypes.ThrowStatement | namedTypes.TryStatement | namedTypes.WhileStatement | namedTypes.DoWhileStatement | namedTypes.ForStatement | namedTypes.VariableDeclaration | namedTypes.ForInStatement | namedTypes.DebuggerStatement | namedTypes.FunctionDeclaration | namedTypes.ForOfStatement | namedTypes.MethodDefinition | namedTypes.ClassPropertyDefinition | namedTypes.ClassProperty | namedTypes.ClassBody | namedTypes.ClassDeclaration | namedTypes.ImportDeclaration | namedTypes.ExportNamedDeclaration | namedTypes.ExportDefaultDeclaration | namedTypes.ExportAllDeclaration | namedTypes.ClassPrivateProperty | namedTypes.TSTypeParameterDeclaration | namedTypes.InterfaceDeclaration | namedTypes.DeclareInterface | namedTypes.TypeAlias | namedTypes.DeclareTypeAlias | namedTypes.OpaqueType | namedTypes.DeclareOpaqueType | namedTypes.DeclareVariable | namedTypes.DeclareFunction | namedTypes.DeclareClass | namedTypes.DeclareModule | namedTypes.DeclareModuleExports | namedTypes.DeclareExportDeclaration | namedTypes.DeclareExportAllDeclaration | namedTypes.EnumDeclaration | namedTypes.ExportDeclaration | namedTypes.Noop | namedTypes.ClassMethod | namedTypes.ClassPrivateMethod | namedTypes.ForAwaitStatement | namedTypes.TSDeclareFunction | namedTypes.TSDeclareMethod | namedTypes.TSIndexSignature | namedTypes.TSPropertySignature | namedTypes.TSMethodSignature | namedTypes.TSCallSignatureDeclaration | namedTypes.TSConstructSignatureDeclaration | namedTypes.TSEnumDeclaration | namedTypes.TSTypeAliasDeclaration | namedTypes.TSModuleDeclaration | namedTypes.TSImportEqualsDeclaration | namedTypes.TSExternalModuleReference | namedTypes.TSExportAssignment | namedTypes.TSNamespaceExportDeclaration | namedTypes.TSInterfaceDeclaration;
|
|
10
10
|
export declare type FunctionKind = namedTypes.FunctionDeclaration | namedTypes.FunctionExpression | namedTypes.ArrowFunctionExpression | namedTypes.ObjectMethod | namedTypes.ClassMethod | namedTypes.ClassPrivateMethod;
|
|
11
|
-
export declare type ExpressionKind = namedTypes.Identifier | namedTypes.FunctionExpression | namedTypes.ThisExpression | namedTypes.ArrayExpression | namedTypes.ObjectExpression | namedTypes.Literal | namedTypes.SequenceExpression | namedTypes.UnaryExpression | namedTypes.BinaryExpression | namedTypes.AssignmentExpression | namedTypes.MemberExpression | namedTypes.UpdateExpression | namedTypes.LogicalExpression | namedTypes.ConditionalExpression | namedTypes.NewExpression | namedTypes.CallExpression | namedTypes.ArrowFunctionExpression | namedTypes.YieldExpression | namedTypes.GeneratorExpression | namedTypes.ComprehensionExpression | namedTypes.ClassExpression | namedTypes.Super | namedTypes.TaggedTemplateExpression | namedTypes.TemplateLiteral | namedTypes.MetaProperty | namedTypes.AwaitExpression | namedTypes.ImportExpression | namedTypes.
|
|
11
|
+
export declare type ExpressionKind = namedTypes.Identifier | namedTypes.FunctionExpression | namedTypes.ThisExpression | namedTypes.ArrayExpression | namedTypes.ObjectExpression | namedTypes.Literal | namedTypes.SequenceExpression | namedTypes.UnaryExpression | namedTypes.BinaryExpression | namedTypes.AssignmentExpression | namedTypes.MemberExpression | namedTypes.UpdateExpression | namedTypes.LogicalExpression | namedTypes.ConditionalExpression | namedTypes.NewExpression | namedTypes.CallExpression | namedTypes.ArrowFunctionExpression | namedTypes.YieldExpression | namedTypes.GeneratorExpression | namedTypes.ComprehensionExpression | namedTypes.ClassExpression | namedTypes.Super | namedTypes.TaggedTemplateExpression | namedTypes.TemplateLiteral | namedTypes.MetaProperty | namedTypes.AwaitExpression | namedTypes.ImportExpression | namedTypes.ChainExpression | namedTypes.OptionalCallExpression | namedTypes.OptionalMemberExpression | namedTypes.JSXIdentifier | namedTypes.JSXExpressionContainer | namedTypes.JSXElement | namedTypes.JSXFragment | namedTypes.JSXMemberExpression | namedTypes.JSXText | namedTypes.PrivateName | namedTypes.TypeCastExpression | namedTypes.DoExpression | namedTypes.BindExpression | namedTypes.ParenthesizedExpression | namedTypes.DirectiveLiteral | namedTypes.StringLiteral | namedTypes.NumericLiteral | namedTypes.BigIntLiteral | namedTypes.NullLiteral | namedTypes.BooleanLiteral | namedTypes.RegExpLiteral | namedTypes.Import | namedTypes.TSAsExpression | namedTypes.TSNonNullExpression | namedTypes.TSTypeParameter | namedTypes.TSTypeAssertion;
|
|
12
12
|
export declare type PatternKind = namedTypes.Identifier | namedTypes.RestElement | namedTypes.SpreadElementPattern | namedTypes.PropertyPattern | namedTypes.ObjectPattern | namedTypes.ArrayPattern | namedTypes.AssignmentPattern | namedTypes.SpreadPropertyPattern | namedTypes.JSXIdentifier | namedTypes.PrivateName | namedTypes.TSAsExpression | namedTypes.TSNonNullExpression | namedTypes.TSTypeParameter | namedTypes.TSTypeAssertion | namedTypes.TSParameterProperty;
|
|
13
13
|
export declare type IdentifierKind = namedTypes.Identifier | namedTypes.JSXIdentifier | namedTypes.TSTypeParameter;
|
|
14
14
|
export declare type BlockStatementKind = namedTypes.BlockStatement;
|
|
@@ -44,6 +44,7 @@ export declare type SequenceExpressionKind = namedTypes.SequenceExpression;
|
|
|
44
44
|
export declare type UnaryExpressionKind = namedTypes.UnaryExpression;
|
|
45
45
|
export declare type BinaryExpressionKind = namedTypes.BinaryExpression;
|
|
46
46
|
export declare type AssignmentExpressionKind = namedTypes.AssignmentExpression;
|
|
47
|
+
export declare type ChainElementKind = namedTypes.MemberExpression | namedTypes.CallExpression | namedTypes.OptionalCallExpression | namedTypes.OptionalMemberExpression | namedTypes.JSXMemberExpression;
|
|
47
48
|
export declare type MemberExpressionKind = namedTypes.MemberExpression | namedTypes.OptionalMemberExpression | namedTypes.JSXMemberExpression;
|
|
48
49
|
export declare type UpdateExpressionKind = namedTypes.UpdateExpression;
|
|
49
50
|
export declare type LogicalExpressionKind = namedTypes.LogicalExpression;
|
|
@@ -91,8 +92,9 @@ export declare type AwaitExpressionKind = namedTypes.AwaitExpression;
|
|
|
91
92
|
export declare type SpreadPropertyKind = namedTypes.SpreadProperty;
|
|
92
93
|
export declare type SpreadPropertyPatternKind = namedTypes.SpreadPropertyPattern;
|
|
93
94
|
export declare type ImportExpressionKind = namedTypes.ImportExpression;
|
|
94
|
-
export declare type
|
|
95
|
+
export declare type ChainExpressionKind = namedTypes.ChainExpression;
|
|
95
96
|
export declare type OptionalCallExpressionKind = namedTypes.OptionalCallExpression;
|
|
97
|
+
export declare type OptionalMemberExpressionKind = namedTypes.OptionalMemberExpression;
|
|
96
98
|
export declare type JSXAttributeKind = namedTypes.JSXAttribute;
|
|
97
99
|
export declare type JSXIdentifierKind = namedTypes.JSXIdentifier;
|
|
98
100
|
export declare type JSXNamespacedNameKind = namedTypes.JSXNamespacedName;
|
package/gen/namedTypes.d.ts
CHANGED
|
@@ -224,7 +224,10 @@ export declare namespace namedTypes {
|
|
|
224
224
|
left: K.PatternKind | K.MemberExpressionKind;
|
|
225
225
|
right: K.ExpressionKind;
|
|
226
226
|
}
|
|
227
|
-
interface
|
|
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)[];
|
|
@@ -476,14 +479,18 @@ export declare namespace namedTypes {
|
|
|
476
479
|
type: "ImportExpression";
|
|
477
480
|
source: K.ExpressionKind;
|
|
478
481
|
}
|
|
479
|
-
interface
|
|
480
|
-
type: "
|
|
481
|
-
|
|
482
|
+
interface ChainExpression extends Omit<Expression, "type"> {
|
|
483
|
+
type: "ChainExpression";
|
|
484
|
+
expression: K.ChainElementKind;
|
|
482
485
|
}
|
|
483
|
-
interface OptionalCallExpression extends Omit<CallExpression, "type"> {
|
|
486
|
+
interface OptionalCallExpression extends Omit<CallExpression, "type" | "optional"> {
|
|
484
487
|
type: "OptionalCallExpression";
|
|
485
488
|
optional?: boolean;
|
|
486
489
|
}
|
|
490
|
+
interface OptionalMemberExpression extends Omit<MemberExpression, "type" | "optional"> {
|
|
491
|
+
type: "OptionalMemberExpression";
|
|
492
|
+
optional?: boolean;
|
|
493
|
+
}
|
|
487
494
|
interface JSXAttribute extends Omit<Node, "type"> {
|
|
488
495
|
type: "JSXAttribute";
|
|
489
496
|
name: K.JSXIdentifierKind | K.JSXNamespacedNameKind;
|
|
@@ -1338,7 +1345,7 @@ export declare namespace namedTypes {
|
|
|
1338
1345
|
readonly?: boolean;
|
|
1339
1346
|
parameter: K.IdentifierKind | K.AssignmentPatternKind;
|
|
1340
1347
|
}
|
|
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 |
|
|
1348
|
+
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 | 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;
|
|
1342
1349
|
let Printable: Type<Printable>;
|
|
1343
1350
|
let SourceLocation: Type<SourceLocation>;
|
|
1344
1351
|
let Node: Type<Node>;
|
|
@@ -1384,6 +1391,7 @@ export declare namespace namedTypes {
|
|
|
1384
1391
|
let UnaryExpression: Type<UnaryExpression>;
|
|
1385
1392
|
let BinaryExpression: Type<BinaryExpression>;
|
|
1386
1393
|
let AssignmentExpression: Type<AssignmentExpression>;
|
|
1394
|
+
let ChainElement: Type<ChainElement>;
|
|
1387
1395
|
let MemberExpression: Type<MemberExpression>;
|
|
1388
1396
|
let UpdateExpression: Type<UpdateExpression>;
|
|
1389
1397
|
let LogicalExpression: Type<LogicalExpression>;
|
|
@@ -1431,8 +1439,9 @@ export declare namespace namedTypes {
|
|
|
1431
1439
|
let SpreadProperty: Type<SpreadProperty>;
|
|
1432
1440
|
let SpreadPropertyPattern: Type<SpreadPropertyPattern>;
|
|
1433
1441
|
let ImportExpression: Type<ImportExpression>;
|
|
1434
|
-
let
|
|
1442
|
+
let ChainExpression: Type<ChainExpression>;
|
|
1435
1443
|
let OptionalCallExpression: Type<OptionalCallExpression>;
|
|
1444
|
+
let OptionalMemberExpression: Type<OptionalMemberExpression>;
|
|
1436
1445
|
let JSXAttribute: Type<JSXAttribute>;
|
|
1437
1446
|
let JSXIdentifier: Type<JSXIdentifier>;
|
|
1438
1447
|
let JSXNamespacedName: Type<JSXNamespacedName>;
|
|
@@ -1661,6 +1670,7 @@ export interface NamedTypes {
|
|
|
1661
1670
|
UnaryExpression: Type<namedTypes.UnaryExpression>;
|
|
1662
1671
|
BinaryExpression: Type<namedTypes.BinaryExpression>;
|
|
1663
1672
|
AssignmentExpression: Type<namedTypes.AssignmentExpression>;
|
|
1673
|
+
ChainElement: Type<namedTypes.ChainElement>;
|
|
1664
1674
|
MemberExpression: Type<namedTypes.MemberExpression>;
|
|
1665
1675
|
UpdateExpression: Type<namedTypes.UpdateExpression>;
|
|
1666
1676
|
LogicalExpression: Type<namedTypes.LogicalExpression>;
|
|
@@ -1708,8 +1718,9 @@ export interface NamedTypes {
|
|
|
1708
1718
|
SpreadProperty: Type<namedTypes.SpreadProperty>;
|
|
1709
1719
|
SpreadPropertyPattern: Type<namedTypes.SpreadPropertyPattern>;
|
|
1710
1720
|
ImportExpression: Type<namedTypes.ImportExpression>;
|
|
1711
|
-
|
|
1721
|
+
ChainExpression: Type<namedTypes.ChainExpression>;
|
|
1712
1722
|
OptionalCallExpression: Type<namedTypes.OptionalCallExpression>;
|
|
1723
|
+
OptionalMemberExpression: Type<namedTypes.OptionalMemberExpression>;
|
|
1713
1724
|
JSXAttribute: Type<namedTypes.JSXAttribute>;
|
|
1714
1725
|
JSXIdentifier: Type<namedTypes.JSXIdentifier>;
|
|
1715
1726
|
JSXNamespacedName: Type<namedTypes.JSXNamespacedName>;
|
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,9 @@ 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
|
-
|
|
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;
|
|
99
101
|
visitJSXAttribute?(this: Context & M, path: NodePath<namedTypes.JSXAttribute>): any;
|
|
100
102
|
visitJSXIdentifier?(this: Context & M, path: NodePath<namedTypes.JSXIdentifier>): any;
|
|
101
103
|
visitJSXNamespacedName?(this: Context & M, path: NodePath<namedTypes.JSXNamespacedName>): any;
|
package/lib/scope.js
CHANGED
|
@@ -277,6 +277,8 @@ function scopePlugin(fork) {
|
|
|
277
277
|
}
|
|
278
278
|
else if ((namedTypes.SpreadElementPattern &&
|
|
279
279
|
namedTypes.SpreadElementPattern.check(pattern)) ||
|
|
280
|
+
(namedTypes.RestElement &&
|
|
281
|
+
namedTypes.RestElement.check(pattern)) ||
|
|
280
282
|
(namedTypes.SpreadPropertyPattern &&
|
|
281
283
|
namedTypes.SpreadPropertyPattern.check(pattern))) {
|
|
282
284
|
addPattern(patternPath.get('argument'), bindings);
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"author": "Ben Newman <bn@cs.stanford.edu>",
|
|
3
3
|
"name": "ast-types",
|
|
4
|
-
"version": "0.14.
|
|
4
|
+
"version": "0.14.2",
|
|
5
5
|
"description": "Esprima-compatible implementation of the Mozilla JS Parser API",
|
|
6
6
|
"keywords": [
|
|
7
7
|
"ast",
|
|
@@ -52,11 +52,11 @@
|
|
|
52
52
|
"flow-parser": "0.132.0",
|
|
53
53
|
"glob": "7.1.6",
|
|
54
54
|
"mocha": "^8.1.1",
|
|
55
|
-
"recast": "0.20.
|
|
55
|
+
"recast": "0.20.3",
|
|
56
56
|
"reify": "0.20.12",
|
|
57
57
|
"ts-add-module-exports": "1.0.0",
|
|
58
58
|
"ts-emit-clean": "1.0.0",
|
|
59
|
-
"ts-node": "
|
|
59
|
+
"ts-node": "9.0.0",
|
|
60
60
|
"typescript": "3.9.7"
|
|
61
61
|
},
|
|
62
62
|
"engines": {
|
package/def/es7.d.ts
DELETED
package/def/es7.js
DELETED
|
@@ -1,34 +0,0 @@
|
|
|
1
|
-
"use strict";;
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
var tslib_1 = require("tslib");
|
|
4
|
-
var es6_1 = tslib_1.__importDefault(require("./es6"));
|
|
5
|
-
var types_1 = tslib_1.__importDefault(require("../lib/types"));
|
|
6
|
-
var shared_1 = tslib_1.__importDefault(require("../lib/shared"));
|
|
7
|
-
function default_1(fork) {
|
|
8
|
-
fork.use(es6_1.default);
|
|
9
|
-
var types = fork.use(types_1.default);
|
|
10
|
-
var def = types.Type.def;
|
|
11
|
-
var or = types.Type.or;
|
|
12
|
-
var defaults = fork.use(shared_1.default).defaults;
|
|
13
|
-
def("Function")
|
|
14
|
-
.field("async", Boolean, defaults["false"]);
|
|
15
|
-
def("SpreadProperty")
|
|
16
|
-
.bases("Node")
|
|
17
|
-
.build("argument")
|
|
18
|
-
.field("argument", def("Expression"));
|
|
19
|
-
def("ObjectExpression")
|
|
20
|
-
.field("properties", [or(def("Property"), def("SpreadProperty"), def("SpreadElement"))]);
|
|
21
|
-
def("SpreadPropertyPattern")
|
|
22
|
-
.bases("Pattern")
|
|
23
|
-
.build("argument")
|
|
24
|
-
.field("argument", def("Pattern"));
|
|
25
|
-
def("ObjectPattern")
|
|
26
|
-
.field("properties", [or(def("Property"), def("PropertyPattern"), def("SpreadPropertyPattern"))]);
|
|
27
|
-
def("AwaitExpression")
|
|
28
|
-
.bases("Expression")
|
|
29
|
-
.build("argument", "all")
|
|
30
|
-
.field("argument", or(def("Expression"), null))
|
|
31
|
-
.field("all", Boolean, defaults["false"]);
|
|
32
|
-
}
|
|
33
|
-
exports.default = default_1;
|
|
34
|
-
module.exports = exports["default"];
|