import { Workflow as Workflow$1, WorkflowEvent, WorkflowEventData } from "@llama-flow/core"; //#region src/middleware/snapshot.d.ts declare const request: (event: WorkflowEvent, reason?: any) => WorkflowEventData>; type SnapshotFn = () => Promise<[requestEvents: WorkflowEvent[], serializable: SnapshotData]>; type SnapshotWorkflowContext = ReturnType & { onRequest: >(event: Event, callback: (reason: any) => void | Promise) => () => void; /** * Snapshot will lock the context and wait for there is no pending event. * * This is useful when you want to take a current snapshot of the workflow * */ snapshot: SnapshotFn; }; type WithSnapshotWorkflow = Omit & { createContext: () => SnapshotWorkflowContext; resume: (data: any[], serializable: Omit) => SnapshotWorkflowContext; }; interface SnapshotData { queue: [data: any, id: number][]; /** * These events are not recoverable because they are not in any handler * * This is useful when you have `messageEvent` but you don't have any handler for it */ unrecoverableQueue: [data: any, id: number][]; /** * This is the version of the snapshot * * Change any of the handlers will change the version */ version: string; missing: number[]; } declare function withSnapshot(workflow: Workflow): WithSnapshotWorkflow; //#endregion export { SnapshotFn, request, withSnapshot }; //# sourceMappingURL=snapshot.d.cts.map