/**
 * Main-thread client for the sync factor worker.
 *
 * Spawns `sync-worker.js`, performs the init handshake, and returns a
 * `SyncProxy` that is a DROP-IN for `ImapManager` from the main thread's point
 * of view: it's an EventEmitter (so `bin`'s `.on(...)` forwarders and the
 * service's `.emit(...)` keep working locally), and any *other* method call is
 * forwarded to the worker over the bus as `{method, args}` and returns the
 * worker's result as a Promise.
 *
 * Two method names are handled locally instead of being forwarded:
 *   - the EventEmitter surface (on/once/off/emit/…) — local event routing.
 *   - getBodyStore() — returns a local FileMessageStore (a path wrapper; the
 *     bytes live on disk, so main can read them without crossing the bus).
 *
 * Worker → main events arrive on the bus topic `sync:event` and are re-emitted
 * on the local EventEmitter, so a `syncProgress` raised inside the worker fires
 * bin's listener exactly as before.
 */
import { Worker } from "node:worker_threads";
import type { ImapManager } from "@bobfrankston/mailx-imap";
export interface SpawnedSyncWorker {
    /** Drop-in for ImapManager. Method calls return Promises (forwarded to the
     *  worker); event methods are local. */
    proxy: ImapManager;
    worker: Worker;
    close(): Promise<void>;
}
export declare function spawnSyncWorker(opts: {
    configDir: string;
    storePath: string;
}): Promise<SpawnedSyncWorker>;
//# sourceMappingURL=sync-worker-client.d.ts.map