import { type IRangeResponse, type IWatchResponse } from 'etcd3'; import { type KernelStateChange, type KernelStateEntry, type KernelStatePrefixSnapshot, type KernelStateWatchStatus } from '@xemahq/contracts/kernel-state'; export interface PrefixWatcher { on(event: 'connected', handler: (response: IWatchResponse) => void): this; on(event: 'data', handler: (response: IWatchResponse) => void): this; on(event: 'disconnected', handler: (error: Error) => void): this; on(event: 'error', handler: (error: Error) => void): this; cancel(): Promise; } export type PrefixSnapshot = KernelStatePrefixSnapshot; export interface EtcdPrefixWatchSubscriptionOptions { readSnapshot: () => Promise; createWatcher: (startRevision: number) => PrefixWatcher; decodeEntry: (kv: IRangeResponse['kvs'][number]) => KernelStateEntry; onChanges: (changes: KernelStateChange[]) => void; onSnapshot?: (snapshot: KernelStatePrefixSnapshot) => void; onStatus?: (status: KernelStateWatchStatus) => void; onDisconnected: (error: Error) => void; onError: (error: unknown) => void; } export declare class EtcdPrefixWatchSubscription { private readonly options; private readonly entries; private readonly queuedBatches; private watcher; private cancelled; private synchronized; private connectionGeneration; private snapshotRevision; private lastEventRevision; private readonly signaturesAtLastEventRevision; constructor(options: EtcdPrefixWatchSubscriptionOptions); start(): void; cancel(): void; private bootstrap; private wireWatcher; private synchronize; private applySnapshot; private drainQueuedBatches; private applyLiveBatch; private emitStatus; } export declare function rangeResponseToSnapshot(response: IRangeResponse, toEntry: (kv: IRangeResponse['kvs'][number]) => KernelStateEntry): PrefixSnapshot; //# sourceMappingURL=etcd-prefix-watch-subscription.d.ts.map