Commit 45085a80 authored by Martin Alvarez-Espinar's avatar Martin Alvarez-Espinar
Browse files

Distribution generated

parent a7fc07f5
Pipeline #18393 failed with stage
in 1 minute and 35 seconds
This image diff could not be displayed because it is too large. You can view the blob instead.
(window.webpackJsonp=window.webpackJsonp||[]).push([[103],{545:function(t,a,s){"use strict";s.r(a);var e=s(31),n=Object(e.a)({},(function(){var t=this,a=t.$createElement,s=t._self._c||a;return s("ContentSlotsDistributor",{attrs:{"slot-key":t.$parent.slotKey}},[s("h1",{attrs:{id:"sharing"}},[s("a",{staticClass:"header-anchor",attrs:{href:"#sharing"}},[t._v("#")]),t._v(" Sharing")]),t._v(" "),s("p",[s("strong",[t._v("Data sharing with other apps")]),t._v(".")]),t._v(" "),s("h2",{attrs:{id:"manifest-declaration"}},[s("a",{staticClass:"header-anchor",attrs:{href:"#manifest-declaration"}},[t._v("#")]),t._v(" Manifest Declaration")]),t._v(" "),s("p",[t._v("You need to declare the use of this API in the "),s("RouterLink",{attrs:{to:"/guide/manifest.html#features"}},[t._v("manifest's "),s("code",[t._v("features")])]),t._v(" member:")],1),t._v(" "),s("div",{staticClass:"language-json extra-class"},[s("pre",{pre:!0,attrs:{class:"language-json"}},[s("code",[s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),s("span",{pre:!0,attrs:{class:"token property"}},[t._v('"name"')]),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token string"}},[t._v('"system.share"')]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),t._v("\n")])])]),s("h2",{attrs:{id:"module-import"}},[s("a",{staticClass:"header-anchor",attrs:{href:"#module-import"}},[t._v("#")]),t._v(" Module Import")]),t._v(" "),s("p",[t._v("Before using this service in a component, you need to "),s("RouterLink",{attrs:{to:"/guide/scripting.html#import-and-export-modules"}},[t._v("import the module")]),t._v(" in the script section of the "),s("a",{attrs:{href:"../guide/ux-documents"}},[t._v("UX document")]),t._v(".")],1),t._v(" "),s("div",{staticClass:"language-js extra-class"},[s("pre",{pre:!0,attrs:{class:"language-js"}},[s("code",[s("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("import")]),t._v(" share "),s("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("from")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token string"}},[t._v("'@system.share'")]),t._v(" \n")])])]),s("p",[t._v("Or")]),t._v(" "),s("div",{staticClass:"language-js extra-class"},[s("pre",{pre:!0,attrs:{class:"language-js"}},[s("code",[s("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("let")]),t._v(" share "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token function"}},[t._v("require")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),s("span",{pre:!0,attrs:{class:"token string"}},[t._v('"@system.share"')]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),t._v("\n")])])]),s("h2",{attrs:{id:"methods"}},[s("a",{staticClass:"header-anchor",attrs:{href:"#methods"}},[t._v("#")]),t._v(" Methods")]),t._v(" "),s("p",[t._v("This service has the following method:")]),t._v(" "),s("ul",[s("li",[s("a",{attrs:{href:"#share-type-data-success-fail-cancel-complete"}},[s("code",[t._v("share({type,data,success,fail,cancel,complete})")])])])]),t._v(" "),s("h3",{attrs:{id:"share-type-data-success-fail-cancel-complete"}},[s("a",{staticClass:"header-anchor",attrs:{href:"#share-type-data-success-fail-cancel-complete"}},[t._v("#")]),t._v(" "),s("code",[t._v("share({type,data,success,fail,cancel,complete})")])]),t._v(" "),s("p",[s("strong",[t._v("This method enables the app to share data with other apps.")]),t._v(".")]),t._v(" "),s("h4",{attrs:{id:"arguments"}},[s("a",{staticClass:"header-anchor",attrs:{href:"#arguments"}},[t._v("#")]),t._v(" Arguments")]),t._v(" "),s("p",[t._v("This method requires an "),s("code",[t._v("object")]),t._v(" with the following attributes:")]),t._v(" "),s("ul",[s("li",[s("code",[t._v("type")]),t._v(" ("),s("code",[t._v("string")]),t._v("). Mandatory "),s("code",[t._v("string")]),t._v(" with the MIME type of the data to share (lowercase).")]),t._v(" "),s("li",[s("code",[t._v("data")]),t._v(" ("),s("code",[t._v("string")]),t._v("). Mandatory "),s("code",[t._v("string")]),t._v(" with the data to share. The value can be of different types:\n"),s("ul",[s("li",[t._v("If the value of "),s("code",[t._v("type")]),t._v(" is a MIME type starting by "),s("code",[t._v("text/")]),t._v(" (e.g.,, "),s("code",[t._v("text/plain")]),t._v("), "),s("code",[t._v("data")]),t._v(" contains the textual content to share.")]),t._v(" "),s("li",[t._v("Otherwise, "),s("code",[t._v("data")]),t._v(" must contain the path of the file to be shared. The following file paths are supported:\n"),s("ul",[s("li",[t._v("Path of the file downloaded through "),s("RouterLink",{attrs:{to:"/services/fetch.html#fetch"}},[s("code",[t._v("fetch.fetch()")])]),t._v(";")],1),t._v(" "),s("li",[t._v("File path obtained through "),s("RouterLink",{attrs:{to:"/services/file-storage.html#save"}},[s("code",[t._v("file.save()")])]),t._v(" or "),s("RouterLink",{attrs:{to:"/services/file-storage.html#list"}},[s("code",[t._v("file.list()")])])],1),t._v(" "),s("li",[t._v("In-app resource file path starting with a slash character ("),s("code",[t._v("/")]),t._v(").")])])])])]),t._v(" "),s("li",[s("code",[t._v("success")]),t._v("\t("),s("code",[t._v("function")]),t._v("). Optional callback function corresponding to the successful execution.")]),t._v(" "),s("li",[s("code",[t._v("fail")]),t._v(" ("),s("code",[t._v("function")]),t._v("). Optional callback function corresponding to the failed execution.")]),t._v(" "),s("li",[s("code",[t._v("cancel")]),t._v(" ("),s("code",[t._v("function")]),t._v("). Optional callback function corresponding to the cancellation of the execution.")]),t._v(" "),s("li",[s("code",[t._v("complete")]),t._v(" ("),s("code",[t._v("function")]),t._v("). Optional callback function corresponding to the end of the execution.")])]),t._v(" "),s("p",[t._v("Example:")]),t._v(" "),s("div",{staticClass:"language-js extra-class"},[s("pre",{pre:!0,attrs:{class:"language-js"}},[s("code",[t._v("share"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),s("span",{pre:!0,attrs:{class:"token function"}},[t._v("share")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v(" \n type"),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token string"}},[t._v('"text/html"')]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" \n data"),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token string"}},[t._v('"<b>bold</b>"')]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" \n "),s("span",{pre:!0,attrs:{class:"token function-variable function"}},[t._v("success")]),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("function")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),s("span",{pre:!0,attrs:{class:"token parameter"}},[t._v("data")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v(" console"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),s("span",{pre:!0,attrs:{class:"token function"}},[t._v("log")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),s("span",{pre:!0,attrs:{class:"token string"}},[t._v('"handling success"')]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" \n "),s("span",{pre:!0,attrs:{class:"token function-variable function"}},[t._v("fail")]),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("function")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),s("span",{pre:!0,attrs:{class:"token parameter"}},[t._v("data"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" code")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v(" \n console"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),s("span",{pre:!0,attrs:{class:"token function"}},[t._v("log")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),s("span",{pre:!0,attrs:{class:"token string"}},[t._v('"handling fail, code="')]),t._v(" "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("+")]),t._v(" code"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v(" \n "),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),t._v(" \n"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n")])])])])}),[],!1,null,null,null);a.default=n.exports}}]);
\ No newline at end of file
(window.webpackJsonp=window.webpackJsonp||[]).push([[104],{546:function(t,s,a){"use strict";a.r(s);var e=a(31),n=Object(e.a)({},(function(){var t=this,s=t.$createElement,a=t._self._c||s;return a("ContentSlotsDistributor",{attrs:{"slot-key":t.$parent.slotKey}},[a("h1",{attrs:{id:"sms-messages"}},[a("a",{staticClass:"header-anchor",attrs:{href:"#sms-messages"}},[t._v("#")]),t._v(" SMS Messages")]),t._v(" "),a("p",[a("strong",[t._v("SMS (texts) distribution.")])]),t._v(" "),a("h2",{attrs:{id:"manifest-declaration"}},[a("a",{staticClass:"header-anchor",attrs:{href:"#manifest-declaration"}},[t._v("#")]),t._v(" Manifest Declaration")]),t._v(" "),a("p",[t._v("You need to declare the use of this API in the "),a("RouterLink",{attrs:{to:"/guide/manifest.html#features"}},[t._v("manifest's "),a("code",[t._v("features")])]),t._v(" member:")],1),t._v(" "),a("div",{staticClass:"language-json extra-class"},[a("pre",{pre:!0,attrs:{class:"language-json"}},[a("code",[a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"name"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('"system.sms"')]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),t._v("\n")])])]),a("h2",{attrs:{id:"module-import"}},[a("a",{staticClass:"header-anchor",attrs:{href:"#module-import"}},[t._v("#")]),t._v(" Module Import")]),t._v(" "),a("p",[t._v("Before using this service in a component, you need to "),a("RouterLink",{attrs:{to:"/guide/scripting.html#import-and-export-modules"}},[t._v("import the module")]),t._v(" in the script section of the "),a("a",{attrs:{href:"../guide/ux-documents"}},[t._v("UX document")]),t._v(".")],1),t._v(" "),a("div",{staticClass:"language-js extra-class"},[a("pre",{pre:!0,attrs:{class:"language-js"}},[a("code",[a("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("import")]),t._v(" sms "),a("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("from")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token string"}},[t._v("'@system.sms'")]),t._v(" \n")])])]),a("p",[t._v("Or")]),t._v(" "),a("div",{staticClass:"language-js extra-class"},[a("pre",{pre:!0,attrs:{class:"language-js"}},[a("code",[a("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("let")]),t._v(" sms "),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token function"}},[t._v("require")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('"@system.sms"')]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),t._v("\n")])])]),a("h2",{attrs:{id:"methods"}},[a("a",{staticClass:"header-anchor",attrs:{href:"#methods"}},[t._v("#")]),t._v(" Methods")]),t._v(" "),a("p",[t._v("This service has the following method:")]),t._v(" "),a("ul",[a("li",[a("a",{attrs:{href:"#send-address-content-success-fail-complete"}},[a("code",[t._v("send({address,content,success,fail,complete})")])])])]),t._v(" "),a("h3",{attrs:{id:"send-address-content-success-fail-complete"}},[a("a",{staticClass:"header-anchor",attrs:{href:"#send-address-content-success-fail-complete"}},[t._v("#")]),t._v(" "),a("code",[t._v("send({address,content,success,fail,complete})")])]),t._v(" "),a("p",[a("strong",[t._v("Sends SMS messages")]),t._v(".")]),t._v(" "),a("p",[t._v("Every time this method is called, the system will show a confirmation prompt. SMS messages contains up to 70 characters.")]),t._v(" "),a("h4",{attrs:{id:"arguments"}},[a("a",{staticClass:"header-anchor",attrs:{href:"#arguments"}},[t._v("#")]),t._v(" Arguments")]),t._v(" "),a("p",[t._v("This method requires an "),a("code",[t._v("object")]),t._v(" with the following attributes:")]),t._v(" "),a("ul",[a("li",[a("code",[t._v("address")]),t._v(" ("),a("code",[t._v("string")]),t._v("). Mandatory attribute with the destination phone number to which the SMS message will be sent. (The value may start with a plus character ("),a("code",[t._v("+")]),t._v(") and may contain numeric characters and spaces.)")]),t._v(" "),a("li",[a("code",[t._v("success")]),t._v("\t("),a("code",[t._v("function()")]),t._v("). Optional callback function for success.")]),t._v(" "),a("li",[a("code",[t._v("fail")]),t._v(" ("),a("code",[t._v("function(data, code)")]),t._v("). Optional callback function for failure. Some of the codes that can be produced:\n"),a("ul",[a("li",[a("code",[t._v("200")]),t._v(": Sending failed.")]),t._v(" "),a("li",[a("code",[t._v("201")]),t._v(": The user has rejected the request of sending an SMS message.")]),t._v(" "),a("li",[a("code",[t._v("202")]),t._v(": The parameter is empty or invalid.")])])]),t._v(" "),a("li",[a("code",[t._v("complete")]),t._v(" ("),a("code",[t._v("function()")]),t._v("). Optional callback function for completion.")])]),t._v(" "),a("p",[t._v("Example:")]),t._v(" "),a("div",{staticClass:"language-js extra-class"},[a("pre",{pre:!0,attrs:{class:"language-js"}},[a("code",[t._v("message"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),a("span",{pre:!0,attrs:{class:"token function"}},[t._v("send")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v(" \n address"),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),a("span",{pre:!0,attrs:{class:"token string"}},[t._v("'198900086'")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" \n content"),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),a("span",{pre:!0,attrs:{class:"token string"}},[t._v("'This is the SMS message content.'")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" \n "),a("span",{pre:!0,attrs:{class:"token function-variable function"}},[t._v("success")]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("function")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v(" \n console"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),a("span",{pre:!0,attrs:{class:"token function"}},[t._v("log")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),a("span",{pre:!0,attrs:{class:"token string"}},[t._v("'handling success'")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),t._v(" \n "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" \n "),a("span",{pre:!0,attrs:{class:"token function-variable function"}},[t._v("fail")]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("function")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),a("span",{pre:!0,attrs:{class:"token parameter"}},[t._v("data"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" code")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v(" \n console"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),a("span",{pre:!0,attrs:{class:"token function"}},[t._v("log")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),a("span",{pre:!0,attrs:{class:"token template-string"}},[a("span",{pre:!0,attrs:{class:"token template-punctuation string"}},[t._v("`")]),a("span",{pre:!0,attrs:{class:"token string"}},[t._v("handling fail, code = ")]),a("span",{pre:!0,attrs:{class:"token interpolation"}},[a("span",{pre:!0,attrs:{class:"token interpolation-punctuation punctuation"}},[t._v("${")]),t._v("code"),a("span",{pre:!0,attrs:{class:"token interpolation-punctuation punctuation"}},[t._v("}")])]),a("span",{pre:!0,attrs:{class:"token template-punctuation string"}},[t._v("`")])]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),t._v(" \n "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),t._v(" \n"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),t._v("\n")])])])])}),[],!1,null,null,null);s.default=n.exports}}]);
\ No newline at end of file
(window.webpackJsonp=window.webpackJsonp||[]).push([[105],{547:function(t,e,s){"use strict";s.r(e);var a=s(31),n=Object(a.a)({},(function(){var t=this,e=t.$createElement,s=t._self._c||e;return s("ContentSlotsDistributor",{attrs:{"slot-key":t.$parent.slotKey}},[s("h1",{attrs:{id:"text-to-speech-tts"}},[s("a",{staticClass:"header-anchor",attrs:{href:"#text-to-speech-tts"}},[t._v("#")]),t._v(" Text to Speech (TTS)")]),t._v(" "),s("p",[s("strong",[t._v("Text to speech (TTS) functions.")])]),t._v(" "),s("h2",{attrs:{id:"manifest-declaration"}},[s("a",{staticClass:"header-anchor",attrs:{href:"#manifest-declaration"}},[t._v("#")]),t._v(" Manifest Declaration")]),t._v(" "),s("p",[t._v("You need to declare the use of this API in the "),s("RouterLink",{attrs:{to:"/guide/manifest.html#features"}},[t._v("manifest's "),s("code",[t._v("features")])]),t._v(" member:")],1),t._v(" "),s("div",{staticClass:"language-json extra-class"},[s("pre",{pre:!0,attrs:{class:"language-json"}},[s("code",[s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),s("span",{pre:!0,attrs:{class:"token property"}},[t._v('"name"')]),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token string"}},[t._v('"system.tts"')]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),t._v("\n")])])]),s("h2",{attrs:{id:"module-import"}},[s("a",{staticClass:"header-anchor",attrs:{href:"#module-import"}},[t._v("#")]),t._v(" Module Import")]),t._v(" "),s("p",[t._v("Before using this service in a component, you need to "),s("RouterLink",{attrs:{to:"/guide/scripting.html#import-and-export-modules"}},[t._v("import the module")]),t._v(" in the script section of the "),s("a",{attrs:{href:"../guide/ux-documents"}},[t._v("UX document")]),t._v(".")],1),t._v(" "),s("div",{staticClass:"language-js extra-class"},[s("pre",{pre:!0,attrs:{class:"language-js"}},[s("code",[s("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("import")]),t._v(" tts "),s("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("from")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token string"}},[t._v("'@system.tts'")]),t._v(" \n")])])]),s("p",[t._v("Or")]),t._v(" "),s("div",{staticClass:"language-js extra-class"},[s("pre",{pre:!0,attrs:{class:"language-js"}},[s("code",[s("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("let")]),t._v(" tts "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token function"}},[t._v("require")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),s("span",{pre:!0,attrs:{class:"token string"}},[t._v('"@system.tts"')]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),t._v("\n")])])]),s("h2",{attrs:{id:"methods"}},[s("a",{staticClass:"header-anchor",attrs:{href:"#methods"}},[t._v("#")]),t._v(" Methods")]),t._v(" "),s("p",[t._v("This service has the following method:")]),t._v(" "),s("ul",[s("li",[s("a",{attrs:{href:"#speak-text-queuemode-volume-success-fail-complete"}},[s("code",[t._v("speak({text,queueMode,volume,success,fail,complete})")])])])]),t._v(" "),s("h3",{attrs:{id:"speak-text-queuemode-volume-success-fail-complete"}},[s("a",{staticClass:"header-anchor",attrs:{href:"#speak-text-queuemode-volume-success-fail-complete"}},[t._v("#")]),t._v(" "),s("code",[t._v("speak({text,queueMode,volume,success,fail,complete})")])]),t._v(" "),s("p",[s("strong",[t._v("This method speaks the specified text")]),t._v(".")]),t._v(" "),s("h4",{attrs:{id:"arguments"}},[s("a",{staticClass:"header-anchor",attrs:{href:"#arguments"}},[t._v("#")]),t._v(" Arguments")]),t._v(" "),s("p",[t._v("This method requires an "),s("code",[t._v("object")]),t._v(" with the following attributes:")]),t._v(" "),s("ul",[s("li",[s("code",[t._v("text")]),t._v(" ("),s("code",[t._v("string")]),t._v("). Mandatory attribute with the content to be spoken.")]),t._v(" "),s("li",[s("code",[t._v("queueMode")]),t._v(" ("),s("code",[t._v("number")]),t._v("). Optional attribute with the mode of the queue ("),s("code",[t._v("1")]),t._v(" for add to the queue and "),s("code",[t._v("0")]),t._v(" to flush the queue). The default value is "),s("code",[t._v("1")]),t._v(" (add).")]),t._v(" "),s("li",[s("code",[t._v("volume")]),t._v(" ("),s("code",[t._v("number")]),t._v("). Optional attribute with the audio volume from "),s("code",[t._v("0.0")]),t._v(" (silence) to "),s("code",[t._v("1.0")]),t._v(" (highest). By default the system volume will be used.")]),t._v(" "),s("li",[s("code",[t._v("success")]),t._v("\t("),s("code",[t._v("function(res)")]),t._v("). Optional callback function for success.")]),t._v(" "),s("li",[s("code",[t._v("fail")]),t._v(" ("),s("code",[t._v("function(code)")]),t._v("). Optional callback function for failure, with the potential codes:\n"),s("ul",[s("li",[s("code",[t._v("200")]),t._v(" General error.")]),t._v(" "),s("li",[s("code",[t._v("202")]),t._v("\tInvalid parameter.")]),t._v(" "),s("li",[s("code",[t._v("1001")]),t._v("\tNetwork connection error.")]),t._v(" "),s("li",[s("code",[t._v("1002")]),t._v("\tNetwork connection timed out.")]),t._v(" "),s("li",[s("code",[t._v("1003")]),t._v("\tVoice data download is not completed.")]),t._v(" "),s("li",[s("code",[t._v("1004")]),t._v("\tFailed to play the audio on an audio device.")]),t._v(" "),s("li",[s("code",[t._v("1005")]),t._v("\tThe TTS service failed.")]),t._v(" "),s("li",[s("code",[t._v("1006")]),t._v("\tText to speech failed.")])])]),t._v(" "),s("li",[s("code",[t._v("complete")]),t._v(" ("),s("code",[t._v("function()")]),t._v("). Optional callback function for completion.")])]),t._v(" "),s("p",[t._v("Example:")]),t._v(" "),s("div",{staticClass:"language-js extra-class"},[s("pre",{pre:!0,attrs:{class:"language-js"}},[s("code",[t._v("tts"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),s("span",{pre:!0,attrs:{class:"token function"}},[t._v("speak")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v(" \n text"),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token string"}},[t._v("'Testing, testing'")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" \n volume"),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token number"}},[t._v("1")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" \n queueMode"),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token number"}},[t._v("0")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" \n "),s("span",{pre:!0,attrs:{class:"token function-variable function"}},[t._v("success")]),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("function")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),s("span",{pre:!0,attrs:{class:"token parameter"}},[t._v("data")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v(" \n console"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),s("span",{pre:!0,attrs:{class:"token function"}},[t._v("log")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),s("span",{pre:!0,attrs:{class:"token string"}},[t._v('"handling success"')]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v(" \n "),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" \n "),s("span",{pre:!0,attrs:{class:"token function-variable function"}},[t._v("fail")]),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("function")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),s("span",{pre:!0,attrs:{class:"token parameter"}},[t._v("data"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" code")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v(" \n console"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),s("span",{pre:!0,attrs:{class:"token function"}},[t._v("log")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),s("span",{pre:!0,attrs:{class:"token string"}},[t._v('"handling fail, code="')]),t._v(" "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("+")]),t._v(" code"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v(" \n "),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),t._v(" \n"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),t._v("\n")])])])])}),[],!1,null,null,null);e.default=n.exports}}]);
\ No newline at end of file
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment