fear(speech-recognition): add missing options

fix:  #2165
This commit is contained in:
Daniel 2018-04-06 23:05:07 +02:00
parent 707ca8ea3c
commit 67cf61d2a8

View File

@ -1,8 +1,10 @@
import { Injectable } from '@angular/core'; 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'; import { Observable } from 'rxjs/Observable';
export type SpeechRecognitionListeningOptions = SpeechRecognitionListeningOptionsIOS | SpeechRecognitionListeningOptionsAndroid; export type SpeechRecognitionListeningOptions =
| SpeechRecognitionListeningOptionsIOS
| SpeechRecognitionListeningOptionsAndroid;
export interface SpeechRecognitionListeningOptionsIOS { export interface SpeechRecognitionListeningOptionsIOS {
/** /**
@ -41,6 +43,11 @@ export interface SpeechRecognitionListeningOptionsAndroid {
* display listener popup window with prompt (default `true`) * display listener popup window with prompt (default `true`)
*/ */
showPopup?: boolean; showPopup?: boolean;
/**
* Allow partial results to be returned (default `false`)
*/
showPartial?: boolean;
} }
/** /**
@ -101,7 +108,6 @@ export interface SpeechRecognitionListeningOptionsAndroid {
}) })
@Injectable() @Injectable()
export class SpeechRecognition extends IonicNativePlugin { export class SpeechRecognition extends IonicNativePlugin {
/** /**
* Check feature available * Check feature available
* @return {Promise<boolean>} * @return {Promise<boolean>}
@ -117,19 +123,18 @@ export class SpeechRecognition extends IonicNativePlugin {
*/ */
@Cordova({ @Cordova({
callbackOrder: 'reverse', callbackOrder: 'reverse',
observable: true, observable: true
}) })
startListening(options?: SpeechRecognitionListeningOptions): Observable<Array<string>> { startListening(
options?: SpeechRecognitionListeningOptions
): Observable<Array<string>> {
return; return;
} }
/** /**
* Stop the recognition process * Stop the recognition process
*/ */
@Cordova({ @Cordova()
platforms: ['iOS']
})
stopListening(): Promise<void> { stopListening(): Promise<void> {
return; return;
} }
@ -160,5 +165,4 @@ export class SpeechRecognition extends IonicNativePlugin {
requestPermission(): Promise<void> { requestPermission(): Promise<void> {
return; return;
} }
} }