import { ConnectionEvent, EventSource, IAudioSource, IAudioStreamNode, IConnection, IDisposable, Promise } from "../common/Exports"; import { CancellationErrorCode, CancellationReason, Recognizer, SpeechRecognitionResult } from "../sdk/Exports"; import { AgentConfig, DynamicGrammarBuilder, RecognitionMode, RequestSession, SpeechContext } from "./Exports"; import { IAuthentication } from "./IAuthentication"; import { IConnectionFactory } from "./IConnectionFactory"; import { RecognizerConfig } from "./RecognizerConfig"; import { SpeechConnectionMessage } from "./SpeechConnectionMessage.Internal"; export declare abstract class ServiceRecognizerBase implements IDisposable { private privAuthentication; private privConnectionFactory; private privAudioSource; private privSpeechServiceConfigConnectionId; private privConnectionConfigurationPromise; private privConnectionPromise; private privAuthFetchEventId; private privIsDisposed; private privMustReportEndOfStream; private privConnectionEvents; private privSpeechContext; private privDynamicGrammar; private privAgentConfig; protected privRequestSession: RequestSession; protected privConnectionId: string; protected privRecognizerConfig: RecognizerConfig; protected privRecognizer: Recognizer; constructor(authentication: IAuthentication, connectionFactory: IConnectionFactory, audioSource: IAudioSource, recognizerConfig: RecognizerConfig, recognizer: Recognizer); readonly audioSource: IAudioSource; readonly speechContext: SpeechContext; readonly dynamicGrammar: DynamicGrammarBuilder; readonly agentConfig: AgentConfig; isDisposed(): boolean; dispose(reason?: string): void; readonly connectionEvents: EventSource; readonly recognitionMode: RecognitionMode; protected recognizeOverride: (recoMode: RecognitionMode, sc: (e: SpeechRecognitionResult) => void, ec: (e: string) => void) => any; recognize(recoMode: RecognitionMode, successCallback: (e: SpeechRecognitionResult) => void, errorCallBack: (e: string) => void): Promise; stopRecognizing(): void; connect(): void; protected disconnectOverride: () => any; disconnect(): void; static telemetryData: (json: string) => void; static telemetryDataEnabled: boolean; sendMessage(message: string): void; protected abstract processTypeSpecificMessages(connectionMessage: SpeechConnectionMessage, successCallback?: (e: SpeechRecognitionResult) => void, errorCallBack?: (e: string) => void): void; protected sendTelemetryData: () => Promise | Promise>; protected abstract cancelRecognition(sessionId: string, requestId: string, cancellationReason: CancellationReason, errorCode: CancellationErrorCode, error: string, cancelRecoCallback: (r: SpeechRecognitionResult) => void): void; protected cancelRecognitionLocal(cancellationReason: CancellationReason, errorCode: CancellationErrorCode, error: string, cancelRecoCallback: (r: SpeechRecognitionResult) => void): void; protected receiveMessageOverride: (sc?: (e: SpeechRecognitionResult) => void, ec?: (e: string) => void) => any; protected receiveMessage: (successCallback: (e: SpeechRecognitionResult) => void, errorCallBack: (e: string) => void) => Promise; protected sendSpeechContext: (connection: IConnection) => Promise; protected connectImplOverride: (isUnAuthorized: boolean) => any; protected connectImpl(isUnAuthorized?: boolean): Promise; protected configConnectionOverride: () => any; protected fetchConnectionOverride: () => any; protected sendSpeechServiceConfig: (connection: IConnection, requestSession: RequestSession, SpeechServiceConfigJson: string) => Promise; protected sendAudio: (audioStreamNode: IAudioStreamNode) => Promise; private sendFinalAudio; private fetchConnection; private configureConnection; }