import { SyncBackend } from '@livestore/common'; import { type Duration, Effect, type Scope } from '@livestore/utils/effect'; import type { WebSocket } from '@livestore/utils/effect/browser'; import type { SyncMetadata } from '../../common/sync-message-types.ts'; export interface WsSyncOptions { /** * URL of the sync backend * * The protocol can either `http`/`https` or `ws`/`wss` * * @example 'https://sync.example.com' */ url: string; /** * Optional WebSocket factory for custom WebSocket implementations (e.g., Cloudflare Durable Objects) * If not provided, uses standard WebSocket from @livestore/utils/effect */ webSocketFactory?: (wsUrl: string) => Effect.Effect; ping?: { /** * @default true */ enabled?: boolean; /** * How long to wait for a ping response before timing out * @default 10 seconds */ requestTimeout?: Duration.DurationInput; /** * How often to send ping requests * @default 10 seconds */ requestInterval?: Duration.DurationInput; }; } /** * Creates a sync backend that uses WebSocket to communicate with the sync backend. * * @example * ```ts * import { makeWsSync } from '@livestore/sync-cf/client' * * const syncBackend = makeWsSync({ url: 'wss://sync.example.com' }) */ export declare const makeWsSync: (options: WsSyncOptions) => SyncBackend.SyncBackendConstructor; //# sourceMappingURL=ws-rpc-client.d.ts.map