@capacitor-community/text-to-speech
Advanced tools
Comparing version 4.0.0 to 4.0.1-dev.1d4e158.1717578191
@@ -9,2 +9,25 @@ { | ||
{ | ||
"name": "initialize", | ||
"signature": "(options: InitializeOptions) => Promise<void>", | ||
"parameters": [ | ||
{ | ||
"name": "options", | ||
"docs": "", | ||
"type": "InitializeOptions" | ||
} | ||
], | ||
"returns": "Promise<void>", | ||
"tags": [ | ||
{ | ||
"name": "since", | ||
"text": "4.1.0" | ||
} | ||
], | ||
"docs": "Initializes the TTS engine.\n\nThis method should be called before any other methods.", | ||
"complexTypes": [ | ||
"InitializeOptions" | ||
], | ||
"slug": "initialize" | ||
}, | ||
{ | ||
"name": "speak", | ||
@@ -90,2 +113,32 @@ "signature": "(options: TTSOptions) => Promise<void>", | ||
{ | ||
"name": "InitializeOptions", | ||
"slug": "initializeoptions", | ||
"docs": "", | ||
"tags": [ | ||
{ | ||
"text": "4.1.0", | ||
"name": "since" | ||
} | ||
], | ||
"methods": [], | ||
"properties": [ | ||
{ | ||
"name": "engine", | ||
"tags": [ | ||
{ | ||
"text": "\"com.google.android.tts\"", | ||
"name": "example" | ||
}, | ||
{ | ||
"text": "4.1.0", | ||
"name": "since" | ||
} | ||
], | ||
"docs": "The engine to use for TTS.\n\nOnly available for Android.", | ||
"complexTypes": [], | ||
"type": "string | undefined" | ||
} | ||
] | ||
}, | ||
{ | ||
"name": "TTSOptions", | ||
@@ -92,0 +145,0 @@ "slug": "ttsoptions", |
export interface TextToSpeechPlugin { | ||
/** | ||
* Initializes the TTS engine. | ||
* | ||
* This method should be called before any other methods. | ||
* | ||
* @since 4.1.0 | ||
*/ | ||
initialize(options: InitializeOptions): Promise<void>; | ||
/** | ||
* Starts the TTS engine and plays the desired text. | ||
@@ -37,2 +45,16 @@ */ | ||
} | ||
/** | ||
* @since 4.1.0 | ||
*/ | ||
export interface InitializeOptions { | ||
/** | ||
* The engine to use for TTS. | ||
* | ||
* Only available for Android. | ||
* | ||
* @example "com.google.android.tts" | ||
* @since 4.1.0 | ||
*/ | ||
engine?: string; | ||
} | ||
export interface TTSOptions { | ||
@@ -39,0 +61,0 @@ /** |
@@ -7,2 +7,3 @@ import { WebPlugin } from '@capacitor/core'; | ||
constructor(); | ||
initialize(): Promise<void>; | ||
speak(options: TTSOptions): Promise<void>; | ||
@@ -9,0 +10,0 @@ stop(): Promise<void>; |
@@ -13,2 +13,5 @@ import { WebPlugin } from '@capacitor/core'; | ||
} | ||
async initialize() { | ||
return; | ||
} | ||
async speak(options) { | ||
@@ -15,0 +18,0 @@ if (!this.speechSynthesis) { |
@@ -22,2 +22,5 @@ 'use strict'; | ||
} | ||
async initialize() { | ||
return; | ||
} | ||
async speak(options) { | ||
@@ -24,0 +27,0 @@ if (!this.speechSynthesis) { |
@@ -19,2 +19,5 @@ var capacitorTextToSpeech = (function (exports, core) { | ||
} | ||
async initialize() { | ||
return; | ||
} | ||
async speak(options) { | ||
@@ -21,0 +24,0 @@ if (!this.speechSynthesis) { |
{ | ||
"name": "@capacitor-community/text-to-speech", | ||
"version": "4.0.0", | ||
"version": "4.0.1-dev.1d4e158.1717578191", | ||
"description": "Capacitor plugin for synthesizing speech from text.", | ||
@@ -5,0 +5,0 @@ "main": "dist/plugin.cjs.js", |
@@ -92,2 +92,3 @@ <p align="center"><br><img src="https://user-images.githubusercontent.com/236501/85893648-1c92e880-b7a8-11ea-926d-95355b8175c7.png" width="128" height="128" /></p> | ||
* [`initialize(...)`](#initialize) | ||
* [`speak(...)`](#speak) | ||
@@ -106,2 +107,21 @@ * [`stop()`](#stop) | ||
### initialize(...) | ||
```typescript | ||
initialize(options: InitializeOptions) => Promise<void> | ||
``` | ||
Initializes the TTS engine. | ||
This method should be called before any other methods. | ||
| Param | Type | | ||
| ------------- | --------------------------------------------------------------- | | ||
| **`options`** | <code><a href="#initializeoptions">InitializeOptions</a></code> | | ||
**Since:** 4.1.0 | ||
-------------------- | ||
### speak(...) | ||
@@ -192,2 +212,9 @@ | ||
#### InitializeOptions | ||
| Prop | Type | Description | Since | | ||
| ------------ | ------------------- | ------------------------------------------------------ | ----- | | ||
| **`engine`** | <code>string</code> | The engine to use for TTS. Only available for Android. | 4.1.0 | | ||
#### TTSOptions | ||
@@ -194,0 +221,0 @@ |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
No v1
QualityPackage is not semver >=1. This means it is not stable and does not support ^ ranges.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
85764
789
251
2