import type { VmContext, VmValue } from '@mirascript/mirascript'; import type { Result } from './interface.js'; /** 转换状态 */ export declare class BaseState { private readonly expr; readonly condition: boolean; /** 可识别的全局环境 */ protected readonly globals: VmContext; constructor(expr: string, condition: boolean, /** 可识别的全局环境 */ globals: VmContext); private readonly globalsCache; /** 获取全局变量 */ hasGlobal(name: string): boolean; /** 获取全局变量 */ global(name: string): VmValue | undefined; /** 帮助函数 */ private readonly helpers; /** 添加帮助函数 */ helper(code: string): void; /** 产生的警告 */ private readonly warnings; /** 产生的错误 */ private readonly errors; /** 产生的失败 */ private readonly critical; /** 声明的本地变量 / 函数 */ readonly locals: Map; /** 标记为非精确转换 */ loose(): void; /** 标记为非精确转换 */ warn(message: string): void; /** 标记为非精确转换 */ err(message: string): void; /** 标记为转换失败 */ crit(message: string): void; private readonly ret; /** 转换一个语句 */ private migrateStmt; /** 转换 */ migrate(): void; /** 获取结果 */ result(): string; } /** 转换状态 */ export type State = Omit<{ [K in keyof BaseState]: BaseState[K]; }, 'migrate' | 'result'>; /** 函数状态 */ export declare class FunctionState implements State { readonly baseState: State; constructor(baseState: State, params: readonly string[]); /** @inheritdoc */ readonly condition = false; /** @inheritdoc */ hasGlobal(name: string): boolean; /** @inheritdoc */ global(name: string): VmValue | undefined; /** @inheritdoc */ helper(code: string): void; /** @inheritdoc */ readonly locals: Map; /** @inheritdoc */ loose(): void; /** @inheritdoc */ warn(message: string): void; /** @inheritdoc */ err(message: string): void; /** @inheritdoc */ crit(message: string): void; } //# sourceMappingURL=state.d.ts.map