/** * Standalone `retrigger()` function for resuming suspended continuations * by re-firing the original effect to the host handlers. * * 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 `retrigger()` — resume a suspended continuation by re-firing * the original effect to the host handlers. * Time travel (auto-checkpointing) is enabled by default. Set `disableAutoCheckpoint: true` to opt out. */ export interface RetriggerOptions { handlers?: Handlers; modules?: DvalaModule[]; maxSnapshots?: number; disableAutoCheckpoint?: boolean; terminalSnapshot?: boolean; } /** * Resume a suspended continuation by re-triggering the original effect. * * Takes a `Snapshot` from a previous `RunResult` of type `'suspended'` and * re-dispatches the original effect (captured in `snapshot.effectName` / * `snapshot.effectArg`) to the registered host handlers. The handler then * calls `resume(value)`, `fail()`, or `suspend()` as normal. * * Throws if the snapshot has no captured effect (i.e. suspension occurred * outside of an effect handler, such as in a parallel/race branch). * * Always resolves — never rejects. May return `completed`, `suspended` * (if the handler suspends again), or `error`. * * ```typescript * const { snapshot } = suspendedResult * const next = await retrigger(snapshot, { handlers }) * ``` */ export declare function retrigger(snapshot: Snapshot, options?: RetriggerOptions): Promise;