// Generated by dts-bundle v0.7.3
// Dependencies for this module:
//   ../../fs

import { PathLike } from "fs";

/**
    * Represents audio input configuration used for specifying what type of input to use (microphone, file, stream).
    * @class AudioConfig
    * Updated in version 1.11.0
    */
export abstract class AudioConfig {
        /**
            * Creates an AudioConfig object representing the default microphone on the system.
            * @member AudioConfig.fromDefaultMicrophoneInput
            * @function
            * @public
            * @returns {AudioConfig} The audio input configuration being created.
            */
        static fromDefaultMicrophoneInput(): AudioConfig;
        /**
            * Creates an AudioConfig object representing a microphone with the specified device ID.
            * @member AudioConfig.fromMicrophoneInput
            * @function
            * @public
            * @param {string | undefined} deviceId - Specifies the device ID of the microphone to be used.
            *        Default microphone is used the value is omitted.
            * @returns {AudioConfig} The audio input configuration being created.
            */
        static fromMicrophoneInput(deviceId?: string): AudioConfig;
        /**
            * Creates an AudioConfig object representing the specified file.
            * @member AudioConfig.fromWavFileInput
            * @function
            * @public
            * @param {File} fileName - Specifies the audio input file. Currently, only WAV / PCM is supported.
            * @returns {AudioConfig} The audio input configuration being created.
            */
        static fromWavFileInput(file: File): AudioConfig;
        /**
            * Creates an AudioConfig object representing the specified stream.
            * @member AudioConfig.fromStreamInput
            * @function
            * @public
            * @param {AudioInputStream | PullAudioInputStreamCallback} audioStream - Specifies the custom audio input
            *        stream. Currently, only WAV / PCM is supported.
            * @returns {AudioConfig} The audio input configuration being created.
            */
        static fromStreamInput(audioStream: AudioInputStream | PullAudioInputStreamCallback): AudioConfig;
        /**
            * Creates an AudioConfig object representing the default speaker.
            * @member AudioConfig.fromDefaultSpeakerOutput
            * @function
            * @public
            * @returns {AudioConfig} The audio output configuration being created.
            * Added in version 1.11.0
            */
        static fromDefaultSpeakerOutput(): AudioConfig;
        /**
            * Creates an AudioConfig object representing the custom IPlayer object.
            * You can use the IPlayer object to control pause, resume, etc.
            * @member AudioConfig.fromSpeakerOutput
            * @function
            * @public
            * @param {IPlayer} player - the IPlayer object for playback.
            * @returns {AudioConfig} The audio output configuration being created.
            * Added in version 1.12.0
            */
        static fromSpeakerOutput(player?: IPlayer): AudioConfig;
        /**
            * Creates an AudioConfig object representing a specified output audio file
            * @member AudioConfig.fromAudioFileOutput
            * @function
            * @public
            * @param {PathLike} filename - the filename of the output audio file
            * @returns {AudioConfig} The audio output configuration being created.
            * Added in version 1.11.0
            */
        static fromAudioFileOutput(filename: PathLike): AudioConfig;
        /**
            * Creates an AudioConfig object representing a specified audio output stream
            * @member AudioConfig.fromStreamOutput
            * @function
            * @public
            * @param {AudioOutputStream | PushAudioOutputStreamCallback} audioStream - Specifies the custom audio output
            *        stream.
            * @returns {AudioConfig} The audio output configuration being created.
            * Added in version 1.11.0
            */
        static fromStreamOutput(audioStream: AudioOutputStream | PushAudioOutputStreamCallback): AudioConfig;
        /**
            * Explicitly frees any external resource attached to the object
            * @member AudioConfig.prototype.close
            * @function
            * @public
            */
        abstract close(): void;
        /**
            * Sets an arbitrary property.
            * @member SpeechConfig.prototype.setProperty
            * @function
            * @public
            * @param {string} name - The name of the property to set.
            * @param {string} value - The new value of the property.
            */
        abstract setProperty(name: string, value: string): void;
        /**
            * Returns the current value of an arbitrary property.
            * @member SpeechConfig.prototype.getProperty
            * @function
            * @public
            * @param {string} name - The name of the property to query.
            * @param {string} def - The value to return in case the property is not known.
            * @returns {string} The current value, or provided default, of the given property.
            */
        abstract getProperty(name: string, def?: string): string;
}
/**
    * Represents audio input stream used for custom audio input configurations.
    * @private
    * @class AudioConfigImpl
    */
export class AudioConfigImpl extends AudioConfig implements IAudioSource {
        /**
            * Creates and initializes an instance of this class.
            * @constructor
            * @param {IAudioSource} source - An audio source.
            */
        constructor(source: IAudioSource);
        /**
            * Format information for the audio
            */
        get format(): Promise<AudioStreamFormatImpl>;
        /**
            * @member AudioConfigImpl.prototype.close
            * @function
            * @public
            */
        close(): void;
        /**
            * @member AudioConfigImpl.prototype.id
            * @function
            * @public
            */
        id(): string;
        /**
            * @member AudioConfigImpl.prototype.blob
            * @function
            * @public
            */
        get blob(): Promise<Blob | Buffer>;
        /**
            * @member AudioConfigImpl.prototype.turnOn
            * @function
            * @public
            * @returns {Promise<boolean>} A promise.
            */
        turnOn(): Promise<boolean>;
        /**
            * @member AudioConfigImpl.prototype.attach
            * @function
            * @public
            * @param {string} audioNodeId - The audio node id.
            * @returns {Promise<IAudioStreamNode>} A promise.
            */
        attach(audioNodeId: string): Promise<IAudioStreamNode>;
        /**
            * @member AudioConfigImpl.prototype.detach
            * @function
            * @public
            * @param {string} audioNodeId - The audio node id.
            */
        detach(audioNodeId: string): void;
        /**
            * @member AudioConfigImpl.prototype.turnOff
            * @function
            * @public
            * @returns {Promise<boolean>} A promise.
            */
        turnOff(): Promise<boolean>;
        /**
            * @member AudioConfigImpl.prototype.events
            * @function
            * @public
            * @returns {EventSource<AudioSourceEvent>} An event source for audio events.
            */
        get events(): EventSource<AudioSourceEvent>;
        setProperty(name: string, value: string): void;
        getProperty(name: string, def?: string): string;
        get deviceInfo(): Promise<ISpeechConfigAudioDevice>;
}
export class AudioOutputConfigImpl extends AudioConfig implements IAudioDestination {
        /**
            * Creates and initializes an instance of this class.
            * @constructor
            * @param {IAudioDestination} destination - An audio destination.
            */
        constructor(destination: IAudioDestination);
        set format(format: AudioStreamFormat);
        write(buffer: ArrayBuffer): void;
        close(): void;
        id(): string;
        setProperty(name: string, value: string): void;
        getProperty(name: string, def?: string): string;
}

/**
    * Represents audio stream format used for custom audio input configurations.
    * @class AudioStreamFormat
    */
export abstract class AudioStreamFormat {
        /**
            * Creates an audio stream format object representing the default audio stream
            * format (16KHz 16bit mono PCM).
            * @member AudioStreamFormat.getDefaultInputFormat
            * @function
            * @public
            * @returns {AudioStreamFormat} The audio stream format being created.
            */
        static getDefaultInputFormat(): AudioStreamFormat;
        /**
            * Creates an audio stream format object with the specified pcm waveformat characteristics.
            * @member AudioStreamFormat.getWaveFormatPCM
            * @function
            * @public
            * @param {number} samplesPerSecond - Sample rate, in samples per second (Hertz).
            * @param {number} bitsPerSample - Bits per sample, typically 16.
            * @param {number} channels - Number of channels in the waveform-audio data. Monaural data
            *        uses one channel and stereo data uses two channels.
            * @returns {AudioStreamFormat} The audio stream format being created.
            */
        static getWaveFormatPCM(samplesPerSecond: number, bitsPerSample: number, channels: number): AudioStreamFormat;
        /**
            * Explicitly frees any external resource attached to the object
            * @member AudioStreamFormat.prototype.close
            * @function
            * @public
            */
        abstract close(): void;
}
/**
    * @private
    * @class AudioStreamFormatImpl
    */
export class AudioStreamFormatImpl extends AudioStreamFormat {
        protected privHeader: ArrayBuffer;
        /**
            * Creates an instance with the given values.
            * @constructor
            * @param {number} samplesPerSec - Samples per second.
            * @param {number} bitsPerSample - Bits per sample.
            * @param {number} channels - Number of channels.
            */
        constructor(samplesPerSec?: number, bitsPerSample?: number, channels?: number);
        /**
            * Retrieves the default input format.
            * @member AudioStreamFormatImpl.getDefaultInputFormat
            * @function
            * @public
            * @returns {AudioStreamFormatImpl} The default input format.
            */
        static getDefaultInputFormat(): AudioStreamFormatImpl;
        /**
            * Closes the configuration object.
            * @member AudioStreamFormatImpl.prototype.close
            * @function
            * @public
            */
        close(): void;
        /**
            * The format of the audio, valid values: 1 (PCM)
            * @member AudioStreamFormatImpl.prototype.formatTag
            * @function
            * @public
            */
        formatTag: number;
        /**
            * The number of channels, valid values: 1 (Mono).
            * @member AudioStreamFormatImpl.prototype.channels
            * @function
            * @public
            */
        channels: number;
        /**
            * The sample rate, valid values: 16000.
            * @member AudioStreamFormatImpl.prototype.samplesPerSec
            * @function
            * @public
            */
        samplesPerSec: number;
        /**
            * The bits per sample, valid values: 16
            * @member AudioStreamFormatImpl.prototype.b
            * @function
            * @public
            */
        bitsPerSample: number;
        /**
            * Average bytes per second, usually calculated as nSamplesPerSec * nChannels * ceil(wBitsPerSample, 8).
            * @member AudioStreamFormatImpl.prototype.avgBytesPerSec
            * @function
            * @public
            */
        avgBytesPerSec: number;
        /**
            * The size of a single frame, valid values: nChannels * ceil(wBitsPerSample, 8).
            * @member AudioStreamFormatImpl.prototype.blockAlign
            * @function
            * @public
            */
        blockAlign: number;
        get header(): ArrayBuffer;
        protected setString: (view: DataView, offset: number, str: string) => void;
}

/**
    * Represents audio input stream used for custom audio input configurations.
    * @class AudioInputStream
    */
export abstract class AudioInputStream {
        /**
            * Creates and initializes an instance.
            * @constructor
            */
        protected constructor();
        /**
            * Creates a memory backed PushAudioInputStream with the specified audio format.
            * @member AudioInputStream.createPushStream
            * @function
            * @public
            * @param {AudioStreamFormat} format - The audio data format in which audio will be
            *        written to the push audio stream's write() method (Required if format is not 16 kHz 16bit mono PCM).
            * @returns {PushAudioInputStream} The audio input stream being created.
            */
        static createPushStream(format?: AudioStreamFormat): PushAudioInputStream;
        /**
            * Creates a PullAudioInputStream that delegates to the specified callback interface for read()
            * and close() methods.
            * @member AudioInputStream.createPullStream
            * @function
            * @public
            * @param {PullAudioInputStreamCallback} callback - The custom audio input object, derived from
            *        PullAudioInputStreamCallback
            * @param {AudioStreamFormat} format - The audio data format in which audio will be returned from
            *        the callback's read() method (Required if format is not 16 kHz 16bit mono PCM).
            * @returns {PullAudioInputStream} The audio input stream being created.
            */
        static createPullStream(callback: PullAudioInputStreamCallback, format?: AudioStreamFormat): PullAudioInputStream;
        /**
            * Explicitly frees any external resource attached to the object
            * @member AudioInputStream.prototype.close
            * @function
            * @public
            */
        abstract close(): void;
}
/**
    * Represents memory backed push audio input stream used for custom audio input configurations.
    * @class PushAudioInputStream
    */
export abstract class PushAudioInputStream extends AudioInputStream {
        /**
            * Creates a memory backed PushAudioInputStream with the specified audio format.
            * @member PushAudioInputStream.create
            * @function
            * @public
            * @param {AudioStreamFormat} format - The audio data format in which audio will be written to the
            *        push audio stream's write() method (Required if format is not 16 kHz 16bit mono PCM).
            * @returns {PushAudioInputStream} The push audio input stream being created.
            */
        static create(format?: AudioStreamFormat): PushAudioInputStream;
        /**
            * Writes the audio data specified by making an internal copy of the data.
            * @member PushAudioInputStream.prototype.write
            * @function
            * @public
            * @param {ArrayBuffer} dataBuffer - The audio buffer of which this function will make a copy.
            */
        abstract write(dataBuffer: ArrayBuffer): void;
        /**
            * Closes the stream.
            * @member PushAudioInputStream.prototype.close
            * @function
            * @public
            */
        abstract close(): void;
}
/**
    * Represents memory backed push audio input stream used for custom audio input configurations.
    * @private
    * @class PushAudioInputStreamImpl
    */
export class PushAudioInputStreamImpl extends PushAudioInputStream implements IAudioSource {
        /**
            * Creates and initalizes an instance with the given values.
            * @constructor
            * @param {AudioStreamFormat} format - The audio stream format.
            */
        constructor(format?: AudioStreamFormat);
        /**
            * Format information for the audio
            */
        get format(): Promise<AudioStreamFormatImpl>;
        /**
            * Writes the audio data specified by making an internal copy of the data.
            * @member PushAudioInputStreamImpl.prototype.write
            * @function
            * @public
            * @param {ArrayBuffer} dataBuffer - The audio buffer of which this function will make a copy.
            */
        write(dataBuffer: ArrayBuffer): void;
        /**
            * Closes the stream.
            * @member PushAudioInputStreamImpl.prototype.close
            * @function
            * @public
            */
        close(): void;
        id(): string;
        get blob(): Promise<Blob | Buffer>;
        turnOn(): Promise<boolean>;
        attach(audioNodeId: string): Promise<IAudioStreamNode>;
        detach(audioNodeId: string): void;
        turnOff(): Promise<boolean>;
        get events(): EventSource<AudioSourceEvent>;
        get deviceInfo(): Promise<ISpeechConfigAudioDevice>;
}
export abstract class PullAudioInputStream extends AudioInputStream {
        /**
            * Creates and initializes and instance.
            * @constructor
            */
        protected constructor();
        /**
            * Creates a PullAudioInputStream that delegates to the specified callback interface for
            * read() and close() methods, using the default format (16 kHz 16bit mono PCM).
            * @member PullAudioInputStream.create
            * @function
            * @public
            * @param {PullAudioInputStreamCallback} callback - The custom audio input object,
            *        derived from PullAudioInputStreamCustomCallback
            * @param {AudioStreamFormat} format - The audio data format in which audio will be
            *        returned from the callback's read() method (Required if format is not 16 kHz 16bit mono PCM).
            * @returns {PullAudioInputStream} The push audio input stream being created.
            */
        static create(callback: PullAudioInputStreamCallback, format?: AudioStreamFormat): PullAudioInputStream;
        /**
            * Explicitly frees any external resource attached to the object
            * @member PullAudioInputStream.prototype.close
            * @function
            * @public
            */
        abstract close(): void;
}
/**
    * Represents audio input stream used for custom audio input configurations.
    * @private
    * @class PullAudioInputStreamImpl
    */
export class PullAudioInputStreamImpl extends PullAudioInputStream implements IAudioSource {
        /**
            * Creates a PullAudioInputStream that delegates to the specified callback interface for
            * read() and close() methods, using the default format (16 kHz 16bit mono PCM).
            * @constructor
            * @param {PullAudioInputStreamCallback} callback - The custom audio input object,
            *        derived from PullAudioInputStreamCustomCallback
            * @param {AudioStreamFormat} format - The audio data format in which audio will be
            *        returned from the callback's read() method (Required if format is not 16 kHz 16bit mono PCM).
            */
        constructor(callback: PullAudioInputStreamCallback, format?: AudioStreamFormatImpl);
        /**
            * Format information for the audio
            */
        get format(): Promise<AudioStreamFormatImpl>;
        /**
            * Closes the stream.
            * @member PullAudioInputStreamImpl.prototype.close
            * @function
            * @public
            */
        close(): void;
        id(): string;
        get blob(): Promise<Blob | Buffer>;
        turnOn(): Promise<boolean>;
        attach(audioNodeId: string): Promise<IAudioStreamNode>;
        detach(audioNodeId: string): void;
        turnOff(): Promise<boolean>;
        get events(): EventSource<AudioSourceEvent>;
        get deviceInfo(): Promise<ISpeechConfigAudioDevice>;
}

/**
    * Represents audio output stream used for custom audio output configurations.
    * @class AudioOutputStream
    */
export abstract class AudioOutputStream {
        /**
            * Creates and initializes an instance.
            * @constructor
            */
        protected constructor();
        /**
            * Sets the format of the AudioOutputStream
            * Note: the format is set by the synthesizer before writing. Do not set it before passing it to AudioConfig
            * @member AudioOutputStream.prototype.format
            */
        abstract set format(format: AudioStreamFormat);
        /**
            * Creates a memory backed PullAudioOutputStream with the specified audio format.
            * @member AudioOutputStream.createPullStream
            * @function
            * @public
            * @returns {PullAudioOutputStream} The audio output stream being created.
            */
        static createPullStream(): PullAudioOutputStream;
        /**
            * Explicitly frees any external resource attached to the object
            * @member AudioOutputStream.prototype.close
            * @function
            * @public
            */
        abstract close(): void;
}
/**
    * Represents memory backed push audio output stream used for custom audio output configurations.
    * @class PullAudioOutputStream
    */
export abstract class PullAudioOutputStream extends AudioOutputStream {
        /**
            * Creates a memory backed PullAudioOutputStream with the specified audio format.
            * @member PullAudioOutputStream.create
            * @function
            * @public
            * @returns {PullAudioOutputStream} The push audio output stream being created.
            */
        static create(): PullAudioOutputStream;
        /**
            * Reads audio data from the internal buffer.
            * @member PullAudioOutputStream.prototype.read
            * @function
            * @public
            * @param {ArrayBuffer} dataBuffer - An ArrayBuffer to store the read data.
            * @returns {Promise<number>} Audio buffer length has been read.
            */
        abstract read(dataBuffer: ArrayBuffer): Promise<number>;
        /**
            * Closes the stream.
            * @member PullAudioOutputStream.prototype.close
            * @function
            * @public
            */
        abstract close(): void;
}
/**
    * Represents memory backed push audio output stream used for custom audio output configurations.
    * @private
    * @class PullAudioOutputStreamImpl
    */
export class PullAudioOutputStreamImpl extends PullAudioOutputStream implements IAudioDestination {
        /**
            * Creates and initializes an instance with the given values.
            * @constructor
            */
        constructor();
        /**
            * Sets the format information to the stream. For internal use only.
            * @param {AudioStreamFormat} format - the format to be set.
            */
        set format(format: AudioStreamFormat);
        /**
            * Format information for the audio
            */
        get format(): AudioStreamFormat;
        /**
            * Checks if the stream is closed
            * @member PullAudioOutputStreamImpl.prototype.isClosed
            * @property
            * @public
            */
        get isClosed(): boolean;
        /**
            * Gets the id of the stream
            * @member PullAudioOutputStreamImpl.prototype.id
            * @property
            * @public
            */
        id(): string;
        /**
            * Reads audio data from the internal buffer.
            * @member PullAudioOutputStreamImpl.prototype.read
            * @function
            * @public
            * @param {ArrayBuffer} dataBuffer - An ArrayBuffer to store the read data.
            * @returns {Promise<number>} - Audio buffer length has been read.
            */
        read(dataBuffer: ArrayBuffer): Promise<number>;
        /**
            * Writes the audio data specified by making an internal copy of the data.
            * @member PullAudioOutputStreamImpl.prototype.write
            * @function
            * @public
            * @param {ArrayBuffer} dataBuffer - The audio buffer of which this function will make a copy.
            */
        write(dataBuffer: ArrayBuffer): void;
        /**
            * Closes the stream.
            * @member PullAudioOutputStreamImpl.prototype.close
            * @function
            * @public
            */
        close(): void;
}
export abstract class PushAudioOutputStream extends AudioOutputStream {
        /**
            * Creates and initializes and instance.
            * @constructor
            */
        protected constructor();
        /**
            * Creates a PushAudioOutputStream that delegates to the specified callback interface for
            * write() and close() methods.
            * @member PushAudioOutputStream.create
            * @function
            * @public
            * @param {PushAudioOutputStreamCallback} callback - The custom audio output object,
            *        derived from PushAudioOutputStreamCallback
            * @returns {PushAudioOutputStream} The push audio output stream being created.
            */
        static create(callback: PushAudioOutputStreamCallback): PushAudioOutputStream;
        /**
            * Explicitly frees any external resource attached to the object
            * @member PushAudioOutputStream.prototype.close
            * @function
            * @public
            */
        abstract close(): void;
}
/**
    * Represents audio output stream used for custom audio output configurations.
    * @private
    * @class PushAudioOutputStreamImpl
    */
export class PushAudioOutputStreamImpl extends PushAudioOutputStream implements IAudioDestination {
        /**
            * Creates a PushAudioOutputStream that delegates to the specified callback interface for
            * read() and close() methods.
            * @constructor
            * @param {PushAudioOutputStreamCallback} callback - The custom audio output object,
            *        derived from PushAudioOutputStreamCallback
            */
        constructor(callback: PushAudioOutputStreamCallback);
        set format(format: AudioStreamFormat);
        write(buffer: ArrayBuffer): void;
        close(): void;
        id(): string;
}

/**
    * Defines the possible reasons a recognition result might be canceled.
    * @class CancellationReason
    */
export enum CancellationReason {
        /**
            * Indicates that an error occurred during speech recognition.
            * @member CancellationReason.Error
            */
        Error = 0,
        /**
            * Indicates that the end of the audio stream was reached.
            * @member CancellationReason.EndOfStream
            */
        EndOfStream = 1
}

/**
    * An abstract base class that defines callback methods (read() and close()) for
    * custom audio input streams).
    * @class PullAudioInputStreamCallback
    */
export abstract class PullAudioInputStreamCallback {
        /**
            * Reads data from audio input stream into the data buffer. The maximal number of bytes
            * to be read is determined by the size of dataBuffer.
            * @member PullAudioInputStreamCallback.prototype.read
            * @function
            * @public
            * @param {ArrayBuffer} dataBuffer - The byte array to store the read data.
            * @returns {number} the number of bytes have been read.
            */
        abstract read(dataBuffer: ArrayBuffer): number;
        /**
            * Closes the audio input stream.
            * @member PullAudioInputStreamCallback.prototype.close
            * @function
            * @public
            */
        abstract close(): void;
}

/**
    * An abstract base class that defines callback methods (write() and close()) for
    * custom audio output streams).
    * @class PushAudioOutputStreamCallback
    */
export abstract class PushAudioOutputStreamCallback {
        /**
            * Writes audio data into the data buffer.
            * @member PushAudioOutputStreamCallback.prototype.write
            * @function
            * @public
            * @param {ArrayBuffer} dataBuffer - The byte array that stores the audio data to write.
            */
        abstract write(dataBuffer: ArrayBuffer): void;
        /**
            * Closes the audio output stream.
            * @member PushAudioOutputStreamCallback.prototype.close
            * @function
            * @public
            */
        abstract close(): void;
}

/**
    * Represents a keyword recognition model for recognizing when
    * the user says a keyword to initiate further speech recognition.
    * @class KeywordRecognitionModel
    */
export class KeywordRecognitionModel {
        /**
            * Creates a keyword recognition model using the specified filename.
            * @member KeywordRecognitionModel.fromFile
            * @function
            * @public
            * @param {string} fileName - A string that represents file name for the keyword recognition model.
            *        Note, the file can point to a zip file in which case the model
            *        will be extracted from the zip.
            * @returns {KeywordRecognitionModel} The keyword recognition model being created.
            */
        static fromFile(fileName: string): KeywordRecognitionModel;
        /**
            * Creates a keyword recognition model using the specified filename.
            * @member KeywordRecognitionModel.fromStream
            * @function
            * @public
            * @param {string} file - A File that represents file for the keyword recognition model.
            *        Note, the file can point to a zip file in which case the model will be extracted from the zip.
            * @returns {KeywordRecognitionModel} The keyword recognition model being created.
            */
        static fromStream(file: File): KeywordRecognitionModel;
        /**
            * Dispose of associated resources.
            * @member KeywordRecognitionModel.prototype.close
            * @function
            * @public
            */
        close(): void;
}

/**
    * Defines content for session events like SessionStarted/Stopped, SoundStarted/Stopped.
    * @class SessionEventArgs
    */
export class SessionEventArgs {
        /**
            * Creates and initializes an instance of this class.
            * @constructor
            * @param {string} sessionId - The session id.
            */
        constructor(sessionId: string);
        /**
            * Represents the session identifier.
            * @member SessionEventArgs.prototype.sessionId
            * @function
            * @public
            * @returns {string} Represents the session identifier.
            */
        get sessionId(): string;
}

/**
    * Defines payload for session events like Speech Start/End Detected
    * @class
    */
export class RecognitionEventArgs extends SessionEventArgs {
        /**
            * Creates and initializes an instance of this class.
            * @constructor
            * @param {number} offset - The offset.
            * @param {string} sessionId - The session id.
            */
        constructor(offset: number, sessionId?: string);
        /**
            * Represents the message offset
            * @member RecognitionEventArgs.prototype.offset
            * @function
            * @public
            */
        get offset(): number;
}

/**
    * Define Speech Recognizer output formats.
    * @class OutputFormat
    */
export enum OutputFormat {
        /**
            * @member OutputFormat.Simple
            */
        Simple = 0,
        /**
            * @member OutputFormat.Detailed
            */
        Detailed = 1
}

/**
    * Intent recognition result event arguments.
    * @class
    */
export class IntentRecognitionEventArgs extends RecognitionEventArgs {
        /**
            * Creates and initializes an instance of this class.
            * @constructor
            * @param result - The result of the intent recognition.
            * @param offset - The offset.
            * @param sessionId - The session id.
            */
        constructor(result: IntentRecognitionResult, offset?: number, sessionId?: string);
        /**
            * Represents the intent recognition result.
            * @member IntentRecognitionEventArgs.prototype.result
            * @function
            * @public
            * @returns {IntentRecognitionResult} Represents the intent recognition result.
            */
        get result(): IntentRecognitionResult;
}

/**
    * Defines result of speech recognition.
    * @class RecognitionResult
    */
export class RecognitionResult {
        /**
            * Creates and initializes an instance of this class.
            * @constructor
            * @param {string} resultId - The result id.
            * @param {ResultReason} reason - The reason.
            * @param {string} text - The recognized text.
            * @param {number} duration - The duration.
            * @param {number} offset - The offset into the stream.
            * @param {string} language - Primary Language detected, if provided.
            * @param {string} languageDetectionConfidence - Primary Language confidence ("Unknown," "Low," "Medium," "High"...), if provided.
            * @param {string} errorDetails - Error details, if provided.
            * @param {string} json - Additional Json, if provided.
            * @param {PropertyCollection} properties - Additional properties, if provided.
            */
        constructor(resultId?: string, reason?: ResultReason, text?: string, duration?: number, offset?: number, language?: string, languageDetectionConfidence?: string, errorDetails?: string, json?: string, properties?: PropertyCollection);
        /**
            * Specifies the result identifier.
            * @member RecognitionResult.prototype.resultId
            * @function
            * @public
            * @returns {string} Specifies the result identifier.
            */
        get resultId(): string;
        /**
            * Specifies status of the result.
            * @member RecognitionResult.prototype.reason
            * @function
            * @public
            * @returns {ResultReason} Specifies status of the result.
            */
        get reason(): ResultReason;
        /**
            * Presents the recognized text in the result.
            * @member RecognitionResult.prototype.text
            * @function
            * @public
            * @returns {string} Presents the recognized text in the result.
            */
        get text(): string;
        /**
            * Duration of recognized speech in 100 nano second incements.
            * @member RecognitionResult.prototype.duration
            * @function
            * @public
            * @returns {number} Duration of recognized speech in 100 nano second incements.
            */
        get duration(): number;
        /**
            * Offset of recognized speech in 100 nano second incements.
            * @member RecognitionResult.prototype.offset
            * @function
            * @public
            * @returns {number} Offset of recognized speech in 100 nano second incements.
            */
        get offset(): number;
        /**
            * Primary Language detected.
            * @member RecognitionResult.prototype.language
            * @function
            * @public
            * @returns {string} language detected.
            */
        get language(): string;
        /**
            * Primary Language detection confidence (Unknown, Low, Medium, High).
            * @member RecognitionResult.prototype.languageDetectionConfidence
            * @function
            * @public
            * @returns {string} detection confidence strength.
            */
        get languageDetectionConfidence(): string;
        /**
            * In case of an unsuccessful recognition, provides details of the occurred error.
            * @member RecognitionResult.prototype.errorDetails
            * @function
            * @public
            * @returns {string} a brief description of an error.
            */
        get errorDetails(): string;
        /**
            * A string containing Json serialized recognition result as it was received from the service.
            * @member RecognitionResult.prototype.json
            * @function
            * @private
            * @returns {string} Json serialized representation of the result.
            */
        get json(): string;
        /**
            *  The set of properties exposed in the result.
            * @member RecognitionResult.prototype.properties
            * @function
            * @public
            * @returns {PropertyCollection} The set of properties exposed in the result.
            */
        get properties(): PropertyCollection;
}

/**
    * Defines result of speech recognition.
    * @class RecognitionResultCustom
    */
export class RecognitionResultCustom {
        /**
            * Creates and initializes an instance of this class.
            * @constructor
            * @param {string} resultId - The result id.
            * @param {ResultReason} reason - The reason.
            * @param {string} text - The recognized text.
            * @param {number} duration - The duration.
            * @param {number} offset - The offset into the stream.
            * @param {string} language - Primary Language detected, if provided.
            * @param {string} languageDetectionConfidence - Primary Language confidence ("Unknown," "Low," "Medium," "High"...), if provided.
            * @param {string} errorDetails - Error details, if provided.
            * @param {string} json - Additional Json, if provided.
            * @param {PropertyCollection} properties - Additional properties, if provided.
            * @param {string} requestId - requestId for DEBUG.
            */
        constructor(resultId?: string, reason?: ResultReason, text?: string, duration?: number, offset?: number, language?: string, languageDetectionConfidence?: string, errorDetails?: string, json?: string, properties?: PropertyCollection, requestId?: string);
        /**
            * Specifies the result identifier.
            * @member RecognitionResult.prototype.resultId
            * @function
            * @public
            * @returns {string} Specifies the result identifier.
            */
        get resultId(): string;
        /**
            * Specifies status of the result.
            * @member RecognitionResult.prototype.reason
            * @function
            * @public
            * @returns {ResultReason} Specifies status of the result.
            */
        get reason(): ResultReason;
        /**
            * Presents the recognized text in the result.
            * @member RecognitionResult.prototype.text
            * @function
            * @public
            * @returns {string} Presents the recognized text in the result.
            */
        get text(): string;
        /**
            * Duration of recognized speech in 100 nano second incements.
            * @member RecognitionResult.prototype.duration
            * @function
            * @public
            * @returns {number} Duration of recognized speech in 100 nano second incements.
            */
        get duration(): number;
        /**
            * Offset of recognized speech in 100 nano second incements.
            * @member RecognitionResult.prototype.offset
            * @function
            * @public
            * @returns {number} Offset of recognized speech in 100 nano second incements.
            */
        get offset(): number;
        /**
            * Primary Language detected.
            * @member RecognitionResult.prototype.language
            * @function
            * @public
            * @returns {string} language detected.
            */
        get language(): string;
        /**
            * Primary Language detection confidence (Unknown, Low, Medium, High).
            * @member RecognitionResult.prototype.languageDetectionConfidence
            * @function
            * @public
            * @returns {string} detection confidence strength.
            */
        get languageDetectionConfidence(): string;
        /**
            * In case of an unsuccessful recognition, provides details of the occurred error.
            * @member RecognitionResult.prototype.errorDetails
            * @function
            * @public
            * @returns {string} a brief description of an error.
            */
        get errorDetails(): string;
        /**
            * A string containing Json serialized recognition result as it was received from the service.
            * @member RecognitionResult.prototype.json
            * @function
            * @private
            * @returns {string} Json serialized representation of the result.
            */
        get json(): string;
        /**
            *  The set of properties exposed in the result.
            * @member RecognitionResult.prototype.properties
            * @function
            * @public
            * @returns {PropertyCollection} The set of properties exposed in the result.
            */
        get properties(): PropertyCollection;
        /**
            * requestId for DEBUG.
            * @member RecognitionResult.prototype.requestId
            * @function
            * @private
            * @returns {string} requestId
            */
        get requestId(): string;
}

/**
    * Defines result of speech recognition.
    * @class SpeechRecognitionResult
    */
export class SpeechRecognitionResult extends RecognitionResult {
        /**
            * Creates and initializes an instance of this class.
            * @constructor
            * @public
            * @param {string} resultId - The result id.
            * @param {ResultReason} reason - The reason.
            * @param {string} text - The recognized text.
            * @param {number} duration - The duration.
            * @param {number} offset - The offset into the stream.
            * @param {string} language - Primary Language detected, if provided.
            * @param {string} languageDetectionConfidence - Primary Language confidence ("Unknown," "Low," "Medium," "High"...), if provided.
            * @param {string} errorDetails - Error details, if provided.
            * @param {string} json - Additional Json, if provided.
            * @param {PropertyCollection} properties - Additional properties, if provided.
            */
        constructor(resultId?: string, reason?: ResultReason, text?: string, duration?: number, offset?: number, language?: string, languageDetectionConfidence?: string, errorDetails?: string, json?: string, properties?: PropertyCollection);
}

/**
    * Defines result of speech recognition.
    * @class SpeechRecognitionResultCustom
    */
export class SpeechRecognitionResultCustom extends RecognitionResultCustom {
        /**
            * Creates and initializes an instance of this class.
            * @constructor
            * @public
            * @param {string} resultId - The result id.
            * @param {ResultReason} reason - The reason.
            * @param {string} text - The recognized text.
            * @param {number} duration - The duration.
            * @param {number} offset - The offset into the stream.
            * @param {string} language - Primary Language detected, if provided.
            * @param {string} languageDetectionConfidence - Primary Language confidence ("Unknown," "Low," "Medium," "High"...), if provided.
            * @param {string} errorDetails - Error details, if provided.
            * @param {string} json - Additional Json, if provided.
            * @param {PropertyCollection} properties - Additional properties, if provided.
            * @param {string} requestId - requestId for DEBUG.
            */
        constructor(resultId?: string, reason?: ResultReason, text?: string, duration?: number, offset?: number, language?: string, languageDetectionConfidence?: string, errorDetails?: string, json?: string, properties?: PropertyCollection, requestId?: string);
}

/**
    * Intent recognition result.
    * @class
    */
export class IntentRecognitionResult extends SpeechRecognitionResult {
        /**
            * Creates and initializes an instance of this class.
            * @constructor
            * @param intentId - The intent id.
            * @param resultId - The result id.
            * @param reason - The reason.
            * @param text - The recognized text.
            * @param duration - The duration.
            * @param offset - The offset into the stream.
            * @param language - Primary Language detected, if provided.
            * @param languageDetectionConfidence - Primary Language confidence ("Unknown," "Low," "Medium," "High"...), if provided.
            * @param errorDetails - Error details, if provided.
            * @param json - Additional Json, if provided.
            * @param properties - Additional properties, if provided.
            */
        constructor(intentId?: string, resultId?: string, reason?: ResultReason, text?: string, duration?: number, offset?: number, language?: string, languageDetectionConfidence?: string, errorDetails?: string, json?: string, properties?: PropertyCollection);
        /**
            * A String that represents the intent identifier being recognized.
            * @member IntentRecognitionResult.prototype.intentId
            * @function
            * @public
            * @returns {string} A String that represents the intent identifier being recognized.
            */
        get intentId(): string;
}

/**
    * Language understanding model
    * @class LanguageUnderstandingModel
    */
export class LanguageUnderstandingModel {
        /**
            * Creates and initializes a new instance
            * @constructor
            */
        protected constructor();
        /**
            * Creates an language understanding model using the specified endpoint.
            * @member LanguageUnderstandingModel.fromEndpoint
            * @function
            * @public
            * @param {URL} uri - A String that represents the endpoint of the language understanding model.
            * @returns {LanguageUnderstandingModel} The language understanding model being created.
            */
        static fromEndpoint(uri: URL): LanguageUnderstandingModel;
        /**
            * Creates an language understanding model using the application id of Language Understanding service.
            * @member LanguageUnderstandingModel.fromAppId
            * @function
            * @public
            * @param {string} appId - A String that represents the application id of Language Understanding service.
            * @returns {LanguageUnderstandingModel} The language understanding model being created.
            */
        static fromAppId(appId: string): LanguageUnderstandingModel;
        /**
            * Creates a language understanding model using hostname, subscription key and application
            * id of Language Understanding service.
            * @member LanguageUnderstandingModel.fromSubscription
            * @function
            * @public
            * @param {string} subscriptionKey - A String that represents the subscription key of
            *        Language Understanding service.
            * @param {string} appId - A String that represents the application id of Language
            *        Understanding service.
            * @param {LanguageUnderstandingModel} region - A String that represents the region
            *        of the Language Understanding service (see the <a href="https://aka.ms/csspeech/region">region page</a>).
            * @returns {LanguageUnderstandingModel} The language understanding model being created.
            */
        static fromSubscription(subscriptionKey: string, appId: string, region: string): LanguageUnderstandingModel;
}
/**
    * @private
    * @class LanguageUnderstandingModelImpl
    */
export class LanguageUnderstandingModelImpl extends LanguageUnderstandingModel {
        appId: string;
        region: string;
        subscriptionKey: string;
}

/**
    * Defines contents of speech recognizing/recognized event.
    * @class SpeechRecognitionEventArgs
    */
export class SpeechRecognitionEventArgs extends RecognitionEventArgs {
        /**
            * Creates and initializes an instance of this class.
            * @constructor
            * @param {SpeechRecognitionResult} result - The speech recognition result.
            * @param {number} offset - The offset.
            * @param {string} sessionId - The session id.
            */
        constructor(result: SpeechRecognitionResult, offset?: number, sessionId?: string);
        /**
            * Specifies the recognition result.
            * @member SpeechRecognitionEventArgs.prototype.result
            * @function
            * @public
            * @returns {SpeechRecognitionResult} the recognition result.
            */
        get result(): SpeechRecognitionResult;
}

/**
    * Defines contents of speech recognizing/recognized event.
    * @class SpeechRecognitionEventArgsCustom
    */
export class SpeechRecognitionEventArgsCustom extends RecognitionEventArgs {
        /**
            * Creates and initializes an instance of this class.
            * @constructor
            * @param {SpeechRecognitionResultCustom} result - The speech recognition result.
            * @param {number} offset - The offset.
            * @param {string} sessionId - The session id.
            */
        constructor(result: SpeechRecognitionResultCustom, offset?: number, sessionId?: string);
        /**
            * Specifies the recognition result.
            * @member SpeechRecognitionEventArgs.prototype.result
            * @function
            * @public
            * @returns {SpeechRecognitionResultCustom} the recognition result.
            */
        get result(): SpeechRecognitionResultCustom;
}

/**
    * Defines content of a RecognitionErrorEvent.
    * @class SpeechRecognitionCanceledEventArgs
    */
export class SpeechRecognitionCanceledEventArgs extends RecognitionEventArgs {
        /**
            * Creates and initializes an instance of this class.
            * @constructor
            * @param {CancellationReason} reason - The cancellation reason.
            * @param {string} errorDetails - Error details, if provided.
            * @param {number} offset - The offset.
            * @param {string} sessionId - The session id.
            */
        constructor(reason: CancellationReason, errorDetails: string, errorCode: CancellationErrorCode, offset?: number, sessionId?: string);
        /**
            * The reason the recognition was canceled.
            * @member SpeechRecognitionCanceledEventArgs.prototype.reason
            * @function
            * @public
            * @returns {CancellationReason} Specifies the reason canceled.
            */
        get reason(): CancellationReason;
        /**
            * The error code in case of an unsuccessful recognition.
            * Added in version 1.1.0.
            * @return An error code that represents the error reason.
            */
        get errorCode(): CancellationErrorCode;
        /**
            * In case of an unsuccessful recognition, provides details of the occurred error.
            * @member SpeechRecognitionCanceledEventArgs.prototype.errorDetails
            * @function
            * @public
            * @returns {string} A String that represents the error details.
            */
        get errorDetails(): string;
}

/**
    * Translation text result event arguments.
    * @class TranslationRecognitionEventArgs
    */
export class TranslationRecognitionEventArgs extends RecognitionEventArgs {
        /**
            * Creates and initializes an instance of this class.
            * @constructor
            * @param {TranslationRecognitionResult} result - The translation recognition result.
            * @param {number} offset - The offset.
            * @param {string} sessionId - The session id.
            */
        constructor(result: TranslationRecognitionResult, offset?: number, sessionId?: string);
        /**
            * Specifies the recognition result.
            * @member TranslationRecognitionEventArgs.prototype.result
            * @function
            * @public
            * @returns {TranslationRecognitionResult} the recognition result.
            */
        get result(): TranslationRecognitionResult;
}

/**
    * Translation Synthesis event arguments
    * @class TranslationSynthesisEventArgs
    */
export class TranslationSynthesisEventArgs extends SessionEventArgs {
        /**
            * Creates and initializes an instance of this class.
            * @constructor
            * @param {TranslationSynthesisResult} result - The translation synthesis result.
            * @param {string} sessionId - The session id.
            */
        constructor(result: TranslationSynthesisResult, sessionId?: string);
        /**
            * Specifies the translation synthesis result.
            * @member TranslationSynthesisEventArgs.prototype.result
            * @function
            * @public
            * @returns {TranslationSynthesisResult} Specifies the translation synthesis result.
            */
        get result(): TranslationSynthesisResult;
}

/**
    * Translation text result.
    * @class TranslationRecognitionResult
    */
export class TranslationRecognitionResult extends SpeechRecognitionResult {
        /**
            * Creates and initializes an instance of this class.
            * @constructor
            * @param {Translations} translations - The translations.
            * @param {string} resultId - The result id.
            * @param {ResultReason} reason - The reason.
            * @param {string} text - The recognized text.
            * @param {number} duration - The duration.
            * @param {number} offset - The offset into the stream.
            * @param {string} errorDetails - Error details, if provided.
            * @param {string} json - Additional Json, if provided.
            * @param {PropertyCollection} properties - Additional properties, if provided.
            */
        constructor(translations: Translations, resultId?: string, reason?: ResultReason, text?: string, duration?: number, offset?: number, errorDetails?: string, json?: string, properties?: PropertyCollection);
        /**
            * Presents the translation results. Each item in the dictionary represents
            * a translation result in one of target languages, where the key is the name
            * of the target language, in BCP-47 format, and the value is the translation
            * text in the specified language.
            * @member TranslationRecognitionResult.prototype.translations
            * @function
            * @public
            * @returns {Translations} the current translation map that holds all translations requested.
            */
        get translations(): Translations;
}

/**
    * Defines translation synthesis result, i.e. the voice output of the translated
    * text in the target language.
    * @class TranslationSynthesisResult
    */
export class TranslationSynthesisResult {
        /**
            * Creates and initializes an instance of this class.
            * @constructor
            * @param {ResultReason} reason - The synthesis reason.
            * @param {ArrayBuffer} audio - The audio data.
            */
        constructor(reason: ResultReason, audio: ArrayBuffer);
        /**
            * Translated text in the target language.
            * @member TranslationSynthesisResult.prototype.audio
            * @function
            * @public
            * @returns {ArrayBuffer} Translated audio in the target language.
            */
        get audio(): ArrayBuffer;
        /**
            * The synthesis status.
            * @member TranslationSynthesisResult.prototype.reason
            * @function
            * @public
            * @returns {ResultReason} The synthesis status.
            */
        get reason(): ResultReason;
}

/**
    * Defines the possible reasons a recognition result might be generated.
    * @class ResultReason
    */
export enum ResultReason {
        /**
            * Indicates speech could not be recognized. More details
            * can be found in the NoMatchDetails object.
            * @member ResultReason.NoMatch
            */
        NoMatch = 0,
        /**
            * Indicates that the recognition was canceled. More details
            * can be found using the CancellationDetails object.
            * @member ResultReason.Canceled
            */
        Canceled = 1,
        /**
            * Indicates the speech result contains hypothesis text.
            * @member ResultReason.RecognizedSpeech
            */
        RecognizingSpeech = 2,
        /**
            * Indicates the speech result contains final text that has been recognized.
            * Speech Recognition is now complete for this phrase.
            * @member ResultReason.RecognizedSpeech
            */
        RecognizedSpeech = 3,
        /**
            * Indicates the intent result contains hypothesis text and intent.
            * @member ResultReason.RecognizingIntent
            */
        RecognizingIntent = 4,
        /**
            * Indicates the intent result contains final text and intent.
            * Speech Recognition and Intent determination are now complete for this phrase.
            * @member ResultReason.RecognizedIntent
            */
        RecognizedIntent = 5,
        /**
            * Indicates the translation result contains hypothesis text and its translation(s).
            * @member ResultReason.TranslatingSpeech
            */
        TranslatingSpeech = 6,
        /**
            * Indicates the translation result contains final text and corresponding translation(s).
            * Speech Recognition and Translation are now complete for this phrase.
            * @member ResultReason.TranslatedSpeech
            */
        TranslatedSpeech = 7,
        /**
            * Indicates the synthesized audio result contains a non-zero amount of audio data
            * @member ResultReason.SynthesizingAudio
            */
        SynthesizingAudio = 8,
        /**
            * Indicates the synthesized audio is now complete for this phrase.
            * @member ResultReason.SynthesizingAudioCompleted
            */
        SynthesizingAudioCompleted = 9,
        /**
            * Indicates the speech synthesis is now started
            * @member ResultReason.SynthesizingAudioStarted
            */
        SynthesizingAudioStarted = 10,
        /**
            * Indicates the voice profile is being enrolled and customers need to send more audio to create a voice profile.
            * @member ResultReason.EnrollingVoiceProfile
            */
        EnrollingVoiceProfile = 11,
        /**
            * Indicates the voice profile has been enrolled.
            * @member ResultReason.EnrolledVoiceProfile
            */
        EnrolledVoiceProfile = 12,
        /**
            * Indicates successful identification of some speakers.
            * @member ResultReason.RecognizedSpeakers
            */
        RecognizedSpeakers = 13,
        /**
            * Indicates successfully verified one speaker.
            * @member ResultReason.RecognizedSpeaker
            */
        RecognizedSpeaker = 14,
        /**
            * Indicates a voice profile has been reset successfully.
            * @member ResultReason.ResetVoiceProfile
            */
        ResetVoiceProfile = 15,
        /**
            * Indicates a voice profile has been deleted successfully.
            * @member ResultReason.DeletedVoiceProfile
            */
        DeletedVoiceProfile = 16
}

/**
    * Speech configuration.
    * @class SpeechConfig
    */
export abstract class SpeechConfig {
        /**
            * Creates and initializes an instance.
            * @constructor
            */
        protected constructor();
        /**
            * Static instance of SpeechConfig returned by passing subscriptionKey and service region.
            * Note: Please use your LanguageUnderstanding subscription key in case you want to use the Intent recognizer.
            * @member SpeechConfig.fromSubscription
            * @function
            * @public
            * @param {string} subscriptionKey - The subscription key.
            * @param {string} region - The region name (see the <a href="https://aka.ms/csspeech/region">region page</a>).
            * @returns {SpeechConfig} The speech factory
            */
        static fromSubscription(subscriptionKey: string, region: string): SpeechConfig;
        /**
            * Creates an instance of the speech config with specified endpoint and subscription key.
            * This method is intended only for users who use a non-standard service endpoint or parameters.
            * Note: Please use your LanguageUnderstanding subscription key in case you want to use the Intent recognizer.
            * Note: The query parameters specified in the endpoint URL are not changed, even if they are set by any other APIs.
            * For example, if language is defined in the uri as query parameter "language=de-DE", and also set by
            *              SpeechConfig.speechRecognitionLanguage = "en-US", the language setting in uri takes precedence,
            *              and the effective language is "de-DE". Only the parameters that are not specified in the
            *              endpoint URL can be set by other APIs.
            * Note: To use authorization token with fromEndpoint, pass an empty string to the subscriptionKey in the
            *       fromEndpoint method, and then set authorizationToken="token" on the created SpeechConfig instance to
            *       use the authorization token.
            * @member SpeechConfig.fromEndpoint
            * @function
            * @public
            * @param {URL} endpoint - The service endpoint to connect to.
            * @param {string} subscriptionKey - The subscription key. If a subscription key is not specified, an authorization token must be set.
            * @returns {SpeechConfig} A speech factory instance.
            */
        static fromEndpoint(endpoint: URL, subscriptionKey?: string): SpeechConfig;
        /**
            * Creates an instance of the speech config with specified host and subscription key.
            * This method is intended only for users who use a non-default service host. Standard resource path will be assumed.
            * For services with a non-standard resource path or no path at all, use fromEndpoint instead.
            * Note: Query parameters are not allowed in the host URI and must be set by other APIs.
            * Note: To use an authorization token with fromHost, use fromHost(URL),
            * and then set the AuthorizationToken property on the created SpeechConfig instance.
            * Note: Added in version 1.9.0.
            * @member SpeechConfig.fromHost
            * @function
            * @public
            * @param {URL} host - The service endpoint to connect to. Format is "protocol://host:port" where ":port" is optional.
            * @param {string} subscriptionKey - The subscription key. If a subscription key is not specified, an authorization token must be set.
            * @returns {SpeechConfig} A speech factory instance.
            */
        static fromHost(hostName: URL, subscriptionKey?: string): SpeechConfig;
        /**
            * Creates an instance of the speech factory with specified initial authorization token and region.
            * Note: The caller needs to ensure that the authorization token is valid. Before the authorization token
            *       expires, the caller needs to refresh it by calling this setter with a new valid token.
            * Note: Please use a token derived from your LanguageUnderstanding subscription key in case you want
            *       to use the Intent recognizer. As configuration values are copied when creating a new recognizer,
            *       the new token value will not apply to recognizers that have already been created. For recognizers
            *       that have been created before, you need to set authorization token of the corresponding recognizer
            *       to refresh the token. Otherwise, the recognizers will encounter errors during recognition.
            * @member SpeechConfig.fromAuthorizationToken
            * @function
            * @public
            * @param {string} authorizationToken - The initial authorization token.
            * @param {string} region - The region name (see the <a href="https://aka.ms/csspeech/region">region page</a>).
            * @returns {SpeechConfig} A speech factory instance.
            */
        static fromAuthorizationToken(authorizationToken: string, region: string): SpeechConfig;
        /**
            * Sets the proxy configuration.
            * Only relevant in Node.js environments.
            * Added in version 1.4.0.
            * @param proxyHostName The host name of the proxy server.
            * @param proxyPort The port number of the proxy server.
            */
        abstract setProxy(proxyHostName: string, proxyPort: number): void;
        /**
            * Sets the proxy configuration.
            * Only relevant in Node.js environments.
            * Added in version 1.4.0.
            * @param proxyHostName The host name of the proxy server, without the protocol scheme (http://)
            * @param proxyPort The port number of the proxy server.
            * @param proxyUserName The user name of the proxy server.
            * @param proxyPassword The password of the proxy server.
            */
        abstract setProxy(proxyHostName: string, proxyPort: number, proxyUserName: string, proxyPassword: string): void;
        /**
            * Gets the authorization token.
            * @member SpeechConfig.prototype.authorizationToken
            * @function
            * @public
            */
        abstract get authorizationToken(): string;
        /**
            * Gets/Sets the authorization token.
            * Note: The caller needs to ensure that the authorization token is valid. Before the authorization token
            * expires, the caller needs to refresh it by calling this setter with a new valid token.
            * @member SpeechConfig.prototype.authorizationToken
            * @function
            * @public
            * @param {string} value - The authorization token.
            */
        abstract set authorizationToken(value: string);
        /**
            * Returns the configured language.
            * @member SpeechConfig.prototype.speechRecognitionLanguage
            * @function
            * @public
            */
        abstract get speechRecognitionLanguage(): string;
        /**
            * Gets/Sets the input language.
            * @member SpeechConfig.prototype.speechRecognitionLanguage
            * @function
            * @public
            * @param {string} value - The authorization token.
            */
        abstract set speechRecognitionLanguage(value: string);
        /**
            * Sets an arbitrary property.
            * @member SpeechConfig.prototype.setProperty
            * @function
            * @public
            * @param {string} name - The name of the property to set.
            * @param {string} value - The new value of the property.
            */
        abstract setProperty(name: string, value: string): void;
        /**
            * Returns the current value of an arbitrary property.
            * @member SpeechConfig.prototype.getProperty
            * @function
            * @public
            * @param {string} name - The name of the property to query.
            * @param {string} def - The value to return in case the property is not known.
            * @returns {string} The current value, or provided default, of the given property.
            */
        abstract getProperty(name: string, def?: string): string;
        /**
            * Gets speech recognition output format (simple or detailed).
            * Note: This output format is for speech recognition result, use [SpeechConfig.speechSynthesisOutputFormat] to
            * get synthesized audio output format.
            * @member SpeechConfig.prototype.outputFormat
            * @function
            * @public
            * @returns {OutputFormat} Returns the output format.
            */
        abstract get outputFormat(): OutputFormat;
        /**
            * Gets/Sets speech recognition output format (simple or detailed).
            * Note: This output format is for speech recognition result, use [SpeechConfig.speechSynthesisOutputFormat] to
            * set synthesized audio output format.
            * @member SpeechConfig.prototype.outputFormat
            * @function
            * @public
            */
        abstract set outputFormat(format: OutputFormat);
        /**
            * Gets the endpoint ID of a customized speech model that is used for speech recognition.
            * @member SpeechConfig.prototype.endpointId
            * @function
            * @public
            * @return {string} The endpoint ID
            */
        abstract get endpointId(): string;
        /**
            * Gets/Sets the endpoint ID of a customized speech model that is used for speech recognition.
            * @member SpeechConfig.prototype.endpointId
            * @function
            * @public
            * @param {string} value - The endpoint ID
            */
        abstract set endpointId(value: string);
        /**
            * Closes the configuration.
            * @member SpeechConfig.prototype.close
            * @function
            * @public
            */
        close(): void;
        /**
            * @member SpeechConfig.prototype.subscriptionKey
            * @function
            * @public
            * @return {string} The subscription key set on the config.
            */
        abstract get subscriptionKey(): string;
        /**
            * @member SpeechConfig.prototype.region
            * @function
            * @public
            * @return {region} The region set on the config.
            */
        abstract get region(): string;
        /**
            * @member SpeechConfig.prototype.setServiceProperty
            * @function
            * @public
            * @param {name} The name of the property.
            * @param {value} Value to set.
            * @param {channel} The channel used to pass the specified property to service.
            * @summary Sets a property value that will be passed to service using the specified channel.
            * Added in version 1.7.0.
            */
        abstract setServiceProperty(name: string, value: string, channel: ServicePropertyChannel): void;
        /**
            * @member SpeechConfig.prototype.setProfanity
            * @function
            * @public
            * @param {profanity} Profanity option to set.
            * @summary Sets profanity option.
            * Added in version 1.7.0.
            */
        abstract setProfanity(profanity: ProfanityOption): void;
        /**
            * @member SpeechConfig.prototype.enableAudioLogging
            * @function
            * @public
            * @summary Enable audio logging in service.
            * Added in version 1.7.0.
            */
        abstract enableAudioLogging(): void;
        /**
            * @member SpeechConfig.prototype.requestWordLevelTimestamps
            * @function
            * @public
            * @summary Includes word-level timestamps.
            * Added in version 1.7.0.
            */
        abstract requestWordLevelTimestamps(): void;
        /**
            * @member SpeechConfig.prototype.enableDictation
            * @function
            * @public
            * @summary Enable dictation. Only supported in speech continuous recognition.
            * Added in version 1.7.0.
            */
        abstract enableDictation(): void;
        /**
            * Gets the language of the speech synthesizer.
            * @member SpeechConfig.prototype.speechSynthesisLanguage
            * @function
            * @public
            * @returns {string} Returns the speech synthesis language.
            * Added in version 1.11.0.
            */
        abstract get speechSynthesisLanguage(): string;
        /**
            * Sets the language of the speech synthesizer.
            * @member SpeechConfig.prototype.speechSynthesisLanguage
            * @function
            * @public
            * Added in version 1.11.0.
            */
        abstract set speechSynthesisLanguage(language: string);
        /**
            * Gets the voice of the speech synthesizer.
            * @member SpeechConfig.prototype.speechSynthesisVoiceName
            * @function
            * @public
            * @returns {string} Returns the speech synthesis voice.
            * Added in version 1.11.0.
            */
        abstract get speechSynthesisVoiceName(): string;
        /**
            * Sets the voice of the speech synthesizer. (see <a href="https://aka.ms/speech/tts-languages">available voices</a>).
            * @member SpeechConfig.prototype.speechSynthesisVoiceName
            * @function
            * @public
            * Added in version 1.11.0.
            */
        abstract set speechSynthesisVoiceName(voice: string);
        /**
            * Gets the speech synthesis output format.
            * @member SpeechConfig.prototype.speechSynthesisOutputFormat
            * @function
            * @public
            * @returns {SpeechSynthesisOutputFormat} Returns the speech synthesis output format
            * Added in version 1.11.0.
            */
        abstract get speechSynthesisOutputFormat(): SpeechSynthesisOutputFormat;
        /**
            * Sets the speech synthesis output format (e.g. Riff16Khz16BitMonoPcm).
            * @member SpeechConfig.prototype.speechSynthesisOutputFormat
            * @function
            * @public
            * The default format is Audio16Khz64KBitRateMonoMp3 for browser and Riff16Khz16BitMonoPcm for Node.JS
            * Added in version 1.11.0.
            */
        abstract set speechSynthesisOutputFormat(format: SpeechSynthesisOutputFormat);
}
/**
    * @public
    * @class SpeechConfigImpl
    */
export class SpeechConfigImpl extends SpeechConfig {
        constructor();
        get properties(): PropertyCollection;
        get endPoint(): URL;
        get subscriptionKey(): string;
        get region(): string;
        get authorizationToken(): string;
        set authorizationToken(value: string);
        get speechRecognitionLanguage(): string;
        set speechRecognitionLanguage(value: string);
        get autoDetectSourceLanguages(): string;
        set autoDetectSourceLanguages(value: string);
        get outputFormat(): OutputFormat;
        set outputFormat(value: OutputFormat);
        get endpointId(): string;
        set endpointId(value: string);
        setProperty(name: string | PropertyId, value: string): void;
        getProperty(name: string | PropertyId, def?: string): string;
        setProxy(proxyHostName: string, proxyPort: number): void;
        setProxy(proxyHostName: string, proxyPort: number, proxyUserName: string, proxyPassword: string): void;
        setServiceProperty(name: string, value: string, channel: ServicePropertyChannel): void;
        setProfanity(profanity: ProfanityOption): void;
        enableAudioLogging(): void;
        requestWordLevelTimestamps(): void;
        enableDictation(): void;
        clone(): SpeechConfigImpl;
        get speechSynthesisLanguage(): string;
        set speechSynthesisLanguage(language: string);
        get speechSynthesisVoiceName(): string;
        set speechSynthesisVoiceName(voice: string);
        get speechSynthesisOutputFormat(): SpeechSynthesisOutputFormat;
        set speechSynthesisOutputFormat(format: SpeechSynthesisOutputFormat);
}

/**
    * Speech translation configuration.
    * @class SpeechTranslationConfig
    */
export abstract class SpeechTranslationConfig extends SpeechConfig {
        /**
            * Creates an instance of recognizer config.
            */
        protected constructor();
        /**
            * Static instance of SpeechTranslationConfig returned by passing a subscription key and service region.
            * @member SpeechTranslationConfig.fromSubscription
            * @function
            * @public
            * @param {string} subscriptionKey - The subscription key.
            * @param {string} region - The region name (see the <a href="https://aka.ms/csspeech/region">region page</a>).
            * @returns {SpeechTranslationConfig} The speech translation config.
            */
        static fromSubscription(subscriptionKey: string, region: string): SpeechTranslationConfig;
        /**
            * Static instance of SpeechTranslationConfig returned by passing authorization token and service region.
            * Note: The caller needs to ensure that the authorization token is valid. Before the authorization token
            *       expires, the caller needs to refresh it by setting the property authorizationToken with a new
            *       valid token. Otherwise, all the recognizers created by this SpeechTranslationConfig instance
            *       will encounter errors during recognition.
            * As configuration values are copied when creating a new recognizer, the new token value will not apply
            * to recognizers that have already been created.
            * For recognizers that have been created before, you need to set authorization token of the corresponding recognizer
            * to refresh the token. Otherwise, the recognizers will encounter errors during recognition.
            * @member SpeechTranslationConfig.fromAuthorizationToken
            * @function
            * @public
            * @param {string} authorizationToken - The authorization token.
            * @param {string} region - The region name (see the <a href="https://aka.ms/csspeech/region">region page</a>).
            * @returns {SpeechTranslationConfig} The speech translation config.
            */
        static fromAuthorizationToken(authorizationToken: string, region: string): SpeechTranslationConfig;
        /**
            * Creates an instance of the speech config with specified host and subscription key.
            * This method is intended only for users who use a non-default service host. Standard resource path will be assumed.
            * For services with a non-standard resource path or no path at all, use fromEndpoint instead.
            * Note: Query parameters are not allowed in the host URI and must be set by other APIs.
            * Note: To use an authorization token with fromHost, use fromHost(URL),
            * and then set the AuthorizationToken property on the created SpeechConfig instance.
            * Note: Added in version 1.9.0.
            * @member SpeechConfig.fromHost
            * @function
            * @public
            * @param {URL} host - The service endpoint to connect to. Format is "protocol://host:port" where ":port" is optional.
            * @param {string} subscriptionKey - The subscription key. If a subscription key is not specified, an authorization token must be set.
            * @returns {SpeechConfig} A speech factory instance.
            */
        static fromHost(hostName: URL, subscriptionKey?: string): SpeechConfig;
        /**
            * Creates an instance of the speech translation config with specified endpoint and subscription key.
            * This method is intended only for users who use a non-standard service endpoint or paramters.
            * Note: The query properties specified in the endpoint URL are not changed, even if they are
            *       set by any other APIs. For example, if language is defined in the uri as query parameter
            *       "language=de-DE", and also set by the speechRecognitionLanguage property, the language
            *       setting in uri takes precedence, and the effective language is "de-DE".
            * Only the properties that are not specified in the endpoint URL can be set by other APIs.
            * Note: To use authorization token with fromEndpoint, pass an empty string to the subscriptionKey in the
            *       fromEndpoint method, and then set authorizationToken="token" on the created SpeechConfig instance to
            *       use the authorization token.
            * @member SpeechTranslationConfig.fromEndpoint
            * @function
            * @public
            * @param {URL} endpoint - The service endpoint to connect to.
            * @param {string} subscriptionKey - The subscription key.
            * @returns {SpeechTranslationConfig} A speech config instance.
            */
        static fromEndpoint(endpoint: URL, subscriptionKey: string): SpeechTranslationConfig;
        /**
            * Gets/Sets the authorization token.
            * Note: The caller needs to ensure that the authorization token is valid. Before the authorization token
            * expires, the caller needs to refresh it by calling this setter with a new valid token.
            * @member SpeechTranslationConfig.prototype.authorizationToken
            * @function
            * @public
            * @param {string} value - The authorization token.
            */
        abstract set authorizationToken(value: string);
        /**
            * Gets/Sets the speech recognition language.
            * @member SpeechTranslationConfig.prototype.speechRecognitionLanguage
            * @function
            * @public
            * @param {string} value - The authorization token.
            */
        abstract set speechRecognitionLanguage(value: string);
        /**
            * Add a (text) target language to translate into.
            * @member SpeechTranslationConfig.prototype.addTargetLanguage
            * @function
            * @public
            * @param {string} value - The language such as de-DE
            */
        abstract addTargetLanguage(value: string): void;
        /**
            * Gets the (text) target language to translate into.
            * @member SpeechTranslationConfig.prototype.targetLanguages
            * @function
            * @public
            * @param {string} value - The language such as de-DE
            */
        abstract get targetLanguages(): string[];
        /**
            * Gets the selected voice name.
            * @member SpeechTranslationConfig.prototype.voiceName
            * @function
            * @public
            * @returns {string} The voice name.
            */
        abstract get voiceName(): string;
        /**
            * Gets/Sets voice of the translated language, enable voice synthesis output.
            * @member SpeechTranslationConfig.prototype.voiceName
            * @function
            * @public
            * @param {string} value - The name of the voice.
            */
        abstract set voiceName(value: string);
        /**
            * Sets a named property as value
            * @member SpeechTranslationConfig.prototype.setProperty
            * @function
            * @public
            * @param {string} name - The name of the property.
            * @param {string} value - The value.
            */
        abstract setProperty(name: string, value: string): void;
        /**
            * Dispose of associated resources.
            * @member SpeechTranslationConfig.prototype.close
            * @function
            * @public
            */
        abstract close(): void;
}
/**
    * @private
    * @class SpeechTranslationConfigImpl
    */
