import type { Transport, TransportSendOptions } from "./transport.js";
export declare class StreamableHttpTransport implements Transport {
    private url;
    private headers;
    private messageHandlers;
    private notificationHandlers;
    private errorHandlers;
    private sessionId;
    private protocolVersion;
    private connected;
    private activeControllers;
    private activeReaders;
    private closing;
    constructor(url: string, headers?: Record<string, string>);
    connect(): Promise<void>;
    send(message: string, options?: TransportSendOptions): Promise<void>;
    private readResponseText;
    private readSseEventStream;
    private readChunkWithTimeout;
    private buildRequestHeaders;
    private requestIdFromMessage;
    private dispatchJsonRpcMessage;
    private parseSseEventStream;
    private dispatchCompleteSseFrames;
    private dispatchSseFrame;
    private dispatchSseData;
    onMessage(handler: (raw: string) => void): void;
    onNotification(handler: (method: string, params: unknown) => void): void;
    onError(handler: (err: Error) => void): void;
    close(): Promise<void>;
}
