mirror of
https://github.com/danielsogl/awesome-cordova-plugins.git
synced 2025-01-19 08:32:52 +08:00
parent
707ca8ea3c
commit
9aff5eaa13
@ -1,8 +1,10 @@
|
||||
import { Injectable } from '@angular/core';
|
||||
import { Plugin, Cordova, IonicNativePlugin } from '@ionic-native/core';
|
||||
import { Cordova, IonicNativePlugin, Plugin } from '@ionic-native/core';
|
||||
import { Observable } from 'rxjs/Observable';
|
||||
|
||||
export type SpeechRecognitionListeningOptions = SpeechRecognitionListeningOptionsIOS | SpeechRecognitionListeningOptionsAndroid;
|
||||
export type SpeechRecognitionListeningOptions =
|
||||
| SpeechRecognitionListeningOptionsIOS
|
||||
| SpeechRecognitionListeningOptionsAndroid;
|
||||
|
||||
export interface SpeechRecognitionListeningOptionsIOS {
|
||||
/**
|
||||
@ -41,6 +43,11 @@ export interface SpeechRecognitionListeningOptionsAndroid {
|
||||
* display listener popup window with prompt (default `true`)
|
||||
*/
|
||||
showPopup?: boolean;
|
||||
|
||||
/**
|
||||
* Allow partial results to be returned (default `false`)
|
||||
*/
|
||||
showPartial?: boolean;
|
||||
}
|
||||
|
||||
/**
|
||||
@ -101,7 +108,6 @@ export interface SpeechRecognitionListeningOptionsAndroid {
|
||||
})
|
||||
@Injectable()
|
||||
export class SpeechRecognition extends IonicNativePlugin {
|
||||
|
||||
/**
|
||||
* Check feature available
|
||||
* @return {Promise<boolean>}
|
||||
@ -117,19 +123,18 @@ export class SpeechRecognition extends IonicNativePlugin {
|
||||
*/
|
||||
@Cordova({
|
||||
callbackOrder: 'reverse',
|
||||
observable: true,
|
||||
|
||||
observable: true
|
||||
})
|
||||
startListening(options?: SpeechRecognitionListeningOptions): Observable<Array<string>> {
|
||||
startListening(
|
||||
options?: SpeechRecognitionListeningOptions
|
||||
): Observable<Array<string>> {
|
||||
return;
|
||||
}
|
||||
|
||||
/**
|
||||
* Stop the recognition process
|
||||
*/
|
||||
@Cordova({
|
||||
platforms: ['iOS']
|
||||
})
|
||||
@Cordova()
|
||||
stopListening(): Promise<void> {
|
||||
return;
|
||||
}
|
||||
@ -160,5 +165,4 @@ export class SpeechRecognition extends IonicNativePlugin {
|
||||
requestPermission(): Promise<void> {
|
||||
return;
|
||||
}
|
||||
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user