export class SpeechTranslationConfigImpl extends SpeechTranslationConfig {
        constructor();
        /**
            * Gets/Sets the authorization token.
            * If this is set, subscription key is ignored.
            * User needs to make sure the provided authorization token is valid and not expired.
            * @member SpeechTranslationConfigImpl.prototype.authorizationToken
            * @function
            * @public
            * @param {string} value - The authorization token.
            */
        set authorizationToken(value: string);
        /**
            * Gets/Sets the speech recognition language.
            * @member SpeechTranslationConfigImpl.prototype.speechRecognitionLanguage
            * @function
            * @public
            * @param {string} value - The authorization token.
            */
        set speechRecognitionLanguage(value: string);
        /**
            * @member SpeechTranslationConfigImpl.prototype.subscriptionKey
            * @function
            * @public
            */
        get subscriptionKey(): string;
        /**
            * Gets the output format
            * @member SpeechTranslationConfigImpl.prototype.outputFormat
            * @function
            * @public
            */
        get outputFormat(): OutputFormat;
        /**
            * Gets/Sets the output format
            * @member SpeechTranslationConfigImpl.prototype.outputFormat
            * @function
            * @public
            */
        set outputFormat(value: OutputFormat);
        /**
            * Gets the endpoint id.
            * @member SpeechTranslationConfigImpl.prototype.endpointId
            * @function
            * @public
            */
        get endpointId(): string;
        /**
            * Gets/Sets the endpoint id.
            * @member SpeechTranslationConfigImpl.prototype.endpointId
            * @function
            * @public
            */
        set endpointId(value: string);
        /**
            * Add a (text) target language to translate into.
            * @member SpeechTranslationConfigImpl.prototype.addTargetLanguage
            * @function
            * @public
            * @param {string} value - The language such as de-DE
            */
        addTargetLanguage(value: string): void;
        /**
            * Gets the (text) target language to translate into.
            * @member SpeechTranslationConfigImpl.prototype.targetLanguages
            * @function
            * @public
            * @param {string} value - The language such as de-DE
            */
        get targetLanguages(): string[];
        /**
            * Gets the voice name.
            * @member SpeechTranslationConfigImpl.prototype.voiceName
            * @function
            * @public
            */
        get voiceName(): string;
        /**
            * Gets/Sets the voice of the translated language, enable voice synthesis output.
            * @member SpeechTranslationConfigImpl.prototype.voiceName
            * @function
            * @public
            * @param {string} value - The name of the voice.
            */
        set voiceName(value: string);
        /**
            * Provides the region.
            * @member SpeechTranslationConfigImpl.prototype.region
            * @function
            * @public
            * @returns {string} The region.
            */
        get region(): string;
        setProxy(proxyHostName: string, proxyPort: number): void;
        setProxy(proxyHostName: string, proxyPort: number, proxyUserName: string, proxyPassword: string): void;
        /**
            * Gets an arbitrary property value.
            * @member SpeechTranslationConfigImpl.prototype.getProperty
            * @function
            * @public
            * @param {string} name - The name of the property.
            * @param {string} def - The default value of the property in case it is not set.
            * @returns {string} The value of the property.
            */
        getProperty(name: string, def?: string): string;
        /**
            * Gets/Sets an arbitrary property value.
            * @member SpeechTranslationConfigImpl.prototype.setProperty
            * @function
            * @public
            * @param {string} name - The name of the property.
            * @param {string} value - The value of the property.
            */
        setProperty(name: string | PropertyId, value: string): void;
        /**
            * Provides access to custom properties.
            * @member SpeechTranslationConfigImpl.prototype.properties
            * @function
            * @public
            * @returns {PropertyCollection} The properties.
            */
        get properties(): PropertyCollection;
        /**
            * Dispose of associated resources.
            * @member SpeechTranslationConfigImpl.prototype.close
            * @function
            * @public
            */
        close(): void;
        setServiceProperty(name: string, value: string, channel: ServicePropertyChannel): void;
        setProfanity(profanity: ProfanityOption): void;
        enableAudioLogging(): void;
        requestWordLevelTimestamps(): void;
        enableDictation(): void;
        get speechSynthesisLanguage(): string;
        set speechSynthesisLanguage(language: string);
        get speechSynthesisVoiceName(): string;
        set speechSynthesisVoiceName(voice: string);
        get speechSynthesisOutputFormat(): SpeechSynthesisOutputFormat;
        set speechSynthesisOutputFormat(format: SpeechSynthesisOutputFormat);
}

/**
    * Represents collection of properties and their values.
    * @class PropertyCollection
    */
export class PropertyCollection {
        /**
            * Returns the property value in type String. The parameter must have the same type as String.
            * Currently only String, int and bool are allowed.
            * If the name is not available, the specified defaultValue is returned.
            * @member PropertyCollection.prototype.getProperty
            * @function
            * @public
            * @param {string} key - The parameter name.
            * @param {string} def - The default value which is returned if the parameter
            *        is not available in the collection.
            * @returns {string} value of the parameter.
            */
        getProperty(key: PropertyId | string, def?: string): string;
        /**
            * Sets the String value of the parameter specified by name.
            * @member PropertyCollection.prototype.setProperty
            * @function
            * @public
            * @param {string} key - The parameter name.
            * @param {string} value - The value of the parameter.
            */
        setProperty(key: string | PropertyId, value: string): void;
        /**
            * Clones the collection.
            * @member PropertyCollection.prototype.clone
            * @function
            * @public
            * @returns {PropertyCollection} A copy of the collection.
            */
        clone(): PropertyCollection;
        /**
            * Merges this set of properties into another, no overwrites.
            * @member PropertyCollection.prototype.mergeTo
            * @function
            * @public
            * @param {PropertyCollection} The collection to merge into.
            */
        mergeTo(destinationCollection: PropertyCollection): void;
}

/**
    * Defines speech property ids.
    * @class PropertyId
    */
export enum PropertyId {
        /**
            * The Cognitive Services Speech Service subscription Key. If you are using an intent recognizer, you need to specify
            * to specify the LUIS endpoint key for your particular LUIS app. Under normal circumstances, you shouldn't
            * have to use this property directly.
            * Instead, use [[SpeechConfig.fromSubscription]].
            * @member PropertyId.SpeechServiceConnection_Key
            */
        SpeechServiceConnection_Key = 0,
        /**
            * The Cognitive Services Speech Service endpoint (url). Under normal circumstances, you shouldn't
            * have to use this property directly.
            * Instead, use [[SpeechConfig.fromEndpoint]].
            * NOTE: This endpoint is not the same as the endpoint used to obtain an access token.
            * @member PropertyId.SpeechServiceConnection_Endpoint
            */
        SpeechServiceConnection_Endpoint = 1,
        /**
            * The Cognitive Services Speech Service region. Under normal circumstances, you shouldn't have to
            * use this property directly.
            * Instead, use [[SpeechConfig.fromSubscription]], [[SpeechConfig.fromEndpoint]], [[SpeechConfig.fromAuthorizationToken]].
            * @member PropertyId.SpeechServiceConnection_Region
            */
        SpeechServiceConnection_Region = 2,
        /**
            * The Cognitive Services Speech Service authorization token (aka access token). Under normal circumstances,
            * you shouldn't have to use this property directly.
            * Instead, use [[SpeechConfig.fromAuthorizationToken]], [[SpeechRecognizer.authorizationToken]],
            * [[IntentRecognizer.authorizationToken]], [[TranslationRecognizer.authorizationToken]], [[SpeakerRecognizer.authorizationToken]].
            * @member PropertyId.SpeechServiceAuthorization_Token
            */
        SpeechServiceAuthorization_Token = 3,
        /**
            * The Cognitive Services Speech Service authorization type. Currently unused.
            * @member PropertyId.SpeechServiceAuthorization_Type
            */
        SpeechServiceAuthorization_Type = 4,
        /**
            * The Cognitive Services Speech Service endpoint id. Under normal circumstances, you shouldn't
            * have to use this property directly.
            * Instead, use [[SpeechConfig.endpointId]].
            * NOTE: The endpoint id is available in the Speech Portal, listed under Endpoint Details.
            * @member PropertyId.SpeechServiceConnection_EndpointId
            */
        SpeechServiceConnection_EndpointId = 5,
        /**
            * The list of comma separated languages (BCP-47 format) used as target translation languages. Under normal circumstances,
            * you shouldn't have to use this property directly.
            * Instead use [[SpeechTranslationConfig.addTargetLanguage]],
            * [[SpeechTranslationConfig.targetLanguages]], [[TranslationRecognizer.targetLanguages]].
            * @member PropertyId.SpeechServiceConnection_TranslationToLanguages
            */
        SpeechServiceConnection_TranslationToLanguages = 6,
        /**
            * The name of the Cognitive Service Text to Speech Service Voice. Under normal circumstances, you shouldn't have to use this
            * property directly.
            * Instead, use [[SpeechTranslationConfig.voiceName]].
            * NOTE: Valid voice names can be found <a href="https://aka.ms/csspeech/voicenames">here</a>.
            * @member PropertyId.SpeechServiceConnection_TranslationVoice
            */
        SpeechServiceConnection_TranslationVoice = 7,
        /**
            * Translation features.
            * @member PropertyId.SpeechServiceConnection_TranslationFeatures
            */
        SpeechServiceConnection_TranslationFeatures = 8,
        /**
            * The Language Understanding Service Region. Under normal circumstances, you shouldn't have to use this property directly.
            * Instead, use [[LanguageUnderstandingModel]].
            * @member PropertyId.SpeechServiceConnection_IntentRegion
            */
        SpeechServiceConnection_IntentRegion = 9,
        /**
            * The host name of the proxy server used to connect to the Cognitive Services Speech Service. Only relevant in Node.js environments.
            * You shouldn't have to use this property directly.
            * Instead use <see cref="SpeechConfig.SetProxy(string,int,string,string)"/>.
            * Added in version 1.4.0.
            */
        SpeechServiceConnection_ProxyHostName = 10,
        /**
            * The port of the proxy server used to connect to the Cognitive Services Speech Service. Only relevant in Node.js environments.
            * You shouldn't have to use this property directly.
            * Instead use <see cref="SpeechConfig.SetProxy(string,int,string,string)"/>.
            * Added in version 1.4.0.
            */
        SpeechServiceConnection_ProxyPort = 11,
        /**
            * The user name of the proxy server used to connect to the Cognitive Services Speech Service. Only relevant in Node.js environments.
            * You shouldn't have to use this property directly.
            * Instead use <see cref="SpeechConfig.SetProxy(string,int,string,string)"/>.
            * Added in version 1.4.0.
            */
        SpeechServiceConnection_ProxyUserName = 12,
        /**
            * The password of the proxy server used to connect to the Cognitive Services Speech Service. Only relevant in Node.js environments.
            * You shouldn't have to use this property directly.
            * Instead use <see cref="SpeechConfig.SetProxy(string,int,string,string)"/>.
            * Added in version 1.4.0.
            */
        SpeechServiceConnection_ProxyPassword = 13,
        /**
            * The Cognitive Services Speech Service recognition Mode. Can be "INTERACTIVE", "CONVERSATION", "DICTATION".
            * This property is intended to be read-only. The SDK is using it internally.
            * @member PropertyId.SpeechServiceConnection_RecoMode
            */
        SpeechServiceConnection_RecoMode = 14,
        /**
            * The spoken language to be recognized (in BCP-47 format). Under normal circumstances, you shouldn't have to use this property
            * directly.
            * Instead, use [[SpeechConfig.speechRecognitionLanguage]].
            * @member PropertyId.SpeechServiceConnection_RecoLanguage
            */
        SpeechServiceConnection_RecoLanguage = 15,
        /**
            * The session id. This id is a universally unique identifier (aka UUID) representing a specific binding of an audio input stream
            * and the underlying speech recognition instance to which it is bound. Under normal circumstances, you shouldn't have to use this
            * property directly.
            * Instead use [[SessionEventArgs.sessionId]].
            * @member PropertyId.Speech_SessionId
            */
        Speech_SessionId = 16,
        /**
            * The spoken language to be synthesized (e.g. en-US)
            * @member PropertyId.SpeechServiceConnection_SynthLanguage
            */
        SpeechServiceConnection_SynthLanguage = 17,
        /**
            * The name of the TTS voice to be used for speech synthesis
            * @member PropertyId.SpeechServiceConnection_SynthVoice
            */
        SpeechServiceConnection_SynthVoice = 18,
        /**
            * The string to specify TTS output audio format
            * @member PropertyId.SpeechServiceConnection_SynthOutputFormat
            */
        SpeechServiceConnection_SynthOutputFormat = 19,
        /**
            * The list of comma separated languages used as possible source languages
            * Added in version 1.13.0
            * @member PropertyId.SpeechServiceConnection_AutoDetectSourceLanguages
            */
        SpeechServiceConnection_AutoDetectSourceLanguages = 20,
        /**
            * The requested Cognitive Services Speech Service response output format (simple or detailed). Under normal circumstances, you shouldn't have
            * to use this property directly.
            * Instead use [[SpeechConfig.outputFormat]].
            * @member PropertyId.SpeechServiceResponse_RequestDetailedResultTrueFalse
            */
        SpeechServiceResponse_RequestDetailedResultTrueFalse = 21,
        /**
            * The requested Cognitive Services Speech Service response output profanity level. Currently unused.
            * @member PropertyId.SpeechServiceResponse_RequestProfanityFilterTrueFalse
            */
        SpeechServiceResponse_RequestProfanityFilterTrueFalse = 22,
        /**
            * The Cognitive Services Speech Service response output (in JSON format). This property is available on recognition result objects only.
            * @member PropertyId.SpeechServiceResponse_JsonResult
            */
        SpeechServiceResponse_JsonResult = 23,
        /**
            * The Cognitive Services Speech Service error details (in JSON format). Under normal circumstances, you shouldn't have to
            * use this property directly. Instead use [[CancellationDetails.errorDetails]].
            * @member PropertyId.SpeechServiceResponse_JsonErrorDetails
            */
        SpeechServiceResponse_JsonErrorDetails = 24,
        /**
            * The cancellation reason. Currently unused.
            * @member PropertyId.CancellationDetails_Reason
            */
        CancellationDetails_Reason = 25,
        /**
            * The cancellation text. Currently unused.
            * @member PropertyId.CancellationDetails_ReasonText
            */
        CancellationDetails_ReasonText = 26,
        /**
            * The Cancellation detailed text. Currently unused.
            * @member PropertyId.CancellationDetails_ReasonDetailedText
            */
        CancellationDetails_ReasonDetailedText = 27,
        /**
            * The Language Understanding Service response output (in JSON format). Available via [[IntentRecognitionResult]]
            * @member PropertyId.LanguageUnderstandingServiceResponse_JsonResult
            */
        LanguageUnderstandingServiceResponse_JsonResult = 28,
        /**
            * The URL string built from speech configuration.
            * This property is intended to be read-only. The SDK is using it internally.
            * NOTE: Added in version 1.7.0.
            */
        SpeechServiceConnection_Url = 29,
        /**
            * The initial silence timeout value (in milliseconds) used by the service.
            * Added in version 1.7.0
            */
        SpeechServiceConnection_InitialSilenceTimeoutMs = 30,
        /**
            * The end silence timeout value (in milliseconds) used by the service.
            * Added in version 1.7.0
            */
        SpeechServiceConnection_EndSilenceTimeoutMs = 31,
        /**
            * A boolean value specifying whether audio logging is enabled in the service or not.
            * Added in version 1.7.0
            */
        SpeechServiceConnection_EnableAudioLogging = 32,
        /**
            * The requested Cognitive Services Speech Service response output profanity setting.
            * Allowed values are "masked", "removed", and "raw".
            * Added in version 1.7.0.
            */
        SpeechServiceResponse_ProfanityOption = 33,
        /**
            * A string value specifying which post processing option should be used by service.
            * Allowed values are "TrueText".
            * Added in version 1.7.0
            */
        SpeechServiceResponse_PostProcessingOption = 34,
        /**
            *  A boolean value specifying whether to include word-level timestamps in the response result.
            * Added in version 1.7.0
            */
        SpeechServiceResponse_RequestWordLevelTimestamps = 35,
        /**
            * The number of times a word has to be in partial results to be returned.
            * Added in version 1.7.0
            */
        SpeechServiceResponse_StablePartialResultThreshold = 36,
        /**
            * A string value specifying the output format option in the response result. Internal use only.
            * Added in version 1.7.0.
            */
        SpeechServiceResponse_OutputFormatOption = 37,
        /**
            * A boolean value to request for stabilizing translation partial results by omitting words in the end.
            * Added in version 1.7.0.
            */
        SpeechServiceResponse_TranslationRequestStablePartialResult = 38,
        /**
            * Identifier used to connect to the backend service.
            * @member PropertyId.Conversation_ApplicationId
            */
        Conversation_ApplicationId = 39,
        /**
            * Type of dialog backend to connect to.
            * @member PropertyId.Conversation_DialogType
            */
        Conversation_DialogType = 40,
        /**
            * Silence timeout for listening
            * @member PropertyId.Conversation_Initial_Silence_Timeout
            */
        Conversation_Initial_Silence_Timeout = 41,
        /**
            * From Id to add to speech recognition activities.
            * @member PropertyId.Conversation_From_Id
            */
        Conversation_From_Id = 42,
        /**
            * ConversationId for the session.
            * @member PropertyId.Conversation_Conversation_Id
            */
        Conversation_Conversation_Id = 43,
        /**
            * Comma separated list of custom voice deployment ids.
            * @member PropertyId.Conversation_Custom_Voice_Deployment_Ids
            */
        Conversation_Custom_Voice_Deployment_Ids = 44,
        /**
            * Speech activity template, stamp properties from the template on the activity generated by the service for speech.
            * @member PropertyId.Conversation_Speech_Activity_Template
            * Added in version 1.10.0.
            */
        Conversation_Speech_Activity_Template = 45,
        /**
            * The Cognitive Services Speech Service host (url). Under normal circumstances, you shouldn't have to use this property directly.
            * Instead, use [[SpeechConfig.fromHost]].
            */
        SpeechServiceConnection_Host = 46,
        /**
            * Set the host for service calls to the Conversation Translator REST management and websocket calls.
            */
        ConversationTranslator_Host = 47,
        /**
            * Optionally set the the host's display name.
            * Used when joining a conversation.
            */
        ConversationTranslator_Name = 48,
        /**
            * Optionally set a value for the X-CorrelationId request header.
            * Used for troubleshooting errors in the server logs. It should be a valid guid.
            */
        ConversationTranslator_CorrelationId = 49,
        /**
            * Set the conversation token to be sent to the speech service. This enables the
            * service to service call from the speech service to the Conversation Translator service for relaying
            * recognitions. For internal use.
            */
        ConversationTranslator_Token = 50
}

/**
    * Defines the base class Recognizer which mainly contains common event handlers.
    * @class Recognizer
    */
export abstract class Recognizer {
        protected audioConfig: AudioConfig;
        protected privReco: ServiceRecognizerBase;
        protected privProperties: PropertyCollection;
        /**
            * Creates and initializes an instance of a Recognizer
            * @constructor
            * @param {AudioConfig} audioInput - An optional audio input stream associated with the recognizer
            */
        protected constructor(audioConfig: AudioConfig, properties: PropertyCollection, connectionFactory: IConnectionFactory);
        /**
            * Defines event handler for session started events.
            * @member Recognizer.prototype.sessionStarted
            * @function
            * @public
            */
        sessionStarted: (sender: Recognizer, event: SessionEventArgs) => void;
        /**
            * Defines event handler for session stopped events.
            * @member Recognizer.prototype.sessionStopped
            * @function
            * @public
            */
        sessionStopped: (sender: Recognizer, event: SessionEventArgs) => void;
        /**
            * Defines event handler for speech started events.
            * @member Recognizer.prototype.speechStartDetected
            * @function
            * @public
            */
        speechStartDetected: (sender: Recognizer, event: RecognitionEventArgs) => void;
        /**
            * Defines event handler for speech stopped events.
            * @member Recognizer.prototype.speechEndDetected
            * @function
            * @public
            */
        speechEndDetected: (sender: Recognizer, event: RecognitionEventArgs) => void;
        /**
            * Dispose of associated resources.
            * @member Recognizer.prototype.close
            * @function
            * @public
            */
        close(): void;
        /**
            * @Internal
            * Internal data member to support fromRecognizer* pattern methods on other classes.
            * Do not use externally, object returned will change without warning or notice.
            */
        get internalData(): object;
        /**
            * This method performs cleanup of resources.
            * The Boolean parameter disposing indicates whether the method is called
            * from Dispose (if disposing is true) or from the finalizer (if disposing is false).
            * Derived classes should override this method to dispose resource if needed.
            * @member Recognizer.prototype.dispose
            * @function
            * @public
            * @param {boolean} disposing - Flag to request disposal.
            */
        protected dispose(disposing: boolean): void;
        /**
            * This method returns the current state of the telemetry setting.
            * @member Recognizer.prototype.telemetryEnabled
            * @function
            * @public
            * @returns true if the telemetry is enabled, false otherwise.
            */
        static get telemetryEnabled(): boolean;
        /**
            * This method globally enables or disables telemetry.
            * @member Recognizer.prototype.enableTelemetry
            * @function
            * @public
            * @param enabled - Global setting for telemetry collection.
            * If set to true, telemetry information like microphone errors,
            * recognition errors are collected and sent to Microsoft.
            * If set to false, no telemetry is sent to Microsoft.
            */
        static enableTelemetry(enabled: boolean): void;
        protected abstract createRecognizerConfig(speechConfig: SpeechServiceConfig): RecognizerConfig;
        protected abstract createServiceRecognizer(authentication: IAuthentication, connectionFactory: IConnectionFactory, audioConfig: AudioConfig, recognizerConfig: RecognizerConfig): ServiceRecognizerBase;
        protected implCommonRecognizerSetup(): void;
        protected recognizeOnceAsyncImpl(recognitionMode: RecognitionMode, cb?: (e: SpeechRecognitionResult) => void, err?: (e: string) => void): void;
        startContinuousRecognitionAsyncImpl(recognitionMode: RecognitionMode, cb?: () => void, err?: (e: string) => void): void;
        protected stopContinuousRecognitionAsyncImpl(cb?: () => void, err?: (e: string) => void): void;
        protected implRecognizerStop(): Promise<boolean>;
}

/**
    * Performs speech recognition from microphone, file, or other audio input streams, and gets transcribed text as result.
    * @class SpeechRecognizer
    */
export class SpeechRecognizer extends Recognizer {
        /**
            * SpeechRecognizer constructor.
            * @constructor
            * @param {SpeechConfig} speechConfig - an set of initial properties for this recognizer
            * @param {AudioConfig} audioConfig - An optional audio configuration associated with the recognizer
            */
        constructor(speechConfig: SpeechConfig, audioConfig?: AudioConfig);
        /**
            * SpeechRecognizer constructor.
            * @constructor
            * @param {SpeechConfig} speechConfig - an set of initial properties for this recognizer
            * @param {AutoDetectSourceLanguageConfig} autoDetectSourceLanguageConfig - An source language detection configuration associated with the recognizer
            * @param {AudioConfig} audioConfig - An optional audio configuration associated with the recognizer
            */
        static FromConfig(speechConfig: SpeechConfig, autoDetectSourceLanguageConfig: AutoDetectSourceLanguageConfig, audioConfig?: AudioConfig): SpeechRecognizer;
        /**
            * The event recognizing signals that an intermediate recognition result is received.
            * @member SpeechRecognizer.prototype.recognizing
            * @function
            * @public
            */
        recognizing: (sender: Recognizer, event: SpeechRecognitionEventArgsCustom) => void;
        /**
            * The event recognized signals that a final recognition result is received.
            * @member SpeechRecognizer.prototype.recognized
            * @function
            * @public
            */
        recognized: (sender: Recognizer, event: SpeechRecognitionEventArgsCustom) => void;
        /**
            * The event canceled signals that an error occurred during recognition.
            * @member SpeechRecognizer.prototype.canceled
            * @function
            * @public
            */
        canceled: (sender: Recognizer, event: SpeechRecognitionCanceledEventArgs) => void;
        /**
            * Gets the endpoint id of a customized speech model that is used for speech recognition.
            * @member SpeechRecognizer.prototype.endpointId
            * @function
            * @public
            * @returns {string} the endpoint id of a customized speech model that is used for speech recognition.
            */
        get endpointId(): string;
        /**
            * Gets the authorization token used to communicate with the service.
            * @member SpeechRecognizer.prototype.authorizationToken
            * @function
            * @public
            * @returns {string} Authorization token.
            */
        get authorizationToken(): string;
        /**
            * Gets/Sets the authorization token used to communicate with the service.
            * @member SpeechRecognizer.prototype.authorizationToken
            * @function
            * @public
            * @param {string} token - Authorization token.
            */
        set authorizationToken(token: string);
        /**
            * Gets the spoken language of recognition.
            * @member SpeechRecognizer.prototype.speechRecognitionLanguage
            * @function
            * @public
            * @returns {string} The spoken language of recognition.
            */
        get speechRecognitionLanguage(): string;
        /**
            * Gets the output format of recognition.
            * @member SpeechRecognizer.prototype.outputFormat
            * @function
            * @public
            * @returns {OutputFormat} The output format of recognition.
            */
        get outputFormat(): OutputFormat;
        /**
            * The collection of properties and their values defined for this SpeechRecognizer.
            * @member SpeechRecognizer.prototype.properties
            * @function
            * @public
            * @returns {PropertyCollection} The collection of properties and their values defined for this SpeechRecognizer.
            */
        get properties(): PropertyCollection;
        /**
            * Starts speech recognition, and stops after the first utterance is recognized.
            * The task returns the recognition text as result.
            * Note: RecognizeOnceAsync() returns when the first utterance has been recognized,
            *       so it is suitable only for single shot recognition
            *       like command or query. For long-running recognition, use StartContinuousRecognitionAsync() instead.
            * @member SpeechRecognizer.prototype.recognizeOnceAsync
            * @function
            * @public
            * @param cb - Callback that received the SpeechRecognitionResult.
            * @param err - Callback invoked in case of an error.
            */
        recognizeOnceAsync(cb?: (e: SpeechRecognitionResult) => void, err?: (e: string) => void): void;
        /**
            * Starts speech recognition, until stopContinuousRecognitionAsync() is called.
            * User must subscribe to events to receive recognition results.
            * @member SpeechRecognizer.prototype.startContinuousRecognitionAsync
            * @function
            * @public
            * @param cb - Callback invoked once the recognition has started.
            * @param err - Callback invoked in case of an error.
            */
        startContinuousRecognitionAsync(cb?: () => void, err?: (e: string) => void): void;
        /**
            * Stops continuous speech recognition.
            * @member SpeechRecognizer.prototype.stopContinuousRecognitionAsync
            * @function
            * @public
            * @param cb - Callback invoked once the recognition has stopped.
            * @param err - Callback invoked in case of an error.
            */
        stopContinuousRecognitionAsync(cb?: () => void, err?: (e: string) => void): void;
        /**
            * Starts speech recognition with keyword spotting, until
            * stopKeywordRecognitionAsync() is called.
            * User must subscribe to events to receive recognition results.
            * Note: Key word spotting functionality is only available on the
            *      Speech Devices SDK. This functionality is currently not included in the SDK itself.
            * @member SpeechRecognizer.prototype.startKeywordRecognitionAsync
            * @function
            * @public
            * @param {KeywordRecognitionModel} model The keyword recognition model that
            *        specifies the keyword to be recognized.
            * @param cb - Callback invoked once the recognition has started.
            * @param err - Callback invoked in case of an error.
            */
        startKeywordRecognitionAsync(model: KeywordRecognitionModel, cb?: () => void, err?: (e: string) => void): void;
        /**
            * Stops continuous speech recognition.
            * Note: Key word spotting functionality is only available on the
            *       Speech Devices SDK. This functionality is currently not included in the SDK itself.
            * @member SpeechRecognizer.prototype.stopKeywordRecognitionAsync
            * @function
            * @public
            * @param cb - Callback invoked once the recognition has stopped.
            * @param err - Callback invoked in case of an error.
            */
        stopKeywordRecognitionAsync(cb?: () => void, err?: (e: string) => void): void;
        /**
            * closes all external resources held by an instance of this class.
            * @member SpeechRecognizer.prototype.close
            * @function
            * @public
            */
        close(): void;
        /**
            * Disposes any resources held by the object.
            * @member SpeechRecognizer.prototype.dispose
            * @function
            * @public
            * @param {boolean} disposing - true if disposing the object.
            */
        protected dispose(disposing: boolean): void;
        protected createRecognizerConfig(speechConfig: SpeechServiceConfig): RecognizerConfig;
        protected createServiceRecognizer(authentication: IAuthentication, connectionFactory: IConnectionFactory, audioConfig: AudioConfig, recognizerConfig: RecognizerConfig): ServiceRecognizerBase;
}

/**
    * Intent recognizer.
    * @class
    */
