import type { EnvironmentActorHandle, LixEnvironment, SpawnActorOptions } from "./api.js"; /** * OPFS SAH‑pool environment implemented with a Dedicated Worker. * * Spawns a Worker and forwards calls via a minimal RPC while keeping the * environment async surface. Use one instance per logical database key. * @example * // Static helper: clear all OPFS data for this origin (destructive) * await OpfsSahEnvironment.clear() */ export declare class OpfsSahEnvironment implements LixEnvironment { private static _instances; private static _openByKey; private worker; private nextId; private inflight; private eventHandler; private readonly dbKey; private isOpen; private actorWorkers; constructor(opts?: { key?: string; }); private send; open(initOpts: Parameters[0]): Promise<{ engine?: import("../engine/boot.js").LixEngine; }>; /** * Invoke a named engine function inside the worker engine. */ call(name: string, args?: unknown): Promise; create(createOpts: Parameters[0]): Promise; /** * Export the SQLite database image as raw bytes. * * Worker returns one of two shapes for performance: * - Fast path: `{ blob: ArrayBuffer }` (zero‑copy transfer) * - Fallback: `{ buffer, offset, length }` (single copy on host) */ export(): Promise; exists(): Promise; close(): Promise; /** * Spawn a dedicated worker-based actor. * * Messages emitted by the worker before any subscribers attach are buffered * and replayed to the first subscriber so initialization events are never lost. * * @example * const actor = await env.spawnActor({ entryModule, name: "echo" }); * const unsubscribe = actor.subscribe((message) => console.log(message)); * actor.post({ type: "ping" }); */ spawnActor(opts: SpawnActorOptions): Promise; /** * Cleans the entire OPFS by removing all files. * Useful for debugging and testing. * * WARNING! This will delete ALL files in OPFS, not just Lix files! */ static clear(): Promise; } //# sourceMappingURL=opfs-sah.d.ts.map