/**
 * Main-thread client for the WASM-in-a-Worker architecture.
 *
 * All queries are posted as messages and awaited as promises; the heavy work
 * runs off the main thread. The API mirrors the in-process `Database` class
 * so consumers can choose the execution model without rewriting their code.
 */
import type { LoraParams, LoraValue, QueryResult } from "./types.js";
import type { Response } from "./worker-protocol.js";
export interface WorkerLike {
    postMessage(message: unknown): void;
    terminate(): void;
    addEventListener(type: "message", listener: (event: {
        data: Response;
    }) => void): void;
    addEventListener(type: "error", listener: (event: {
        message?: string;
    }) => void): void;
    removeEventListener(type: "message", listener: (event: {
        data: Response;
    }) => void): void;
}
export interface WorkerDatabase {
    execute<T extends Record<string, LoraValue> = Record<string, LoraValue>>(query: string, params?: LoraParams): Promise<QueryResult<T>>;
    clear(): Promise<void>;
    nodeCount(): Promise<number>;
    relationshipCount(): Promise<number>;
    dispose(): Promise<void>;
}
/**
 * Build a Database client that proxies to the supplied worker.
 *
 * Typical browser usage:
 * ```ts
 * const worker = new Worker(new URL("./worker.js", import.meta.url), { type: "module" });
 * const db = createWorkerDatabase(worker);
 * const result = await db.execute("MATCH (n) RETURN n");
 * ```
 */
export declare function createWorkerDatabase(worker: WorkerLike): WorkerDatabase;
//# sourceMappingURL=worker-client.d.ts.map