import { SyncBackend } from '@livestore/common'; import { type CfTypes } from '@livestore/common-cf'; import type { SyncBackendRpcInterface } from '../../cf-worker/shared.ts'; import type { SyncMetadata } from '../../common/sync-message-types.ts'; export interface SyncBackendRpcStub extends CfTypes.DurableObjectStub, SyncBackendRpcInterface { } export interface DoRpcSyncOptions { /** Durable Object stub that implements the SyncDoRpc interface */ syncBackendStub: SyncBackendRpcStub; /** Information about this DurableObject instance so the Sync DO instance can call back to this instance */ durableObjectContext: { /** See `wrangler.toml` for the binding name */ bindingName: string; /** `state.id.toString()` in the DO */ durableObjectId: string; }; } /** * Creates a sync backend that uses Durable Object RPC to communicate with the sync backend. * * Used internally by `@livestore/adapter-cf` to connect to the sync backend. */ export declare const makeDoRpcSync: ({ syncBackendStub, durableObjectContext }: DoRpcSyncOptions) => SyncBackend.SyncBackendConstructor; /** * * ```ts * import { DurableObject } from 'cloudflare:workers' * import { ClientDoWithRpcCallback } from '@livestore/common-cf' * * export class MyDurableObject extends DurableObject implements ClientDoWithRpcCallback { * // ... * * async syncUpdateRpc(payload: RpcMessage.ResponseChunkEncoded) { * return handleSyncUpdateRpc(payload) * } * } * ``` */ export declare const handleSyncUpdateRpc: (payload: unknown) => Promise; //# sourceMappingURL=do-rpc-client.d.ts.map