import type { VmConst, VmValue } from '@mirascript/mirascript'; import type { ExpressionOrValue, ExpressionSource } from '../expression.js'; import type { Scope } from '../scope.js'; import type { Evaluator } from '../main.js'; /** * 表示一个具有类似表达式功能的 JS 函数,与某个 {@link ArgumentValue} 相关联,在其之后求值 */ export type ArgumentFunction = ( /** 相关联的参数值 */ value: V, /** 当前作用域 */ scope: Scope, /** 当前求值器 */ evaluator: Evaluator, ) => R; /** 条件表达式 */ export type ConditionExpression = boolean | ExpressionSource; /** 条件函数 */ export type ConditionFunction = ArgumentFunction; /** 参数值 */ export type ArgumentValue = NonNullable; /** 未求值的参数表 */ export type ArgumentMap = Record> = { [K in keyof T]?: ExpressionOrValue>; };