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,IAAI,EAAE,MAAM,GAAG,UAAU,EAAE,GAAG,CAAC,EAAE,MAAM,GAAG,MAAM;IAInE;;;;;;;;OAQG;IACI,QAAQ,CAAC,aAAa,EAAE,MAAM,EAAE,SAAS,EAAE,MAAM,EAAE,aAAa,CAAC,EAAE,MAAM,EAAE,aAAa,CAAC,EAAE,MAAM,GAAG,IAAI;IAWxG,kBAAkB,CAAC,IAAI,EAAE,MAAM,EAAE,KAAK,EAAE,MAAM,EAAE,OAAO,EAAE,OAAO,0BAA0B,EAAE,sBAAsB,GAAG,IAAI;IAIhI;;;;;OAKG;IACI,KAAK,IAAI,IAAI;CAGvB","file":"DialogServiceConfig.d.ts","sourcesContent":["// Copyright (c) Microsoft Corporation. All rights reserved.\n// Licensed under the MIT license.\n\nimport { Contracts } from \"./Contracts\";\nimport { PropertyCollection, PropertyId, ServicePropertyChannel, SpeechConfigImpl } from \"./Exports\";\n\n/**\n * Class that defines base configurations for dialog service connector\n * @class DialogServiceConfig\n */\nexport abstract class DialogServiceConfig {\n\n /**\n * Creates an instance of DialogService config.\n * @constructor\n */\n protected constructor() { }\n\n /**\n * Sets an arbitrary property.\n * @member DialogServiceConfig.prototype.setProperty\n * @function\n * @public\n * @param {string} name - The name of the property to set.\n * @param {string} value - The new value of the property.\n */\n public abstract setProperty(name: string, value: string): void;\n\n /**\n * Returns the current value of an arbitrary property.\n * @member DialogServiceConfig.prototype.getProperty\n * @function\n * @public\n * @param {string} name - The name of the property to query.\n * @param {string} def - The value to return in case the property is not known.\n * @returns {string} The current value, or provided default, of the given property.\n */\n public abstract getProperty(name: string, def?: string): string;\n\n /**\n * @member DialogServiceConfig.prototype.setServiceProperty\n * @function\n * @public\n * @param {name} The name of the property.\n * @param {value} Value to set.\n * @param {channel} The channel used to pass the specified property to service.\n * @summary Sets a property value that will be passed to service using the specified channel.\n */\n public abstract setServiceProperty(name: string, value: string, channel: ServicePropertyChannel): void;\n\n /**\n * Sets the proxy configuration.\n * Only relevant in Node.js environments.\n * Added in version 1.4.0.\n * @param proxyHostName The host name of the proxy server.\n * @param proxyPort The port number of the proxy server.\n */\n public abstract setProxy(proxyHostName: string, proxyPort: number): void;\n\n /**\n * Sets the proxy configuration.\n * Only relevant in Node.js environments.\n * Added in version 1.4.0.\n * @param proxyHostName The host name of the proxy server, without the protocol scheme (http://)\n * @param porxyPort The port number of the proxy server.\n * @param proxyUserName The user name of the proxy server.\n * @param proxyPassword The password of the proxy server.\n */\n public abstract setProxy(proxyHostName: string, proxyPort: number, proxyUserName: string, proxyPassword: string): void;\n\n /**\n * Returns the configured language.\n * @member DialogServiceConfig.prototype.speechRecognitionLanguage\n * @function\n * @public\n */\n public abstract get speechRecognitionLanguage(): string;\n\n /**\n * Gets/Sets the input language.\n * @member DialogServiceConfig.prototype.speechRecognitionLanguage\n * @function\n * @public\n * @param {string} value - The language to use for recognition.\n */\n public abstract set speechRecognitionLanguage(value: string);\n\n /**\n * Not used in DialogServiceConfig\n * @member DialogServiceConfig.applicationId\n */\n public applicationId: string;\n}\n\n/**\n * Dialog Service configuration.\n * @class DialogServiceConfigImpl\n */\n// tslint:disable-next-line:max-classes-per-file\nexport class DialogServiceConfigImpl extends DialogServiceConfig {\n\n private privSpeechConfig: SpeechConfigImpl;\n\n /**\n * Creates an instance of dialogService config.\n */\n public constructor() {\n super();\n this.privSpeechConfig = new SpeechConfigImpl();\n }\n\n /**\n * Provides access to custom properties.\n * @member DialogServiceConfigImpl.prototype.properties\n * @function\n * @public\n * @returns {PropertyCollection} The properties.\n */\n public get properties(): PropertyCollection {\n return this.privSpeechConfig.properties;\n }\n\n /**\n * Gets the speech recognition language.\n * @member DialogServiceConfigImpl.prototype.speechRecognitionLanguage\n * @function\n * @public\n */\n public get speechRecognitionLanguage(): string {\n return this.privSpeechConfig.speechRecognitionLanguage;\n }\n\n /**\n * Sets the speech recognition language.\n * @member DialogServiceConfigImpl.prototype.speechRecognitionLanguage\n * @function\n * @public\n * @param {string} value - The language to set.\n */\n public set speechRecognitionLanguage(value: string) {\n Contracts.throwIfNullOrWhitespace(value, \"value\");\n this.privSpeechConfig.speechRecognitionLanguage = value;\n }\n\n /**\n * Sets a named property as value\n * @member DialogServiceConfigImpl.prototype.setProperty\n * @function\n * @public\n * @param {PropertyId | string} name - The property to set.\n * @param {string} value - The value.\n */\n public setProperty(name: string | PropertyId, value: string): void {\n this.privSpeechConfig.setProperty(name, value);\n }\n\n /**\n * Sets a named property as value\n * @member DialogServiceConfigImpl.prototype.getProperty\n * @function\n * @public\n * @param {PropertyId | string} name - The property to get.\n * @param {string} def - The default value to return in case the property is not known.\n * @returns {string} The current value, or provided default, of the given property.\n */\n public getProperty(name: string | PropertyId, def?: string): string {\n return this.privSpeechConfig.getProperty(name);\n }\n\n /**\n * Sets the proxy configuration.\n * Only relevant in Node.js environments.\n * Added in version 1.4.0.\n * @param proxyHostName The host name of the proxy server, without the protocol scheme (http://)\n * @param proxyPort The port number of the proxy server.\n * @param proxyUserName The user name of the proxy server.\n * @param proxyPassword The password of the proxy server.\n */\n public setProxy(proxyHostName: string, proxyPort: number, proxyUserName?: string, proxyPassword?: string): void {\n this.setProperty(PropertyId.SpeechServiceConnection_ProxyHostName, proxyHostName);\n this.setProperty(PropertyId.SpeechServiceConnection_ProxyPort, `${proxyPort}`);\n if (proxyUserName) {\n this.setProperty(PropertyId.SpeechServiceConnection_ProxyUserName, proxyUserName);\n }\n if (proxyPassword) {\n this.setProperty(PropertyId.SpeechServiceConnection_ProxyPassword, proxyPassword);\n }\n }\n\n public setServiceProperty(name: string, value: string, channel: import(\"./ServicePropertyChannel\").ServicePropertyChannel): void {\n this.privSpeechConfig.setServiceProperty(name, value, channel);\n }\n\n /**\n * Dispose of associated resources.\n * @member DialogServiceConfigImpl.prototype.close\n * @function\n * @public\n */\n public close(): void {\n return;\n }\n}\n"]}