export class IntentRecognizer extends Recognizer {
        /**
            * Initializes an instance of the IntentRecognizer.
            * @constructor
            * @param {SpeechConfig} speechConfig - The set of configuration properties.
            * @param {AudioConfig} audioConfig - An optional audio input config associated with the recognizer
            */
        constructor(speechConfig: SpeechConfig, audioConfig?: AudioConfig);
        /**
            * The event recognizing signals that an intermediate recognition result is received.
            * @member IntentRecognizer.prototype.recognizing
            * @function
            * @public
            */
        recognizing: (sender: IntentRecognizer, event: IntentRecognitionEventArgs) => void;
        /**
            * The event recognized signals that a final recognition result is received.
            * @member IntentRecognizer.prototype.recognized
            * @function
            * @public
            */
        recognized: (sender: IntentRecognizer, event: IntentRecognitionEventArgs) => void;
        /**
            * The event canceled signals that an error occurred during recognition.
            * @member IntentRecognizer.prototype.canceled
            * @function
            * @public
            */
        canceled: (sender: IntentRecognizer, event: IntentRecognitionCanceledEventArgs) => void;
        /**
            * Gets the spoken language of recognition.
            * @member IntentRecognizer.prototype.speechRecognitionLanguage
            * @function
            * @public
            * @returns {string} the spoken language of recognition.
            */
        get speechRecognitionLanguage(): string;
        /**
            * Gets the authorization token used to communicate with the service.
            * @member IntentRecognizer.prototype.authorizationToken
            * @function
            * @public
            * @returns {string} Authorization token.
            */
        get authorizationToken(): string;
        /**
            * Gets/Sets the authorization token used to communicate with the service.
            * Note: Please use a token derived from your LanguageUnderstanding subscription key for the Intent recognizer.
            * @member IntentRecognizer.prototype.authorizationToken
            * @function
            * @public
            * @param {string} value - Authorization token.
            */
        set authorizationToken(value: string);
        /**
            * The collection of properties and their values defined for this IntentRecognizer.
            * @member IntentRecognizer.prototype.properties
            * @function
            * @public
            * @returns {PropertyCollection} The collection of properties and their
            *          values defined for this IntentRecognizer.
            */
        get properties(): PropertyCollection;
        /**
            * Starts intent recognition, and stops after the first utterance is recognized.
            * The task returns the recognition text and intent as result.
            * Note: RecognizeOnceAsync() returns when the first utterance has been recognized,
            *       so it is suitable only for single shot recognition like command or query.
            *       For long-running recognition, use StartContinuousRecognitionAsync() instead.
            * @member IntentRecognizer.prototype.recognizeOnceAsync
            * @function
            * @public
            * @param cb - Callback that received the recognition has finished with an IntentRecognitionResult.
            * @param err - Callback invoked in case of an error.
            */
        recognizeOnceAsync(cb?: (e: IntentRecognitionResult) => void, err?: (e: string) => void): void;
        /**
            * Starts speech recognition, until stopContinuousRecognitionAsync() is called.
            * User must subscribe to events to receive recognition results.
            * @member IntentRecognizer.prototype.startContinuousRecognitionAsync
            * @function
            * @public
            * @param cb - Callback invoked once the recognition has started.
            * @param err - Callback invoked in case of an error.
            */
        startContinuousRecognitionAsync(cb?: () => void, err?: (e: string) => void): void;
        /**
            * Stops continuous intent recognition.
            * @member IntentRecognizer.prototype.stopContinuousRecognitionAsync
            * @function
            * @public
            * @param cb - Callback invoked once the recognition has stopped.
            * @param err - Callback invoked in case of an error.
            */
        stopContinuousRecognitionAsync(cb?: () => void, err?: (e: string) => void): void;
        /**
            * Starts speech recognition with keyword spotting, until stopKeywordRecognitionAsync() is called.
            * User must subscribe to events to receive recognition results.
            * Note: Key word spotting functionality is only available on the Speech Devices SDK.
            *       This functionality is currently not included in the SDK itself.
            * @member IntentRecognizer.prototype.startKeywordRecognitionAsync
            * @function
            * @public
            * @param {KeywordRecognitionModel} model - The keyword recognition model that specifies the keyword to be recognized.
            * @param cb - Callback invoked once the recognition has started.
            * @param err - Callback invoked in case of an error.
            */
        startKeywordRecognitionAsync(model: KeywordRecognitionModel, cb?: () => void, err?: (e: string) => void): void;
        /**
            * Stops continuous speech recognition.
            * Note: Key word spotting functionality is only available on the Speech Devices SDK.
            *       This functionality is currently not included in the SDK itself.
            * @member IntentRecognizer.prototype.stopKeywordRecognitionAsync
            * @function
            * @public
            * @param cb - Callback invoked once the recognition has stopped.
            * @param err - Callback invoked in case of an error.
            */
        stopKeywordRecognitionAsync(cb?: () => void, err?: (e: string) => void): void;
        /**
            * Adds a phrase that should be recognized as intent.
            * @member IntentRecognizer.prototype.addIntent
            * @function
            * @public
            * @param {string} intentId - A String that represents the identifier of the intent to be recognized.
            * @param {string} phrase - A String that specifies the phrase representing the intent.
            */
        addIntent(simplePhrase: string, intentId?: string): void;
        /**
            * Adds an intent from Language Understanding service for recognition.
            * @member IntentRecognizer.prototype.addIntentWithLanguageModel
            * @function
            * @public
            * @param {string} intentId - A String that represents the identifier of the intent
            *        to be recognized. Ignored if intentName is empty.
            * @param {string} model - The intent model from Language Understanding service.
            * @param {string} intentName - The intent name defined in the intent model. If it
            *        is empty, all intent names defined in the model will be added.
            */
        addIntentWithLanguageModel(intentId: string, model: LanguageUnderstandingModel, intentName?: string): void;
        /**
            * @summary Adds all intents from the specified Language Understanding Model.
            * @member IntentRecognizer.prototype.addAllIntents
            * @function
            * @public
            * @function
            * @public
            * @param {LanguageUnderstandingModel} model - The language understanding model containing the intents.
            * @param {string} intentId - A custom id String to be returned in the IntentRecognitionResult's getIntentId() method.
            */
        addAllIntents(model: LanguageUnderstandingModel, intentId?: string): void;
        /**
            * closes all external resources held by an instance of this class.
            * @member IntentRecognizer.prototype.close
            * @function
            * @public
            */
        close(): void;
        protected createRecognizerConfig(speechConfig: SpeechServiceConfig): RecognizerConfig;
        protected createServiceRecognizer(authentication: IAuthentication, connectionFactory: IConnectionFactory, audioConfig: AudioConfig, recognizerConfig: RecognizerConfig): ServiceRecognizerBase;
        protected dispose(disposing: boolean): void;
}

/**
    * Output format
    * @class VoiceProfileType
    */
export enum VoiceProfileType {
        /**
            * Text independent speaker identification
            * @member VoiceProfileType.TextIndependentIdentification
            */
        TextIndependentIdentification = 0,
        /**
            * Text dependent speaker verification
            * @member VoiceProfileType.TextDependentVerification
            */
        TextDependentVerification = 1,
        /**
            * Text independent speaker verification
            * @member VoiceProfileType.TextIndependentVerification
            */
        TextIndependentVerification = 2
}

/**
    * Translation recognizer
    * @class TranslationRecognizer
    */
export class TranslationRecognizer extends Recognizer {
        /**
            * Initializes an instance of the TranslationRecognizer.
            * @constructor
            * @param {SpeechTranslationConfig} speechConfig - Set of properties to configure this recognizer.
            * @param {AudioConfig} audioConfig - An optional audio config associated with the recognizer
            */
        constructor(speechConfig: SpeechTranslationConfig, audioConfig?: AudioConfig);
        /**
            * The event recognizing signals that an intermediate recognition result is received.
            * @member TranslationRecognizer.prototype.recognizing
            * @function
            * @public
            */
        recognizing: (sender: TranslationRecognizer, event: TranslationRecognitionEventArgs) => void;
        /**
            * The event recognized signals that a final recognition result is received.
            * @member TranslationRecognizer.prototype.recognized
            * @function
            * @public
            */
        recognized: (sender: TranslationRecognizer, event: TranslationRecognitionEventArgs) => void;
        /**
            * The event canceled signals that an error occurred during recognition.
            * @member TranslationRecognizer.prototype.canceled
            * @function
            * @public
            */
        canceled: (sender: TranslationRecognizer, event: TranslationRecognitionCanceledEventArgs) => void;
        /**
            * The event synthesizing signals that a translation synthesis result is received.
            * @member TranslationRecognizer.prototype.synthesizing
            * @function
            * @public
            */
        synthesizing: (sender: TranslationRecognizer, event: TranslationSynthesisEventArgs) => void;
        /**
            * Gets the language name that was set when the recognizer was created.
            * @member TranslationRecognizer.prototype.speechRecognitionLanguage
            * @function
            * @public
            * @returns {string} Gets the language name that was set when the recognizer was created.
            */
        get speechRecognitionLanguage(): string;
        /**
            * Gets target languages for translation that were set when the recognizer was created.
            * The language is specified in BCP-47 format. The translation will provide translated text for each of language.
            * @member TranslationRecognizer.prototype.targetLanguages
            * @function
            * @public
            * @returns {string[]} Gets target languages for translation that were set when the recognizer was created.
            */
        get targetLanguages(): string[];
        /**
            * Gets the name of output voice.
            * @member TranslationRecognizer.prototype.voiceName
            * @function
            * @public
            * @returns {string} the name of output voice.
            */
        get voiceName(): string;
        /**
            * Gets the authorization token used to communicate with the service.
            * @member TranslationRecognizer.prototype.authorizationToken
            * @function
            * @public
            * @returns {string} Authorization token.
            */
        get authorizationToken(): string;
        /**
            * Gets/Sets the authorization token used to communicate with the service.
            * @member TranslationRecognizer.prototype.authorizationToken
            * @function
            * @public
            * @param {string} value - Authorization token.
            */
        set authorizationToken(value: string);
        /**
            * The collection of properties and their values defined for this TranslationRecognizer.
            * @member TranslationRecognizer.prototype.properties
            * @function
            * @public
            * @returns {PropertyCollection} The collection of properties and their values defined for this TranslationRecognizer.
            */
        get properties(): PropertyCollection;
        /**
            * Starts recognition and translation, and stops after the first utterance is recognized.
            * The task returns the translation text as result.
            * Note: recognizeOnceAsync returns when the first utterance has been recognized, so it is suitableonly
            *       for single shot recognition like command or query. For long-running recognition,
            *       use startContinuousRecognitionAsync() instead.
            * @member TranslationRecognizer.prototype.recognizeOnceAsync
            * @function
            * @public
            * @param cb - Callback that received the result when the translation has completed.
            * @param err - Callback invoked in case of an error.
            */
        recognizeOnceAsync(cb?: (e: TranslationRecognitionResult) => void, err?: (e: string) => void): void;
        /**
            * Starts recognition and translation, until stopContinuousRecognitionAsync() is called.
            * User must subscribe to events to receive translation results.
            * @member TranslationRecognizer.prototype.startContinuousRecognitionAsync
            * @function
            * @public
            * @param cb - Callback that received the translation has started.
            * @param err - Callback invoked in case of an error.
            */
        startContinuousRecognitionAsync(cb?: () => void, err?: (e: string) => void): void;
        /**
            * Stops continuous recognition and translation.
            * @member TranslationRecognizer.prototype.stopContinuousRecognitionAsync
            * @function
            * @public
            * @param cb - Callback that received the translation has stopped.
            * @param err - Callback invoked in case of an error.
            */
        stopContinuousRecognitionAsync(cb?: () => void, err?: (e: string) => void): void;
        /**
            * closes all external resources held by an instance of this class.
            * @member TranslationRecognizer.prototype.close
            * @function
            * @public
            */
        close(): void;
        protected dispose(disposing: boolean): boolean;
        protected createRecognizerConfig(speechConfig: SpeechServiceConfig): RecognizerConfig;
        protected createServiceRecognizer(authentication: IAuthentication, connectionFactory: IConnectionFactory, audioConfig: AudioConfig, recognizerConfig: RecognizerConfig): ServiceRecognizerBase;
}

/**
    * Represents collection of parameters and their values.
    * @class Translation
    */
export class Translations {
        /**
            * Returns the parameter value in type String. The parameter must have the same type as String.
            * Currently only String, int and bool are allowed.
            * If the name is not available, the specified defaultValue is returned.
            * @member Translation.prototype.get
            * @function
            * @public
            * @param {string} key - The parameter name.
            * @param {string} def - The default value which is returned if the parameter is not available in the collection.
            * @returns {string} value of the parameter.
            */
        get(key: string, def?: string): string;
        /**
            * Sets the String value of the parameter specified by name.
            * @member Translation.prototype.set
            * @function
            * @public
            * @param {string} key - The parameter name.
            * @param {string} value - The value of the parameter.
            */
        set(key: string, value: string): void;
}

/**
    * Defines the possible reasons a recognition result might not be recognized.
    * @class NoMatchReason
    */
export enum NoMatchReason {
        /**
            * Indicates that speech was detected, but not recognized.
            * @member NoMatchReason.NotRecognized
            */
        NotRecognized = 0,
        /**
            * Indicates that the start of the audio stream contained only silence,
            * and the service timed out waiting for speech.
            * @member NoMatchReason.InitialSilenceTimeout
            */
        InitialSilenceTimeout = 1,
        /**
            * Indicates that the start of the audio stream contained only noise,
            * and the service timed out waiting for speech.
            * @member NoMatchReason.InitialBabbleTimeout
            */
        InitialBabbleTimeout = 2
}

/**
    * Contains detailed information for NoMatch recognition results.
    * @class NoMatchDetails
    */
export class NoMatchDetails {
        /**
            * Creates an instance of NoMatchDetails object for the NoMatch SpeechRecognitionResults.
            * @member NoMatchDetails.fromResult
            * @function
            * @public
            * @param {SpeechRecognitionResult | IntentRecognitionResult | TranslationRecognitionResult}
            *        result - The recognition result that was not recognized.
            * @returns {NoMatchDetails} The no match details object being created.
            */
        static fromResult(result: SpeechRecognitionResult | IntentRecognitionResult | TranslationRecognitionResult): NoMatchDetails;
        /**
            * The reason the recognition was canceled.
            * @member NoMatchDetails.prototype.reason
            * @function
            * @public
            * @returns {NoMatchReason} Specifies the reason canceled.
            */
        get reason(): NoMatchReason;
}

/**
    * Define payload of speech recognition canceled result events.
    * @class TranslationRecognitionCanceledEventArgs
    */
export class TranslationRecognitionCanceledEventArgs {
        /**
            * Creates and initializes an instance of this class.
            * @constructor
            * @param {string} sessionid - The session id.
            * @param {CancellationReason} cancellationReason - The cancellation reason.
            * @param {string} errorDetails - Error details, if provided.
            * @param {TranslationRecognitionResult} result - The result.
            */
        constructor(sessionid: string, cancellationReason: CancellationReason, errorDetails: string, errorCode: CancellationErrorCode, result: TranslationRecognitionResult);
        /**
            * Specifies the recognition result.
            * @member TranslationRecognitionCanceledEventArgs.prototype.result
            * @function
            * @public
            * @returns {TranslationRecognitionResult} the recognition result.
            */
        get result(): TranslationRecognitionResult;
        /**
            * Specifies the session identifier.
            * @member TranslationRecognitionCanceledEventArgs.prototype.sessionId
            * @function
            * @public
            * @returns {string} the session identifier.
            */
        get sessionId(): string;
        /**
            * The reason the recognition was canceled.
            * @member TranslationRecognitionCanceledEventArgs.prototype.reason
            * @function
            * @public
            * @returns {CancellationReason} Specifies the reason canceled.
            */
        get reason(): CancellationReason;
        /**
            * The error code in case of an unsuccessful recognition.
            * Added in version 1.1.0.
            * @return An error code that represents the error reason.
            */
        get errorCode(): CancellationErrorCode;
        /**
            * In case of an unsuccessful recognition, provides details of the occurred error.
            * @member TranslationRecognitionCanceledEventArgs.prototype.errorDetails
            * @function
            * @public
            * @returns {string} A String that represents the error details.
            */
        get errorDetails(): string;
}

/**
    * Define payload of intent recognition canceled result events.
    * @class IntentRecognitionCanceledEventArgs
    */
export class IntentRecognitionCanceledEventArgs extends IntentRecognitionEventArgs {
        /**
            * Creates and initializes an instance of this class.
            * @constructor
            * @param {CancellationReason} result - The result of the intent recognition.
            * @param {string} offset - The offset.
            * @param {IntentRecognitionResult} sessionId - The session id.
            */
        constructor(reason: CancellationReason, errorDetails: string, errorCode: CancellationErrorCode, result?: IntentRecognitionResult, offset?: number, sessionId?: string);
        /**
            * The reason the recognition was canceled.
            * @member IntentRecognitionCanceledEventArgs.prototype.reason
            * @function
            * @public
            * @returns {CancellationReason} Specifies the reason canceled.
            */
        get reason(): CancellationReason;
        /**
            * The error code in case of an unsuccessful recognition.
            * Added in version 1.1.0.
            * @return An error code that represents the error reason.
            */
        get errorCode(): CancellationErrorCode;
        /**
            * In case of an unsuccessful recognition, provides details of the occurred error.
            * @member IntentRecognitionCanceledEventArgs.prototype.errorDetails
            * @function
            * @public
            * @returns {string} A String that represents the error details.
            */
        get errorDetails(): string;
}

/**
    * Contains detailed information about why a result was canceled.
    * @class CancellationDetailsBase
    */
export class CancellationDetailsBase {
        /**
            * Creates and initializes an instance of this class.
            * @constructor
            * @param {CancellationReason} reason - The cancellation reason.
            * @param {string} errorDetails - The error details, if provided.
            */
        protected constructor(reason: CancellationReason, errorDetails: string, errorCode: CancellationErrorCode);
        /**
            * The reason the recognition was canceled.
            * @member CancellationDetailsBase.prototype.reason
            * @function
            * @public
            * @returns {CancellationReason} Specifies the reason canceled.
            */
        get reason(): CancellationReason;
        /**
            * In case of an unsuccessful recognition, provides details of the occurred error.
            * @member CancellationDetailsBase.prototype.errorDetails
            * @function
            * @public
            * @returns {string} A String that represents the error details.
            */
        get errorDetails(): string;
        /**
            * The error code in case of an unsuccessful recognition.
            * Added in version 1.1.0.
            * @return An error code that represents the error reason.
            */
        get ErrorCode(): CancellationErrorCode;
}

/**
    * Contains detailed information about why a result was canceled.
    * @class CancellationDetails
    */
export class CancellationDetails extends CancellationDetailsBase {
        /**
            * Creates an instance of CancellationDetails object for the canceled RecognitionResult.
            * @member CancellationDetails.fromResult
            * @function
            * @public
            * @param {RecognitionResult | SpeechSynthesisResult} result - The result that was canceled.
            * @returns {CancellationDetails} The cancellation details object being created.
            */
        static fromResult(result: RecognitionResult | SpeechSynthesisResult): CancellationDetails;
}

/**
    *  Defines error code in case that CancellationReason is Error.
    *  Added in version 1.1.0.
    */
export enum CancellationErrorCode {
        /**
            * Indicates that no error occurred during speech recognition.
            */
        NoError = 0,
        /**
            * Indicates an authentication error.
            */
        AuthenticationFailure = 1,
        /**
            * Indicates that one or more recognition parameters are invalid.
            */
        BadRequestParameters = 2,
        /**
            * Indicates that the number of parallel requests exceeded the number of allowed
            * concurrent transcriptions for the subscription.
            */
        TooManyRequests = 3,
        /**
            * Indicates a connection error.
            */
        ConnectionFailure = 4,
        /**
            * Indicates a time-out error when waiting for response from service.
            */
        ServiceTimeout = 5,
        /**
            * Indicates that an error is returned by the service.
            */
        ServiceError = 6,
        /**
            * Indicates an unexpected runtime error.
            */
        RuntimeError = 7
}

/**
  * Defines payload for connection events like Connected/Disconnected.
  * Added in version 1.2.0
  */
export class ConnectionEventArgs extends SessionEventArgs {
}

/**
    * Defines payload for any Service message event
    * Added in version 1.9.0
    */
export class ServiceEventArgs extends SessionEventArgs {
        /**
            * Creates and initializes an instance of this class.
            * @constructor
            * @param {string} json - json payload of the USP message.
            */
        constructor(json: string, name: string, sessionId?: string);
        get jsonString(): string;
        get eventName(): string;
}

/**
    * Connection is a proxy class for managing connection to the speech service of the specified Recognizer.
    * By default, a Recognizer autonomously manages connection to service when needed.
    * The Connection class provides additional methods for users to explicitly open or close a connection and
    * to subscribe to connection status changes.
    * The use of Connection is optional, and mainly for scenarios where fine tuning of application
    * behavior based on connection status is needed. Users can optionally call Open() to manually set up a connection
    * in advance before starting recognition on the Recognizer associated with this Connection.
    * If the Recognizer needs to connect or disconnect to service, it will
    * setup or shutdown the connection independently. In this case the Connection will be notified by change of connection
    * status via Connected/Disconnected events.
    * Added in version 1.2.1.
    */
export class Connection {
        /**
            * Gets the Connection instance from the specified recognizer.
            * @param recognizer The recognizer associated with the connection.
            * @return The Connection instance of the recognizer.
            */
        static fromRecognizer(recognizer: Recognizer): Connection;
        /**
            * Gets the Connection instance from the specified synthesizer.
            * @param synthesizer The synthesizer associated with the connection.
            * @return The Connection instance of the synthesizer.
            */
        static fromSynthesizer(synthesizer: SpeechSynthesizer): Connection;
        /**
            * Starts to set up connection to the service.
            * Users can optionally call openConnection() to manually set up a connection in advance before starting recognition on the
            * Recognizer associated with this Connection. After starting recognition, calling Open() will have no effect
            *
            * Note: On return, the connection might not be ready yet. Please subscribe to the Connected event to
            * be notified when the connection is established.
            */
        openConnection(): void;
        /**
            * Closes the connection the service.
            * Users can optionally call closeConnection() to manually shutdown the connection of the associated Recognizer.
            *
            * If closeConnection() is called during recognition, recognition will fail and cancel with an error.
            */
        closeConnection(): void;
        /**
            * Appends a parameter in a message to service.
            * Added in version 1.12.1.
            * @param path The path of the network message.
            * @param propertyName Name of the property
            * @param propertyValue Value of the property. This is a json string.
            */
        setMessageProperty(path: string, propertyName: string, propertyValue: string): void;
        /**
            * Sends a message to the speech service.
            * Added in version 1.13.0.
            * @param path The WebSocket path of the message
            * @param payload The payload of the message. This is a json string or a ArrayBuffer.
            * @param success A callback to indicate success.
            * @param error A callback to indicate an error.
            */
        sendMessageAsync(path: string, payload: string | ArrayBuffer, success?: () => void, error?: (error: string) => void): void;
        /**
            * Any message from service that is not being processed by any other top level recognizers.
            *
            * Will be removed in 2.0.
            */
        receivedServiceMessage: (args: ServiceEventArgs) => void;
        /**
            * Any message received from the Speech Service.
            */
        messageReceived: (args: ConnectionMessageEventArgs) => void;
        /**
            * Any message sent to the Speech Service.
            */
        messageSent: (args: ConnectionMessageEventArgs) => void;
        /**
            * The Connected event to indicate that the recognizer is connected to service.
            */
        connected: (args: ConnectionEventArgs) => void;
        /**
            * The Disconnected event to indicate that the recognizer is disconnected from service.
            */
        disconnected: (args: ConnectionEventArgs) => void;
        /**
            * Dispose of associated resources.
            */
        close(): void;
}

/**
    * Allows additions of new phrases to improve speech recognition.
    *
    * Phrases added to the recognizer are effective at the start of the next recognition, or the next time the SpeechSDK must reconnect
    * to the speech service.
    */
export class PhraseListGrammar {
        /**
            * Creates a PhraseListGrammar from a given speech recognizer. Will accept any recognizer that derives from @class Recognizer.
            * @param recognizer The recognizer to add phrase lists to.
            */
        static fromRecognizer(recognizer: Recognizer): PhraseListGrammar;
        /**
            * Adds a single phrase to the current recognizer.
            * @param phrase Phrase to add.
            */
        addPhrase(phrase: string): void;
        /**
            * Adds multiple phrases to the current recognizer.
            * @param phrases Array of phrases to add.
            */
        addPhrases(phrases: string[]): void;
        /**
            * Clears all phrases added to the current recognizer.
            */
        clear(): void;
}

/**
    * Class that defines base configurations for dialog service connector
    * @class DialogServiceConfig
    */
export abstract class DialogServiceConfig {
        /**
            * Creates an instance of DialogService config.
            * @constructor
            */
        protected constructor();
        /**
            * Sets an arbitrary property.
            * @member DialogServiceConfig.prototype.setProperty
            * @function
            * @public
            * @param {string} name - The name of the property to set.
            * @param {string} value - The new value of the property.
            */
        abstract setProperty(name: string, value: string): void;
        /**
            * Returns the current value of an arbitrary property.
            * @member DialogServiceConfig.prototype.getProperty
            * @function
            * @public
            * @param {string} name - The name of the property to query.
            * @param {string} def - The value to return in case the property is not known.
            * @returns {string} The current value, or provided default, of the given property.
            */
        abstract getProperty(name: string, def?: string): string;
        /**
            * @member DialogServiceConfig.prototype.setServiceProperty
            * @function
            * @public
            * @param {name} The name of the property.
            * @param {value} Value to set.
            * @param {channel} The channel used to pass the specified property to service.
            * @summary Sets a property value that will be passed to service using the specified channel.
            */
        abstract setServiceProperty(name: string, value: string, channel: ServicePropertyChannel): void;
        /**
            * Sets the proxy configuration.
            * Only relevant in Node.js environments.
            * Added in version 1.4.0.
            * @param proxyHostName The host name of the proxy server.
            * @param proxyPort The port number of the proxy server.
            */
        abstract setProxy(proxyHostName: string, proxyPort: number): void;
        /**
            * Sets the proxy configuration.
            * Only relevant in Node.js environments.
            * Added in version 1.4.0.
            * @param proxyHostName The host name of the proxy server, without the protocol scheme (http://)
            * @param porxyPort The port number of the proxy server.
            * @param proxyUserName The user name of the proxy server.
            * @param proxyPassword The password of the proxy server.
            */
        abstract setProxy(proxyHostName: string, proxyPort: number, proxyUserName: string, proxyPassword: string): void;
        /**
            * Returns the configured language.
            * @member DialogServiceConfig.prototype.speechRecognitionLanguage
            * @function
            * @public
            */
        abstract get speechRecognitionLanguage(): string;
        /**
            * Gets/Sets the input language.
            * @member DialogServiceConfig.prototype.speechRecognitionLanguage
            * @function
            * @public
            * @param {string} value - The language to use for recognition.
            */
        abstract set speechRecognitionLanguage(value: string);
        /**
            * Not used in DialogServiceConfig
            * @member DialogServiceConfig.applicationId
            */
        applicationId: string;
}
/**
    * Dialog Service configuration.
    * @class DialogServiceConfigImpl
    */
export class DialogServiceConfigImpl extends DialogServiceConfig {
        /**
            * Creates an instance of dialogService config.
            */
        constructor();
        /**
            * Provides access to custom properties.
            * @member DialogServiceConfigImpl.prototype.properties
            * @function
            * @public
            * @returns {PropertyCollection} The properties.
            */
        get properties(): PropertyCollection;
        /**
            * Gets the speech recognition language.
            * @member DialogServiceConfigImpl.prototype.speechRecognitionLanguage
            * @function
            * @public
            */
        get speechRecognitionLanguage(): string;
        /**
            * Sets the speech recognition language.
            * @member DialogServiceConfigImpl.prototype.speechRecognitionLanguage
            * @function
            * @public
            * @param {string} value - The language to set.
            */
        set speechRecognitionLanguage(value: string);
        /**
            * Sets a named property as value
            * @member DialogServiceConfigImpl.prototype.setProperty
            * @function
            * @public
            * @param {PropertyId | string} name - The property to set.
            * @param {string} value - The value.
            */
        setProperty(name: string | PropertyId, value: string): void;
        /**
            * Sets a named property as value
            * @member DialogServiceConfigImpl.prototype.getProperty
            * @function
            * @public
            * @param {PropertyId | string} name - The property to get.
            * @param {string} def - The default value to return in case the property is not known.
            * @returns {string} The current value, or provided default, of the given property.
            */
        getProperty(name: string | PropertyId, def?: string): string;
        /**
            * Sets the proxy configuration.
            * Only relevant in Node.js environments.
            * Added in version 1.4.0.
            * @param proxyHostName The host name of the proxy server, without the protocol scheme (http://)
            * @param proxyPort The port number of the proxy server.
            * @param proxyUserName The user name of the proxy server.
            * @param proxyPassword The password of the proxy server.
            */
        setProxy(proxyHostName: string, proxyPort: number, proxyUserName?: string, proxyPassword?: string): void;
        setServiceProperty(name: string, value: string, channel: ServicePropertyChannel): void;
        /**
            * Dispose of associated resources.
            * @member DialogServiceConfigImpl.prototype.close
            * @function
            * @public
            */
        close(): void;
}

/**
    * Class that defines configurations for the dialog service connector object for using a Bot Framework backend.
    * @class BotFrameworkConfig
    */
export class BotFrameworkConfig extends DialogServiceConfigImpl {
        /**
            * Creates an instance of BotFrameworkConfig.
            */
        constructor();
        /**
            * Creates an instance of the bot framework config with the specified subscription and region.
            * @member BotFrameworkConfig.fromSubscription
            * @function
            * @public
            * @param subscription Subscription key associated with the bot
            * @param region The region name (see the <a href="https://aka.ms/csspeech/region">region page</a>).
            * @param botId Optional, ID for using a specific bot.
            * @returns {BotFrameworkConfig} A new bot framework config.
            */
        static fromSubscription(subscription: string, region: string, botId?: string): BotFrameworkConfig;
        /**
            * Creates an instance of the bot framework config with the specified authorization token and region.
            * Note: The caller needs to ensure that the authorization token is valid. Before the authorization token
            * expires, the caller needs to refresh it by calling this setter with a new valid token.
            * As configuration values are copied when creating a new recognizer, the new token value will not apply to recognizers that have already been created.
            * For recognizers that have been created before, you need to set authorization token of the corresponding recognizer
            * to refresh the token. Otherwise, the recognizers will encounter errors during recognition.
            * @member BotFrameworkConfig.fromAuthorizationToken
            * @function
            * @public
            * @param authorizationToken The authorization token associated with the bot
            * @param region The region name (see the <a href="https://aka.ms/csspeech/region">region page</a>).
            * @returns {BotFrameworkConfig} A new bot framework config.
            */
        static fromAuthorizationToken(authorizationToken: string, region: string): BotFrameworkConfig;
}

/**
    * Class that defines configurations for the dialog service connector object for using a CustomCommands backend.
    * @class CustomCommandsConfig
    */
export class CustomCommandsConfig extends DialogServiceConfigImpl {
        /**
            * Creates an instance of CustomCommandsConfig.
            */
        constructor();
        /**
            * Creates an instance of the bot framework config with the specified subscription and region.
            * @member CustomCommandsConfig.fromSubscription
            * @function
            * @public
            * @param applicationId Speech Commands application id.
            * @param subscription Subscription key associated with the bot
            * @param region The region name (see the <a href="https://aka.ms/csspeech/region">region page</a>).
            * @returns {CustomCommandsConfig} A new bot framework config.
            */
        static fromSubscription(applicationId: string, subscription: string, region: string): CustomCommandsConfig;
        /**
            * Creates an instance of the bot framework config with the specified Speech Commands application id, authorization token and region.
            * Note: The caller needs to ensure that the authorization token is valid. Before the authorization token
            * expires, the caller needs to refresh it by calling this setter with a new valid token.
            * As configuration values are copied when creating a new recognizer, the new token value will not apply to recognizers that have already been created.
            * For recognizers that have been created before, you need to set authorization token of the corresponding recognizer
            * to refresh the token. Otherwise, the recognizers will encounter errors during recognition.
            * @member CustomCommandsConfig.fromAuthorizationToken
            * @function
            * @public
            * @param applicationId Speech Commands application id.
            * @param authorizationToken The authorization token associated with the application.
            * @param region The region name (see the <a href="https://aka.ms/csspeech/region">region page</a>).
            * @returns {CustomCommandsConfig} A new speech commands config.
            */
        static fromAuthorizationToken(applicationId: string, authorizationToken: string, region: string): CustomCommandsConfig;
        /**
            * Sets the corresponding backend application identifier.
            * @member CustomCommandsConfig.prototype.Conversation_ApplicationId
            * @function
            * @public
            * @param {string} value - The application identifier to set.
            */
        set applicationId(value: string);
        /**
            * Gets the corresponding backend application identifier.
            * @member CustomCommandsConfig.prototype.Conversation_ApplicationId
            * @function
            * @public
            * @param {string} value - The application identifier to get.
            */
        get applicationId(): string;
}

