import { CryptoProvider, Peer, StorageAPI } from "cojson"; import { type AnyWebSocketConstructor } from "cojson-transport-ws"; import { Account, AccountClass, AnyAccountSchema, CoValueFromRaw, Inbox, Loaded } from "jazz-tools"; type WorkerOptions & CoValueFromRaw) | AnyAccountSchema> = { accountID?: string; accountSecret?: string; /** * A peer to connect to for synchronization. * If provided, syncServer is ignored. */ peer?: Peer; syncServer?: string; WebSocket?: AnyWebSocketConstructor; AccountSchema?: S; crypto?: CryptoProvider; /** * If true, the inbox will not be loaded. */ skipInboxLoad?: boolean; /** * If false, the worker will not set in the global account context */ asActiveAccount?: boolean; storage?: StorageAPI; }; /** @category Context Creation */ export declare function startWorker & CoValueFromRaw) | AnyAccountSchema>(options: WorkerOptions): Promise<{ /** * The worker account instance. */ worker: Loaded; experimental: { /** * API to subscribe to the inbox messages. * * More info on the Inbox API: https://jazz.tools/docs/react/server-side/inbox */ inbox: { subscribe: Inbox["subscribe"]; } | { subscribe: () => void; }; }; /** * Wait for the connection to the sync server to be established. * * If already connected, it will resolve immediately. * Returns immediately if using a custom peer. */ waitForConnection(): Promise; subscribeToConnectionChange(listener: (connected: boolean) => void): () => void; /** * Waits for all CoValues to sync and then shuts down the worker. * * To only wait for sync use worker.$jazz.waitForAllCoValuesSync() * * @deprecated Use shutdownWorker */ done: () => Promise; /** * Waits for all CoValues to sync and then shuts down the worker. * * To only wait for sync use worker.$jazz.waitForAllCoValuesSync() */ shutdownWorker(): Promise; }>; export {}; //# sourceMappingURL=index.d.ts.map