import { type AuthTokenResolver } from './auth.js';
import { type StreamReconnectPolicy } from './reconnect.js';
export interface ServerSentEventHandlers {
    readonly onEvent?: (eventName: string, payload: unknown) => void;
    readonly onReady?: (payload: unknown) => void;
    readonly onError?: (error: unknown) => void;
    readonly onReconnect?: (input: {
        readonly attempt: number;
        readonly delayMs: number;
    }) => void;
}
export interface ServerSentEventOptions {
    readonly signal?: AbortSignal;
    readonly headers?: HeadersInit;
    readonly authToken?: string | null;
    readonly getAuthToken?: AuthTokenResolver;
    readonly lastEventId?: string | null;
    readonly reconnect?: StreamReconnectPolicy;
}
export declare function isAbortError(error: unknown): boolean;
export declare function openServerSentEventStream(fetchImpl: typeof fetch, url: string, handlers: ServerSentEventHandlers, options?: ServerSentEventOptions): Promise<() => void>;
//# sourceMappingURL=sse-stream.d.ts.map