import { EventEmitter } from 'events';
import WebSocket from 'ws';
export type VideoCallback = (id: string, data: Uint8Array) => void;
export type AudioCallback = (id: string, data: Uint8Array) => void;
export declare function waitForEvent<T>(emitter: EventEmitter, eventName: string | symbol): Promise<T>;
export interface IConnectionOptions {
    autoConnect: boolean;
    autoReconnect: boolean;
    url: string;
}
export declare class SesameConnection extends EventEmitter {
    private socket;
    private active;
    private numRetries;
    private url;
    private autoReconnect;
    constructor(options: IConnectionOptions);
    isConnected(): boolean;
    send(data: Uint8Array): Promise<void>;
    connect(): Promise<void>;
    /**
     * Disconnect from the server.
     */
    disconnect(): Promise<void>;
    private retryHandler;
    private closeHandler;
    private errorHandler;
    private openHandler;
    protected messageHandler: (event: {
        data: any;
        type: string;
        target: WebSocket;
    }) => void;
}
//# sourceMappingURL=sesame-connection.d.ts.map