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<LixEnvironment["open"]>[0]): Promise<{
        engine?: import("../engine/boot.js").LixEngine;
    }>;
    /**
     * Invoke a named engine function inside the worker engine.
     */
    call(name: string, args?: unknown): Promise<unknown>;
    create(createOpts: Parameters<LixEnvironment["create"]>[0]): Promise<void>;
    /**
     * 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<ArrayBuffer>;
    exists(): Promise<boolean>;
    close(): Promise<void>;
    /**
     * 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<EnvironmentActorHandle>;
    /**
     * 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<void>;
}
//# sourceMappingURL=opfs-sah.d.ts.map