import { SpeechRecognition } from '@ionic-native/speech-recognition' ; import { Observable } from 'rxjs/Observable' ; import { Observer } from 'rxjs/Observer' ; export declare type SpeechRecognitionListeningOptions = SpeechRecognitionListeningOptionsIOS | SpeechRecognitionListeningOptionsAndroid ; export interface SpeechRecognitionListeningOptionsIOS { /**
     * used language for recognition (default `"en-US"`)
     */ language ? : string ; /**
     * umber of return matches (default `5`)
     */ matches ? : number ; /**
     * Allow partial results to be returned (default `false`)
     */ showPartial ? : boolean ; } export interface SpeechRecognitionListeningOptionsAndroid { /**
     * used language for recognition (default `"en-US"`)
     */ language ? : string ; /**
     * number of return matches (maximum number of matches)
     */ matches ? : number ; /**
     * displayed prompt of listener popup window
     */ prompt ? : string ; /**
     * display listener popup window with prompt (default `true`)
     */ showPopup ? : boolean ; } export class SpeechRecognitionMock extends SpeechRecognition { return { Promise < boolean > } isRecognitionAvailable ( ) { let response = true ; return new Promise ( ( resolve , reject ) => { resolve ( response ) ; } ) ; } ; return { Promise < Array < string > > } startListening ( options ? ) { let response = [ ] ; return Observable . create ( ( observer ) => { observer . next ( response ) ; observer . complete ( ) ; } ) ; } ; /**
     * Stop the recognition process
     */ stopListening ( ) { return new Promise ( ( resolve , reject ) => { resolve ( ) ; } ) ; } ; return { Promise < Array < string > > } getSupportedLanguages ( ) { let response = [ ] ; return new Promise ( ( resolve , reject ) => { resolve ( response ) ; } ) ; } ; return { Promise < boolean > } hasPermission ( ) { let response = true ; return new Promise ( ( resolve , reject ) => { resolve ( response ) ; } ) ; } ; return { Promise < void > } requestPermission ( ) { return new Promise ( ( resolve , reject ) => { resolve ( ) ; } ) ; } ; }