import type { ClassExpression } from "./class"; import type { KeywordIdentifier, PrivateKeyIdentifier, PublicKeyIdentifier, VariableIdentifier, } from "./identifier"; import type { ArrowFunctionExpression, FunctionExpression } from "./function"; import type { AssignmentOperator, BinaryOperator, LogicalOperator, UnaryOperator, UpdateOperator, } from "../operator"; import type { CallablePattern, CallableUpdatePattern, UpdatePattern, } from "./pattern"; import type { Literal } from "./literal"; import type { ObjectExpression } from "./object"; import type { MemberExpression } from "./member"; import type { TaggedTemplateExpression, TemplateLiteral } from "./template"; import type { CallExpression } from "./call"; import type { ChainExpression } from "./chain"; import type { VariableDeclaration } from "./declaration"; export type Expression = | ArrayExpression | ArrowFunctionExpression | AssignmentExpression | AwaitExpression | BinaryExpression | CallExpression | ChainExpression | ClassExpression | ConditionalExpression | FunctionExpression | VariableIdentifier | ImportExpression | Literal | LogicalExpression | MemberExpression | MetaProperty | NewExpression | ObjectExpression | SequenceExpression | TaggedTemplateExpression | TemplateLiteral | ThisExpression | UnaryExpression | UpdateExpression | YieldExpression; export type DeclarableExpression = VariableDeclaration | Expression; export type SpreadableExpression = SpreadElement | Expression; export type SuperableExpression = Super | Expression; export type PrivatableExpression = PrivateKeyIdentifier | Expression; export type ThisExpression = X & { type: "ThisExpression"; }; export type ArrayExpression = X & { type: "ArrayExpression"; elements: Array | null>; }; export type SequenceExpression = X & { type: "SequenceExpression"; expressions: Expression[]; }; export type UnaryExpression = X & { type: "UnaryExpression"; operator: UnaryOperator; prefix: true; argument: Expression; }; export type InBinaryExpression = X & { type: "BinaryExpression"; operator: "in"; left: PrivatableExpression; right: Expression; }; export type OtherBinaryExpression = X & { type: "BinaryExpression"; operator: Exclude; left: Expression; right: Expression; }; export type BinaryExpression = | InBinaryExpression | OtherBinaryExpression; export type UpdateAssignmentExpression = X & { type: "AssignmentExpression"; operator: Exclude; prefix: boolean; }; export type LogicalExpression = X & { type: "LogicalExpression"; operator: LogicalOperator; left: Expression; right: Expression; }; export type ConditionalExpression = X & { type: "ConditionalExpression"; test: Expression; alternate: Expression; consequent: Expression; }; export type NewExpression = X & { type: "NewExpression"; callee: Expression; arguments: Array>; }; export type Super = X & { type: "Super"; }; export type SpreadElement = X & { type: "SpreadElement"; argument: Expression; }; export type YieldExpression = X & { type: "YieldExpression"; delegate: boolean; argument: Expression | null; }; export type MetaProperty = X & { type: "MetaProperty"; meta: KeywordIdentifier; property: PublicKeyIdentifier; }; export type ImportExpression = X & { type: "ImportExpression"; source: Expression; }; export type AwaitExpression = X & { type: "AwaitExpression"; argument: Expression; };