UNPKG

@voice-ping/cognitive-services-speech

Version:

VoicePing Cognitive Services Speech SDK for JavaScript forked from Microsoft

34 lines (33 loc) 1.35 kB
import { ConnectionEvent, ConnectionMessage, ConnectionOpenResponse, ConnectionState, EventSource, IWebsocketMessageFormatter, Promise } from "../common/Exports"; import { ProxyInfo } from "./ProxyInfo"; export declare class WebsocketMessageAdapter { private privConnectionState; private privMessageFormatter; private privWebsocketClient; private privSendMessageQueue; private privReceivingMessageQueue; private privConnectionEstablishDeferral; private privCertificateValidatedDeferral; private privDisconnectDeferral; private privConnectionEvents; private privConnectionId; private privUri; private proxyInfo; private privHeaders; private privLastErrorReceived; static forceNpmWebSocket: boolean; constructor(uri: string, connectionId: string, messageFormatter: IWebsocketMessageFormatter, proxyInfo: ProxyInfo, headers: { [key: string]: string; }); get state(): ConnectionState; open: () => Promise<ConnectionOpenResponse>; send: (message: ConnectionMessage) => Promise<boolean>; read: () => Promise<ConnectionMessage>; close: (reason?: string) => Promise<boolean>; get events(): EventSource<ConnectionEvent>; private sendRawMessage; private onClose; private processSendQueue; private onEvent; private get isWebsocketOpen(); }