API index and search · Build metadata
Supporting declarations
packages/remote/src/backend.ts. These declarations explain referenced types. Only package-page symbols are package exports.
RemoteBackendOptions
export interface RemoteBackendOptions {
/** Resolve the upstream subscribe target. Defaults to embedded-server `{name,args}`. */
resolveSubscribe?: SubscribeResolver;
/** Override raw authoritative writes, e.g. POST them to an app API server. */
sendMutation?: RawMutationSender;
}RemoteBackend
export declare class RemoteBackend implements Backend {
private readonly transport;
private readonly resolveSubscribe;
private readonly sendMutation?;
private handler;
private readonly devObservers;
private readonly subs;
constructor(transport: Transport, opts?: RemoteBackendOptions);
registerQuery(qid: QueryId, _ast: unknown, remote?: RemoteQuery): void;
unregisterQuery(qid: QueryId): void;
/** Eventually-consistent: the mutation is sent; the resulting batches arrive async on the
* stream. The promise resolves once sent (the §2.3 write asymmetry, named not leaked). */
mutate(mutations: Mutation[]): Promise<void>;
onEvent(handler: (qid: QueryId, ev: ChangeEvent) => void): void;
__attachDevtoolsServerDeltas(observer: BackendDevObserver): () => void;
private subscribe;
private onServerMsg;
/** Route a `queryError` by its 101 §5 classification: retryable ⇒ keep the QState (and the
* rows already folded downstream — 101 §6) and re-subscribe after a jittered backoff
* honoring `retryAfterMs`; terminal (or pre-classification servers) ⇒ drop the
* subscription, exactly as before (FOLLOWER-LAG-SHED §6.3). */
private onQueryError;
private openSubscriber;
private applyBatch;
private emitServerEvent;
}createRemoteStore
/** Convenience: a `Store` backed by a remote server, over a ws URL or a custom transport. */
export declare function createRemoteStore<S extends ColsMap>(schema: Schema<S>, urlOrTransport: string | Transport, opts?: RemoteBackendOptions): Store<S>;