import type { Location } from '@wyw-in-js/shared'; export type SourceLocation = { end: Location; filename?: string; identifierName?: string | null; start: Location; }; export type BaseAstNode = { end?: number | null; loc?: unknown; start?: number | null; type: string; }; export type Expression = BaseAstNode; export type Identifier = Expression & { name: string; type: 'Identifier'; }; export type StringLiteral = Expression & { type: 'StringLiteral'; value: string; }; export type NumericLiteral = Expression & { type: 'NumericLiteral'; value: number; }; export type BooleanLiteral = Expression & { type: 'BooleanLiteral'; value: boolean; }; export type NullLiteral = Expression & { type: 'NullLiteral'; }; export type BlockStatement = BaseAstNode & { body: BaseAstNode[]; type: 'BlockStatement'; }; export type TemplateElement = BaseAstNode & { loc?: SourceLocation | null; tail: boolean; type: 'TemplateElement'; value: { cooked?: string | null; raw: string; }; }; export type MemberExpression = Expression & { computed?: boolean; object: Expression; property: Expression; type: 'MemberExpression'; }; export type ObjectProperty = BaseAstNode & { computed?: boolean; key: Expression; shorthand?: boolean; type: 'ObjectProperty'; value: Expression; }; export type ObjectExpression = Expression & { properties: ObjectProperty[]; type: 'ObjectExpression'; }; export type ArrayExpression = Expression & { elements: (Expression | null)[]; type: 'ArrayExpression'; }; export type CallExpression = Expression & { arguments: Expression[]; callee: Expression; type: 'CallExpression'; }; export type ArrowFunctionExpression = Expression & { async?: boolean; body: BlockStatement | Expression; params: Identifier[]; type: 'ArrowFunctionExpression'; }; export type AstService = { addDefaultImport(source: string, nameHint?: string): Identifier; addNamedImport(name: string, source: string, nameHint?: string): Identifier; arrayExpression(elements: (Expression | null)[]): ArrayExpression; arrowFunctionExpression(params: Identifier[], body: BlockStatement | Expression): ArrowFunctionExpression; blockStatement(body: BaseAstNode[]): BlockStatement; booleanLiteral(value: boolean): BooleanLiteral; callExpression(callee: Expression, args: Expression[]): CallExpression; identifier(name: string): Identifier; memberExpression(object: Expression, property: Expression, computed?: boolean): MemberExpression; nullLiteral(): NullLiteral; numericLiteral(value: number): NumericLiteral; objectExpression(properties: ObjectProperty[]): ObjectExpression; objectProperty(key: Expression, value: Expression): ObjectProperty; stringLiteral(value: string): StringLiteral; }; export declare const expressionToCode: (expression: Expression) => string;