import type { AnonymousClassDeclaration, ClassDeclaration } from "./class"; import type { Declaration } from "./declaration"; import type { Expression } from "./expression"; import type { AnonymousFunctionDeclaration, FunctionDeclaration, } from "./function"; import type { SpecifierIdentifier, VariableIdentifier } from "./identifier"; import type { SpecifierLiteral, SourceLiteral } from "./literal"; import type { Statement } from "./statement"; export type ModuleStatement = Statement | ModuleDeclaration; export type ModuleDeclaration = | ImportDeclaration | ExportNamedDeclaration | ExportDefaultDeclaration | ExportAllDeclaration; export type Specifier = SpecifierIdentifier | SpecifierLiteral; export type ImportSpecifier = | RegularImportSpecifier | ImportDefaultSpecifier | ImportNamespaceSpecifier; export type ExportNamedDeclaration = | AggregateExportNamedDeclaration | IndirectExportNamedDeclaration | DirectExportNamedDeclaration; export type DefaultDeclaration = | AnonymousFunctionDeclaration | FunctionDeclaration | AnonymousClassDeclaration | ClassDeclaration | Expression; export type ImportDeclaration = X & { type: "ImportDeclaration"; specifiers: Array>; source: SourceLiteral; }; export type RegularImportSpecifier = X & { type: "ImportSpecifier"; imported: Specifier; local: VariableIdentifier; }; export type ImportDefaultSpecifier = X & { type: "ImportDefaultSpecifier"; local: VariableIdentifier; }; export type ImportNamespaceSpecifier = X & { type: "ImportNamespaceSpecifier"; local: VariableIdentifier; }; export type AggregateExportNamedDeclaration = X & { type: "ExportNamedDeclaration"; declaration: null; specifiers: AggregateExportSpecifier[]; source: SourceLiteral; }; export type IndirectExportNamedDeclaration = X & { type: "ExportNamedDeclaration"; declaration: null; specifiers: ExportSpecifier[]; source: null; }; export type DirectExportNamedDeclaration = X & { type: "ExportNamedDeclaration"; declaration: Declaration; specifiers: []; source: null; }; export type AggregateExportSpecifier = X & { type: "ExportSpecifier"; exported: Specifier; local: Specifier; }; export type ExportSpecifier = X & { type: "ExportSpecifier"; exported: Specifier; local: VariableIdentifier; }; export type ExportDefaultDeclaration = X & { type: "ExportDefaultDeclaration"; declaration: DefaultDeclaration; }; export type ExportAllDeclaration = X & { type: "ExportAllDeclaration"; exported: Specifier | null; source: SourceLiteral; };