UNPKG

1.92 kBJavaScriptView Raw
1"use strict";
2var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
3 var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
4 if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
5 else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
6 return c > 3 && r && Object.defineProperty(target, key, r), r;
7};
8var plugin_1 = require('./plugin');
9/**
10 * @name TextToSpeech
11 * @description
12 * Text to Speech plugin
13 *
14 * @usage
15 * ```
16 * import {TextToSpeech} from 'ionic-native';
17 *
18 * TextToSpeech.speak('Hello World')
19 * .then(() => console.log('Success'))
20 * .catch((reason: any) => console.log(reason));
21 *
22 * ```
23 * @interfaces
24 * TTSOptions
25 */
26var TextToSpeech = (function () {
27 function TextToSpeech() {
28 }
29 /**
30 * This function speaks
31 * @param options {string | TTSOptions} Text to speak or TTSOptions
32 * @return {Promise<any>} Returns a promise that resolves when the speaking finishes
33 */
34 TextToSpeech.speak = function (options) {
35 return;
36 };
37 TextToSpeech.stop = function () {
38 return;
39 };
40 __decorate([
41 plugin_1.Cordova({
42 successIndex: 1,
43 errorIndex: 2
44 })
45 ], TextToSpeech, "speak", null);
46 TextToSpeech = __decorate([
47 plugin_1.Plugin({
48 pluginName: 'TextToSpeech',
49 plugin: 'cordova-plugin-tts',
50 pluginRef: 'TTS',
51 repo: 'https://github.com/vilic/cordova-plugin-tts'
52 })
53 ], TextToSpeech);
54 return TextToSpeech;
55}());
56exports.TextToSpeech = TextToSpeech;
57//# sourceMappingURL=text-to-speech.js.map
\No newline at end of file