/** * Standalone `resume()` function for resuming suspended continuations. * * The primary API for running Dvala programs is `createDvala()` from `./createDvala`. */ import type { DvalaModule } from './builtin/modules/interface'; import type { Handlers, RunResult, Snapshot } from './evaluator/effectTypes'; /** * Options for `resume()` — resume a suspended continuation. * All host interaction goes through `handlers`. * `modules` must be provided again (they are not in the blob). */ export interface ResumeOptions { handlers?: Handlers; modules?: DvalaModule[]; maxSnapshots?: number; disableAutoCheckpoint?: boolean; terminalSnapshot?: boolean; /** New scope values to inject into the computation's globalContext before resuming. */ scope?: Record; } /** * Resume a suspended continuation. * * Takes a `Snapshot` from a previous `RunResult` of type `'suspended'`, a * resume value, and optional handlers. Re-enters the trampoline at * the point of suspension with the provided value. * * `modules` must be provided again if the Dvala program uses `import`. * * Always resolves — never rejects. May return `completed`, `suspended` * (if another suspend is hit), or `error`. * * ```typescript * const { snapshot } = suspendedResult * const next = await resume(snapshot, humanDecision, { handlers }) * ``` */ export declare function resume(snapshot: Snapshot, value: unknown, options?: ResumeOptions): Promise;