Skip to content

Commit

Permalink
fix(speech-recognition): add missing options
Browse files Browse the repository at this point in the history
fix:  #2165
  • Loading branch information
danielsogl committed Apr 6, 2018
1 parent 707ca8e commit 9aff5ea
Showing 1 changed file with 14 additions and 10 deletions.
24 changes: 14 additions & 10 deletions src/@ionic-native/plugins/speech-recognition/index.ts
Original file line number Diff line number Diff line change
@@ -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 {
/**
Expand Down Expand Up @@ -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;
}

/**
Expand Down Expand Up @@ -101,7 +108,6 @@ export interface SpeechRecognitionListeningOptionsAndroid {
})
@Injectable()
export class SpeechRecognition extends IonicNativePlugin {

/**
* Check feature available
* @return {Promise<boolean>}
Expand All @@ -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;
}
Expand Down Expand Up @@ -160,5 +165,4 @@ export class SpeechRecognition extends IonicNativePlugin {
requestPermission(): Promise<void> {
return;
}

}

0 comments on commit 9aff5ea

Please sign in to comment.