import * as React from 'react'; import type { NatsClient, NatsStatus } from './nats'; import { type AcquireClientOptions, type NatsReconnectionBackoff } from './shared-connection'; export type { NatsReconnectionBackoff } from './shared-connection'; export interface NatsProviderProps { children: React.ReactNode; /** Return the current NATS WebSocket URL (or null when not yet available, e.g. unauthenticated). */ getWsUrl: () => string | null; /** Called before each reconnect attempt. */ onBeforeReconnect?: () => Promise | void; clientConfig?: AcquireClientOptions; reconnectionBackoff?: NatsReconnectionBackoff; /** * Bump this to force re-evaluating `getWsUrl()` (e.g. when auth state flips). * Provider does not subscribe to external auth state by itself. */ urlRevision?: unknown; } export interface NatsContextValue { client: NatsClient | null; status: NatsStatus; isReady: boolean; reconnectionCount: number; } export declare function NatsProvider({ children, getWsUrl, onBeforeReconnect, clientConfig, reconnectionBackoff, urlRevision, }: NatsProviderProps): React.JSX.Element; export declare function useNats(): NatsContextValue; export declare function useOptionalNats(): NatsContextValue | null; //# sourceMappingURL=nats-provider.d.ts.map