import type { KernelRecord } from "./types.js"; import type { DisconnectReason, Transport, TransportName } from "./transports/types.js"; export interface SubscribeOptions { sinceClock?: number; onError?: (err: SubscribeError) => void; onOpen?: () => void; onHeartbeat?: () => void; reconnectBaseMs?: number; reconnectMaxMs?: number; maxReconnects?: number; heartbeatTimeoutMs?: number; transport?: Transport; fetch?: typeof fetch; bearer?: string; } export interface SubscribeError { reason: DisconnectReason; message: string; attempt: number; nextRetryMs: number; } export interface Subscription { readonly thread: string; readonly closed: boolean; readonly cursor: string | null; readonly transportName: TransportName; close(): void; } export interface SubscriptionDeps { endpoint: string; apiKey?: string; defaultFetch: typeof fetch; defaultTransport: Transport; } export declare function startSubscription(thread: string, callback: (record: KernelRecord) => void, options: SubscribeOptions, deps: SubscriptionDeps): Subscription;