@voice-ping/cognitive-services-speech
Version:
VoicePing Cognitive Services Speech SDK for JavaScript forked from Microsoft
1 lines • 3.25 kB
Source Map (JSON)
{"version":3,"sources":["src/sdk/VoiceProfileResult.ts"],"names":[],"mappings":"AAKA,OAAO,EACH,uBAAuB,EAGvB,kBAAkB,EAClB,YAAY,EACf,MAAM,WAAW,CAAC;AAEnB;;;GAGG;AACH,qBAAa,kBAAkB;IAC3B,OAAO,CAAC,UAAU,CAAe;IACjC,OAAO,CAAC,cAAc,CAAqB;IAC3C,OAAO,CAAC,gBAAgB,CAAS;gBAEd,MAAM,EAAE,YAAY,EAAE,UAAU,EAAE,MAAM;IAU3D,IAAW,MAAM,IAAI,YAAY,CAEhC;IAED,IAAW,UAAU,IAAI,kBAAkB,CAE1C;IAED,IAAW,YAAY,IAAI,MAAM,CAEhC;CACJ;AAED;;GAEG;AAEH,qBAAa,+BAAgC,SAAQ,uBAAuB;IAExE,OAAO;IAIP;;;;;;;OAOG;WACW,UAAU,CAAC,MAAM,EAAE,kBAAkB,GAAG,+BAA+B;CAUxF","file":"VoiceProfileResult.d.ts","sourcesContent":["// Copyright (c) Microsoft Corporation. All rights reserved.\n// Licensed under the MIT license.\n\nimport { CancellationErrorCodePropertyName } from \"../common.speech/Exports\";\nimport { Contracts } from \"./Contracts\";\nimport {\n CancellationDetailsBase,\n CancellationErrorCode,\n CancellationReason,\n PropertyCollection,\n ResultReason,\n} from \"./Exports\";\n\n/**\n * Output format\n * @class VoiceProfileResult\n */\nexport class VoiceProfileResult {\n private privReason: ResultReason;\n private privProperties: PropertyCollection;\n private privErrorDetails: string;\n\n public constructor(reason: ResultReason, statusText: string) {\n this.privReason = reason;\n this.privProperties = new PropertyCollection();\n if (reason === ResultReason.Canceled) {\n Contracts.throwIfNullOrUndefined(statusText, \"statusText\");\n this.privErrorDetails = statusText;\n this.privProperties.setProperty(CancellationErrorCodePropertyName, CancellationErrorCode[CancellationErrorCode.ServiceError]);\n }\n }\n\n public get reason(): ResultReason {\n return this.privReason;\n }\n\n public get properties(): PropertyCollection {\n return this.privProperties;\n }\n\n public get errorDetails(): string {\n return this.privErrorDetails;\n }\n}\n\n/**\n * @class VoiceProfileCancellationDetails\n */\n// tslint:disable-next-line:max-classes-per-file\nexport class VoiceProfileCancellationDetails extends CancellationDetailsBase {\n\n private constructor(reason: CancellationReason, errorDetails: string, errorCode: CancellationErrorCode) {\n super(reason, errorDetails, errorCode);\n }\n\n /**\n * Creates an instance of VoiceProfileCancellationDetails object for the canceled VoiceProfileResult.\n * @member VoiceProfileCancellationDetails.fromResult\n * @function\n * @public\n * @param {VoiceProfileResult} result - The result that was canceled.\n * @returns {VoiceProfileCancellationDetails} The cancellation details object being created.\n */\n public static fromResult(result: VoiceProfileResult): VoiceProfileCancellationDetails {\n const reason = CancellationReason.Error;\n let errorCode: CancellationErrorCode = CancellationErrorCode.NoError;\n\n if (!!result.properties) {\n errorCode = (CancellationErrorCode as any)[result.properties.getProperty(CancellationErrorCodePropertyName, CancellationErrorCode[CancellationErrorCode.NoError])];\n }\n\n return new VoiceProfileCancellationDetails(reason, result.errorDetails, errorCode);\n }\n}\n"]}