ast-types 0.12.3 → 0.13.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/gen/namedTypes.js CHANGED
@@ -1,2 +1,5 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
+ var namedTypes;
4
+ (function (namedTypes) {
5
+ })(namedTypes = exports.namedTypes || (exports.namedTypes = {}));
package/gen/nodes.d.ts CHANGED
@@ -46,11 +46,11 @@ export interface Function extends Node {
46
46
  returnType: K.TypeAnnotationKind | K.TSTypeAnnotationKind | null;
47
47
  typeParameters: K.TypeParameterDeclarationKind | K.TSTypeParameterDeclarationKind | null;
48
48
  }
49
- export interface Pattern extends Node {
49
+ export interface Expression extends Node {
50
50
  }
51
- export interface Expression extends Node, Pattern {
51
+ export interface Pattern extends Node {
52
52
  }
53
- export interface Identifier extends Omit<Node, "type">, Omit<Expression, "type">, Omit<Pattern, "type"> {
53
+ export interface Identifier extends Omit<Expression, "type">, Omit<Pattern, "type"> {
54
54
  type: "Identifier";
55
55
  name: string;
56
56
  optional: boolean;
@@ -191,7 +191,7 @@ export interface Property extends Omit<Node, "type"> {
191
191
  computed: boolean;
192
192
  decorators: K.DecoratorKind[] | null;
193
193
  }
194
- export interface Literal extends Omit<Node, "type">, Omit<Expression, "type"> {
194
+ export interface Literal extends Omit<Expression, "type"> {
195
195
  type: "Literal";
196
196
  value: string | boolean | null | number | RegExp;
197
197
  regex: {
@@ -218,9 +218,15 @@ export interface BinaryExpression extends Omit<Expression, "type"> {
218
218
  export interface AssignmentExpression extends Omit<Expression, "type"> {
219
219
  type: "AssignmentExpression";
220
220
  operator: "=" | "+=" | "-=" | "*=" | "/=" | "%=" | "<<=" | ">>=" | ">>>=" | "|=" | "^=" | "&=";
221
- left: K.PatternKind;
221
+ left: K.PatternKind | K.MemberExpressionKind;
222
222
  right: K.ExpressionKind;
223
223
  }
224
+ export interface MemberExpression extends Omit<Expression, "type"> {
225
+ type: "MemberExpression";
226
+ object: K.ExpressionKind;
227
+ property: K.IdentifierKind | K.ExpressionKind;
228
+ computed: boolean;
229
+ }
224
230
  export interface UpdateExpression extends Omit<Expression, "type"> {
225
231
  type: "UpdateExpression";
226
232
  operator: "++" | "--";
@@ -249,12 +255,6 @@ export interface CallExpression extends Omit<Expression, "type"> {
249
255
  callee: K.ExpressionKind;
250
256
  arguments: (K.ExpressionKind | K.SpreadElementKind)[];
251
257
  }
252
- export interface MemberExpression extends Omit<Expression, "type"> {
253
- type: "MemberExpression";
254
- object: K.ExpressionKind;
255
- property: K.IdentifierKind | K.ExpressionKind;
256
- computed: boolean;
257
- }
258
258
  export interface RestElement extends Omit<Pattern, "type"> {
259
259
  type: "RestElement";
260
260
  argument: K.PatternKind;
@@ -985,7 +985,7 @@ export interface TSHasOptionalTypeParameters {
985
985
  export interface TSHasOptionalTypeAnnotation {
986
986
  typeAnnotation: K.TSTypeAnnotationKind | null;
987
987
  }
988
- export interface TSAsExpression extends Omit<Expression, "type"> {
988
+ export interface TSAsExpression extends Omit<Expression, "type">, Omit<Pattern, "type"> {
989
989
  type: "TSAsExpression";
990
990
  expression: K.ExpressionKind;
991
991
  typeAnnotation: K.TSTypeKind;
@@ -993,7 +993,7 @@ export interface TSAsExpression extends Omit<Expression, "type"> {
993
993
  parenthesized: boolean;
994
994
  } | null;
995
995
  }
996
- export interface TSNonNullExpression extends Omit<Expression, "type"> {
996
+ export interface TSNonNullExpression extends Omit<Expression, "type">, Omit<Pattern, "type"> {
997
997
  type: "TSNonNullExpression";
998
998
  expression: K.ExpressionKind;
999
999
  }
@@ -1042,7 +1042,7 @@ export interface TSArrayType extends Omit<TSType, "type"> {
1042
1042
  }
1043
1043
  export interface TSLiteralType extends Omit<TSType, "type"> {
1044
1044
  type: "TSLiteralType";
1045
- literal: K.NumericLiteralKind | K.StringLiteralKind | K.BooleanLiteralKind;
1045
+ literal: K.NumericLiteralKind | K.StringLiteralKind | K.BooleanLiteralKind | K.TemplateLiteralKind | K.UnaryExpressionKind;
1046
1046
  }
1047
1047
  export interface TSUnionType extends Omit<TSType, "type"> {
1048
1048
  type: "TSUnionType";
@@ -1186,7 +1186,7 @@ export interface TSTypeLiteral extends Omit<TSType, "type"> {
1186
1186
  type: "TSTypeLiteral";
1187
1187
  members: (K.TSCallSignatureDeclarationKind | K.TSConstructSignatureDeclarationKind | K.TSIndexSignatureKind | K.TSMethodSignatureKind | K.TSPropertySignatureKind)[];
1188
1188
  }
1189
- export interface TSTypeAssertion extends Omit<Expression, "type"> {
1189
+ export interface TSTypeAssertion extends Omit<Expression, "type">, Omit<Pattern, "type"> {
1190
1190
  type: "TSTypeAssertion";
1191
1191
  typeAnnotation: K.TSTypeKind;
1192
1192
  expression: K.ExpressionKind;
@@ -1262,4 +1262,4 @@ export interface OptionalCallExpression extends Omit<CallExpression, "type"> {
1262
1262
  type: "OptionalCallExpression";
1263
1263
  optional: boolean;
1264
1264
  }
1265
- export declare 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 | UpdateExpression | LogicalExpression | ConditionalExpression | NewExpression | CallExpression | MemberExpression | RestElement | TypeAnnotation | TSTypeAnnotation | SpreadElementPattern | ArrowFunctionExpression | ForOfStatement | YieldExpression | GeneratorExpression | ComprehensionBlock | ComprehensionExpression | ObjectProperty | PropertyPattern | ObjectPattern | ArrayPattern | MethodDefinition | SpreadElement | AssignmentPattern | ClassPropertyDefinition | ClassProperty | ClassBody | ClassDeclaration | ClassExpression | ImportSpecifier | ImportNamespaceSpecifier | ImportDefaultSpecifier | ImportDeclaration | TaggedTemplateExpression | TemplateLiteral | TemplateElement | SpreadProperty | SpreadPropertyPattern | AwaitExpression | JSXAttribute | JSXIdentifier | JSXNamespacedName | JSXExpressionContainer | JSXMemberExpression | JSXSpreadAttribute | JSXElement | JSXOpeningElement | JSXClosingElement | JSXFragment | JSXText | JSXOpeningFragment | JSXClosingFragment | JSXEmptyExpression | JSXSpreadChild | TypeParameterDeclaration | TSTypeParameterDeclaration | TypeParameterInstantiation | TSTypeParameterInstantiation | ClassImplements | TSExpressionWithTypeArguments | AnyTypeAnnotation | EmptyTypeAnnotation | MixedTypeAnnotation | VoidTypeAnnotation | NumberTypeAnnotation | NumberLiteralTypeAnnotation | NumericLiteralTypeAnnotation | 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 | OpaqueType | DeclareTypeAlias | DeclareOpaqueType | TypeCastExpression | TupleTypeAnnotation | DeclareVariable | DeclareFunction | DeclareClass | DeclareModule | DeclareModuleExports | DeclareExportDeclaration | ExportSpecifier | ExportBatchSpecifier | DeclareExportAllDeclaration | InferredPredicate | DeclaredPredicate | ExportDeclaration | Block | Line | Noop | DoExpression | Super | BindExpression | Decorator | MetaProperty | ParenthesizedExpression | ExportDefaultDeclaration | ExportNamedDeclaration | ExportNamespaceSpecifier | ExportDefaultSpecifier | ExportAllDeclaration | CommentBlock | CommentLine | Directive | DirectiveLiteral | InterpreterDirective | StringLiteral | NumericLiteral | BigIntLiteral | NullLiteral | BooleanLiteral | RegExpLiteral | ObjectMethod | ClassPrivateProperty | ClassMethod | ClassPrivateMethod | PrivateName | 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 | 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 | OptionalMemberExpression | OptionalCallExpression;
1265
+ export declare 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 | MethodDefinition | SpreadElement | AssignmentPattern | ClassPropertyDefinition | ClassProperty | ClassBody | ClassDeclaration | ClassExpression | ImportSpecifier | ImportNamespaceSpecifier | ImportDefaultSpecifier | ImportDeclaration | TaggedTemplateExpression | TemplateLiteral | TemplateElement | SpreadProperty | SpreadPropertyPattern | AwaitExpression | JSXAttribute | JSXIdentifier | JSXNamespacedName | JSXExpressionContainer | JSXMemberExpression | JSXSpreadAttribute | JSXElement | JSXOpeningElement | JSXClosingElement | JSXFragment | JSXText | JSXOpeningFragment | JSXClosingFragment | JSXEmptyExpression | JSXSpreadChild | TypeParameterDeclaration | TSTypeParameterDeclaration | TypeParameterInstantiation | TSTypeParameterInstantiation | ClassImplements | TSExpressionWithTypeArguments | AnyTypeAnnotation | EmptyTypeAnnotation | MixedTypeAnnotation | VoidTypeAnnotation | NumberTypeAnnotation | NumberLiteralTypeAnnotation | NumericLiteralTypeAnnotation | 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 | OpaqueType | DeclareTypeAlias | DeclareOpaqueType | TypeCastExpression | TupleTypeAnnotation | DeclareVariable | DeclareFunction | DeclareClass | DeclareModule | DeclareModuleExports | DeclareExportDeclaration | ExportSpecifier | ExportBatchSpecifier | DeclareExportAllDeclaration | InferredPredicate | DeclaredPredicate | ExportDeclaration | Block | Line | Noop | DoExpression | Super | BindExpression | Decorator | MetaProperty | ParenthesizedExpression | ExportDefaultDeclaration | ExportNamedDeclaration | ExportNamespaceSpecifier | ExportDefaultSpecifier | ExportAllDeclaration | CommentBlock | CommentLine | Directive | DirectiveLiteral | InterpreterDirective | StringLiteral | NumericLiteral | BigIntLiteral | NullLiteral | BooleanLiteral | RegExpLiteral | ObjectMethod | ClassPrivateProperty | ClassMethod | ClassPrivateMethod | PrivateName | 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 | 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 | OptionalMemberExpression | OptionalCallExpression;