/*!
 * Copyright (c) 2015-2020 Cisco Systems, Inc. See LICENSE file.
 */
/// <reference types="node" />
import { EventEmitter } from 'events';
import type { SocketCloseEvent, SocketLogger, SocketMessageEvent, SendRequestOptions, SocketOpenOptions, SocketResponse } from './types';
export default class Socket extends EventEmitter {
    private domain;
    private pendingResponses;
    forceCloseDelay: number;
    logger: SocketLogger;
    refreshToken?: (response: SocketResponse) => unknown;
    token: string;
    trackingId: string;
    wssResponseTimeout?: number;
    constructor();
    get binaryType(): string;
    get bufferedAmount(): number;
    get extensions(): string;
    get protocol(): string;
    get readyState(): number;
    get url(): string;
    static getWebSocketConstructor(): unknown;
    close(options?: {
        reason?: string;
        code?: number;
    }): Promise<void | SocketCloseEvent>;
    open(url: string, options?: SocketOpenOptions): Promise<void>;
    onclose(event: SocketCloseEvent): void;
    onmessage(event: SocketMessageEvent<string>): void;
    send(data: string | Record<string, unknown>): Promise<void>;
    sendRequest(data: SocketResponse, options?: SendRequestOptions): Promise<SocketResponse>;
    private acknowledge;
    refresh(token: string | {
        toString(): string;
    }): Promise<SocketResponse>;
    private authorize;
    private clearPendingResponse;
    private rejectPendingResponses;
    private handlePendingResponse;
    private fixCloseCode;
}
//# sourceMappingURL=socket-base.d.ts.map