import { type VmContext, type VmValue } from '@mirascript/mirascript'; import { type CompiledExpression, type Expression, type ExpressionOrValue } from './expression.js'; import type { Evaluator } from './main.js'; /** 函数的执行环境 */ export declare class Scope { /** 生成环境的工厂函数 */ readonly scope: ((key: string) => ExpressionOrValue | undefined) | Record | null; /** 求值失败是否抛异常 */ readonly throws: boolean; /** 执行环境名称 */ readonly name: string; constructor( /** 生成环境的工厂函数 */ scope?: ((key: string) => ExpressionOrValue | undefined) | Record | null, /** 求值失败是否抛异常 */ throws?: boolean, /** 执行环境名称 */ name?: string); /** 枚举环境中的值 */ enumerator: (() => Iterable) | null | undefined; /** 描述环境中的值 */ describer: ((key: string) => string | undefined) | null | undefined; /** 执行器上下文 */ protected evaluator: Evaluator | null; /** 求值计数 */ protected evalCounter: number; /** 重置执行器 */ reset(evaluator: Evaluator | null): () => void; /** 函数的执行环境,惰性求值 */ protected _proxy: VmContext | null; /** 函数的执行环境,惰性求值 */ get proxy(): VmContext; /** 检查环境中是否有值,不包含 evaluator 和 default context 中的值 */ has(key: string): boolean; /** 获取环境中的值,不包含 evaluator 和 default context 中的值 */ get(key: string): V | undefined; /** 表达式递归求值 */ eval(expression: Expression | CompiledExpression, path: readonly PropertyKey[]): VmValue; } /** 移除 PROXY */ export declare function unwrap(value: T): T; //# sourceMappingURL=scope.d.ts.map