/** * Evaluator Shared Utilities * * Shared module-level evaluator utilities. Each function takes * the evaluator state as its first parameter, replacing `this` access with * an explicit `s` argument. * * @internal */ import type { ASTNode, SourceLocation } from '../../../types.js'; import type { RillValue } from '../types/structures.js'; import type { EvalState } from './state.js'; /** * Get source location from an AST node. * Used for error reporting with precise location information. */ export declare function getNodeLocation(_s: EvalState, node?: ASTNode): SourceLocation | undefined; /** * Check if execution has been aborted via AbortSignal. * Throws a non-catchable RuntimeHaltSignal via throwAbortHalt * when the signal is aborted. */ export declare function checkAborted(s: EvalState, node?: ASTNode): void; /** * Check if the current pipe value matches any autoException pattern. * Only checks string values. Throws a non-catchable RuntimeHaltSignal * via throwAutoExceptionHalt on match. */ export declare function checkAutoExceptions(s: EvalState, value: RillValue, node?: ASTNode): void; /** * Wrap a promise with a timeout. * Returns original promise if no timeout configured. * * The pending timer is always cleared once the race settles — whether the * wrapped promise wins or the timeout fires — so a completed operation never * holds the event loop open waiting on a dead timer. * * On expiry the race rejects with a catchable `RuntimeHaltSignal` (atom * `RILL_R012`), so `guard { slow() }` and `retry { slow() }` can recover a * timeout the same way they recover any other operational halt. */ export declare function withTimeout(s: EvalState, promise: Promise, timeoutMs: number | undefined, functionName: string, node?: ASTNode): Promise; /** * Access a field on a dict value with property-style callable auto-invocation. * Shared by closures.ts and variables.ts for consistent property access. * * @param s - Evaluator state * @param value - The dict to access * @param field - The field name * @param location - Source location for error reporting * @param allowMissing - If true, returns null for missing fields instead of throwing * @returns The field value * @throws RuntimeError if value is not a dict or field is missing (unless allowMissing) */ export declare function accessDictField(s: EvalState, value: RillValue, field: string, location?: SourceLocation, allowMissing?: boolean): Promise; export { setDictField } from '../types/dict-keys.js';