import { default as EventEmitterType } from 'eventemitter3'; import { w3cwebsocket } from 'websocket'; import { OperationRequest } from '../types'; import { ClientStateSchema } from './types'; declare type Options = { options?: { lazy?: boolean; /** * Number of ms to wait for operation result (in case of subscriptions this is ignored) * 0/Infinity is the same */ operationTimeout?: number; reconnect?: boolean; /** * How many times we should try to reconnect? * If Infinity is given, then it is inifinite */ reconnectAttempts?: number; }; /** * Web socket endpoint */ uri: string; webSockImpl?: w3cwebsocket; }; declare class Client { private machine; private lazy; private ee; private operationProcessor; constructor({ uri, options: { lazy, operationTimeout, reconnect, reconnectAttempts, }, webSockImpl, }: Options); disconnect: () => void; request(operation: OperationRequest): import("zen-observable-ts").Observable<{}>; readonly status: keyof ClientStateSchema['states']; on: (event: "error" | "message" | "connecting" | "connected" | "disconnected" | "reconnecting" | "reconnected", listener: EventEmitterType.ListenerFn) => Function; onConnecting: (listener: EventEmitterType.ListenerFn) => Function; onConnected: (listener: EventEmitterType.ListenerFn) => Function; onDisconnected: (listener: EventEmitterType.ListenerFn) => Function; onError: (listener: EventEmitterType.ListenerFn) => Function; onMessage: (listener: EventEmitterType.ListenerFn) => Function; onReconnecting: (listener: EventEmitterType.ListenerFn) => Function; onReconnected: (listener: EventEmitterType.ListenerFn) => Function; private handleMessage; } export { Client }; export default Client;