/**
    * Dialog Service Connector
    * @class DialogServiceConnector
    */
export class DialogServiceConnector extends Recognizer {
        /**
            * Initializes an instance of the DialogServiceConnector.
            * @constructor
            * @param {DialogServiceConfig} dialogConfig - Set of properties to configure this recognizer.
            * @param {AudioConfig} audioConfig - An optional audio config associated with the recognizer
            */
        constructor(dialogConfig: DialogServiceConfig, audioConfig?: AudioConfig);
        /**
            * The event recognizing signals that an intermediate recognition result is received.
            * @member DialogServiceConnector.prototype.recognizing
            * @function
            * @public
            */
        recognizing: (sender: DialogServiceConnector, event: SpeechRecognitionEventArgs) => void;
        /**
            * The event recognized signals that a final recognition result is received.
            * @member DialogServiceConfig.prototype.recognized
            * @function
            * @public
            */
        recognized: (sender: DialogServiceConnector, event: SpeechRecognitionEventArgs) => void;
        /**
            * The event canceled signals that an error occurred during recognition.
            * @member DialogServiceConnector.prototype.canceled
            * @function
            * @public
            */
        canceled: (sender: DialogServiceConnector, event: SpeechRecognitionCanceledEventArgs) => void;
        /**
            * The event activityReceived signals that an activity has been received.
            * @member DialogServiceConnector.prototype.activityReceived
            * @function
            * @public
            */
        activityReceived: (sender: DialogServiceConnector, event: ActivityReceivedEventArgs) => void;
        /**
            * Starts a connection to the service.
            * Users can optionally call connect() to manually set up a connection in advance, before starting interactions.
            *
            * Note: On return, the connection might not be ready yet. Please subscribe to the Connected event to
            * be notified when the connection is established.
            * @member DialogServiceConnector.prototype.connect
            * @function
            * @public
            */
        connect(): void;
        /**
            * Closes the connection the service.
            * Users can optionally call disconnect() to manually shutdown the connection of the associated DialogServiceConnector.
            *
            * If disconnect() is called during a recognition, recognition will fail and cancel with an error.
            */
        disconnect(): void;
        /**
            * Gets the authorization token used to communicate with the service.
            * @member DialogServiceConnector.prototype.authorizationToken
            * @function
            * @public
            * @returns {string} Authorization token.
            */
        get authorizationToken(): string;
        /**
            * Sets the authorization token used to communicate with the service.
            * @member DialogServiceConnector.prototype.authorizationToken
            * @function
            * @public
            * @param {string} token - Authorization token.
            */
        set authorizationToken(token: string);
        /**
            * The collection of properties and their values defined for this DialogServiceConnector.
            * @member DialogServiceConnector.prototype.properties
            * @function
            * @public
            * @returns {PropertyCollection} The collection of properties and their values defined for this DialogServiceConnector.
            */
        get properties(): PropertyCollection;
        /** Gets the template for the activity generated by service from speech.
            * Properties from the template will be stamped on the generated activity.
            * It can be empty
            */
        get speechActivityTemplate(): string;
        /** Sets the template for the activity generated by service from speech.
            * Properties from the template will be stamped on the generated activity.
            * It can be null or empty.
            * Note: it has to be a valid Json object.
            */
        set speechActivityTemplate(speechActivityTemplate: string);
        /**
            * Starts recognition and stops after the first utterance is recognized.
            * @member DialogServiceConnector.prototype.listenOnceAsync
            * @function
            * @public
            * @param cb - Callback that received the result when the reco has completed.
            * @param err - Callback invoked in case of an error.
            */
        listenOnceAsync(cb?: (e: SpeechRecognitionResult) => void, err?: (e: string) => void): void;
        sendActivityAsync(activity: string): void;
        /**
            * closes all external resources held by an instance of this class.
            * @member DialogServiceConnector.prototype.close
            * @function
            * @public
            */
        close(): void;
        protected dispose(disposing: boolean): boolean;
        protected createRecognizerConfig(speechConfig: SpeechServiceConfig): RecognizerConfig;
        protected createServiceRecognizer(authentication: IAuthentication, connectionFactory: IConnectionFactory, audioConfig: AudioConfig, recognizerConfig: RecognizerConfig): ServiceRecognizerBase;
}

/**
    * Defines contents of received message/events.
    * @class ActivityReceivedEventArgs
    */
export class ActivityReceivedEventArgs {
        /**
            * Creates and initializes an instance of this class.
            * @constructor
            * @param {any} activity - The activity..
            */
        constructor(activity: any, audioStream?: PullAudioOutputStream);
        /**
            * Gets the received activity
            * @member ActivityReceivedEventArgs.prototype.activity
            * @function
            * @public
            * @returns {any} the received activity.
            */
        get activity(): any;
        get audioStream(): PullAudioOutputStream;
}

/**
    * Defines channels used to pass property settings to service.
    * Added in version 1.7.0.
    */
export enum ServicePropertyChannel {
        /**
            * Uses URI query parameter to pass property settings to service.
            */
        UriQueryParameter = 0
}

/**
  * Profanity option.
  * Added in version 1.7.0.
  */
export enum ProfanityOption {
    Masked = 0,
    Removed = 1,
    Raw = 2
}

/**
    * Base audio player class
    * TODO: Plays only PCM for now.
    * @class
    */
export class BaseAudioPlayer {
        /**
            * Creates and initializes an instance of this class.
            * @constructor
            */
        constructor(audioFormat: AudioStreamFormat);
        /**
            * play Audio sample
            * @param newAudioData audio data to be played.
            */
        playAudioSample(newAudioData: ArrayBuffer): void;
        /**
            * stops audio and clears the buffers
            */
        stopAudio(): void;
}

export class ConnectionMessageEventArgs {
        constructor(message: ConnectionMessage);
        /**
            * Gets the <see cref="ConnectionMessage"/> associated with this <see cref="ConnectionMessageEventArgs"/>.
            */
        get message(): ConnectionMessage;
        /**
            * Returns a string that represents the connection message event.
            */
        toString(): string;
}

/**
    * ConnectionMessage represents implementation specific messages sent to and received from
    * the speech service. These messages are provided for debugging purposes and should not
    * be used for production use cases with the Azure Cognitive Services Speech Service.
    * Messages sent to and received from the Speech Service are subject to change without
    * notice. This includes message contents, headers, payloads, ordering, etc.
    * Added in version 1.11.0.
    */
export abstract class ConnectionMessage {
        /**
            * The message path.
            */
        abstract get path(): string;
        /**
            * Checks to see if the ConnectionMessage is a text message.
            * See also IsBinaryMessage().
            */
        abstract get isTextMessage(): boolean;
        /**
            * Checks to see if the ConnectionMessage is a binary message.
            * See also GetBinaryMessage().
            */
        abstract get isBinaryMessage(): boolean;
        /**
            * Gets the text message payload. Typically the text message content-type is
            * application/json. To determine other content-types use
            * Properties.GetProperty("Content-Type").
            */
        abstract get TextMessage(): string;
        /**
            * Gets the binary message payload.
            */
        abstract get binaryMessage(): ArrayBuffer;
        /**
            * A collection of properties and their values defined for this <see cref="ConnectionMessage"/>.
            * Message headers can be accessed via this collection (e.g. "Content-Type").
            */
        abstract get properties(): PropertyCollection;
        /**
            * Returns a string that represents the connection message.
            */
        abstract toString(): string;
}
export class ConnectionMessageImpl {
        constructor(message: IntConnectionMessage);
        /**
            * The message path.
            */
        get path(): string;
        /**
            * Checks to see if the ConnectionMessage is a text message.
            * See also IsBinaryMessage().
            */
        get isTextMessage(): boolean;
        /**
            * Checks to see if the ConnectionMessage is a binary message.
            * See also GetBinaryMessage().
            */
        get isBinaryMessage(): boolean;
        /**
            * Gets the text message payload. Typically the text message content-type is
            * application/json. To determine other content-types use
            * Properties.GetProperty("Content-Type").
            */
        get TextMessage(): string;
        /**
            * Gets the binary message payload.
            */
        get binaryMessage(): ArrayBuffer;
        /**
            * A collection of properties and their values defined for this <see cref="ConnectionMessage"/>.
            * Message headers can be accessed via this collection (e.g. "Content-Type").
            */
        get properties(): PropertyCollection;
        /**
            * Returns a string that represents the connection message.
            */
        toString(): string;
}

/**
    * Defines Voice Profile class for Speaker Recognition
    * @class VoiceProfile
    */
export class VoiceProfile {
        /**
            * Creates and initializes an instance of this class.
            * @constructor
            * @param {string} profileId - profileId of this Voice Profile.
            * @param {VoiceProfileType} profileType - profileType of this Voice Profile.
            */
        constructor(profileId: string, profileType: VoiceProfileType);
        /**
            * profileId of this Voice Profile instance
            * @member VoiceProfile.prototype.profileId
            * @function
            * @public
            * @returns {string} profileId of this Voice Profile instance.
            */
        get profileId(): string;
        /**
            * profileType of this Voice Profile instance
            * @member VoiceProfile.prototype.profileType
            * @function
            * @public
            * @returns {VoiceProfileType} profile type of this Voice Profile instance.
            */
        get profileType(): VoiceProfileType;
}

export interface IEnrollmentResultDetails {
        enrollmentsCount: number;
        enrollmentsLength: number;
        enrollmentsSpeechLength: number;
        remainingEnrollmentsCount: number;
        remainingEnrollmentsSpeechLength: number;
        audioLength: number;
        audioSpeechLength: number;
        enrollmentStatus: string;
}
/**
    * Output format
    * @class VoiceProfileEnrollmentResult
    */
export class VoiceProfileEnrollmentResult {
        constructor(reason: ResultReason, json: string, statusText: string);
        get reason(): ResultReason;
        get enrollmentsCount(): number;
        get enrollmentsLength(): number;
        get properties(): PropertyCollection;
        get errorDetails(): string;
}
/**
    * @class VoiceProfileEnrollmentCancellationDetails
    */
export class VoiceProfileEnrollmentCancellationDetails extends CancellationDetailsBase {
        /**
            * Creates an instance of VoiceProfileEnrollmentCancellationDetails object for the canceled VoiceProfileEnrollmentResult.
            * @member VoiceProfileEnrollmentCancellationDetails.fromResult
            * @function
            * @public
            * @param {VoiceProfileEnrollmentResult} result - The result that was canceled.
            * @returns {VoiceProfileEnrollmentCancellationDetails} The cancellation details object being created.
            */
        static fromResult(result: VoiceProfileEnrollmentResult): VoiceProfileEnrollmentCancellationDetails;
}

/**
    * Output format
    * @class VoiceProfileResult
    */
export class VoiceProfileResult {
        constructor(reason: ResultReason, statusText: string);
        get reason(): ResultReason;
        get properties(): PropertyCollection;
        get errorDetails(): string;
}
/**
    * @class VoiceProfileCancellationDetails
    */
export class VoiceProfileCancellationDetails extends CancellationDetailsBase {
        /**
            * Creates an instance of VoiceProfileCancellationDetails object for the canceled VoiceProfileResult.
            * @member VoiceProfileCancellationDetails.fromResult
            * @function
            * @public
            * @param {VoiceProfileResult} result - The result that was canceled.
            * @returns {VoiceProfileCancellationDetails} The cancellation details object being created.
            */
        static fromResult(result: VoiceProfileResult): VoiceProfileCancellationDetails;
}

/**
    * Defines VoiceProfileClient class for Speaker Recognition
    * Handles operations from user for Voice Profile operations (e.g. createProfile, deleteProfile)
    * @class VoiceProfileClient
    */
export class VoiceProfileClient {
        protected privProperties: PropertyCollection;
        /**
            * Gets the authorization token used to communicate with the service.
            * @member VoiceProfileClient.prototype.authorizationToken
            * @function
            * @public
            * @returns {string} Authorization token.
            */
        get authorizationToken(): string;
        /**
            * Gets/Sets the authorization token used to communicate with the service.
            * @member VoiceProfileClient.prototype.authorizationToken
            * @function
            * @public
            * @param {string} token - Authorization token.
            */
        set authorizationToken(token: string);
        /**
            * The collection of properties and their values defined for this VoiceProfileClient.
            * @member VoiceProfileClient.prototype.properties
            * @function
            * @public
            * @returns {PropertyCollection} The collection of properties and their values defined for this VoiceProfileClient.
            */
        get properties(): PropertyCollection;
        /**
            * VoiceProfileClient constructor.
            * @constructor
            * @param {SpeechConfig} speechConfig - An set of initial properties for this synthesizer (authentication key, region, &c)
            */
        constructor(speechConfig: SpeechConfig);
        /**
            * Create a speaker recognition voice profile
            * @member VoiceProfileClient.prototype.createProfileAsync
            * @function
            * @public
            * @param {VoiceProfileType} profileType Type of Voice Profile to be created
            *        specifies the keyword to be recognized.
            * @param {string} lang Language string (locale) for Voice Profile
            * @param cb - Callback invoked once Voice Profile has been created.
            * @param err - Callback invoked in case of an error.
            */
        createProfileAsync(profileType: VoiceProfileType, lang: string, cb?: (e: VoiceProfile) => void, err?: (e: string) => void): void;
        /**
            * Create a speaker recognition voice profile
            * @member VoiceProfileClient.prototype.enrollProfileAsync
            * @function
            * @public
            * @param {VoiceProfile} profile Voice Profile to create enrollment for
            * @param {AudioConfig} audioConfig source info from which to create enrollment
            * @param cb - Callback invoked once Enrollment request has been submitted.
            * @param err - Callback invoked in case of an error.
            */
        enrollProfileAsync(profile: VoiceProfile, audioConfig: AudioConfig, cb?: (e: VoiceProfileEnrollmentResult) => void, err?: (e: string) => void): void;
        /**
            * Delete a speaker recognition voice profile
            * @member VoiceProfileClient.prototype.deleteProfileAsync
            * @function
            * @public
            * @param {VoiceProfile} profile Voice Profile to be deleted
            * @param cb - Callback invoked once Voice Profile has been deleted.
            * @param err - Callback invoked in case of an error.
            */
        deleteProfileAsync(profile: VoiceProfile, cb?: (response: VoiceProfileResult) => void, err?: (e: string) => void): void;
        /**
            * Remove all enrollments for a speaker recognition voice profile
            * @member VoiceProfileClient.prototype.resetProfileAsync
            * @function
            * @public
            * @param {VoiceProfile} profile Voice Profile to be reset
            * @param cb - Callback invoked once Voice Profile has been reset.
            * @param err - Callback invoked in case of an error.
            */
        resetProfileAsync(profile: VoiceProfile, cb?: (response: VoiceProfileResult) => void, err?: (e: string) => void): void;
        /**
            * Included for compatibility
            * @member VoiceProfileClient.prototype.close
            * @function
            * @public
            */
        close(): void;
        protected implClientSetup(): void;
}

/**
    * Defines SpeakerRecognizer class for Speaker Recognition
    * Handles operations from user for Voice Profile operations (e.g. createProfile, deleteProfile)
    * @class SpeakerRecognizer
    */
export class SpeakerRecognizer {
        protected privProperties: PropertyCollection;
        /**
            * Gets the authorization token used to communicate with the service.
            * @member SpeakerRecognizer.prototype.authorizationToken
            * @function
            * @public
            * @returns {string} Authorization token.
            */
        get authorizationToken(): string;
        /**
            * Gets/Sets the authorization token used to communicate with the service.
            * @member SpeakerRecognizer.prototype.authorizationToken
            * @function
            * @public
            * @param {string} token - Authorization token.
            */
        set authorizationToken(token: string);
        /**
            * The collection of properties and their values defined for this SpeakerRecognizer.
            * @member SpeakerRecognizer.prototype.properties
            * @function
            * @public
            * @returns {PropertyCollection} The collection of properties and their values defined for this SpeakerRecognizer.
            */
        get properties(): PropertyCollection;
        /**
            * SpeakerRecognizer constructor.
            * @constructor
            * @param {SpeechConfig} speechConfig - An set of initial properties for this recognizer (authentication key, region, &c)
            */
        constructor(speechConfig: SpeechConfig, audioConfig: AudioConfig);
        /**
            * Get recognition result for model using given audio
            * @member SpeakerRecognizer.prototype.recognizeOnceAsync
            * @function
            * @public
            * @param {SpeakerIdentificationModel} model Model containing Voice Profiles to be identified
            * @param cb - Callback invoked once result is returned.
            * @param err - Callback invoked in case of an error.
            */
        recognizeOnceAsync(model: SpeakerIdentificationModel | SpeakerVerificationModel, cb?: (e: SpeakerRecognitionResult) => void, err?: (e: string) => void): void;
        /**
            * Included for compatibility
            * @member SpeakerRecognizer.prototype.close
            * @function
            * @public
            */
        close(): void;
}

/**
  * Defines SpeakerIdentificationModel class for Speaker Recognition
  * Model contains a set of profiles against which to identify speaker(s)
  * @class SpeakerIdentificationModel
  */
export class SpeakerIdentificationModel {
    static fromProfiles(profiles: VoiceProfile[]): SpeakerIdentificationModel;
    get voiceProfileIds(): string;
}

/**
  * Defines SpeakerVerificationModel class for Speaker Recognition
  * Model contains a profile against which to verify a speaker
  * @class SpeakerVerificationModel
  */
export class SpeakerVerificationModel {
    static fromProfile(profile: VoiceProfile): SpeakerVerificationModel;
    get voiceProfile(): VoiceProfile;
}

/**
    * Language auto detect configuration.
    * @class AutoDetectSourceLanguageConfig
    * Added in version 1.13.0.
    */
export class AutoDetectSourceLanguageConfig {
        /**
            * @member AutoDetectSourceLanguageConfig.fromOpenRange
            * @function
            * @public
            * Only [[SpeechSynthesizer]] supports source language auto detection from open range,
            * for [[Recognizer]], please use AutoDetectSourceLanguageConfig with specific source languages.
            * @return {AutoDetectSourceLanguageConfig} Instance of AutoDetectSourceLanguageConfig
            * @summary Creates an instance of the AutoDetectSourceLanguageConfig with open range.
            */
        static fromOpenRange(): AutoDetectSourceLanguageConfig;
        /**
            * @member AutoDetectSourceLanguageConfig.fromLanguages
            * @function
            * @public
            * @param {string[]} languages Comma-separated string of languages (eg. "en-US,fr-FR") to populate properties of config.
            * @return {AutoDetectSourceLanguageConfig} Instance of AutoDetectSourceLanguageConfig
            * @summary Creates an instance of the AutoDetectSourceLanguageConfig with given languages.
            */
        static fromLanguages(languages: string[]): AutoDetectSourceLanguageConfig;
        /**
            * @member AutoDetectSourceLanguageConfig.fromSourceLanguageConfigs
            * @function
            * @public
            * @param {SourceLanguageConfig[]} configs SourceLanguageConfigs to populate properties of config.
            * @return {AutoDetectSourceLanguageConfig} Instance of AutoDetectSourceLanguageConfig
            * @summary Creates an instance of the AutoDetectSourceLanguageConfig with given SourceLanguageConfigs.
            */
        static fromSourceLanguageConfigs(configs: SourceLanguageConfig[]): AutoDetectSourceLanguageConfig;
        /**
            * @member AutoDetectSourceLanguageConfig.prototype.properties
            * @function
            * @public
            * @return {PropertyCollection} Properties of the config.
            * @summary Gets a auto detected language config properties
            */
        get properties(): PropertyCollection;
}

/**
    * Output format
    * @class AutoDetectSourceLanguageResult
    */
export class AutoDetectSourceLanguageResult {
        /**
            * Creates an instance of AutoDetectSourceLanguageResult object from a SpeechRecognitionResult instance.
            * @member AutoDetectSourceLanguageResult.fromResult
            * @function
            * @public
            * @param {SpeechRecognitionResult} result - The recognition result.
            * @returns {AutoDetectSourceLanguageResult} AutoDetectSourceLanguageResult object being created.
            */
        static fromResult(result: SpeechRecognitionResult): AutoDetectSourceLanguageResult;
        get language(): string;
        get languageDetectionConfidence(): string;
}

/**
    * Source Language configuration.
    * @class SourceLanguageConfig
    */
export class SourceLanguageConfig {
        /**
            * @member SourceLanguageConfig.fromLanguage
            * @function
            * @public
            * @param {string} language language (eg. "en-US") value of config.
            * @param {string?} endpointId endpointId of model bound to given language of config.
            * @return {SourceLanguageConfig} Instance of SourceLanguageConfig
            * @summary Creates an instance of the SourceLanguageConfig with the given language and optional endpointId.
            * Added in version 1.13.0.
            */
        static fromLanguage(language: string, endpointId?: string): SourceLanguageConfig;
        get language(): string;
        get endpointId(): string;
}

export enum SpeakerRecognitionResultType {
        Verify = 0,
        Identify = 1
}
/**
    * Output format
    * @class SpeakerRecognitionResult
    */
export class SpeakerRecognitionResult {
        constructor(resultType: SpeakerRecognitionResultType, data: string, profileId: string, resultReason?: ResultReason);
        get properties(): PropertyCollection;
        get reason(): ResultReason;
        get profileId(): string;
        get errorDetails(): string;
        get score(): number;
}
/**
    * @class SpeakerRecognitionCancellationDetails
    */
export class SpeakerRecognitionCancellationDetails extends CancellationDetailsBase {
        /**
            * Creates an instance of SpeakerRecognitionCancellationDetails object for the canceled SpeakerRecognitionResult
            * @member SpeakerRecognitionCancellationDetails.fromResult
            * @function
            * @public
            * @param {SpeakerRecognitionResult} result - The result that was canceled.
            * @returns {SpeakerRecognitionCancellationDetails} The cancellation details object being created.
            */
        static fromResult(result: SpeakerRecognitionResult): SpeakerRecognitionCancellationDetails;
}

/**
    * Define speech synthesis audio output formats.
    * @enum SpeechSynthesisOutputFormat
    * Added in version 1.11.0
    */
export enum SpeechSynthesisOutputFormat {
        /**
            * raw-8khz-8bit-mono-mulaw
            * @member SpeechSynthesisOutputFormat.Raw8Khz8BitMonoMULaw,
            */
        Raw8Khz8BitMonoMULaw = 0,
        /**
            * riff-16khz-16kbps-mono-siren
            * @member SpeechSynthesisOutputFormat.Riff16Khz16KbpsMonoSiren
            */
        Riff16Khz16KbpsMonoSiren = 1,
        /**
            * audio-16khz-16kbps-mono-siren
            * @member SpeechSynthesisOutputFormat.Audio16Khz16KbpsMonoSiren
            */
        Audio16Khz16KbpsMonoSiren = 2,
        /**
            * audio-16khz-32kbitrate-mono-mp3
            * @member SpeechSynthesisOutputFormat.Audio16Khz32KBitRateMonoMp3
            */
        Audio16Khz32KBitRateMonoMp3 = 3,
        /**
            * audio-16khz-128kbitrate-mono-mp3
            * @member SpeechSynthesisOutputFormat.Audio16Khz128KBitRateMonoMp3
            */
        Audio16Khz128KBitRateMonoMp3 = 4,
        /**
            * audio-16khz-64kbitrate-mono-mp3
            * @member SpeechSynthesisOutputFormat.Audio16Khz64KBitRateMonoMp3
            */
        Audio16Khz64KBitRateMonoMp3 = 5,
        /**
            * audio-24khz-48kbitrate-mono-mp3
            * @member SpeechSynthesisOutputFormat.Audio24Khz48KBitRateMonoMp3
            */
        Audio24Khz48KBitRateMonoMp3 = 6,
        /**
            * audio-24khz-96kbitrate-mono-mp3
            * @member SpeechSynthesisOutputFormat.Audio24Khz96KBitRateMonoMp3
            */
        Audio24Khz96KBitRateMonoMp3 = 7,
        /**
            * audio-24khz-160kbitrate-mono-mp3
            * @member SpeechSynthesisOutputFormat.Audio24Khz160KBitRateMonoMp3
            */
        Audio24Khz160KBitRateMonoMp3 = 8,
        /**
            * raw-16khz-16bit-mono-truesilk
            * @member SpeechSynthesisOutputFormat.Raw16Khz16BitMonoTrueSilk
            */
        Raw16Khz16BitMonoTrueSilk = 9,
        /**
            * riff-16khz-16bit-mono-pcm
            * @member SpeechSynthesisOutputFormat.Riff16Khz16BitMonoPcm
            */
        Riff16Khz16BitMonoPcm = 10,
        /**
            * riff-8khz-16bit-mono-pcm
            * @member SpeechSynthesisOutputFormat.Riff8Khz16BitMonoPcm
            */
        Riff8Khz16BitMonoPcm = 11,
        /**
            * riff-24khz-16bit-mono-pcm
            * @member SpeechSynthesisOutputFormat.Riff24Khz16BitMonoPcm
            */
        Riff24Khz16BitMonoPcm = 12,
        /**
            * riff-8khz-8bit-mono-mulaw
            * @member SpeechSynthesisOutputFormat.Riff8Khz8BitMonoMULaw
            */
        Riff8Khz8BitMonoMULaw = 13,
        /**
            * raw-16khz-16bit-mono-pcm
            * @member SpeechSynthesisOutputFormat.Raw16Khz16BitMonoPcm
            */
        Raw16Khz16BitMonoPcm = 14,
        /**
            * raw-24khz-16bit-mono-pcm
            * @member SpeechSynthesisOutputFormat.Raw24Khz16BitMonoPcm
            */
        Raw24Khz16BitMonoPcm = 15,
        /**
            * raw-8khz-16bit-mono-pcm
            * @member SpeechSynthesisOutputFormat.Raw8Khz16BitMonoPcm
            */
        Raw8Khz16BitMonoPcm = 16,
        /**
            * ogg-16khz-16bit-mono-opus
            * @member SpeechSynthesisOutputFormat.Ogg16Khz16BitMonoOpus
            */
        Ogg16Khz16BitMonoOpus = 17,
        /**
            * ogg-24khz-16bit-mono-opus
            * @member SpeechSynthesisOutputFormat.Ogg24Khz16BitMonoOpus
            */
        Ogg24Khz16BitMonoOpus = 18
}

/**
    * Defines the class SpeechSynthesizer for text to speech.
    * Added in version 1.11.0
    * @class SpeechSynthesizer
    */
export class SpeechSynthesizer {
        protected audioConfig: AudioConfig;
        protected privAdapter: SynthesisAdapterBase;
        protected privProperties: PropertyCollection;
        protected synthesisRequestQueue: Queue<SynthesisRequest>;
        /**
            * Defines event handler for synthesis start events.
            * @member SpeechSynthesizer.prototype.synthesisStarted
            * @function
            * @public
            */
        synthesisStarted: (sender: SpeechSynthesizer, event: SpeechSynthesisEventArgs) => void;
        /**
            * Defines event handler for synthesizing events.
            * @member SpeechSynthesizer.prototype.synthesizing
            * @function
            * @public
            */
        synthesizing: (sender: SpeechSynthesizer, event: SpeechSynthesisEventArgs) => void;
        /**
            * Defines event handler for synthesis completed events.
            * @member SpeechSynthesizer.prototype.synthesisCompleted
            * @function
            * @public
            */
        synthesisCompleted: (sender: SpeechSynthesizer, event: SpeechSynthesisEventArgs) => void;
        /**
            * Defines event handler for synthesis cancelled events.
            * @member SpeechSynthesizer.prototype.SynthesisCanceled
            * @function
            * @public
            */
        SynthesisCanceled: (sender: SpeechSynthesizer, event: SpeechSynthesisEventArgs) => void;
        /**
            * Defines event handler for word boundary events
            * @member SpeechSynthesizer.prototype.wordBoundary
            * @function
            * @public
            */
        wordBoundary: (sender: SpeechSynthesizer, event: SpeechSynthesisWordBoundaryEventArgs) => void;
        /**
            * Gets the authorization token used to communicate with the service.
            * @member SpeechSynthesizer.prototype.authorizationToken
            * @function
            * @public
            * @returns {string} Authorization token.
            */
        get authorizationToken(): string;
        /**
            * Gets/Sets the authorization token used to communicate with the service.
            * @member SpeechSynthesizer.prototype.authorizationToken
            * @function
            * @public
            * @param {string} token - Authorization token.
            */
        set authorizationToken(token: string);
        /**
            * The collection of properties and their values defined for this SpeechSynthesizer.
            * @member SpeechSynthesizer.prototype.properties
            * @function
            * @public
            * @returns {PropertyCollection} The collection of properties and their values defined for this SpeechSynthesizer.
            */
        get properties(): PropertyCollection;
        /**
            * Indicates if auto detect source language is enabled
            * @member SpeechSynthesizer.prototype.properties
            * @function
            * @public
            * @returns {boolean} if auto detect source language is enabled
            */
        get autoDetectSourceLanguage(): boolean;
        /**
            * SpeechSynthesizer constructor.
            * @constructor
            * @param {SpeechConfig} speechConfig - An set of initial properties for this synthesizer
            * @param {AudioConfig} audioConfig - An optional audio configuration associated with the synthesizer
            */
        constructor(speechConfig: SpeechConfig, audioConfig?: AudioConfig);
        /**
            * SpeechSynthesizer constructor.
            * @constructor
            * @param {SpeechConfig} speechConfig - an set of initial properties for this synthesizer
            * @param {AutoDetectSourceLanguageConfig} autoDetectSourceLanguageConfig - An source language detection configuration associated with the synthesizer
            * @param {AudioConfig} audioConfig - An optional audio configuration associated with the synthesizer
            */
        static FromConfig(speechConfig: SpeechConfig, autoDetectSourceLanguageConfig: AutoDetectSourceLanguageConfig, audioConfig?: AudioConfig): SpeechSynthesizer;
        buildSsml(text: string): string;
        /**
            * Executes speech synthesis on plain text.
            * The task returns the synthesis result.
            * @member SpeechSynthesizer.prototype.speakTextAsync
            * @function
            * @public
            * @param text - Text to be synthesized.
            * @param cb - Callback that received the SpeechSynthesisResult.
            * @param err - Callback invoked in case of an error.
            * @param stream - AudioOutputStream to receive the synthesized audio.
            */
        speakTextAsync(text: string, cb?: (e: SpeechSynthesisResult) => void, err?: (e: string) => void, stream?: AudioOutputStream | PushAudioOutputStreamCallback | PathLike): void;
        /**
            * Executes speech synthesis on SSML.
            * The task returns the synthesis result.
            * @member SpeechSynthesizer.prototype.speakSsmlAsync
            * @function
            * @public
            * @param ssml - SSML to be synthesized.
            * @param cb - Callback that received the SpeechSynthesisResult.
            * @param err - Callback invoked in case of an error.
            * @param stream - AudioOutputStream to receive the synthesized audio.
            */
        speakSsmlAsync(ssml: string, cb?: (e: SpeechSynthesisResult) => void, err?: (e: string) => void, stream?: AudioOutputStream | PushAudioOutputStreamCallback | PathLike): void;
        /**
            * Dispose of associated resources.
            * @member SpeechSynthesizer.prototype.close
            * @function
            * @public
            */
        close(): void;
        /**
            * @Internal
            * Do not use externally, object returned will change without warning or notice.
            */
        get internalData(): object;
        /**
            * This method performs cleanup of resources.
            * The Boolean parameter disposing indicates whether the method is called
            * from Dispose (if disposing is true) or from the finalizer (if disposing is false).
            * Derived classes should override this method to dispose resource if needed.
            * @member SpeechSynthesizer.prototype.dispose
            * @function
            * @public
            * @param {boolean} disposing - Flag to request disposal.
            */
        protected dispose(disposing: boolean): void;
        protected createSynthesizerConfig(speechConfig: SpeechServiceConfig): SynthesizerConfig;
        protected createSynthesisAdapter(authentication: IAuthentication, connectionFactory: ISynthesisConnectionFactory, audioConfig: AudioConfig, synthesizerConfig: SynthesizerConfig): SynthesisAdapterBase;
        protected implCommonSynthesizeSetup(): void;
        protected speakImpl(text: string, IsSsml: boolean, cb?: (e: SpeechSynthesisResult) => void, err?: (e: string) => void, dataStream?: AudioOutputStream | PushAudioOutputStreamCallback | PathLike): void;
        protected adapterSpeak(): Promise<boolean>;
}
export class SynthesisRequest {
        requestId: string;
        text: string;
        isSSML: boolean;
        cb: (e: SpeechSynthesisResult) => void;
        err: (e: string) => void;
        dataStream: IAudioDestination;
        constructor(requestId: string, text: string, isSSML: boolean, cb?: (e: SpeechSynthesisResult) => void, err?: (e: string) => void, dataStream?: IAudioDestination);
}

