/**
 * Server-Sent Events manager with reconnection
 * @countermeasure/web-components/services/sse
 */
export type SSEEventHandler = (data: unknown) => void;
export interface SSEConfig {
    url: string;
    /**
     * Legacy query-token source. Prefer cookie-backed SSE auth with withCredentials.
     * This token is only appended to the URL when allowQueryTokenAuth is true.
     */
    getAuthToken?: () => string | null;
    /**
     * Explicitly opt into appending getAuthToken() as ?token=... on the EventSource URL.
     * Query-string bearer tokens can leak through logs, browser history, and referrers.
     */
    allowQueryTokenAuth?: boolean;
    reconnect?: boolean;
    reconnectInterval?: number;
    maxRetries?: number;
    withCredentials?: boolean;
}
export declare class SSEManager {
    private readonly config;
    private readonly handlers;
    private eventSource;
    private attachedTypes;
    private retryCount;
    private reconnectTimer;
    constructor(config: SSEConfig);
    on(eventType: string, handler: SSEEventHandler): () => void;
    off(eventType: string, handler: SSEEventHandler): void;
    connect(): void;
    disconnect(): void;
    isConnected(): boolean;
    /**
     * Returns `true` when the manager has given up reconnecting — i.e. the
     * EventSource errored and `maxRetries` has been exhausted.  Consumers can
     * use this to show a permanent-failure indicator rather than an optimistic
     * "reconnecting" state.
     */
    isFailed(): boolean;
    private buildUrl;
    private attachEventListener;
}
export { useSSE, type UseSSEOptions, type UseSSEResult } from './sse-react';
//# sourceMappingURL=sse.d.ts.map