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ACxD,QAAQ,CAAC,aAAa,EAAE,MAAM,EAAE,SAAS,EAAE,MAAM,EAAE,aAAa,EAAE,MAAM,EAAE,aAAa,EAAE,MAAM,GAAG,IAAI;IAQ7G;;;;;;;;OAQG;IACI,WAAW,CAAC,IAAI,EAAE,MAAM,EAAE,GAAG,CAAC,EAAE,MAAM,GAAG,MAAM;IAItD;;;;;;;OAOG;IACI,WAAW,CAAC,IAAI,EAAE,MAAM,GAAG,UAAU,EAAE,KAAK,EAAE,MAAM,GAAG,IAAI;IAIlE;;;;;;OAMG;IACH,IAAW,UAAU,IAAI,kBAAkB,CAE1C;IAED;;;;;OAKG;IACI,KAAK,IAAI,IAAI;IAIb,kBAAkB,CAAC,IAAI,EAAE,MAAM,EAAE,KAAK,EAAE,MAAM,GAAG,IAAI;IAQrD,YAAY,CAAC,SAAS,EAAE,eAAe,GAAG,IAAI;IAI9C,kBAAkB,IAAI,IAAI;IAG1B,0BAA0B,IAAI,IAAI;IAGlC,eAAe,IAAI,IAAI;IAI9B,IAAW,uBAAuB,IAAI,MAAM,CAE3C;IAED,IAAW,uBAAuB,CAAC,QAAQ,EAAE,MAAM,EAElD;IAED,IAAW,wBAAwB,IAAI,MAAM,CAE5C;IAED,IAAW,wBAAwB,CAAC,KAAK,EAAE,MAAM,EAEhD;IAED,IAAW,2BAA2B,IAAI,2BAA2B,CAGpE;IAED,IAAW,2BAA2B,CAAC,MAAM,EAAE,2BAA2B,EAEzE;CACJ","file":"SpeechTranslationConfig.d.ts","sourcesContent":["// Copyright (c) Microsoft Corporation. All rights reserved.\n// Licensed under the MIT license.\n\n/* eslint-disable max-classes-per-file */\nimport { KeyCredential, TokenCredential } from \"@azure/core-auth\";\nimport {\n    ForceDictationPropertyName,\n    OutputFormatPropertyName,\n    ServicePropertiesPropertyName\n} from \"../common.speech/Exports.js\";\nimport { IStringDictionary } from \"../common/Exports.js\";\nimport { Contracts } from \"./Contracts.js\";\nimport {\n    OutputFormat,\n    ProfanityOption,\n    PropertyCollection,\n    PropertyId,\n    SpeechConfig,\n    SpeechSynthesisOutputFormat,\n} from \"./Exports.js\";\n\n/**\n * Speech translation configuration.\n * @class SpeechTranslationConfig\n */\nexport abstract class SpeechTranslationConfig extends SpeechConfig {\n\n    /**\n     * Creates an instance of recognizer config.\n     */\n    protected constructor() {\n        super();\n    }\n\n    /**\n     * Static instance of SpeechTranslationConfig returned by passing a subscription key and service region.\n     * @member SpeechTranslationConfig.fromSubscription\n     * @function\n     * @public\n     * @param {string} subscriptionKey - The subscription key.\n     * @param {string} region - The region name (see the <a href=\"https://aka.ms/csspeech/region\">region page</a>).\n     * @returns {SpeechTranslationConfig} The speech translation config.\n     */\n    public static fromSubscription(subscriptionKey: string, region: string): SpeechTranslationConfig {\n        Contracts.throwIfNullOrWhitespace(subscriptionKey, \"subscriptionKey\");\n        Contracts.throwIfNullOrWhitespace(region, \"region\");\n\n        const ret: SpeechTranslationConfigImpl = new SpeechTranslationConfigImpl();\n        ret.properties.setProperty(PropertyId.SpeechServiceConnection_Key, subscriptionKey);\n        ret.properties.setProperty(PropertyId.SpeechServiceConnection_Region, region);\n        return ret;\n    }\n\n    /**\n     * Static instance of SpeechTranslationConfig returned by passing authorization token and service region.\n     * Note: The caller needs to ensure that the authorization token is valid. Before the authorization token\n     * expires, the caller needs to refresh it by setting the property authorizationToken with a new\n     * valid token. Otherwise, all the recognizers created by this SpeechTranslationConfig instance\n     * will encounter errors during recognition.\n     * As configuration values are copied when creating a new recognizer, the new token value will not apply\n     * to recognizers that have already been created.\n     * For recognizers that have been created before, you need to set authorization token of the corresponding recognizer\n     * to refresh the token. Otherwise, the recognizers will encounter errors during recognition.\n     * @member SpeechTranslationConfig.fromAuthorizationToken\n     * @function\n     * @public\n     * @param {string} authorizationToken - The authorization token.\n     * @param {string} region - The region name (see the <a href=\"https://aka.ms/csspeech/region\">region page</a>).\n     * @returns {SpeechTranslationConfig} The speech translation config.\n     */\n    public static fromAuthorizationToken(authorizationToken: string, region: string): SpeechTranslationConfig {\n        Contracts.throwIfNullOrWhitespace(authorizationToken, \"authorizationToken\");\n        Contracts.throwIfNullOrWhitespace(region, \"region\");\n\n        const ret: SpeechTranslationConfigImpl = new SpeechTranslationConfigImpl();\n        ret.properties.setProperty(PropertyId.SpeechServiceAuthorization_Token, authorizationToken);\n        ret.properties.setProperty(PropertyId.SpeechServiceConnection_Region, region);\n        return ret;\n    }\n\n    /**\n     * Creates an instance of the speech config with specified host and subscription key.\n     * This method is intended only for users who use a non-default service host. Standard resource path will be assumed.\n     * For services with a non-standard resource path or no path at all, use fromEndpoint instead.\n     * Note: Query parameters are not allowed in the host URI and must be set by other APIs.\n     * Note: To use an authorization token with fromHost, use fromHost(URL),\n     * and then set the AuthorizationToken property on the created SpeechConfig instance.\n     * Note: Added in version 1.9.0.\n     * @member SpeechConfig.fromHost\n     * @function\n     * @public\n     * @param {URL} host - The service endpoint to connect to. Format is \"protocol://host:port\" where \":port\" is optional.\n     * @param {string} subscriptionKey - The subscription key. If a subscription key is not specified, an authorization token must be set.\n     * @returns {SpeechConfig} A speech factory instance.\n     */\n    public static fromHost(hostName: URL, subscriptionKey?: string): SpeechTranslationConfig {\n        Contracts.throwIfNull(hostName, \"hostName\");\n\n        const speechImpl: SpeechTranslationConfigImpl = new SpeechTranslationConfigImpl();\n        speechImpl.setProperty(PropertyId.SpeechServiceConnection_Host, hostName.protocol + \"//\" + hostName.hostname + (hostName.port === \"\" ? \"\" : \":\" + hostName.port));\n\n        if (undefined !== subscriptionKey) {\n            speechImpl.setProperty(PropertyId.SpeechServiceConnection_Key, subscriptionKey);\n        }\n        return speechImpl;\n    }\n\n    /**\n     * Creates an instance of the speech translation config with specified endpoint and subscription key.\n     * This method is intended only for users who use a non-standard service endpoint or paramters.\n     * Note: The query properties specified in the endpoint URL are not changed, even if they are\n     * set by any other APIs. For example, if language is defined in the uri as query parameter\n     * \"language=de-DE\", and also set by the speechRecognitionLanguage property, the language\n     * setting in uri takes precedence, and the effective language is \"de-DE\".\n     * Only the properties that are not specified in the endpoint URL can be set by other APIs.\n     * Note: To use authorization token with fromEndpoint, pass an empty string to the subscriptionKey in the\n     * fromEndpoint method, and then set authorizationToken=\"token\" on the created SpeechConfig instance to\n     * use the authorization token.\n     * @member SpeechTranslationConfig.fromEndpoint\n     * @function\n     * @public\n     * @param {URL} endpoint - The service endpoint to connect to.\n     * @param {string} subscriptionKey - The subscription key.\n     * @returns {SpeechTranslationConfig} A speech translation config instance.\n     */\n    public static fromEndpoint(endpoint: URL, subscriptionKey?: string): SpeechTranslationConfig;\n\n    /**\n     * Creates an instance of a speech translation config with a custom endpoint and a credential.\n     * The query parameters specified in the endpoint URI are not changed, even if they are set by any other API call.\n     * For example, if the recognition language is defined in the URI query parameter as \"language=de-DE\", and the property SpeechRecognitionLanguage is set to \"en-US\",\n     * the language set in the URI takes precedence, and \"de-DE\" remains the expected language.\n     * Since parameters included in the endpoint URI take priority, only parameters that are not specified in the endpoint URI can be set by other APIs.\n     * Supported credential types:\n     * - KeyCredential: For API key-based authentication.\n     * - TokenCredential: For Azure AD-based authentication.\n     * Note: To use authorization token with fromEndpoint, pass an empty string to the subscriptionKey in the\n     * fromEndpoint method, and then set authorizationToken=\"token\" on the created SpeechConfig instance to use the authorization token.\n     * @member SpeechConfig.fromEndpoint\n     * @function\n     * @public\n     * @param {URL} endpoint - The service endpoint to connect to.\n     * @param {KeyCredential | TokenCredential} credential - The credential used for authentication.\n     * @returns {SpeechTranslationConfig} A speech factory instance.\n     */\n    public static fromEndpoint(endpoint: URL, credential: KeyCredential | TokenCredential): SpeechTranslationConfig;\n\n    /**\n     * Internal implementation of fromEndpoint() overloads. Accepts either a subscription key or a TokenCredential.\n     * @private\n     */\n    public static fromEndpoint(endpoint: URL, auth: string | TokenCredential | KeyCredential): SpeechTranslationConfig {\n        Contracts.throwIfNull(endpoint, \"endpoint\");\n        const isValidString = typeof auth === \"string\" && auth.trim().length > 0;\n        const isTokenCredential = typeof auth === \"object\" && auth !== null && typeof (auth as TokenCredential).getToken === \"function\";\n        const isKeyCredential = typeof auth === \"object\" && auth !== null && typeof (auth as KeyCredential).key === \"string\";\n        if (auth !== undefined && !isValidString && !isTokenCredential && !isKeyCredential) {\n            throw new Error(\"Invalid 'auth' parameter: expected a non-empty API key string, a TokenCredential, or a KeyCredential.\");\n        }\n\n        let speechImpl: SpeechTranslationConfigImpl;\n        if (typeof auth === \"string\") {\n            speechImpl = new SpeechTranslationConfigImpl();\n            speechImpl.setProperty(PropertyId.SpeechServiceConnection_Key, auth);\n        } else if (typeof auth === \"object\" && typeof (auth as TokenCredential).getToken === \"function\") {\n            speechImpl = new SpeechTranslationConfigImpl(auth as TokenCredential);\n        } else if (typeof auth === \"object\" && typeof (auth as KeyCredential).key === \"string\") {\n            speechImpl = new SpeechTranslationConfigImpl();\n            speechImpl.setProperty(PropertyId.SpeechServiceConnection_Key, (auth as KeyCredential).key);\n        } else {\n            speechImpl = new SpeechTranslationConfigImpl();\n        }\n\n        speechImpl.setProperty(PropertyId.SpeechServiceConnection_Endpoint, endpoint.href);\n\n        return speechImpl;\n    }\n\n    /**\n     * Gets/Sets the authorization token.\n     * Note: The caller needs to ensure that the authorization token is valid. Before the authorization token\n     * expires, the caller needs to refresh it by calling this setter with a new valid token.\n     * @member SpeechTranslationConfig.prototype.authorizationToken\n     * @function\n     * @public\n     * @param {string} value - The authorization token.\n     */\n    public abstract set authorizationToken(value: string);\n\n    /**\n     * Gets/Sets the speech recognition language.\n     * @member SpeechTranslationConfig.prototype.speechRecognitionLanguage\n     * @function\n     * @public\n     * @param {string} value - The authorization token.\n     */\n    public abstract set speechRecognitionLanguage(value: string);\n\n    /**\n     * Add a (text) target language to translate into.\n     * @member SpeechTranslationConfig.prototype.addTargetLanguage\n     * @function\n     * @public\n     * @param {string} value - The language such as de-DE\n     */\n    public abstract addTargetLanguage(value: string): void;\n\n    /**\n     * Gets the (text) target language to translate into.\n     * @member SpeechTranslationConfig.prototype.targetLanguages\n     * @function\n     * @public\n     * @param {string} value - The language such as de-DE\n     */\n    public abstract get targetLanguages(): string[];\n\n    /**\n     * Gets the selected voice name.\n     * @member SpeechTranslationConfig.prototype.voiceName\n     * @function\n     * @public\n     * @returns {string} The voice name.\n     */\n    public abstract get voiceName(): string;\n\n    /**\n     * Gets/Sets voice of the translated language, enable voice synthesis output.\n     * @member SpeechTranslationConfig.prototype.voiceName\n     * @function\n     * @public\n     * @param {string} value - The name of the voice.\n     */\n    public abstract set voiceName(value: string);\n\n    /**\n     * Sets a named property as value\n     * @member SpeechTranslationConfig.prototype.setProperty\n     * @function\n     * @public\n     * @param {string | PropertyId} 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 | PropertyId, value: string): void;\n\n    /**\n     * Dispose of associated resources.\n     * @member SpeechTranslationConfig.prototype.close\n     * @function\n     * @public\n     */\n    public abstract close(): void;\n}\n\n/**\n * @private\n * @class SpeechTranslationConfigImpl\n */\nexport class SpeechTranslationConfigImpl extends SpeechTranslationConfig {\n\n    private privSpeechProperties: PropertyCollection;\n    private readonly privTokenCredential?: TokenCredential;\n\n    public constructor(tokenCredential?: TokenCredential) {\n        super();\n        this.privSpeechProperties = new PropertyCollection();\n        this.outputFormat = OutputFormat.Simple;\n        this.privTokenCredential = tokenCredential;\n    }\n    /**\n     * Gets/Sets the authorization token.\n     * If this is set, subscription key is ignored.\n     * User needs to make sure the provided authorization token is valid and not expired.\n     * @member SpeechTranslationConfigImpl.prototype.authorizationToken\n     * @function\n     * @public\n     * @param {string} value - The authorization token.\n     */\n    public set authorizationToken(value: string) {\n        Contracts.throwIfNullOrWhitespace(value, \"value\");\n\n        this.privSpeechProperties.setProperty(PropertyId.SpeechServiceAuthorization_Token, value);\n    }\n\n    /**\n     * Sets the speech recognition language.\n     * @member SpeechTranslationConfigImpl.prototype.speechRecognitionLanguage\n     * @function\n     * @public\n     * @param {string} value - The authorization token.\n     */\n    public set speechRecognitionLanguage(value: string) {\n        Contracts.throwIfNullOrWhitespace(value, \"value\");\n        this.privSpeechProperties.setProperty(PropertyId.SpeechServiceConnection_RecoLanguage, value);\n    }\n\n    /**\n     * Gets the speech recognition language.\n     * @member SpeechTranslationConfigImpl.prototype.speechRecognitionLanguage\n     * @function\n     * @public\n     * @return {string} The speechRecognitionLanguage.\n     */\n    public get speechRecognitionLanguage(): string {\n        return this.privSpeechProperties.getProperty(PropertyId[PropertyId.SpeechServiceConnection_RecoLanguage]);\n    }\n\n    /**\n     * @member SpeechTranslationConfigImpl.prototype.subscriptionKey\n     * @function\n     * @public\n     */\n    public get subscriptionKey(): string {\n        return this.privSpeechProperties.getProperty(PropertyId[PropertyId.SpeechServiceConnection_Key]);\n    }\n\n    /**\n     * Gets the output format\n     * @member SpeechTranslationConfigImpl.prototype.outputFormat\n     * @function\n     * @public\n     */\n    public get outputFormat(): OutputFormat {\n        // eslint-disable-next-line\n        return (OutputFormat as any)[this.privSpeechProperties.getProperty(OutputFormatPropertyName, undefined)];\n    }\n\n    /**\n     * Gets/Sets the output format\n     * @member SpeechTranslationConfigImpl.prototype.outputFormat\n     * @function\n     * @public\n     */\n    public set outputFormat(value: OutputFormat) {\n        this.privSpeechProperties.setProperty(OutputFormatPropertyName, OutputFormat[value]);\n    }\n\n    /**\n     * Gets the endpoint id.\n     * @member SpeechTranslationConfigImpl.prototype.endpointId\n     * @function\n     * @public\n     */\n    public get endpointId(): string {\n        return this.privSpeechProperties.getProperty(PropertyId.SpeechServiceConnection_EndpointId);\n    }\n\n    /**\n     * Gets/Sets the endpoint id.\n     * @member SpeechTranslationConfigImpl.prototype.endpointId\n     * @function\n     * @public\n     */\n    public set endpointId(value: string) {\n        this.privSpeechProperties.setProperty(PropertyId.SpeechServiceConnection_EndpointId, value);\n    }\n\n    /**\n     * Add a (text) target language to translate into.\n     * @member SpeechTranslationConfigImpl.prototype.addTargetLanguage\n     * @function\n     * @public\n     * @param {string} value - The language such as de-DE\n     */\n    public addTargetLanguage(value: string): void {\n        Contracts.throwIfNullOrWhitespace(value, \"value\");\n\n        const languages: string[] = this.targetLanguages;\n        if (!languages.includes(value)) {\n            languages.push(value);\n            this.privSpeechProperties.setProperty(PropertyId.SpeechServiceConnection_TranslationToLanguages, languages.join(\",\"));\n        }\n    }\n\n    /**\n     * Gets the (text) target language to translate into.\n     * @member SpeechTranslationConfigImpl.prototype.targetLanguages\n     * @function\n     * @public\n     * @param {string} value - The language such as de-DE\n     */\n    public get targetLanguages(): string[] {\n\n        if (this.privSpeechProperties.getProperty(PropertyId.SpeechServiceConnection_TranslationToLanguages, undefined) !== undefined) {\n            return this.privSpeechProperties.getProperty(PropertyId.SpeechServiceConnection_TranslationToLanguages).split(\",\");\n        } else {\n            return [];\n        }\n\n    }\n\n    /**\n     * Gets the voice name.\n     * @member SpeechTranslationConfigImpl.prototype.voiceName\n     * @function\n     * @public\n     */\n    public get voiceName(): string {\n        return this.getProperty(PropertyId[PropertyId.SpeechServiceConnection_TranslationVoice]);\n    }\n\n    /**\n     * Gets/Sets the voice of the translated language, enable voice synthesis output.\n     * @member SpeechTranslationConfigImpl.prototype.voiceName\n     * @function\n     * @public\n     * @param {string} value - The name of the voice.\n     */\n    public set voiceName(value: string) {\n        Contracts.throwIfNullOrWhitespace(value, \"value\");\n\n        this.privSpeechProperties.setProperty(PropertyId.SpeechServiceConnection_TranslationVoice, value);\n    }\n\n    /**\n     * Provides the region.\n     * @member SpeechTranslationConfigImpl.prototype.region\n     * @function\n     * @public\n     * @returns {string} The region.\n     */\n    public get region(): string {\n        return this.privSpeechProperties.getProperty(PropertyId.SpeechServiceConnection_Region);\n    }\n\n    public get tokenCredential(): TokenCredential | undefined {\n        return this.privTokenCredential;\n    }\n\n    public setProxy(proxyHostName: string, proxyPort: number): void;\n    public setProxy(proxyHostName: string, proxyPort: number, proxyUserName: string, proxyPassword: string): void;\n    public setProxy(proxyHostName: any, proxyPort: any, proxyUserName?: any, proxyPassword?: any): void {\n        this.setProperty(PropertyId[PropertyId.SpeechServiceConnection_ProxyHostName], proxyHostName as string);\n        this.setProperty(PropertyId[PropertyId.SpeechServiceConnection_ProxyPort], proxyPort as string);\n        this.setProperty(PropertyId[PropertyId.SpeechServiceConnection_ProxyUserName], proxyUserName as string);\n        this.setProperty(PropertyId[PropertyId.SpeechServiceConnection_ProxyPassword], proxyPassword as string);\n    }\n\n    /**\n     * Gets an arbitrary property value.\n     * @member SpeechTranslationConfigImpl.prototype.getProperty\n     * @function\n     * @public\n     * @param {string} name - The name of the property.\n     * @param {string} def - The default value of the property in case it is not set.\n     * @returns {string} The value of the property.\n     */\n    public getProperty(name: string, def?: string): string {\n        return this.privSpeechProperties.getProperty(name, def);\n    }\n\n    /**\n     * Gets/Sets an arbitrary property value.\n     * @member SpeechTranslationConfigImpl.prototype.setProperty\n     * @function\n     * @public\n     * @param {string | PropertyId} name - The name of the property to set.\n     * @param {string} value - The value of the property.\n     */\n    public setProperty(name: string | PropertyId, value: string): void {\n        this.privSpeechProperties.setProperty(name, value);\n    }\n\n    /**\n     * Provides access to custom properties.\n     * @member SpeechTranslationConfigImpl.prototype.properties\n     * @function\n     * @public\n     * @returns {PropertyCollection} The properties.\n     */\n    public get properties(): PropertyCollection {\n        return this.privSpeechProperties;\n    }\n\n    /**\n     * Dispose of associated resources.\n     * @member SpeechTranslationConfigImpl.prototype.close\n     * @function\n     * @public\n     */\n    public close(): void {\n        return;\n    }\n\n    public setServiceProperty(name: string, value: string): void {\n        const currentProperties: IStringDictionary<string> = JSON.parse(this.privSpeechProperties.getProperty(ServicePropertiesPropertyName, \"{}\")) as IStringDictionary<string>;\n\n        currentProperties[name] = value;\n\n        this.privSpeechProperties.setProperty(ServicePropertiesPropertyName, JSON.stringify(currentProperties));\n    }\n\n    public setProfanity(profanity: ProfanityOption): void {\n        this.privSpeechProperties.setProperty(PropertyId.SpeechServiceResponse_ProfanityOption, ProfanityOption[profanity]);\n    }\n\n    public enableAudioLogging(): void {\n        this.privSpeechProperties.setProperty(PropertyId.SpeechServiceConnection_EnableAudioLogging, \"true\");\n    }\n    public requestWordLevelTimestamps(): void {\n        this.privSpeechProperties.setProperty(PropertyId.SpeechServiceResponse_RequestWordLevelTimestamps, \"true\");\n    }\n    public enableDictation(): void {\n        this.privSpeechProperties.setProperty(ForceDictationPropertyName, \"true\");\n    }\n\n    public get speechSynthesisLanguage(): string {\n        return this.privSpeechProperties.getProperty(PropertyId.SpeechServiceConnection_SynthLanguage);\n    }\n\n    public set speechSynthesisLanguage(language: string) {\n        this.privSpeechProperties.setProperty(PropertyId.SpeechServiceConnection_SynthLanguage, language);\n    }\n\n    public get speechSynthesisVoiceName(): string {\n        return this.privSpeechProperties.getProperty(PropertyId.SpeechServiceConnection_SynthVoice);\n    }\n\n    public set speechSynthesisVoiceName(voice: string) {\n        this.privSpeechProperties.setProperty(PropertyId.SpeechServiceConnection_SynthVoice, voice);\n    }\n\n    public get speechSynthesisOutputFormat(): SpeechSynthesisOutputFormat {\n        // eslint-disable-next-line\n        return (SpeechSynthesisOutputFormat as any)[this.privSpeechProperties.getProperty(PropertyId.SpeechServiceConnection_SynthOutputFormat, undefined)];\n    }\n\n    public set speechSynthesisOutputFormat(format: SpeechSynthesisOutputFormat) {\n        this.privSpeechProperties.setProperty(PropertyId.SpeechServiceConnection_SynthOutputFormat, SpeechSynthesisOutputFormat[format]);\n    }\n}\n"]}