/**
    * Defines result of speech synthesis.
    * @class SpeechSynthesisResult
    * Added in version 1.11.0
    */
export class SpeechSynthesisResult {
        /**
            * Creates and initializes an instance of this class.
            * @constructor
            * @param {string} resultId - The result id.
            * @param {ResultReason} reason - The reason.
            * @param {number} audioData - The offset into the stream.
            * @param {string} errorDetails - Error details, if provided.
            * @param {PropertyCollection} properties - Additional properties, if provided.
            */
        constructor(resultId?: string, reason?: ResultReason, audioData?: ArrayBuffer, errorDetails?: string, properties?: PropertyCollection);
        /**
            * Specifies the result identifier.
            * @member SpeechSynthesisResult.prototype.resultId
            * @function
            * @public
            * @returns {string} Specifies the result identifier.
            */
        get resultId(): string;
        /**
            * Specifies status of the result.
            * @member SpeechSynthesisResult.prototype.reason
            * @function
            * @public
            * @returns {ResultReason} Specifies status of the result.
            */
        get reason(): ResultReason;
        /**
            * The synthesized audio data
            * @member SpeechSynthesisResult.prototype.audioData
            * @function
            * @public
            * @returns {ArrayBuffer} The synthesized audio data.
            */
        get audioData(): ArrayBuffer;
        /**
            * In case of an unsuccessful synthesis, provides details of the occurred error.
            * @member SpeechSynthesisResult.prototype.errorDetails
            * @function
            * @public
            * @returns {string} a brief description of an error.
            */
        get errorDetails(): string;
        /**
            *  The set of properties exposed in the result.
            * @member SpeechSynthesisResult.prototype.properties
            * @function
            * @public
            * @returns {PropertyCollection} The set of properties exposed in the result.
            */
        get properties(): PropertyCollection;
}

/**
    * Defines contents of speech synthesis events.
    * @class SpeechSynthesisEventArgs
    * Added in version 1.11.0
    */
export class SpeechSynthesisEventArgs {
        /**
            * Creates and initializes an instance of this class.
            * @constructor
            * @param {SpeechSynthesisResult} result - The speech synthesis result.
            */
        constructor(result: SpeechSynthesisResult);
        /**
            * Specifies the synthesis result.
            * @member SpeechSynthesisEventArgs.prototype.result
            * @function
            * @public
            * @returns {SpeechSynthesisResult} the synthesis result.
            */
        get result(): SpeechSynthesisResult;
}

/**
    * Defines contents of speech synthesis word boundary event.
    * @class SpeechSynthesisWordBoundaryEventArgs
    * Added in version 1.11.0
    */
export class SpeechSynthesisWordBoundaryEventArgs {
        /**
            * Creates and initializes an instance of this class.
            * @constructor
            * @param {number} audioOffset - The audio offset.
            * @param {string} text - The text.
            * @param {number} wordLength - The length of the word.
            * @param {number} textOffset - The text offset.
            */
        constructor(audioOffset: number, text: string, wordLength: number, textOffset: number);
        /**
            * Specifies the audio offset.
            * @member SpeechSynthesisWordBoundaryEventArgs.prototype.audioOffset
            * @function
            * @public
            * @returns {number} the audio offset.
            */
        get audioOffset(): number;
        /**
            * Specifies the text of the word boundary event.
            * @member SpeechSynthesisWordBoundaryEventArgs.prototype.text
            * @function
            * @public
            * @returns {string} the text.
            */
        get text(): string;
        /**
            * Specifies the word length
            * @member SpeechSynthesisWordBoundaryEventArgs.prototype.wordLength
            * @function
            * @public
            * @returns {number} the word length
            */
        get wordLength(): number;
        /**
            * Specifies the text offset.
            * @member SpeechSynthesisWordBoundaryEventArgs.prototype.textOffset
            * @function
            * @public
            * @returns {number} the text offset.
            */
        get textOffset(): number;
}

/**
    * Represents audio player interface to control the audio playback, such as pause, resume, etc.
    * @interface IPlayer
    * Added in version 1.12.0
    */
export interface IPlayer {
        /**
            * Pauses the audio playing
            * @member IPlayer.pause
            * @function
            * @public
            */
        pause(): void;
        /**
            * Resumes the audio playing
            * @member IPlayer.resume
            * @function
            * @public
            */
        resume(): void;
        /**
            * Defines event handler audio playback end event.
            * @member IPlayer.prototype.onAudioEnd
            * @function
            * @public
            */
        onAudioEnd: (sender: IPlayer) => void;
        /**
            * Gets the current play audio offset.
            * @member IPlayer.prototype.currentTime
            * @function
            * @public
            * @returns {number} The current play audio offset, in second
            */
        currentTime: number;
}

/**
  * Represents the speaker playback audio destination, which only works in browser.
  * Note: the SDK will try to use <a href="https://www.w3.org/TR/media-source/">Media Source Extensions</a> to play audio.
  * Mp3 format has better supports on Microsoft Edge, Chrome and Safari (desktop), so, it's better to specify mp3 format for playback.
  * @class SpeakerAudioDestination
  * Updated in version 1.12.1
  */
export class SpeakerAudioDestination implements IAudioDestination, IPlayer {
    constructor(audioDestinationId?: string);
    id(): string;
    write(buffer: ArrayBuffer): void;
    close(): void;
    set format(format: AudioStreamFormat);
    get isClosed(): boolean;
    get currentTime(): number;
    pause(): void;
    resume(): void;
    onAudioEnd: (sender: IPlayer) => void;
    get internalAudio(): HTMLAudioElement;
}

export const OutputFormatPropertyName: string;
export const CancellationErrorCodePropertyName: string;
export const ServicePropertiesPropertyName: string;
export const ForceDictationPropertyName: string;
export const AutoDetectSourceLanguagesOpenRangeOptionName: string;

export abstract class Conversation implements IConversation {
        abstract get authorizationToken(): string;
        abstract set authorizationToken(value: string);
        abstract get config(): SpeechTranslationConfig;
        abstract get conversationId(): string;
        abstract get properties(): PropertyCollection;
        abstract get speechRecognitionLanguage(): string;
        protected constructor();
        /**
            * Create a conversation
            * @param speechConfig
            * @param cb
            * @param err
            */
        static createConversationAsync(speechConfig: SpeechTranslationConfig, cb?: Callback, err?: Callback): Conversation;
        /** Start a conversation. */
        abstract startConversationAsync(cb?: Callback, err?: Callback): void;
        /** Delete a conversation. After this no one will be able to join the conversation. */
        abstract deleteConversationAsync(cb?: Callback, err?: Callback): void;
        /** End a conversation. */
        abstract endConversationAsync(cb?: Callback, err?: Callback): void;
        /** Lock a conversation. This will prevent new participants from joining. */
        abstract lockConversationAsync(cb?: Callback, err?: Callback): void;
        /**
            * Mute all other participants in the conversation. After this no other participants will
            * have their speech recognitions broadcast, nor be able to send text messages.
            */
        abstract muteAllParticipantsAsync(cb?: Callback, err?: Callback): void;
        /**
            * Mute a participant.
            * @param userId A user identifier
            */
        abstract muteParticipantAsync(userId: string, cb?: Callback, err?: Callback): void;
        /**
            * Remove a participant from a conversation using the user id, Participant or User object
            * @param userId A user identifier
            */
        abstract removeParticipantAsync(userId: string | IParticipant | IUser, cb?: Callback, err?: Callback): void;
        /** Unlocks a conversation. */
        abstract unlockConversationAsync(cb?: Callback, err?: Callback): void;
        /** Unmute all other participants in the conversation. */
        abstract unmuteAllParticipantsAsync(cb?: Callback, err?: Callback): void;
        /**
            * Unmute a participant.
            * @param userId A user identifier
            */
        abstract unmuteParticipantAsync(userId: string, cb?: Callback, err?: Callback): void;
}
export class ConversationImpl extends Conversation implements IDisposable {
        set conversationTranslator(value: ConversationTranslator);
        get room(): IInternalConversation;
        get connection(): ConversationTranslatorRecognizer;
        get authorizationToken(): string;
        set authorizationToken(value: string);
        get config(): SpeechTranslationConfig;
        get conversationId(): string;
        get properties(): PropertyCollection;
        get speechRecognitionLanguage(): string;
        get isMutedByHost(): boolean;
        get isConnected(): boolean;
        get participants(): Participant[];
        get me(): Participant;
        get host(): Participant;
        /**
            * Create a conversation impl
            * @param speechConfig
            */
        constructor(speechConfig: SpeechTranslationConfig);
        /**
            * Create a new conversation as Host
            * @param cb
            * @param err
            */
        createConversationAsync(cb?: Callback, err?: Callback): void;
        /**
            * Starts a new conversation as host.
            * @param cb
            * @param err
            */
        startConversationAsync(cb?: Callback, err?: Callback): void;
        /**
            * Join a conversation as a participant.
            * @param conversation
            * @param nickname
            * @param lang
            * @param cb
            * @param err
            */
        joinConversationAsync(conversationId: string, nickname: string, lang: string, cb?: Callback, err?: Callback): void;
        /**
            * Deletes a conversation
            * @param cb
            * @param err
            */
        deleteConversationAsync(cb?: Callback, err?: Callback): void;
        /**
            * Issues a request to close the client websockets
            * @param cb
            * @param err
            */
        endConversationAsync(cb?: Callback, err?: Callback): void;
        /**
            * Issues a request to lock the conversation
            * @param cb
            * @param err
            */
        lockConversationAsync(cb?: Callback, err?: Callback): void;
        /**
            * Issues a request to mute the conversation
            * @param cb
            * @param err
            */
        muteAllParticipantsAsync(cb?: Callback, err?: Callback): void;
        /**
            * Issues a request to mute a participant in the conversation
            * @param userId
            * @param cb
            * @param err
            */
        muteParticipantAsync(userId: string, cb?: Callback, err?: Callback): void;
        /**
            * Issues a request to remove a participant from the conversation
            * @param userId
            * @param cb
            * @param err
            */
        removeParticipantAsync(userId: string | IParticipant | IUser, cb?: Callback, err?: Callback): void;
        /**
            * Issues a request to unlock the conversation
            * @param cb
            * @param err
            */
        unlockConversationAsync(cb?: Callback, err?: Callback): void;
        /**
            * Issues a request to unmute all participants in the conversation
            * @param cb
            * @param err
            */
        unmuteAllParticipantsAsync(cb?: Callback, err?: Callback): void;
        /**
            * Issues a request to unmute a participant in the conversation
            * @param userId
            * @param cb
            * @param err
            */
        unmuteParticipantAsync(userId: string, cb?: Callback, err?: Callback): void;
        /**
            * Send a text message
            * @param message
            * @param cb
            * @param err
            */
        sendTextMessageAsync(message: string, cb?: Callback, err?: Callback): void;
        /**
            * Change nickname
            * @param message
            * @param cb
            * @param err
            */
        changeNicknameAsync(nickname: string, cb?: Callback, err?: Callback): void;
        isDisposed(): boolean;
        dispose(reason?: string): void;
}

export class ConversationExpirationEventArgs extends SessionEventArgs {
    constructor(expirationTime: number, sessionId?: string);
    /** How much longer until the conversation expires (in minutes). */
    get expirationTime(): number;
}

export class ConversationParticipantsChangedEventArgs extends SessionEventArgs {
    constructor(reason: ParticipantChangedReason, participants: IParticipant[], sessionId?: string);
    get reason(): ParticipantChangedReason;
    get participants(): IParticipant[];
}

export class ConversationTranslationCanceledEventArgs extends RecognitionEventArgs {
        /**
            * Creates and initializes an instance of this class.
            * @constructor
            * @param {CancellationReason} reason - The cancellation reason.
            * @param {string} errorDetails - Error details, if provided.
            * @param {number} offset - The offset.
            * @param {string} sessionId - The session id.
            */
        constructor(reason: CancellationReason, errorDetails: string, errorCode: CancellationErrorCode, offset?: number, sessionId?: string);
        /**
            * The reason the recognition was canceled.
            * @member SpeechRecognitionCanceledEventArgs.prototype.reason
            * @function
            * @public
            * @returns {CancellationReason} Specifies the reason canceled.
            */
        get reason(): CancellationReason;
        /**
            * The error code in case of an unsuccessful recognition.
            * Added in version 1.1.0.
            * @return An error code that represents the error reason.
            */
        get errorCode(): CancellationErrorCode;
        /**
            * In case of an unsuccessful recognition, provides details of the occurred error.
            * @member SpeechRecognitionCanceledEventArgs.prototype.errorDetails
            * @function
            * @public
            * @returns {string} A String that represents the error details.
            */
        get errorDetails(): string;
}

export class ConversationTranslationEventArgs extends RecognitionEventArgs {
        /**
            * Creates and initializes an instance of this class.
            * @constructor
            * @param {ConversationTranslationResult} result - The translation recognition result.
            * @param {number} offset - The offset.
            * @param {string} sessionId - The session id.
            */
        constructor(result: ConversationTranslationResult, offset?: number, sessionId?: string);
        /**
            * Specifies the recognition result.
            * @returns {ConversationTranslationResult} the recognition result.
            */
        get result(): ConversationTranslationResult;
}

export class ConversationTranslationResult extends TranslationRecognitionResult {
        constructor(participantId: string, translations: Translations, originalLanguage?: string, resultId?: string, reason?: ResultReason, text?: string, duration?: number, offset?: number, errorDetails?: string, json?: string, properties?: PropertyCollection);
        /**
            * The unique identifier for the participant this result is for.
            */
        get participantId(): string;
        /**
            * The original language this result was in.
            */
        get originalLang(): string;
}

export enum SpeechState {
        Inactive = 0,
        Connecting = 1,
        Connected = 2
}
/***
    * Join, leave or connect to a conversation.
    */
export class ConversationTranslator implements IConversationTranslator, IDisposable {
        constructor(audioConfig?: AudioConfig);
        get properties(): PropertyCollection;
        get speechRecognitionLanguage(): string;
        get participants(): Participant[];
        canceled: (sender: IConversationTranslator, event: ConversationTranslationCanceledEventArgs) => void;
        conversationExpiration: (sender: IConversationTranslator, event: ConversationExpirationEventArgs) => void;
        participantsChanged: (sender: IConversationTranslator, event: ConversationParticipantsChangedEventArgs) => void;
        sessionStarted: (sender: IConversationTranslator, event: SessionEventArgs) => void;
        sessionStopped: (sender: IConversationTranslator, event: SessionEventArgs) => void;
        textMessageReceived: (sender: IConversationTranslator, event: ConversationTranslationEventArgs) => void;
        transcribed: (sender: IConversationTranslator, event: ConversationTranslationEventArgs) => void;
        transcribing: (sender: IConversationTranslator, event: ConversationTranslationEventArgs) => void;
        /**
            * Join a conversation. If this is the host, pass in the previously created Conversation object.
            * @param conversation
            * @param nickname
            * @param lang
            * @param cb
            * @param err
            */
        joinConversationAsync(conversation: IConversation, nickname: string, cb?: Callback, err?: Callback): void;
        joinConversationAsync(conversationId: string, nickname: string, lang: string, cb?: Callback, err?: Callback): void;
        /**
            * Leave the conversation
            * @param cb
            * @param err
            */
        leaveConversationAsync(cb?: Callback, err?: Callback): void;
        /**
            * Send a text message
            * @param message
            * @param cb
            * @param err
            */
        sendTextMessageAsync(message: string, cb?: Callback, err?: Callback): void;
        /**
            * Start speaking
            * @param cb
            * @param err
            */
        startTranscribingAsync(cb?: Callback, err?: Callback): void;
        /**
            * Stop speaking
            * @param cb
            * @param err
            */
        stopTranscribingAsync(cb?: Callback, err?: Callback): void;
        isDisposed(): boolean;
        dispose(reason?: string): void;
}

/**
    * Represents a user in a conversation.
    * Added in version 1.4.0
    */
export interface IUser {
        /** Gets the user's ID */
        readonly userId: string;
}
export class User implements IUser {
        constructor(userId: string);
        get userId(): string;
}
/**
    * Represents a participant in a conversation.
    * Added in version 1.4.0
    */
export interface IParticipant {
        /** Gets the colour of the user's avatar as an HTML hex string (e.g. FF0000 for red). */
        readonly avatar: string;
        /**
            * The participant's display name. Please note that there may be more than one participant
            * with the same name. You can use <see cref="Id"/> property to tell them apart.
            */
        readonly displayName: string;
        /** The unique identifier for the participant. */
        readonly id: string;
        /** Gets whether or not this participant is the host. */
        readonly isHost: boolean;
        /** Gets whether or not this participant is muted. */
        readonly isMuted: boolean;
        /** Gets whether or not the participant is using Text To Speech (TTS). */
        readonly isUsingTts: boolean;
        /** The participant's preferred spoken language. */
        readonly preferredLanguage: string;
        /** Contains properties of the participant. */
        readonly properties: PropertyCollection;
}
export class Participant implements IParticipant {
        constructor(id: string, avatar: string, displayName: string, isHost: boolean, isMuted: boolean, isUsingTts: boolean, preferredLanguage: string);
        get avatar(): string;
        get displayName(): string;
        get id(): string;
        get preferredLanguage(): string;
        get isHost(): boolean;
        get isMuted(): boolean;
        get isUsingTts(): boolean;
        get properties(): PropertyCollection;
}

export enum ParticipantChangedReason {
        /** Participant has joined the conversation. */
        JoinedConversation = 0,
        /** Participant has left the conversation. This could be voluntary, or involuntary
            *  (e.g. they are experiencing networking issues).
            */
        LeftConversation = 1,
        /** The participants' state has changed (e.g. they became muted, changed their nickname). */
        Updated = 2
}

/**
    * @class
    */
export class CognitiveSubscriptionKeyAuthentication implements IAuthentication {
        /**
            * Creates and initializes an instance of the CognitiveSubscriptionKeyAuthentication class.
            * @constructor
            * @param {string} subscriptionKey - The subscription key
            */
        constructor(subscriptionKey: string);
        /**
            * Fetches the subscription key.
            * @member
            * @function
            * @public
            * @param {string} authFetchEventId - The id to fetch.
            */
        fetch: (authFetchEventId: string) => Promise<AuthInfo>;
        /**
            * Fetches the subscription key.
            * @member
            * @function
            * @public
            * @param {string} authFetchEventId - The id to fetch.
            */
        fetchOnExpiry: (authFetchEventId: string) => Promise<AuthInfo>;
}

export class CognitiveTokenAuthentication implements IAuthentication {
    constructor(fetchCallback: (authFetchEventId: string) => Promise<string>, fetchOnExpiryCallback: (authFetchEventId: string) => Promise<string>);
    fetch: (authFetchEventId: string) => Promise<AuthInfo>;
    fetchOnExpiry: (authFetchEventId: string) => Promise<AuthInfo>;
}

export interface IAuthentication {
    fetch(authFetchEventId: string): Promise<AuthInfo>;
    fetchOnExpiry(authFetchEventId: string): Promise<AuthInfo>;
}
export class AuthInfo {
    constructor(headerName: string, token: string);
    get headerName(): string;
    get token(): string;
}

export interface IConnectionFactory {
    create(config: RecognizerConfig, authInfo: AuthInfo, connectionId?: string): IConnection;
}

export interface ISynthesisConnectionFactory {
    create(config: SynthesizerConfig, authInfo: AuthInfo, connectionId?: string): IConnection;
}

export class IntentConnectionFactory extends ConnectionFactoryBase {
    create: (config: RecognizerConfig, authInfo: AuthInfo, connectionId?: string) => IConnection;
}

export class SpeechRecognitionEvent extends PlatformEvent {
    constructor(eventName: string, requestId: string, sessionId: string, eventType?: EventType);
    get requestId(): string;
    get sessionId(): string;
}
export class RecognitionTriggeredEvent extends SpeechRecognitionEvent {
    constructor(requestId: string, sessionId: string, audioSourceId: string, audioNodeId: string);
    get audioSourceId(): string;
    get audioNodeId(): string;
}
export class ListeningStartedEvent extends SpeechRecognitionEvent {
    constructor(requestId: string, sessionId: string, audioSourceId: string, audioNodeId: string);
    get audioSourceId(): string;
    get audioNodeId(): string;
}
export class ConnectingToServiceEvent extends SpeechRecognitionEvent {
    constructor(requestId: string, authFetchEventid: string, sessionId: string);
    get authFetchEventid(): string;
}
export class RecognitionStartedEvent extends SpeechRecognitionEvent {
    constructor(requestId: string, audioSourceId: string, audioNodeId: string, authFetchEventId: string, sessionId: string);
    get audioSourceId(): string;
    get audioNodeId(): string;
    get authFetchEventId(): string;
}
export enum RecognitionCompletionStatus {
    Success = 0,
    AudioSourceError = 1,
    AudioSourceTimeout = 2,
    AuthTokenFetchError = 3,
    AuthTokenFetchTimeout = 4,
    UnAuthorized = 5,
    ConnectTimeout = 6,
    ConnectError = 7,
    ClientRecognitionActivityTimeout = 8,
    UnknownError = 9
}
export class RecognitionEndedEvent extends SpeechRecognitionEvent {
    constructor(requestId: string, audioSourceId: string, audioNodeId: string, authFetchEventId: string, sessionId: string, serviceTag: string, status: RecognitionCompletionStatus, error: string);
    get audioSourceId(): string;
    get audioNodeId(): string;
    get authFetchEventId(): string;
    get serviceTag(): string;
    get status(): RecognitionCompletionStatus;
    get error(): string;
}

export abstract class ServiceRecognizerBase implements IDisposable {
    protected privSpeechContext: SpeechContext;
    protected privRequestSession: RequestSession;
    protected privConnectionId: string;
    protected privRecognizerConfig: RecognizerConfig;
    protected privRecognizer: Recognizer;
    protected privSuccessCallback: (e: SpeechRecognitionResult | SpeechRecognitionResultCustom) => void;
    protected privErrorCallback: (e: string) => void;
    constructor(authentication: IAuthentication, connectionFactory: IConnectionFactory, audioSource: IAudioSource, recognizerConfig: RecognizerConfig, recognizer: Recognizer);
    get audioSource(): IAudioSource;
    get speechContext(): SpeechContext;
    get dynamicGrammar(): DynamicGrammarBuilder;
    get agentConfig(): AgentConfig;
    set conversationTranslatorToken(token: string);
    isDisposed(): boolean;
    dispose(reason?: string): void;
    get connectionEvents(): EventSource<ConnectionEvent>;
    get serviceEvents(): EventSource<ServiceEvent>;
    get 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<boolean>;
    stopRecognizing(): Promise<boolean>;
    connect(): void;
    connectAsync(cb?: Callback, err?: Callback): void;
    protected disconnectOverride: () => any;
    disconnect(): void;
    disconnectAsync(cb?: Callback, err?: Callback): void;
    static telemetryData: (json: string) => void;
    static telemetryDataEnabled: boolean;
    sendMessage(message: string): void;
    sendNetworkMessage(path: string, payload: string | ArrayBuffer, success?: () => void, err?: (error: string) => void): void;
    set activityTemplate(messagePayload: string);
    get activityTemplate(): string;
    protected abstract processTypeSpecificMessages(connectionMessage: SpeechConnectionMessage, successCallback?: (e: SpeechRecognitionResult) => void, errorCallBack?: (e: string) => void): boolean;
    protected sendTelemetryData: () => Promise<boolean> | Promise<Promise<boolean>>;
    protected abstract cancelRecognition(sessionId: string, requestId: string, cancellationReason: CancellationReason, errorCode: CancellationErrorCode, error: string): void;
    protected cancelRecognitionLocal(cancellationReason: CancellationReason, errorCode: CancellationErrorCode, error: string): void;
    protected receiveMessageOverride: () => any;
    protected receiveMessage: () => Promise<IConnection>;
    protected sendSpeechContext: (connection: IConnection) => Promise<boolean>;
    protected sendWaveHeader(connection: IConnection): Promise<boolean>;
    protected connectImplOverride: (isUnAuthorized: boolean) => any;
    protected connectImpl(isUnAuthorized?: boolean): Promise<IConnection>;
    protected configConnectionOverride: () => any;
    protected fetchConnectionOverride: () => any;
    protected sendSpeechServiceConfig: (connection: IConnection, requestSession: RequestSession, SpeechServiceConfigJson: string) => Promise<boolean>;
    protected sendAudio: (audioStreamNode: IAudioStreamNode) => Promise<boolean>;
}

export enum RecognitionMode {
    Interactive = 0,
    Conversation = 1,
    Dictation = 2
}
export enum SpeechResultFormat {
    Simple = 0,
    Detailed = 1
}
export class RecognizerConfig {
    constructor(speechServiceConfig: SpeechServiceConfig, parameters: PropertyCollection);
    get parameters(): PropertyCollection;
    get recognitionMode(): RecognitionMode;
    set recognitionMode(value: RecognitionMode);
    get SpeechServiceConfig(): SpeechServiceConfig;
    get recognitionActivityTimeout(): number;
    get isContinuousRecognition(): boolean;
    get autoDetectSourceLanguages(): string;
}
export class SpeechServiceConfig {
    constructor(context: Context);
    serialize: () => string;
    get Context(): Context;
    get Recognition(): string;
    set Recognition(value: string);
}
export class Context {
    system: System;
    os: OS;
    audio: ISpeechConfigAudio;
    constructor(os: OS);
}
export class System {
    name: string;
    version: string;
    build: string;
    lang: string;
    constructor();
}
export class OS {
    platform: string;
    name: string;
    version: string;
    constructor(platform: string, name: string, version: string);
}
export class Device {
    manufacturer: string;
    model: string;
    version: string;
    constructor(manufacturer: string, model: string, version: string);
}
export interface ISpeechConfigAudio {
    source?: ISpeechConfigAudioDevice;
    playback?: ISpeechConfigAudioDevice;
}
export interface ISpeechConfigAudioDevice {
    manufacturer: string;
    model: string;
    connectivity: connectivity;
    type: type;
    samplerate: number;
    bitspersample: number;
    channelcount: number;
}
export enum connectivity {
    Bluetooth = "Bluetooth",
    Wired = "Wired",
    WiFi = "WiFi",
    Cellular = "Cellular",
    InBuilt = "InBuilt",
    Unknown = "Unknown"
}
export enum type {
    Phone = "Phone",
    Speaker = "Speaker",
    Car = "Car",
    Headset = "Headset",
    Thermostat = "Thermostat",
    Microphones = "Microphones",
    Deskphone = "Deskphone",
    RemoteControl = "RemoteControl",
    Unknown = "Unknown",
    File = "File",
    Stream = "Stream"
}

export interface ITranslations {
    TranslationStatus: TranslationStatus;
    Translations: ITranslation[];
    FailureReason: string;
}
export interface ITranslation {
    Language: string;
    Text: string;
}
export interface ISpeechEndDetectedResult {
    Offset?: number;
}
export interface ITurnStart {
    context: ITurnStartContext;
}
export interface ITurnStartContext {
    serviceTag: string;
}
export interface IResultErrorDetails {
    errorText: string;
    recogSate: RecognitionCompletionStatus;
}

export class WebsocketMessageFormatter implements IWebsocketMessageFormatter {
    toConnectionMessage: (message: RawWebsocketMessage) => Promise<ConnectionMessage>;
    fromConnectionMessage: (message: ConnectionMessage) => Promise<RawWebsocketMessage>;
}

export class SpeechConnectionFactory extends ConnectionFactoryBase {
    create: (config: RecognizerConfig, authInfo: AuthInfo, connectionId?: string) => IConnection;
}

export class TranslationConnectionFactory extends ConnectionFactoryBase {
    create: (config: RecognizerConfig, authInfo: AuthInfo, connectionId?: string) => IConnection;
}

export class SpeechSynthesisConnectionFactory implements ISynthesisConnectionFactory {
    create: (config: SynthesizerConfig, authInfo: AuthInfo, connectionId?: string) => IConnection;
}

export class EnumTranslation {
    static implTranslateRecognitionResult(recognitionStatus: RecognitionStatus): ResultReason;
    static implTranslateCancelResult(recognitionStatus: RecognitionStatus): CancellationReason;
    static implTranslateCancelErrorCode(recognitionStatus: RecognitionStatus): CancellationErrorCode;
}

/**
    * @class SynthesisStatus
    * @private
    */
export enum SynthesisStatus {
        /**
            * The response contains valid audio data.
            * @member SynthesisStatus.Success
            */
        Success = 0,
        /**
            * Indicates the end of audio data. No valid audio data is included in the message.
            * @member SynthesisStatus.SynthesisEnd
            */
        SynthesisEnd = 1,
        /**
            * Indicates an error occurred during synthesis data processing.
            * @member SynthesisStatus.Error
            */
        Error = 2
}
export enum RecognitionStatus {
        Success = 0,
        NoMatch = 1,
        InitialSilenceTimeout = 2,
        BabbleTimeout = 3,
        Error = 4,
        EndOfDictation = 5,
        TooManyRequests = 6
}

export interface ITranslationSynthesisEnd {
    SynthesisStatus: SynthesisStatus;
    FailureReason: string;
}
export class TranslationSynthesisEnd implements ITranslationSynthesisEnd {
    static fromJSON(json: string): TranslationSynthesisEnd;
    get SynthesisStatus(): SynthesisStatus;
    get FailureReason(): string;
}

export interface ITranslationHypothesis {
    Duration: number;
    Offset: number;
    Text: string;
    Translation: ITranslations;
}
export class TranslationHypothesis implements ITranslationHypothesis {
    static fromJSON(json: string): TranslationHypothesis;
    get Duration(): number;
    get Offset(): number;
    get Text(): string;
    get Translation(): ITranslations;
}

