import { NatsConnection, QueuedIterator } from '@nats-io/nats-core'; import { KvEntry, Kvm, KvOptions, KvStatus, KvWatchEntry } from '@nats-io/kv'; import { KvSubscriptionConfig } from '../actions/kv'; import { NatsTrafficMetrics, NatsTrafficRecordEvent, NatsTrafficResetEvent } from '../traffic'; type InternalEvents = { type: 'ERROR'; error: Error; } | NatsTrafficRecordEvent; export type ExternalEvents = { type: 'KV.CONNECT'; connection: NatsConnection; } | { type: 'KV.CONNECTED'; } | { type: 'KV.DISCONNECTED'; } | { type: 'KV.BUCKET_LIST'; bucket?: string; onResult: (result: KvStatus[] | string[] | { error: Error; }) => void; } | { type: 'KV.BUCKET_CREATE'; bucket: string; onResult: (result: { ok: true; } | { ok: false; } | { error: Error; }) => void; } | { type: 'KV.BUCKET_DELETE'; bucket: string; onResult: (result: { ok: true; } | { ok: false; } | { error: Error; }) => void; } | { type: 'KV.GET'; bucket: string; key: string; onResult: (result: KvEntry | null | { error: Error; }) => void; } | { type: 'KV.PUT'; bucket: string; key: string; value: any; onResult: (result: { ok: true; } | { error: Error; }) => void; } | { type: 'KV.DELETE'; bucket: string; key: string; onResult: (result: { ok: true; } | { error: Error; }) => void; } | { type: 'KV.SUBSCRIBE'; config: KvSubscriptionConfig; } | { type: 'KV.UNSUBSCRIBE'; bucket: string; key: string; } | { type: 'KV.UNSUBSCRIBE_ALL'; } | NatsTrafficResetEvent; export type Events = InternalEvents | ExternalEvents; export interface Context { uid: string; cachedConnection: NatsConnection | null; cachedKvm: Kvm | null; kvmOpts?: KvOptions; subscriptions: Map>; subscriptionConfigs: Map; syncRequired: number; trafficMetrics: NatsTrafficMetrics; error?: Error; } export declare const kvManagerLogic: import("xstate").StateMachine void; } | { type: 'KV.BUCKET_CREATE'; bucket: string; onResult: (result: { ok: true; } | { ok: false; } | { error: Error; }) => void; } | { type: 'KV.BUCKET_DELETE'; bucket: string; onResult: (result: { ok: true; } | { ok: false; } | { error: Error; }) => void; } | { type: 'KV.GET'; bucket: string; key: string; onResult: (result: KvEntry | null | { error: Error; }) => void; } | { type: 'KV.PUT'; bucket: string; key: string; value: any; onResult: (result: { ok: true; } | { error: Error; }) => void; } | { type: 'KV.DELETE'; bucket: string; key: string; onResult: (result: { ok: true; } | { error: Error; }) => void; } | { type: 'KV.SUBSCRIBE'; config: KvSubscriptionConfig; } | { type: 'KV.UNSUBSCRIBE'; bucket: string; key: string; } | { type: 'KV.UNSUBSCRIBE_ALL'; }, { [x: string]: import("xstate").ActorRefFromLogic>, { kvm: Kvm | null; connection: NatsConnection | null; currentState: Map>; targetState: Map; }, import("xstate").EventObject>> | undefined; }, { src: "kvConsolidateState"; logic: import("xstate").PromiseActorLogic>, { kvm: Kvm | null; connection: NatsConnection | null; currentState: Map>; targetState: Map; }, import("xstate").EventObject>; id: string | undefined; }, never, { type: "hasPendingSync"; params: unknown; }, never, "kv_check_sync" | "kv_connected" | "kv_disconnecting" | "kv_error" | "kv_idle" | "kv_syncing", string, import("xstate").NonReducibleUnknown, import("xstate").NonReducibleUnknown, import("xstate").EventObject, import("xstate").MetaObject, { states: { readonly kv_idle: {}; readonly kv_disconnecting: {}; readonly kv_connected: {}; readonly kv_check_sync: {}; readonly kv_syncing: {}; readonly kv_error: {}; }; }, import("xstate").MetaObject>; export {}; //# sourceMappingURL=kv.d.ts.map