import { Tracer } from '@opentelemetry/api';
import WebSocket from 'isomorphic-ws';
import { TracedSocket } from './tracedSocket.js';
import { GenericMiddleware, ISocketClient, MethodHandlers, RequestContextBase, SocketTimeouts } from './types.js';
export declare class ISocketWithClientAuth<ImplementedMethods, CallableMethods, RequestContext extends RequestContextBase> extends TracedSocket<ImplementedMethods, CallableMethods, RequestContext> {
    private authorization?;
    private authorizationVersion;
    private hasSentAuth;
    constructor(ws: WebSocket, authorization: string | undefined, requestHandlers: MethodHandlers<ImplementedMethods, CallableMethods, RequestContext>, globalMiddlewares: GenericMiddleware<CallableMethods, RequestContext>[], tracer: Tracer, options: {
        onClose: (event: WebSocket.CloseEvent) => void;
        timeouts?: SocketTimeouts;
        logger?: {
            error: (message?: string) => void;
            info: (message?: string) => void;
            warn: (message?: string) => void;
        };
    });
    request<Params, Result>(method: string, params: Params): Promise<Result>;
    /**
     * Updates the authorization token for this socket.
     * This is useful for long-lived connections where the token may expire and need to be refreshed.
     *
     * @param newAuthorization - The new authorization token (e.g., "Bearer <token>") or undefined to clear it
     */
    setAuthorization(newAuthorization: string | undefined): void;
}
/**
 * Creates a new socket for a set of operations, without any retry behavior
 * If the requests fail, the promise will reject.
 */
export declare function connectSingleUseISocket<CallableMethods, ImplementedMethods, RequestContext extends RequestContextBase = RequestContextBase>(wsUrl: string, authorization: string | undefined, requestHandlers: MethodHandlers<ImplementedMethods, CallableMethods, RequestContext>, globalMiddlewares: GenericMiddleware<CallableMethods, RequestContext>[], tracer: Tracer, options: {
    onClose: (event: WebSocket.CloseEvent) => void;
    timeouts?: SocketTimeouts;
    logger?: {
        error: (message?: string) => void;
        info: (message?: string) => void;
        warn: (message?: string) => void;
    };
}): Promise<ISocketClient<CallableMethods>>;
//# sourceMappingURL=socketWithClientAuth.d.ts.map