export interface ITranslationPhrase {
    RecognitionStatus: RecognitionStatus;
    Offset: number;
    Duration: number;
    Text: string;
    Translation: ITranslations;
}
export class TranslationPhrase implements ITranslationPhrase {
    static fromJSON(json: string): TranslationPhrase;
    get RecognitionStatus(): RecognitionStatus;
    get Offset(): number;
    get Duration(): number;
    get Text(): string;
    get Translation(): ITranslations;
}

export class TranslationServiceRecognizer extends ServiceRecognizerBase {
    constructor(authentication: IAuthentication, connectionFactory: IConnectionFactory, audioSource: IAudioSource, recognizerConfig: RecognizerConfig, translationRecognizer: TranslationRecognizer);
    protected processTypeSpecificMessages(connectionMessage: SpeechConnectionMessage): boolean;
    protected cancelRecognition(sessionId: string, requestId: string, cancellationReason: CancellationReason, errorCode: CancellationErrorCode, error: string): void;
}

export interface ISpeechDetected {
    Offset: number;
}
export class SpeechDetected implements ISpeechDetected {
    static fromJSON(json: string): SpeechDetected;
    get Offset(): number;
}

export interface ISpeechHypothesis {
    Text: string;
    Offset: number;
    Duration: number;
    PrimaryLanguage?: IPrimaryLanguage;
}
export class SpeechHypothesis implements ISpeechHypothesis {
    static fromJSON(json: string): SpeechHypothesis;
    get Text(): string;
    get Offset(): number;
    get Duration(): number;
    get Language(): string;
    get LanguageDetectionConfidence(): string;
}

export class SpeechServiceRecognizer extends ServiceRecognizerBase {
    constructor(authentication: IAuthentication, connectionFactory: IConnectionFactory, audioSource: IAudioSource, recognizerConfig: RecognizerConfig, speechRecognizer: SpeechRecognizer);
    protected processTypeSpecificMessages(connectionMessage: SpeechConnectionMessage): boolean;
    protected cancelRecognition(sessionId: string, requestId: string, cancellationReason: CancellationReason, errorCode: CancellationErrorCode, error: string): void;
}

export interface IDetailedSpeechPhrase {
    RecognitionStatus: RecognitionStatus;
    NBest: IPhrase[];
    Duration?: number;
    Offset?: number;
    PrimaryLanguage?: IPrimaryLanguage;
}
export interface IPhrase {
    Confidence?: number;
    Lexical: string;
    ITN: string;
    MaskedITN: string;
    Display: string;
}
export class DetailedSpeechPhrase implements IDetailedSpeechPhrase {
    static fromJSON(json: string): DetailedSpeechPhrase;
    get RecognitionStatus(): RecognitionStatus;
    get NBest(): IPhrase[];
    get Duration(): number;
    get Offset(): number;
    get Language(): string;
    get LanguageDetectionConfidence(): string;
}

export interface ISimpleSpeechPhrase {
    RecognitionStatus: RecognitionStatus;
    DisplayText: string;
    Offset?: number;
    Duration?: number;
    PrimaryLanguage?: IPrimaryLanguage;
}
export interface IPrimaryLanguage {
    Language: string;
    Confidence: string;
}
export class SimpleSpeechPhrase implements ISimpleSpeechPhrase {
    static fromJSON(json: string): SimpleSpeechPhrase;
    get RecognitionStatus(): RecognitionStatus;
    get DisplayText(): string;
    get Offset(): number;
    get Duration(): number;
    get Language(): string;
    get LanguageDetectionConfidence(): string;
}

/**
    * @class AddedLmIntent
    */
export class AddedLmIntent {
        modelImpl: LanguageUnderstandingModelImpl;
        intentName: string;
        /**
            * Creates and initializes an instance of this class.
            * @constructor
            * @param modelImpl - The model.
            * @param intentName - The intent name.
            */
        constructor(modelImpl: LanguageUnderstandingModelImpl, intentName: string);
}

export class IntentServiceRecognizer extends ServiceRecognizerBase {
    constructor(authentication: IAuthentication, connectionFactory: IConnectionFactory, audioSource: IAudioSource, recognizerConfig: RecognizerConfig, recognizer: IntentRecognizer);
    setIntents(addedIntents: {
        [id: string]: AddedLmIntent;
    }, umbrellaIntent: AddedLmIntent): void;
    protected processTypeSpecificMessages(connectionMessage: SpeechConnectionMessage): boolean;
    protected cancelRecognition(sessionId: string, requestId: string, cancellationReason: CancellationReason, errorCode: CancellationErrorCode, error: string): void;
}

export interface IIntentResponse {
    query: string;
    topScoringIntent: ISingleIntent;
    entities: IIntentEntity[];
}
export interface IIntentEntity {
    entity: string;
    type: string;
    startIndex: number;
    endIndex: number;
    score: number;
}
export interface ISingleIntent {
    intent: string;
    score: number;
}
export class IntentResponse implements IIntentResponse {
    static fromJSON(json: string): IntentResponse;
    get query(): string;
    get topScoringIntent(): ISingleIntent;
    get entities(): IIntentEntity[];
}

export class RequestSession {
    constructor(audioSourceId: string);
    get sessionId(): string;
    get requestId(): string;
    get audioNodeId(): string;
    get turnCompletionPromise(): Promise<boolean>;
    get isSpeechEnded(): boolean;
    get isRecognizing(): boolean;
    get currentTurnAudioOffset(): number;
    get recogNumber(): number;
    get bytesSent(): number;
    listenForServiceTelemetry(eventSource: IEventSource<PlatformEvent>): void;
    startNewRecognition(): void;
    onAudioSourceAttachCompleted: (audioNode: ReplayableAudioNode, isError: boolean, error?: string) => void;
    onPreConnectionStart: (authFetchEventId: string, connectionId: string) => void;
    onAuthCompleted: (isError: boolean, error?: string) => void;
    onConnectionEstablishCompleted: (statusCode: number, reason?: string) => void;
    onServiceTurnEndResponse: (continuousRecognition: boolean) => void;
    onServiceTurnStartResponse: () => void;
    onHypothesis(offset: number): void;
    onPhraseRecognized(offset: number): void;
    onServiceRecognized(offset: number): void;
    onAudioSent(bytesSent: number): void;
    dispose: (error?: string) => void;
    getTelemetry: () => string;
    onStopRecognizing(): void;
    onSpeechEnded(): void;
    protected onEvent: (event: SpeechRecognitionEvent) => void;
}

/**
    * Represents the JSON used in the speech.context message sent to the speech service.
    * The dynamic grammar is always refreshed from the encapsulated dynamic grammar object.
    */
export class SpeechContext {
        constructor(dynamicGrammar: DynamicGrammarBuilder);
        /**
            * Adds a section to the speech.context object.
            * @param sectionName Name of the section to add.
            * @param value JSON serializable object that represents the value.
            */
        setSection(sectionName: string, value: any): void;
        toJSON(): string;
}

/**
  * Responsible for building the object to be sent to the speech service to support dynamic grammars.
  * @class DynamicGrammarBuilder
  */
export class DynamicGrammarBuilder {
    addPhrase(phrase: string | string[]): void;
    clearPhrases(): void;
    addReferenceGrammar(grammar: string | string[]): void;
    clearGrammars(): void;
    generateGrammarObject(): IDynamicGrammar;
}

/**
    *  Top level grammar node
    */
export interface IDynamicGrammar {
        ReferenceGrammars?: string[];
        Groups?: IDynamicGrammarGroup[];
}
/**
    * Group of Dynamic Grammar items of a common type.
    */
export interface IDynamicGrammarGroup {
        Type: string;
        Name?: string;
        SubstringMatch?: string;
        Items: IDynamicGrammarPeople[] | IDynamicGrammarGeneric[];
}
export interface IDynamicGrammarPeople {
        Name: string;
        First?: string;
        Middle?: string;
        Last?: string;
        Synonyms?: string[];
        Weight?: number;
}
/**
    * Generic phrase based dynamic grammars
    */
export interface IDynamicGrammarGeneric {
        Text: string;
        Synonyms?: string[];
        Weight?: number;
}

export class DialogServiceAdapter extends ServiceRecognizerBase {
    constructor(authentication: IAuthentication, connectionFactory: IConnectionFactory, audioSource: IAudioSource, recognizerConfig: RecognizerConfig, dialogServiceConnector: DialogServiceConnector);
    isDisposed(): boolean;
    dispose(reason?: string): void;
    sendMessage: (message: string) => void;
    protected privDisconnect(): void;
    protected processTypeSpecificMessages(connectionMessage: SpeechConnectionMessage): boolean;
    protected cancelRecognition(sessionId: string, requestId: string, cancellationReason: CancellationReason, errorCode: CancellationErrorCode, error: string): void;
    protected listenOnce: (recoMode: RecognitionMode, successCallback: (e: SpeechRecognitionResult) => void, errorCallback: (e: string) => void) => Promise<boolean>;
    protected sendAudio: (audioStreamNode: IAudioStreamNode) => Promise<boolean>;
    protected sendWaveHeader(connection: IConnection): Promise<boolean>;
}

/**
    * Represents the JSON used in the agent.config message sent to the speech service.
    */
export class AgentConfig {
        toJsonString(): string;
        get(): IAgentConfig;
        /**
            * Setter for the agent.config object.
            * @param value a JSON serializable object.
            */
        set(value: IAgentConfig): void;
}
export interface IAgentConfig {
        botInfo: {
                commType: string;
                connectionId: string;
                conversationId: string;
                fromId: string;
                commandsCulture: string;
                ttsAudioFormat: string;
        };
        version: number;
}

export interface ISynthesisMetadata {
    Type: string;
    Data: {
        Offset: number;
        text: {
            Text: string;
            Length: number;
        };
    };
}
export interface ISynthesisAudioMetadata {
    Metadata: ISynthesisMetadata[];
}
export class SynthesisAudioMetadata implements ISynthesisAudioMetadata {
    static fromJSON(json: string): SynthesisAudioMetadata;
    get Metadata(): ISynthesisMetadata[];
}

export interface ISynthesisResponseContext {
    serviceTag: string;
}
export interface ISynthesisResponseAudio {
    type: string;
    streamId: string;
}
export interface ISynthesisResponse {
    context: ISynthesisResponseContext;
    audio: ISynthesisResponseAudio;
}
export class SynthesisTurn {
    get requestId(): string;
    get streamId(): string;
    set streamId(value: string);
    get audioOutputFormat(): AudioOutputFormatImpl;
    set audioOutputFormat(format: AudioOutputFormatImpl);
    get turnCompletionPromise(): Promise<boolean>;
    get isSynthesisEnded(): boolean;
    get isSynthesizing(): boolean;
    get currentTextOffset(): number;
    get bytesReceived(): number;
    get allReceivedAudio(): ArrayBuffer;
    get allReceivedAudioWithHeader(): ArrayBuffer;
    constructor();
    startNewSynthesis(requestId: string, rawText: string, isSSML: boolean, audioDestination?: IAudioDestination): void;
    onPreConnectionStart: (authFetchEventId: string, connectionId: string) => void;
    onAuthCompleted: (isError: boolean, error?: string) => void;
    onConnectionEstablishCompleted: (statusCode: number, reason?: string) => void;
    onServiceResponseMessage: (responseJson: string) => void;
    onServiceTurnEndResponse: () => void;
    onServiceTurnStartResponse: () => void;
    onAudioChunkReceived(data: ArrayBuffer): void;
    onWordBoundaryEvent(text: string): void;
    dispose: (error?: string) => void;
    onStopSynthesizing(): void;
    protected onEvent: (event: SpeechSynthesisEvent) => void;
}

export class SynthesisAdapterBase implements IDisposable {
    protected privSynthesisTurn: SynthesisTurn;
    protected privConnectionId: string;
    protected privSynthesizerConfig: SynthesizerConfig;
    protected privSpeechSynthesizer: SpeechSynthesizer;
    protected privSuccessCallback: (e: SpeechSynthesisResult) => void;
    protected privErrorCallback: (e: string) => void;
    get synthesisContext(): SynthesisContext;
    get agentConfig(): AgentConfig;
    get connectionEvents(): EventSource<ConnectionEvent>;
    get serviceEvents(): EventSource<ServiceEvent>;
    protected speakOverride: (ssml: string, requestId: string, sc: (e: SpeechSynthesisResult) => void, ec: (e: string) => void) => any;
    static telemetryData: (json: string) => void;
    static telemetryDataEnabled: boolean;
    set activityTemplate(messagePayload: string);
    get activityTemplate(): string;
    protected receiveMessageOverride: () => any;
    protected connectImplOverride: (isUnAuthorized: boolean) => any;
    protected configConnectionOverride: () => any;
    protected fetchConnectionOverride: () => any;
    set audioOutputFormat(format: AudioOutputFormatImpl);
    constructor(authentication: IAuthentication, connectionFactory: ISynthesisConnectionFactory, synthesizerConfig: SynthesizerConfig, speechSynthesizer: SpeechSynthesizer, audioDestination: IAudioDestination);
    static addHeader(audio: ArrayBuffer, format: AudioOutputFormatImpl): ArrayBuffer;
    isDisposed(): boolean;
    dispose(reason?: string): void;
    connect(): void;
    connectAsync(cb?: Callback, err?: Callback): void;
    sendNetworkMessage(path: string, payload: string | ArrayBuffer, success?: () => void, err?: (error: string) => void): void;
    Speak(text: string, isSSML: boolean, requestId: string, successCallback: (e: SpeechSynthesisResult) => void, errorCallBack: (e: string) => void, audioDestination: IAudioDestination): Promise<boolean>;
    protected cancelSynthesis(requestId: string, cancellationReason: CancellationReason, errorCode: CancellationErrorCode, error: string): void;
    protected cancelSynthesisLocal(cancellationReason: CancellationReason, errorCode: CancellationErrorCode, error: string): void;
    protected processTypeSpecificMessages(connectionMessage: SpeechConnectionMessage, successCallback?: (e: SpeechSynthesisResult) => void, errorCallBack?: (e: string) => void): boolean;
    protected receiveMessage: () => Promise<IConnection>;
    protected sendSynthesisContext: (connection: IConnection) => Promise<boolean>;
    protected connectImpl(isUnAuthorized?: boolean): Promise<IConnection>;
    protected sendSpeechServiceConfig: (connection: IConnection, SpeechServiceConfigJson: string) => Promise<boolean>;
    protected sendSsmlMessage: (connection: IConnection, ssml: string, requestId: string) => Promise<boolean>;
}

export enum SynthesisServiceType {
    Standard = 0,
    Custom = 1
}
export class SynthesizerConfig {
    constructor(speechServiceConfig: SpeechServiceConfig, parameters: PropertyCollection);
    get parameters(): PropertyCollection;
    get synthesisServiceType(): SynthesisServiceType;
    set synthesisServiceType(value: SynthesisServiceType);
    get SpeechServiceConfig(): SpeechServiceConfig;
}

/**
    * Represents the JSON used in the synthesis.context message sent to the speech service.
    * The dynamic grammar is always refreshed from the encapsulated dynamic grammar object.
    */
export class SynthesisContext {
        constructor(speechSynthesizer: SpeechSynthesizer);
        /**
            * Adds a section to the synthesis.context object.
            * @param sectionName Name of the section to add.
            * @param value JSON serializable object that represents the value.
            */
        setSection(sectionName: string, value: any): void;
        /**
            * Sets the audio output format for synthesis context generation.
            * @param format {AudioOutputFormatImpl} the output format
            */
        set audioOutputFormat(format: AudioOutputFormatImpl);
        toJSON(): string;
}

export class SpeakerRecognitionConfig {
    constructor(context: Context, parameters: PropertyCollection);
    get parameters(): PropertyCollection;
    get Context(): Context;
}

/**
    * Implements methods for speaker recognition classes, sending requests to endpoint
    * and parsing response into expected format
    * @class SpeakerIdMessageAdapter
    */
export class SpeakerIdMessageAdapter {
        constructor(config: SpeakerRecognitionConfig);
        /**
            * Sends create profile request to endpoint.
            * @function
            * @param {VoiceProfileType} profileType - type of voice profile to create.
            * @param {string} lang - language/locale of voice profile
            * @public
            * @returns {Promise<IRestResponse>} promised rest response containing id of created profile.
            */
        createProfile(profileType: VoiceProfileType, lang: string): Promise<IRestResponse>;
        /**
            * Sends create enrollment request to endpoint.
            * @function
            * @param {VoiceProfile} profileType - voice profile for which to create new enrollment.
            * @param {IAudioSource} audioSource - audioSource from which to pull data to send
            * @public
            * @returns {Promise<IRestResponse>} rest response to enrollment request.
            */
        createEnrollment(profile: VoiceProfile, audioSource: IAudioSource): Promise<IRestResponse>;
        /**
            * Sends verification request to endpoint.
            * @function
            * @param {SpeakerVerificationModel} model - voice model to verify against.
            * @param {IAudioSource} audioSource - audioSource from which to pull data to send
            * @public
            * @returns {Promise<IRestResponse>} rest response to enrollment request.
            */
        verifySpeaker(model: SpeakerVerificationModel, audioSource: IAudioSource): Promise<IRestResponse>;
        /**
            * Sends identification request to endpoint.
            * @function
            * @param {SpeakerIdentificationModel} model - voice profiles against which to identify.
            * @param {IAudioSource} audioSource - audioSource from which to pull data to send
            * @public
            * @returns {Promise<IRestResponse>} rest response to enrollment request.
            */
        identifySpeaker(model: SpeakerIdentificationModel, audioSource: IAudioSource): Promise<IRestResponse>;
        /**
            * Sends delete profile request to endpoint.
            * @function
            * @param {VoiceProfile} profile - voice profile to delete.
            * @public
            * @returns {Promise<IRestResponse>} rest response to deletion request
            */
        deleteProfile(profile: VoiceProfile): Promise<IRestResponse>;
        /**
            * Sends reset profile request to endpoint.
            * @function
            * @param {VoiceProfile} profile - voice profile to reset enrollments for.
            * @public
            * @returns {Promise<IRestResponse>} rest response to reset request
            */
        resetProfile(profile: VoiceProfile): Promise<IRestResponse>;
}

export class AudioSourceEvent extends PlatformEvent {
    constructor(eventName: string, audioSourceId: string, eventType?: EventType);
    get audioSourceId(): string;
}
export class AudioSourceInitializingEvent extends AudioSourceEvent {
    constructor(audioSourceId: string);
}
export class AudioSourceReadyEvent extends AudioSourceEvent {
    constructor(audioSourceId: string);
}
export class AudioSourceOffEvent extends AudioSourceEvent {
    constructor(audioSourceId: string);
}
export class AudioSourceErrorEvent extends AudioSourceEvent {
    constructor(audioSourceId: string, error: string);
    get error(): string;
}
export class AudioStreamNodeEvent extends AudioSourceEvent {
    constructor(eventName: string, audioSourceId: string, audioNodeId: string);
    get audioNodeId(): string;
}
export class AudioStreamNodeAttachingEvent extends AudioStreamNodeEvent {
    constructor(audioSourceId: string, audioNodeId: string);
}
export class AudioStreamNodeAttachedEvent extends AudioStreamNodeEvent {
    constructor(audioSourceId: string, audioNodeId: string);
}
export class AudioStreamNodeDetachedEvent extends AudioStreamNodeEvent {
    constructor(audioSourceId: string, audioNodeId: string);
}
export class AudioStreamNodeErrorEvent extends AudioStreamNodeEvent {
    constructor(audioSourceId: string, audioNodeId: string, error: string);
    get error(): string;
}

export class ServiceEvent extends PlatformEvent {
    constructor(eventName: string, jsonstring: string, eventType?: EventType);
    get jsonString(): string;
}
export class ConnectionEvent extends PlatformEvent {
    constructor(eventName: string, connectionId: string, eventType?: EventType);
    get connectionId(): string;
}
export class ConnectionStartEvent extends ConnectionEvent {
    constructor(connectionId: string, uri: string, headers?: IStringDictionary<string>);
    get uri(): string;
    get headers(): IStringDictionary<string>;
}
export class ConnectionEstablishedEvent extends ConnectionEvent {
    constructor(connectionId: string, metadata?: IStringDictionary<string>);
}
export class ConnectionClosedEvent extends ConnectionEvent {
    constructor(connectionId: string, statusCode: number, reason: string);
    get reason(): string;
    get statusCode(): number;
}
export class ConnectionErrorEvent extends ConnectionEvent {
    constructor(connectionId: string, message: string, type: string);
    get message(): string;
    get type(): string;
}
export class ConnectionEstablishErrorEvent extends ConnectionEvent {
    constructor(connectionId: string, statuscode: number, reason: string);
    get reason(): string;
    get statusCode(): number;
}
export class ConnectionMessageReceivedEvent extends ConnectionEvent {
    constructor(connectionId: string, networkReceivedTimeISO: string, message: ConnectionMessage);
    get networkReceivedTime(): string;
    get message(): ConnectionMessage;
}
export class ConnectionMessageSentEvent extends ConnectionEvent {
    constructor(connectionId: string, networkSentTimeISO: string, message: ConnectionMessage);
    get networkSentTime(): string;
    get message(): ConnectionMessage;
}

export enum MessageType {
    Text = 0,
    Binary = 1
}
export class ConnectionMessage {
    constructor(messageType: MessageType, body: any, headers?: IStringDictionary<string>, id?: string);
    get messageType(): MessageType;
    get headers(): IStringDictionary<string>;
    get body(): any;
    get textBody(): string;
    get binaryBody(): ArrayBuffer;
    get id(): string;
}

export class ConnectionOpenResponse {
    constructor(statusCode: number, reason: string);
    get statusCode(): number;
    get reason(): string;
}

/**
    * The error that is thrown when an argument passed in is null.
    *
    * @export
    * @class ArgumentNullError
    * @extends {Error}
    */
export class ArgumentNullError extends Error {
        /**
            * Creates an instance of ArgumentNullError.
            *
            * @param {string} argumentName - Name of the argument that is null
            *
            * @memberOf ArgumentNullError
            */
        constructor(argumentName: string);
}
/**
    * The error that is thrown when an invalid operation is performed in the code.
    *
    * @export
    * @class InvalidOperationError
    * @extends {Error}
    */
export class InvalidOperationError extends Error {
        /**
            * Creates an instance of InvalidOperationError.
            *
            * @param {string} error - The error
            *
            * @memberOf InvalidOperationError
            */
        constructor(error: string);
}
/**
    * The error that is thrown when an object is disposed.
    *
    * @export
    * @class ObjectDisposedError
    * @extends {Error}
    */
export class ObjectDisposedError extends Error {
        /**
            * Creates an instance of ObjectDisposedError.
            *
            * @param {string} objectName - The object that is disposed
            * @param {string} error - The error
            *
            * @memberOf ObjectDisposedError
            */
        constructor(objectName: string, error?: string);
}

export class Events {
    static setEventSource: (eventSource: IEventSource<PlatformEvent>) => void;
    static get instance(): IEventSource<PlatformEvent>;
}

export class EventSource<TEvent extends PlatformEvent> implements IEventSource<TEvent> {
    constructor(metadata?: IStringDictionary<string>);
    onEvent: (event: TEvent) => void;
    attach: (onEventCallback: (event: TEvent) => void) => IDetachable;
    attachListener: (listener: IEventListener<TEvent>) => IDetachable;
    isDisposed: () => boolean;
    dispose: () => void;
    get metadata(): IStringDictionary<string>;
}

const createGuid: () => string;
const createNoDashGuid: () => string;
export { createGuid, createNoDashGuid };

export interface IAudioSource {
    id(): string;
    turnOn(): Promise<boolean>;
    attach(audioNodeId: string): Promise<IAudioStreamNode>;
    detach(audioNodeId: string): void;
    turnOff(): Promise<boolean>;
    events: EventSource<AudioSourceEvent>;
    format: Promise<AudioStreamFormatImpl>;
    deviceInfo: Promise<ISpeechConfigAudioDevice>;
    blob: Promise<Blob | Buffer>;
    setProperty?(name: string, value: string): void;
    getProperty?(name: string, def?: string): string;
}
export interface IAudioStreamNode extends IDetachable {
    id(): string;
    read(): Promise<IStreamChunk<ArrayBuffer>>;
}

export enum ConnectionState {
    None = 0,
    Connected = 1,
    Connecting = 2,
    Disconnected = 3
}
export interface IConnection extends IDisposable {
    id: string;
    state(): ConnectionState;
    open(): Promise<ConnectionOpenResponse>;
    send(message: ConnectionMessage): Promise<boolean>;
    read(): Promise<ConnectionMessage>;
    events: EventSource<ConnectionEvent>;
}

export interface IDetachable {
    detach(): void;
}

export interface IStringDictionary<TValue> {
    [propName: string]: TValue;
}
export interface INumberDictionary<TValue> extends Object {
    [propName: number]: TValue;
}

/**
    * @export
    * @interface IDisposable
    */
export interface IDisposable {
        /**
            * @returns {boolean}
            *
            * @memberOf IDisposable
            */
        isDisposed(): boolean;
        /**
            * Performs cleanup operations on this instance
            *
            * @param {string} [reason] - optional reason for disposing the instance.
            * This will be used to throw errors when a operations are performed on the disposed object.
            *
            * @memberOf IDisposable
            */
        dispose(reason?: string): void;
}

export interface IEventListener<TEvent extends PlatformEvent> {
    onEvent(e: TEvent): void;
}
export interface IEventSource<TEvent extends PlatformEvent> extends IDisposable {
    metadata: IStringDictionary<string>;
    onEvent(e: TEvent): void;
    attach(onEventCallback: (event: TEvent) => void): IDetachable;
    attachListener(listener: IEventListener<TEvent>): IDetachable;
}

export interface IErrorMessages {
    authInvalidSubscriptionKey: string;
    authInvalidSubscriptionRegion: string;
    invalidArgs: string;
    invalidCreateJoinConversationResponse: string;
    invalidParticipantRequest: string;
    permissionDeniedConnect: string;
    permissionDeniedConversation: string;
    permissionDeniedParticipant: string;
    permissionDeniedSend: string;
    permissionDeniedStart: string;
}

export interface ITimer {
        /**
            * start timer
            *
            * @param {number} delay
            * @param {(...args: any[]) => any} successCallback
            * @returns {*}
            *
            * @memberOf ITimer
            */
        start(): void;
        /**
            * stops timer
            *
            * @param {*} timerId
            *
            * @memberOf ITimer
            */
        stop(): void;
}

export interface IWebsocketMessageFormatter {
    toConnectionMessage(message: RawWebsocketMessage): Promise<ConnectionMessage>;
    fromConnectionMessage(message: ConnectionMessage): Promise<RawWebsocketMessage>;
}

export interface IList<TItem> extends IDisposable {
    get(itemIndex: number): TItem;
    first(): TItem;
    last(): TItem;
    add(item: TItem): void;
    insertAt(index: number, item: TItem): void;
    removeFirst(): TItem;
    removeLast(): TItem;
    removeAt(index: number): TItem;
    remove(index: number, count: number): TItem[];
    clear(): void;
    length(): number;
    onAdded(addedCallback: () => void): IDetachable;
    onRemoved(removedCallback: () => void): IDetachable;
    onDisposed(disposedCallback: () => void): IDetachable;
    join(seperator?: string): string;
    toArray(): TItem[];
    any(callback?: (item: TItem, index: number) => boolean): boolean;
    all(callback: (item: TItem) => boolean): boolean;
    forEach(callback: (item: TItem, index: number) => void): void;
    select<T2>(callback: (item: TItem, index: number) => T2): List<T2>;
    where(callback: (item: TItem, index: number) => boolean): List<TItem>;
    orderBy(compareFn: (a: TItem, b: TItem) => number): List<TItem>;
    orderByDesc(compareFn: (a: TItem, b: TItem) => number): List<TItem>;
    clone(): List<TItem>;
    concat(list: List<TItem>): List<TItem>;
    concatArray(array: TItem[]): List<TItem>;
}
export class List<TItem> implements IList<TItem> {
    constructor(list?: TItem[]);
    get: (itemIndex: number) => TItem;
    first: () => TItem;
    last: () => TItem;
    add: (item: TItem) => void;
    insertAt: (index: number, item: TItem) => void;
    removeFirst: () => TItem;
    removeLast: () => TItem;
    removeAt: (index: number) => TItem;
    remove: (index: number, count: number) => TItem[];
    clear: () => void;
    length: () => number;
    onAdded: (addedCallback: () => void) => IDetachable;
    onRemoved: (removedCallback: () => void) => IDetachable;
    onDisposed: (disposedCallback: () => void) => IDetachable;
    join: (seperator?: string) => string;
    toArray: () => TItem[];
    any: (callback?: (item: TItem, index: number) => boolean) => boolean;
    all: (callback: (item: TItem) => boolean) => boolean;
    forEach: (callback: (item: TItem, index: number) => void) => void;
    select: <T2>(callback: (item: TItem, index: number) => T2) => List<T2>;
    where: (callback: (item: TItem, index: number) => boolean) => List<TItem>;
    orderBy: (compareFn: (a: TItem, b: TItem) => number) => List<TItem>;
    orderByDesc: (compareFn: (a: TItem, b: TItem) => number) => List<TItem>;
    clone: () => List<TItem>;
    concat: (list: List<TItem>) => List<TItem>;
    concatArray: (array: TItem[]) => List<TItem>;
    isDisposed: () => boolean;
    dispose: (reason?: string) => void;
}

export enum EventType {
    Debug = 0,
    Info = 1,
    Warning = 2,
    Error = 3
}
export class PlatformEvent {
    constructor(eventName: string, eventType: EventType);
    get name(): string;
    get eventId(): string;
    get eventTime(): string;
    get eventType(): EventType;
    get metadata(): IStringDictionary<string>;
}

export enum PromiseState {
    None = 0,
    Resolved = 1,
    Rejected = 2
}
export interface IPromise<T> {
    result(): PromiseResult<T>;
    continueWith<TContinuationResult>(continuationCallback: (promiseResult: PromiseResult<T>) => TContinuationResult): IPromise<TContinuationResult>;
    continueWithPromise<TContinuationResult>(continuationCallback: (promiseResult: PromiseResult<T>) => IPromise<TContinuationResult>): IPromise<TContinuationResult>;
    onSuccessContinueWith<TContinuationResult>(continuationCallback: (result: T) => TContinuationResult): IPromise<TContinuationResult>;
    onSuccessContinueWithPromise<TContinuationResult>(continuationCallback: (result: T) => IPromise<TContinuationResult>): IPromise<TContinuationResult>;
    on(successCallback: (result: T) => void, errorCallback: (error: string) => void): IPromise<T>;
    finally(callback: () => void): IPromise<T>;
}
export interface IDeferred<T> {
    state(): PromiseState;
    promise(): IPromise<T>;
    resolve(result: T): IDeferred<T>;
    reject(error: string): IDeferred<T>;
}
export class PromiseResult<T> {
    protected privIsCompleted: boolean;
    protected privIsError: boolean;
    protected privError: string;
    protected privResult: T;
    constructor(promiseResultEventSource: PromiseResultEventSource<T>);
    get isCompleted(): boolean;
    get isError(): boolean;
    get error(): string;
    get result(): T;
    throwIfError: () => void;
}
export class PromiseResultEventSource<T> {
    setResult: (result: T) => void;
    setError: (error: string) => void;
    on: (onSetResult: (result: T) => void, onSetError: (error: string) => void) => void;
}
export class PromiseHelper {
    static whenAll: (promises: Promise<any>[]) => Promise<boolean>;
    static fromResult: <TResult>(result: TResult) => Promise<TResult>;
    static fromError: <TResult>(error: string) => Promise<TResult>;
}
export class Promise<T> implements IPromise<T> {
    constructor(sink: Sink<T>);
    result: () => PromiseResult<T>;
    continueWith: <TContinuationResult>(continuationCallback: (promiseResult: PromiseResult<T>) => TContinuationResult) => Promise<TContinuationResult>;
    onSuccessContinueWith: <TContinuationResult>(continuationCallback: (result: T) => TContinuationResult) => Promise<TContinuationResult>;
    continueWithPromise: <TContinuationResult>(continuationCallback: (promiseResult: PromiseResult<T>) => Promise<TContinuationResult>) => Promise<TContinuationResult>;
    onSuccessContinueWithPromise: <TContinuationResult>(continuationCallback: (result: T) => Promise<TContinuationResult>) => Promise<TContinuationResult>;
    on: (successCallback: (result: T) => void, errorCallback: (error: string) => void) => Promise<T>;
    finally: (callback: () => void) => Promise<T>;
}
export class Deferred<T> implements IDeferred<T> {
    constructor();
    state: () => PromiseState;
    promise: () => Promise<T>;
    resolve: (result: T) => Deferred<T>;
    reject: (error: string) => Deferred<T>;
}
export class Sink<T> {
    constructor();
    get state(): PromiseState;
    get result(): PromiseResult<T>;
    resolve: (result: T) => void;
    reject: (error: string) => void;
    on: (successCallback: (result: T) => void, errorCallback: (error: string) => void) => void;
}

