12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849 |
- /// <reference types="node" />
- import { EventEmitter } from 'events';
- import { BaseRequest } from '../models/methods/baseMethod';
- interface ConnectionOptions {
- trace?: boolean | ((id: string, message: string) => void);
- proxy?: string;
- proxyAuthorization?: string;
- authorization?: string;
- trustedCertificates?: string[];
- key?: string;
- passphrase?: string;
- certificate?: string;
- timeout: number;
- connectionTimeout: number;
- headers?: {
- [key: string]: string;
- };
- }
- export type ConnectionUserOptions = Partial<ConnectionOptions>;
- export declare const INTENTIONAL_DISCONNECT_CODE = 4000;
- export declare class Connection extends EventEmitter {
- private readonly url;
- private ws;
- private reconnectTimeoutID;
- private heartbeatIntervalID;
- private readonly retryConnectionBackoff;
- private readonly config;
- private readonly requestManager;
- private readonly connectionManager;
- constructor(url?: string, options?: ConnectionUserOptions);
- private get state();
- private get shouldBeConnected();
- isConnected(): boolean;
- connect(): Promise<void>;
- disconnect(): Promise<number | undefined>;
- reconnect(): Promise<void>;
- request<T extends BaseRequest>(request: T, timeout?: number): Promise<unknown>;
- getUrl(): string;
- readonly trace: (id: string, message: string) => void;
- private onMessage;
- private onceOpen;
- private intentionalDisconnect;
- private clearHeartbeatInterval;
- private startHeartbeatInterval;
- private heartbeat;
- private onConnectionFailed;
- }
- export {};
- //# sourceMappingURL=connection.d.ts.map
|