import { Shell } from "../Shell"; import { IWaterfallOptions } from "./IWaterfallOptions"; export declare const REGEXP_URL: RegExp; /** * The Waterfall provide a Websocket that will try to reconnect automatically according to the policy */ export declare class Waterfall extends Shell { private protocols; private options; private timeout; private connectionTimeout; private retryPolicy; private _url; private attempts; /** * * @param {string} url * @param {string | string[]} protocols * @param {IWaterfallOptions} options */ constructor(url: string, protocols?: string | string[], options?: IWaterfallOptions); /** * The URL as resolved by the constructor. This is always an absolute URL. **Read only.** */ readonly url: string; /** * The current state of the connection; this is one of the Ready state constants. **Read only.** */ readonly readyState: number; /** * The number of bytes of data that have been queued using calls to _send()_ but not yet transmitted to the network. * This value resets to zero once all queued data has been sent. This value does not reset to zero when the * connection is closed; if you keep calling _send()_, this will continue to climb. **Read only** */ readonly bufferedAmount: number; /** * The extensions selected by the server. This is currently only the empty string or a list * of extensions as negotiated by the connection. */ readonly extensions: string; readonly protocol: string; /** * Closes the WebSocket connection or connection attempt, if any. * If the connection is already CLOSED, this method does nothing. * @param {number} A numeric value indicating the status code explaining why the connection is being closed. * If this parameter is not specified, a default value of 1005 is assumed. * See the list of status codes https://developer.mozilla.org/en-US/docs/Web/API/CloseEvent#Status_codes * on the CloseEvent page for permitted values. * @param {string} A human-readable string explaining why the connection is closing. * This string must be no longer than 123 bytes of UTF-8 text (not characters). */ close(code?: number, reason?: string): void; private webSocketFactory(); private onOpenWebSocket(evt); private onCloseWebSocket(evt); private unbindWebSocket(); private bindWebSocket(); private forceClose(); private setupWebSocketTimeout(); private open(); }