import { EventEmitter } from 'events';
import { ParsedFrame } from './sesame-wire-protocol';
export type MediaPacketCallback = (id: string, frame: ParsedFrame) => void;
export declare enum ConnectionState {
    Disconnected = "disconnected",
    Connecting = "connecting",
    Connected = "connected",
    Reconnecting = "reconnecting"
}
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;
    private _state;
    get state(): ConnectionState;
    private setState;
    private boundMessageHandler;
    private boundOpenHandler;
    private boundCloseHandler;
    private boundErrorHandler;
    constructor(options: IConnectionOptions);
    isConnected(): boolean;
    send(data: Uint8Array): Promise<void>;
    connect(): Promise<void>;
    /**
     * Disconnect from the server.
     */
    disconnect(): Promise<void>;
    private removeSocketListeners;
    private retryHandler;
    private closeHandler;
    private errorHandler;
    private openHandler;
    protected messageHandler: (event: MessageEvent) => void;
}
//# sourceMappingURL=sesame-connection.d.ts.map