/** * Closure, host function, method, and invocation evaluation. * @internal */ import type { HostCallNode, HostRefNode, ClosureCallNode, MethodCallNode, InvokeNode, PipeInvokeNode, SourceLocation } from '../../../../types.js'; import type { RillCallable, ScriptCallable } from '../../callable.js'; import type { RuntimeContext } from '../../types/runtime.js'; import type { RillValue } from '../../types/structures.js'; import type { EvalState } from '../state.js'; /** Invoke any callable; dispatches by kind. */ export declare function invokeCallable(s: EvalState, callable: RillCallable, args: (RillValue | undefined)[], callLocation?: SourceLocation, functionName?: string, internal?: boolean): Promise; /** Create closure execution context with defining scope as parent. */ export declare function createCallableContext(s: EvalState, callable: ScriptCallable): RuntimeContext; /** Push chunk to active stream channel, or throw YieldSignal if not streaming. */ export declare function evaluateYield(s: EvalState, value: RillValue, location?: SourceLocation): never | Promise; /** Evaluate host function call: functionName(args). * * When `inPipeTarget` is true the unified pipe-binding rule applies: * auto-prepend fires when no top-level `$` appears in the argument list. * When false (primary-expression context) the legacy guard is used instead * (`args.length === 0`), preserving existing behaviour for calls inside * blocks, conditionals, and other non-direct-pipe-target positions. */ export declare function evaluateHostCall(s: EvalState, node: HostCallNode, inPipeTarget?: boolean): Promise; /** Evaluate host function reference: ns::name. Returns callable when pipeValue is null. */ export declare function evaluateHostRef(s: EvalState, node: HostRefNode): Promise; /** Evaluate closure call: $fn(args). */ export declare function evaluateClosureCall(s: EvalState, node: ClosureCallNode): Promise; /** Evaluate closure call with pipe input; supports access chains like $math.double(args). */ export declare function evaluateClosureCallWithPipe(s: EvalState, node: ClosureCallNode, pipeInput: RillValue): Promise; /** Evaluate pipe invoke: value -> (args). */ export declare function evaluatePipeInvoke(s: EvalState, node: PipeInvokeNode, input: RillValue): Promise; /** Evaluate method call on receiver: value.method(args). */ export declare function evaluateMethod(s: EvalState, node: MethodCallNode | InvokeNode, receiver: RillValue): Promise; /** Evaluate annotation reflection access: .^key on callables, type values, and streams. */ export declare function evaluateAnnotationAccess(s: EvalState, value: RillValue, key: string, location: SourceLocation | undefined): Promise; /** Evaluate .params property access on callables; builds dict from parameter metadata. */ export declare function evaluateParamsProperty(s: EvalState, callable: RillValue, location: SourceLocation | undefined): Promise>;