pub enum Statement {
Show 45 variants
BlockStatement(BlockStatement),
ReturnStatement(ReturnStatement),
IfStatement(IfStatement),
ForStatement(ForStatement),
WhileStatement(WhileStatement),
DoWhileStatement(DoWhileStatement),
ForInStatement(ForInStatement),
ForOfStatement(ForOfStatement),
SwitchStatement(SwitchStatement),
ThrowStatement(ThrowStatement),
TryStatement(TryStatement),
BreakStatement(BreakStatement),
ContinueStatement(ContinueStatement),
LabeledStatement(LabeledStatement),
ExpressionStatement(ExpressionStatement),
EmptyStatement(EmptyStatement),
DebuggerStatement(DebuggerStatement),
WithStatement(WithStatement),
VariableDeclaration(VariableDeclaration),
FunctionDeclaration(FunctionDeclaration),
ClassDeclaration(ClassDeclaration),
ImportDeclaration(ImportDeclaration),
ExportNamedDeclaration(ExportNamedDeclaration),
ExportDefaultDeclaration(ExportDefaultDeclaration),
ExportAllDeclaration(ExportAllDeclaration),
TSTypeAliasDeclaration(TSTypeAliasDeclaration),
TSInterfaceDeclaration(TSInterfaceDeclaration),
TSEnumDeclaration(TSEnumDeclaration),
TSModuleDeclaration(TSModuleDeclaration),
TSDeclareFunction(TSDeclareFunction),
TypeAlias(TypeAlias),
OpaqueType(OpaqueType),
InterfaceDeclaration(InterfaceDeclaration),
DeclareVariable(DeclareVariable),
DeclareFunction(DeclareFunction),
DeclareClass(DeclareClass),
DeclareModule(DeclareModule),
DeclareModuleExports(DeclareModuleExports),
DeclareExportDeclaration(DeclareExportDeclaration),
DeclareExportAllDeclaration(DeclareExportAllDeclaration),
DeclareInterface(DeclareInterface),
DeclareTypeAlias(DeclareTypeAlias),
DeclareOpaqueType(DeclareOpaqueType),
EnumDeclaration(EnumDeclaration),
Unknown(UnknownStatement),
}Variants§
BlockStatement(BlockStatement)
ReturnStatement(ReturnStatement)
IfStatement(IfStatement)
ForStatement(ForStatement)
WhileStatement(WhileStatement)
DoWhileStatement(DoWhileStatement)
ForInStatement(ForInStatement)
ForOfStatement(ForOfStatement)
SwitchStatement(SwitchStatement)
ThrowStatement(ThrowStatement)
TryStatement(TryStatement)
BreakStatement(BreakStatement)
ContinueStatement(ContinueStatement)
LabeledStatement(LabeledStatement)
ExpressionStatement(ExpressionStatement)
EmptyStatement(EmptyStatement)
DebuggerStatement(DebuggerStatement)
WithStatement(WithStatement)
VariableDeclaration(VariableDeclaration)
FunctionDeclaration(FunctionDeclaration)
ClassDeclaration(ClassDeclaration)
ImportDeclaration(ImportDeclaration)
ExportNamedDeclaration(ExportNamedDeclaration)
ExportDefaultDeclaration(ExportDefaultDeclaration)
ExportAllDeclaration(ExportAllDeclaration)
TSTypeAliasDeclaration(TSTypeAliasDeclaration)
TSInterfaceDeclaration(TSInterfaceDeclaration)
TSEnumDeclaration(TSEnumDeclaration)
TSModuleDeclaration(TSModuleDeclaration)
TSDeclareFunction(TSDeclareFunction)
TypeAlias(TypeAlias)
OpaqueType(OpaqueType)
InterfaceDeclaration(InterfaceDeclaration)
DeclareVariable(DeclareVariable)
DeclareFunction(DeclareFunction)
DeclareClass(DeclareClass)
DeclareModule(DeclareModule)
DeclareModuleExports(DeclareModuleExports)
DeclareExportDeclaration(DeclareExportDeclaration)
DeclareExportAllDeclaration(DeclareExportAllDeclaration)
DeclareInterface(DeclareInterface)
DeclareTypeAlias(DeclareTypeAlias)
DeclareOpaqueType(DeclareOpaqueType)
EnumDeclaration(EnumDeclaration)
Unknown(UnknownStatement)
Catch-all for statement types the typed AST does not model, e.g. the
TypeScript module-interop statements import x = require(...),
export = x, and export as namespace X. Carries the complete raw
Babel node so the Babel path can preserve unmodeled top-level
statements verbatim instead of failing the whole file.
Deserialization dispatches through [KnownStatement]: a modeled type
whose body is malformed errors with the typed variant’s precise message
rather than degrading to Unknown. Adding a variant to this enum
requires adding it to the known_statements! list below, which is the
single source for the dispatch enum, its From mapping, and
[KNOWN_STATEMENT_TYPES]. A variant added here but not there degrades
to Unknown silently; that is the one drift case structure cannot
catch.