/** * tenant-live-changes — `r.live.subscribe(projectId, { tables }, onEvent)` and * `r.live.changes(projectId, { tables, cursor, wait })`, also project-scoped * as `r.project(id).live.*`. * * The stream is `GET /live/v1` as Server-Sent Events, read through the * injected fetch so it works in Node and browsers alike and can carry the * `apikey` header (a bare `EventSource` cannot). It reconnects on its own with * `Last-Event-ID`, honors the server's `retry:` hint and `Retry-After`, and * surfaces `resync` to the caller — the one event every consumer must handle: * refetch what you care about. The held read is one request. * * Helpers are module-level on purpose: the public surface of the class is * exactly `changes` and `subscribe` (the surface sync test enumerates runtime * methods, and `private` is erased at runtime). */ import type { Client } from "../kernel.js"; import type { LiveChangesOptions, LiveChangesPage, LiveEvent, LiveSubscribeOptions, LiveSubscription } from "./live.types.js"; export declare class Live { private readonly client; constructor(client: Client); /** `GET /live/v1/changes` — hints since `cursor`, or hold up to `wait` seconds for the first one. */ changes(projectId: string, opts: LiveChangesOptions): Promise; /** * `GET /live/v1` as a reconnecting SSE subscription. `onEvent` receives * `ready`, `change`, `resync`, `reconnect` (server-side lifetime close, the * loop reconnects) and `disconnected` (a retryable failure; the loop backs * off and retries). A non-retryable refusal (403 TABLE_NOT_LIVE, 401, 400) * rejects `done` with the gateway's error envelope, as `request` would. */ subscribe(projectId: string, opts: LiveSubscribeOptions, onEvent: (event: LiveEvent) => void): LiveSubscription; } //# sourceMappingURL=live.d.ts.map