export interface IQueue<TItem> extends IDisposable {
    enqueue(item: TItem): void;
    enqueueFromPromise(promise: Promise<TItem>): void;
    dequeue(): Promise<TItem>;
    peek(): Promise<TItem>;
    length(): number;
}
export class Queue<TItem> implements IQueue<TItem> {
    constructor(list?: List<TItem>);
    enqueue: (item: TItem) => void;
    enqueueFromPromise: (promise: Promise<TItem>) => void;
    dequeue: () => Promise<TItem>;
    peek: () => Promise<TItem>;
    length: () => number;
    isDisposed: () => boolean;
    drainAndDispose: (pendingItemProcessor: (pendingItemInQueue: TItem) => void, reason?: string) => Promise<boolean>;
    dispose: (reason?: string) => void;
}

export class RawWebsocketMessage {
    constructor(messageType: MessageType, payload: any, id?: string);
    get messageType(): MessageType;
    get payload(): any;
    get textContent(): string;
    get binaryContent(): ArrayBuffer;
    get id(): string;
}

export class RiffPcmEncoder {
    constructor(actualSampleRate: number, desiredSampleRate: number);
    encode: (actualAudioFrame: Float32Array) => ArrayBuffer;
}

export interface IStreamChunk<TBuffer> {
    isEnd: boolean;
    buffer: TBuffer;
    timeReceived: number;
}
export class Stream<TBuffer> {
    constructor(streamId?: string);
    get isClosed(): boolean;
    get isReadEnded(): boolean;
    get id(): string;
    close(): void;
    writeStreamChunk(streamChunk: IStreamChunk<TBuffer>): void;
    read: () => Promise<IStreamChunk<TBuffer>>;
    readEnded: () => void;
}

/**
    * Defines translation status.
    * @class TranslationStatus
    */
export enum TranslationStatus {
        /**
            * @member TranslationStatus.Success
            */
        Success = 0,
        /**
            * @member TranslationStatus.Error
            */
        Error = 1
}

export class ChunkedArrayBufferStream extends Stream<ArrayBuffer> {
    constructor(targetChunkSize: number, streamId?: string);
    writeStreamChunk(chunk: IStreamChunk<ArrayBuffer>): void;
    close(): void;
}

export interface IAudioDestination {
    id(): string;
    write(buffer: ArrayBuffer): void;
    format: AudioStreamFormat;
    close(): void;
}

interface IWorkerTimers {
    clearTimeout: (timerId: number) => void;
    setTimeout: (func: () => any, delay: number) => number;
}
export class Timeout {
    static clearTimeout: IWorkerTimers["clearTimeout"];
    static setTimeout: IWorkerTimers["setTimeout"];
    static load: (url: string) => {
        clearTimeout: (timerId: number) => void;
        setTimeout: (func: () => void, delay: number) => number;
    };
    static timers: () => IWorkerTimers;
}
export {};

export class OCSPEvent extends PlatformEvent {
    constructor(eventName: string, eventType: EventType, signature: string);
}
export class OCSPMemoryCacheHitEvent extends OCSPEvent {
    constructor(signature: string);
}
export class OCSPCacheMissEvent extends OCSPEvent {
    constructor(signature: string);
}
export class OCSPDiskCacheHitEvent extends OCSPEvent {
    constructor(signature: string);
}
export class OCSPCacheUpdateNeededEvent extends OCSPEvent {
    constructor(signature: string);
}
export class OCSPMemoryCacheStoreEvent extends OCSPEvent {
    constructor(signature: string);
}
export class OCSPDiskCacheStoreEvent extends OCSPEvent {
    constructor(signature: string);
}
export class OCSPCacheUpdatehCompleteEvent extends OCSPEvent {
    constructor(signature: string);
}
export class OCSPStapleReceivedEvent extends OCSPEvent {
    constructor();
}
export class OCSPWSUpgradeStartedEvent extends OCSPEvent {
    constructor(serialNumber: string);
}
export class OCSPCacheEntryExpiredEvent extends OCSPEvent {
    constructor(serialNumber: string, expireTime: number);
}
export class OCSPCacheEntryNeedsRefreshEvent extends OCSPEvent {
    constructor(serialNumber: string, startTime: number, expireTime: number);
}
export class OCSPCacheHitEvent extends OCSPEvent {
    constructor(serialNumber: string, startTime: number, expireTime: number);
}
export class OCSPVerificationFailedEvent extends OCSPEvent {
    constructor(serialNumber: string, error: string);
}
export class OCSPCacheFetchErrorEvent extends OCSPEvent {
    constructor(serialNumber: string, error: string);
}
export class OCSPResponseRetrievedEvent extends OCSPEvent {
    constructor(serialNumber: string);
}
export class OCSPCacheUpdateErrorEvent extends OCSPEvent {
    constructor(serialNumber: string, error: string);
}

export type Callback = (result?: any) => void;
/**
    * Manages conversations.
    * Added in version 1.4.0
    */
export interface IConversation {
        config: SpeechTranslationConfig;
        /**
            * Gets/sets authorization token used to communicate with the service.
            * Note: The caller needs to ensure that the authorization token is valid. Before the authorization token
            * expires, the caller needs to refresh it by calling this setter with a new valid token.
            * Otherwise, the recognizer will encounter errors during recognition.
            */
        authorizationToken: string;
        /** Gets the unique identifier for the current conversation. */
        readonly conversationId: string;
        /** Gets the collection of properties and their values defined for this instance. */
        readonly properties: PropertyCollection;
        /** Gets the language name that is used for recognition. */
        readonly speechRecognitionLanguage: string;
        /** Start a conversation.
            *  The host must connect to the websocket within a minute for the conversation to remain open.
            */
        startConversationAsync(cb?: () => void, err?: (e: string) => void): void;
        /** Delete a conversation. After this no one will be able to join the conversation. */
        deleteConversationAsync(cb?: () => void, err?: (e: string) => void): void;
        /** End a conversation. */
        endConversationAsync(cb?: () => void, err?: (e: string) => void): void;
        /** Lock a conversation. This will prevent new participants from joining. */
        lockConversationAsync(cb?: () => void, err?: (e: string) => void): void;
        /**
            * Mute all other participants in the conversation. After this no other participants will
            * have their speech recognitions broadcast, nor be able to send text messages.
            */
        muteAllParticipantsAsync(cb?: () => void, err?: (e: string) => void): void;
        /**
            * Mute a participant.
            * @param userId A user identifier
            */
        muteParticipantAsync(userId: string, cb?: () => void, err?: (e: string) => void): void;
        /**
            * Remove a participant from a conversation using the user id, Participant or User object
            * @param userId A user identifier
            */
        removeParticipantAsync(userId: string | IParticipant | IUser, cb?: () => void, err?: (e: string) => void): void;
        /** Unlocks a conversation. */
        unlockConversationAsync(): void;
        /** Unmute all other participants in the conversation. */
        unmuteAllParticipantsAsync(cb?: () => void, err?: (e: string) => void): void;
        /**
            * Unmute a participant.
            * @param userId A user identifier
            */
        unmuteParticipantAsync(userId: string, cb?: () => void, err?: (e: string) => void): void;
}

/**
    * A conversation translator that enables a connected experience where participants can use their
    * own devices to see everyone else's recognitions and IMs in their own languages. Participants
    * can also speak and send IMs to others.
    */
export interface IConversationTranslator {
        /** Gets the collection of properties and their values defined for this instance. */
        readonly properties: PropertyCollection;
        /** Gets the language name that is used for recognition. */
        readonly speechRecognitionLanguage: string;
        /**
            * Event that signals an error with the conversation transcription, or the end of the audio stream has been reached.
            */
        canceled: (sender: IConversationTranslator, event: ConversationTranslationCanceledEventArgs) => void;
        /**
            * Event that signals how many more minutes are left before the conversation expires.
            */
        conversationExpiration: (sender: IConversationTranslator, event: ConversationExpirationEventArgs) => void;
        /**
            * Event that signals participants in the conversation have changed (e.g. a new participant joined).
            */
        participantsChanged: (sender: IConversationTranslator, event: ConversationParticipantsChangedEventArgs) => void;
        /**
            * Defines event handler for session started events.
            */
        sessionStarted: (sender: IConversationTranslator, event: SessionEventArgs) => void;
        /**
            * Defines event handler for session stopped events.
            */
        sessionStopped: (sender: IConversationTranslator, event: SessionEventArgs) => void;
        /**
            * Event that signals a translated text message from a conversation participant.
            */
        textMessageReceived: (sender: IConversationTranslator, event: ConversationTranslationEventArgs) => void;
        /**
            * The event recognized signals that a final  conversation translation result is received.
            */
        transcribed: (sender: IConversationTranslator, event: ConversationTranslationEventArgs) => void;
        /**
            * The event recognizing signals that an intermediate conversation translation result is received.
            */
        transcribing: (sender: IConversationTranslator, event: ConversationTranslationEventArgs) => void;
        /** Start a conversation. */
        joinConversationAsync(conversation: IConversation, nickname: string, cb?: Callback, err?: Callback): void;
        /**
            * Joins an existing conversation.
            * @param conversationId The unique identifier for the conversation to join.
            * @param nickname The display name to use for the current participant.
            * @param lang The speech language to use for the current participant.
            */
        joinConversationAsync(conversationId: string, nickname: string, lang: string, cb?: Callback, err?: Callback): void;
        /**
            * Leave the current conversation. After this is called, you will no longer receive any events.
            */
        leaveConversationAsync(cb?: Callback, err?: Callback): void;
        /**
            * Sends an instant message to all participants in the conversation. This instant message
            * will be translated into each participant's text language.
            * @param message
            */
        sendTextMessageAsync(message: string, cb?: Callback, err?: Callback): void;
        /**
            * Starts sending audio to the conversation service for speech recognition and translation. You
            * should subscribe to the Transcribing, and Transcribed events to receive conversation
            * translation results for yourself, and other participants in the conversation.
            */
        startTranscribingAsync(cb?: Callback, err?: Callback): void;
        /**
            * Stops sending audio to the conversation service. You will still receive Transcribing, and
            * and Transcribed events for other participants in the conversation.
            */
        stopTranscribingAsync(cb?: Callback, err?: Callback): void;
}

export abstract class ConnectionFactoryBase implements IConnectionFactory {
    abstract create(config: RecognizerConfig, authInfo: AuthInfo, connectionId?: string): IConnection;
    protected setCommonUrlParams(config: RecognizerConfig, queryParams: IStringDictionary<string>, endpoint: string): void;
    protected setUrlParameter(propId: PropertyId, parameterName: string, config: RecognizerConfig, queryParams: IStringDictionary<string>, endpoint: string): void;
}

export class SpeechConnectionMessage extends ConnectionMessage {
    constructor(messageType: MessageType, path: string, requestId: string, contentType: string, body: any, streamId?: string, additionalHeaders?: IStringDictionary<string>, id?: string);
    get path(): string;
    get requestId(): string;
    get contentType(): string;
    get streamId(): string;
    get additionalHeaders(): IStringDictionary<string>;
    static fromConnectionMessage: (message: ConnectionMessage) => SpeechConnectionMessage;
}

export class ConversationManager {
        constructor();
        /**
            * Make a POST request to the Conversation Manager service endpoint to create or join a conversation.
            * @param args
            * @param conversationCode
            * @param callback
            * @param errorCallback
            */
        createOrJoin(args: PropertyCollection, conversationCode: string, cb?: any, err?: any): void;
        /**
            * Make a DELETE request to the Conversation Manager service endpoint to leave the conversation.
            * @param args
            * @param sessionToken
            * @param callback
            */
        leave(args: PropertyCollection, sessionToken: string, cb?: any, err?: any): void;
}

/**
    * Sends messages to the Conversation Translator websocket and listens for incoming events containing websocket messages.
    * Based off the recognizers in the SDK folder.
    */
export class ConversationTranslatorRecognizer extends Recognizer implements IConversationTranslatorRecognizer {
        constructor(speechConfig: SpeechTranslationConfig, audioConfig?: AudioConfig);
        canceled: (sender: IConversationTranslatorRecognizer, event: ConversationTranslationCanceledEventArgs) => void;
        conversationExpiration: (sender: IConversationTranslatorRecognizer, event: ConversationExpirationEventArgs) => void;
        lockRoomCommandReceived: (sender: IConversationTranslatorRecognizer, event: LockRoomEventArgs) => void;
        muteAllCommandReceived: (sender: IConversationTranslatorRecognizer, event: MuteAllEventArgs) => void;
        participantJoinCommandReceived: (sender: IConversationTranslatorRecognizer, event: ParticipantEventArgs) => void;
        participantLeaveCommandReceived: (sender: IConversationTranslatorRecognizer, event: ParticipantEventArgs) => void;
        participantUpdateCommandReceived: (sender: IConversationTranslatorRecognizer, event: ParticipantAttributeEventArgs) => void;
        connectionOpened: (sender: IConversationTranslatorRecognizer, event: SessionEventArgs) => void;
        connectionClosed: (sender: IConversationTranslatorRecognizer, event: SessionEventArgs) => void;
        translationReceived: (sender: IConversationTranslatorRecognizer, event: ConversationReceivedTranslationEventArgs) => void;
        participantsListReceived: (sender: IConversationTranslatorRecognizer, event: ParticipantsListEventArgs) => void;
        participantsChanged: (sender: IConversationTranslatorRecognizer, event: ConversationParticipantsChangedEventArgs) => void;
        set conversation(value: IInternalConversation);
        /**
            * Return the speech language used by the recognizer
            */
        get speechRecognitionLanguage(): string;
        /**
            * Return the properties for the recognizer
            */
        get properties(): PropertyCollection;
        isDisposed(): boolean;
        /**
            * Connect to the recognizer
            * @param token
            */
        connect(token: string, cb?: () => void, err?: (e: string) => void): void;
        /**
            * Disconnect from the recognizer
            */
        disconnect(cb?: () => void, err?: (e: string) => void): void;
        /**
            * Send the text message command to the websocket
            * @param conversationId
            * @param participantId
            * @param message
            */
        sendMessageRequest(message: string, cb?: () => void, err?: (e: string) => void): void;
        /**
            * Send the lock conversation command to the websocket
            * @param conversationId
            * @param participantId
            * @param isLocked
            */
        sendLockRequest(isLocked: boolean, cb?: () => void, err?: (e: string) => void): void;
        /**
            * Send the mute all participants command to the websocket
            * @param conversationId
            * @param participantId
            * @param isMuted
            */
        sendMuteAllRequest(isMuted: boolean, cb?: () => void, err?: (e: string) => void): void;
        /**
            * Send the mute participant command to the websocket
            * @param conversationId
            * @param participantId
            * @param isMuted
            */
        sendMuteRequest(participantId: string, isMuted: boolean, cb?: () => void, err?: (e: string) => void): void;
        /**
            * Send the eject participant command to the websocket
            * @param conversationId
            * @param participantId
            */
        sendEjectRequest(participantId: string, cb?: () => void, err?: (e: string) => void): void;
        /**
            * Send the mute participant command to the websocket
            * @param conversationId
            * @param participantId
            * @param isMuted
            */
        sendChangeNicknameRequest(nickname: string, cb?: () => void, err?: (e: string) => void): void;
        /**
            * Close and dispose the recognizer
            */
        close(): void;
        /**
            * Dispose the recognizer
            * @param disposing
            */
        protected dispose(disposing: boolean): boolean;
        /**
            * Create the config for the recognizer
            * @param speechConfig
            */
        protected createRecognizerConfig(speechConfig: SpeechServiceConfig): RecognizerConfig;
        /**
            * Create the service recognizer.
            * The audio source is redundnant here but is required by the implementation.
            * @param authentication
            * @param connectionFactory
            * @param audioConfig
            * @param recognizerConfig
            */
        protected createServiceRecognizer(authentication: IAuthentication, connectionFactory: IConnectionFactory, audioConfig: AudioConfig, recognizerConfig: RecognizerConfig): ServiceRecognizerBase;
}

export class ConversationConnectionConfig extends RestConfigBase {
    static get host(): string;
    static get apiVersion(): string;
    static get clientAppId(): string;
    static get defaultLanguageCode(): string;
    static get restPath(): string;
    static get webSocketPath(): string;
    static get speechHost(): string;
    static get speechPath(): string;
}

export class MuteAllEventArgs extends SessionEventArgs {
    constructor(isMuted: boolean, sessionId?: string);
    get isMuted(): boolean;
}
export class LockRoomEventArgs extends SessionEventArgs {
    constructor(isLocked: boolean, sessionId?: string);
    get isMuted(): boolean;
}
export class ParticipantEventArgs extends SessionEventArgs {
    constructor(participant: IInternalParticipant, sessionId?: string);
    get participant(): IInternalParticipant;
}
export class ParticipantAttributeEventArgs extends SessionEventArgs {
    constructor(participantId: string, key: string, value: boolean | number | string | string[], sessionId?: string);
    get value(): boolean | number | string | string[];
    get key(): string;
    get id(): string;
}
export class ParticipantsListEventArgs extends SessionEventArgs {
    constructor(conversationId: string, token: string, translateTo: string[], profanityFilter: string, roomProfanityFilter: string, isRoomLocked: boolean, isMuteAll: boolean, participants: IInternalParticipant[], sessionId?: string);
    get sessionToken(): string;
    get conversationId(): string;
    get translateTo(): string[];
    get profanityFilter(): string;
    get roomProfanityFilter(): string;
    get isRoomLocked(): boolean;
    get isMuteAll(): boolean;
    get participants(): IInternalParticipant[];
}
export class ConversationReceivedTranslationEventArgs {
    constructor(command: string, payload: any, sessionId?: string);
    get payload(): any;
    get command(): string;
    get sessionId(): string;
}

/**
    * Internal conversation data
    */
export interface IInternalConversation {
        cognitiveSpeechAuthToken: string;
        cognitiveSpeechRegion: string;
        participantId: string;
        name: string;
        description: string;
        speechModel: string;
        modalities: number;
        isApproved: boolean;
        isMuted: boolean;
        roomId: string;
        avatar: string;
        token: string;
        correlationId: string;
        requestId: string;
}
/**
    * The user who is participating in the conversation.
    */
export interface IInternalParticipant {
        avatar?: string;
        displayName?: string;
        id?: string;
        isHost?: boolean;
        isMuted?: boolean;
        isUsingTts?: boolean;
        preferredLanguage?: string;
}
/** Users participating in the conversation */
export class InternalParticipants {
        participants: IInternalParticipant[];
        meId?: string;
        constructor(participants?: IInternalParticipant[], meId?: string);
        /**
            * Add or update a participant
            * @param value
            */
        addOrUpdateParticipant(value: IInternalParticipant): IInternalParticipant;
        /**
            * Find the participant's position in the participants list.
            * @param id
            */
        getParticipantIndex(id: string): number;
        /**
            * Find the participant by id.
            * @param id
            */
        getParticipant(id: string): IInternalParticipant;
        /***
            * Remove a participant from the participants list.
            */
        deleteParticipant(id: string): void;
        /***
            * Helper to return the conversation host.
            */
        get host(): IInternalParticipant;
        /**
            * Helper to return the current user.
            */
        get me(): IInternalParticipant;
}
/**
    * Recognizer for handling Conversation Translator websocket messages
    */
export interface IConversationTranslatorRecognizer {
        canceled: (sender: IConversationTranslatorRecognizer, event: ConversationTranslationCanceledEventArgs) => void;
        connectionOpened: (sender: IConversationTranslatorRecognizer, event: SessionEventArgs) => void;
        connectionClosed: (sender: IConversationTranslatorRecognizer, event: SessionEventArgs) => void;
        participantsListReceived: (sender: IConversationTranslatorRecognizer, event: ParticipantsListEventArgs) => void;
        translationReceived: (sender: IConversationTranslatorRecognizer, event: ConversationReceivedTranslationEventArgs) => void;
        lockRoomCommandReceived: (sender: IConversationTranslatorRecognizer, event: LockRoomEventArgs) => void;
        muteAllCommandReceived: (sender: IConversationTranslatorRecognizer, event: MuteAllEventArgs) => void;
        participantJoinCommandReceived: (sender: IConversationTranslatorRecognizer, event: ParticipantEventArgs) => void;
        participantLeaveCommandReceived: (sender: IConversationTranslatorRecognizer, event: ParticipantEventArgs) => void;
        participantUpdateCommandReceived: (sender: IConversationTranslatorRecognizer, event: ParticipantAttributeEventArgs) => void;
}
/**
    * Error message returned from the Conversation Translator websocket
    */
export interface IConversationResponseErrorMessage {
        code: string;
        message: string;
}
/**
    * Error returned from the Conversation Translator websocket
    */
export interface IConversationResponseError {
        error: IConversationResponseErrorMessage;
}
/**
    * Base message command
    */
export interface IClientMessage {
        type: any;
}
/**
    * Command message
    */
export interface ICommandMessage extends IClientMessage {
        command?: string;
}
/**
    * Text message command
    */
export interface IInstantMessageCommand extends ICommandMessage {
        roomId: string;
        nickname?: string;
        participantId: string;
        text: string;
}
/**
    * Lock command
    */
export interface ILockConversationCommand extends ICommandMessage {
        id?: string;
        nickname?: string;
        participantId: string;
        roomid: string;
        value: boolean;
}
/**
    * Mute all command
    */
export interface IMuteAllCommand extends ICommandMessage {
        roomid: string;
        nickname?: string;
        participantId: string;
        value: boolean;
        id?: string;
}
/**
    * Mute participant command
    */
export interface IMuteCommand extends ICommandMessage {
        roomid: string;
        nickname?: string;
        participantId: string;
        value: boolean;
        id?: string;
}
/**
    * Remove participant command
    */
export interface IEjectParticipantCommand extends ICommandMessage {
        roomid: string;
        participantId: string;
}
/**
    * Change nickname command
    */
export interface IChangeNicknameCommand extends ICommandMessage {
        roomid: string;
        participantId: string;
        nickname: string;
        value: string;
}
/**
    * List of command message types
    */
export const ConversationTranslatorMessageTypes: {
        command: string;
        final: string;
        info: string;
        instantMessage: string;
        partial: string;
        participantCommand: string;
        translatedMessage: string;
};
/**
    * List of command types
    */
export const ConversationTranslatorCommandTypes: {
        changeNickname: string;
        disconnectSession: string;
        ejectParticipant: string;
        instant_message: string;
        joinSession: string;
        leaveSession: string;
        participantList: string;
        roomExpirationWarning: string;
        setLockState: string;
        setMute: string;
        setMuteAll: string;
        setProfanityFiltering: string;
        setTranslateToLanguages: string;
        setUseTTS: string;
};
/**
    * HTTP response helper
    */
export interface IResponse {
        ok: boolean;
        status: number;
        statusText: string;
        data: string;
        json: <T>() => T;
        headers: string;
}

export enum AudioFormatTag {
        PCM = 1,
        MuLaw = 2,
        Siren = 3,
        MP3 = 4,
        SILKSkype = 5,
        Opus = 6
}
/**
    * @private
    * @class AudioOutputFormatImpl
    * Added in version 1.11.0
    */
export class AudioOutputFormatImpl extends AudioStreamFormatImpl {
        static SpeechSynthesisOutputFormatToString: INumberDictionary<string>;
        /**
            * Creates an instance with the given values.
            * @constructor
            * @param formatTag
            * @param {number} samplesPerSec - Samples per second.
            * @param {number} bitsPerSample - Bits per sample.
            * @param {number} channels - Number of channels.
            * @param avgBytesPerSec
            * @param blockAlign
            * @param audioFormatString
            * @param requestAudioFormatString
            * @param hasHeader
            */
        constructor(formatTag: AudioFormatTag, channels: number, samplesPerSec: number, avgBytesPerSec: number, blockAlign: number, bitsPerSample: number, audioFormatString: string, requestAudioFormatString: string, hasHeader: boolean);
        static fromSpeechSynthesisOutputFormat(speechSynthesisOutputFormat?: SpeechSynthesisOutputFormat): AudioOutputFormatImpl;
        static fromSpeechSynthesisOutputFormatString(speechSynthesisOutputFormatString: string): AudioOutputFormatImpl;
        static getDefaultOutputFormat(): AudioOutputFormatImpl;
        /**
            * The format tag of the audio
            * @AudioFormatTag AudioOutputFormatImpl.prototype.formatTag
            * @function
            * @public
            */
        formatTag: AudioFormatTag;
        /**
            * Specifies if this audio output format has a header
            * @boolean AudioOutputFormatImpl.prototype.hasHeader
            * @function
            * @public
            */
        get hasHeader(): boolean;
        /**
            * Specifies the header of this format
            * @ArrayBuffer AudioOutputFormatImpl.prototype.header
            * @function
            * @public
            */
        get header(): ArrayBuffer;
        /**
            * Updates the header based on the audio length
            * @member AudioOutputFormatImpl.updateHeader
            * @function
            * @public
            * @param {number} audioLength - the audio length
            */
        updateHeader(audioLength: number): void;
        /**
            * Specifies the audio format string to be sent to the service
            * @string AudioOutputFormatImpl.prototype.requestAudioFormatString
            * @function
            * @public
            */
        get requestAudioFormatString(): string;
}

export class SpeechSynthesisEvent extends PlatformEvent {
    constructor(eventName: string, requestId: string, eventType?: EventType);
    get requestId(): string;
}
export class SynthesisTriggeredEvent extends SpeechSynthesisEvent {
    constructor(requestId: string, sessionAudioDestinationId: string, turnAudioDestinationId: string);
    get audioSessionDestinationId(): string;
    get audioTurnDestinationId(): string;
}
export class ConnectingToSynthesisServiceEvent extends SpeechSynthesisEvent {
    constructor(requestId: string, authFetchEventId: string);
    get authFetchEventId(): string;
}
export class SynthesisStartedEvent extends SpeechSynthesisEvent {
    constructor(requestId: string, authFetchEventId: string);
    get authFetchEventId(): string;
}

export class ConsoleLoggingListener implements IEventListener<PlatformEvent> {
    constructor(logLevelFilter?: EventType);
    onEvent: (event: PlatformEvent) => void;
}

export interface IRecorder {
    record(context: AudioContext, mediaStream: MediaStream, outputStream: Stream<ArrayBuffer>): void;
    releaseMediaResources(context: AudioContext): void;
    setWorkletUrl(url: string): void;
}

export const AudioWorkletSourceURLPropertyName = "MICROPHONE-WorkletSourceUrl";
export class MicAudioSource implements IAudioSource {
    constructor(privRecorder: IRecorder, deviceId?: string, audioSourceId?: string);
    get format(): Promise<AudioStreamFormatImpl>;
    get blob(): Promise<Blob>;
    turnOn: () => Promise<boolean>;
    id: () => string;
    attach: (audioNodeId: string) => Promise<IAudioStreamNode>;
    detach: (audioNodeId: string) => void;
    turnOff: () => Promise<boolean>;
    get events(): EventSource<AudioSourceEvent>;
    get deviceInfo(): Promise<ISpeechConfigAudioDevice>;
    setProperty(name: string, value: string): void;
}

export class FileAudioSource implements IAudioSource {
    constructor(file: File, audioSourceId?: string);
    get format(): Promise<AudioStreamFormatImpl>;
    get blob(): Promise<Blob | Buffer>;
    turnOn: () => Promise<boolean>;
    id: () => string;
    attach: (audioNodeId: string) => Promise<IAudioStreamNode>;
    detach: (audioNodeId: string) => void;
    turnOff: () => Promise<boolean>;
    get events(): EventSource<AudioSourceEvent>;
    get deviceInfo(): Promise<ISpeechConfigAudioDevice>;
}

export class PcmRecorder implements IRecorder {
    record: (context: AudioContext, mediaStream: MediaStream, outputStream: Stream<ArrayBuffer>) => void;
    releaseMediaResources: (context: AudioContext) => void;
    setWorkletUrl(url: string): void;
}

export class WebsocketConnection implements IConnection {
    constructor(uri: string, queryParameters: IStringDictionary<string>, headers: IStringDictionary<string>, messageFormatter: IWebsocketMessageFormatter, proxyInfo: ProxyInfo, connectionId?: string);
    dispose: () => void;
    isDisposed: () => boolean;
    get id(): string;
    state: () => ConnectionState;
    open: () => Promise<ConnectionOpenResponse>;
    send: (message: ConnectionMessage) => Promise<boolean>;
    read: () => Promise<ConnectionMessage>;
    get events(): EventSource<ConnectionEvent>;
}

export class WebsocketMessageAdapter {
    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>;
}

export class ReplayableAudioNode implements IAudioStreamNode {
    constructor(audioSource: IAudioStreamNode, bytesPerSecond: number);
    id: () => string;
    read(): Promise<IStreamChunk<ArrayBuffer>>;
    detach(): void;
    replay(): void;
    shrinkBuffers(offset: number): void;
    findTimeAtOffset(offset: number): number;
}

export class ProxyInfo {
    static fromParameters(parameters: PropertyCollection): ProxyInfo;
    static fromRecognizerConfig(config: RecognizerConfig): ProxyInfo;
    get HostName(): string;
    get Port(): number;
    get UserName(): string;
    get Password(): string;
}

export enum RestRequestType {
    Get = "get",
    Post = "post",
    Delete = "delete",
    File = "file"
}
export interface IRestResponse {
    ok: boolean;
    status: number;
    statusText: string;
    data: string;
    json: <T>() => T;
    headers: string;
}
export class RestMessageAdapter {
    constructor(configParams: IRequestOptions, connectionId?: string);
    setHeaders(key: string, value: string): void;
    request(method: RestRequestType, uri: string, queryParams?: any, body?: any, binaryBody?: Blob | Buffer): Promise<IRestResponse>;
}

/**
  * HTTP request helper
  */
export interface IRequestOptions {
    headers?: {
        [key: string]: string;
    };
    ignoreCache?: boolean;
    timeout?: number;
}
export interface IRestParams {
    apiVersion: string;
    authorization: string;
    clientAppId: string;
    contentTypeKey: string;
    correlationId: string;
    languageCode: string;
    nickname: string;
    profanity: string;
    requestId: string;
    roomId: string;
    sessionToken: string;
    subscriptionKey: string;
    subscriptionRegion: string;
    token: string;
}
export class RestConfigBase {
    static get requestOptions(): IRequestOptions;
    static get configParams(): IRestParams;
    static get restErrors(): IErrorMessages;
}

