/** * A `kind` is a union of node types that appears as a property value in any * node type. For instance, `KeyIdentifier` appears as the `property` of * `NonComputedMemberExpression` and can either an `Identifier` or a * `PrivateIdentifier`. * * @module */ import type { CatchClause, BlockStatement, Statement, SwitchCase, } from "./node/statement"; import type { ChainableExpression, SuperableChainableExpression, } from "./node/chain"; import type { CallablePattern, CallableUpdatePattern, DeclarablePattern, Pattern, RestablePattern, RestablePatternProperty, UpdatePattern, } from "./node/pattern"; import type { ClassEntry, ClassBody } from "./node/class"; import type { ConstructorFunctionExpression, MethodFunctionExpression, GetterFunctionExpression, SetterFunctionExpression, } from "./node/function"; import type { Declaration, VariableDeclarator } from "./node/declaration"; import type { DefaultDeclaration, ExportSpecifier, ImportSpecifier, ModuleStatement, Specifier, } from "./node/module"; import type { DeclarableExpression, Expression, PrivatableExpression, SpreadableExpression, SuperableExpression, } from "./node/expression"; import type { Program } from "./node/program"; import type { Key, KeyIdentifier, PublicKey } from "./node/key"; import type { SourceLiteral } from "./node/literal"; import type { SpreadableObjectProperty } from "./node/object"; import type { TemplateElement, TemplateLiteral } from "./node/template"; import type { ConstructorIdentifier, KeywordIdentifier, LabelIdentifier, PublicKeyIdentifier, VariableIdentifier, } from "./node/identifier"; export type KindRecord = { SuperableChainableExpression: SuperableChainableExpression; MethodFunctionExpression: MethodFunctionExpression; ConstructorFunctionExpression: ConstructorFunctionExpression; GetterFunctionExpression: GetterFunctionExpression; SetterFunctionExpression: SetterFunctionExpression; DeclarableExpression: DeclarableExpression; Program: Program; ScriptProgram: Program; ModuleProgram: Program; Expression: Expression; SpreadableExpression: SpreadableExpression; SuperableExpression: SuperableExpression; Statement: Statement; ModuleStatement: ModuleStatement; Pattern: Pattern; RestablePattern: RestablePattern; DefaultDeclaration: DefaultDeclaration; RestablePatternProperty: RestablePatternProperty; Key: Key; KeyIdentifier: KeyIdentifier; PublicKey: PublicKey; SourceLiteral: SourceLiteral; SpreadableObjectProperty: SpreadableObjectProperty; TemplateElement: TemplateElement; TemplateLiteral: TemplateLiteral; CallableUpdatePattern: CallableUpdatePattern; VariableDeclarator: VariableDeclarator; DeclarablePattern: DeclarablePattern; ConstructorIdentifier: ConstructorIdentifier; PublicKeyIdentifier: PublicKeyIdentifier; ChainableExpression: ChainableExpression; CatchClause: CatchClause; SwitchCase: SwitchCase; Specifier: Specifier; KeywordIdentifier: KeywordIdentifier; ImportSpecifier: ImportSpecifier; LabelIdentifier: LabelIdentifier; VariableIdentifier: VariableIdentifier; ExportSpecifier: ExportSpecifier; CallablePattern: CallablePattern; Declaration: Declaration; BlockStatement: BlockStatement; ClassBody: ClassBody; PrivatableExpression: PrivatableExpression; ClassEntry: ClassEntry; UpdatePattern: UpdatePattern; }; export type Kind = keyof KindRecord<{}>;