Created
June 2, 2019 03:40
-
-
Save rpf5573/ac7c5e8e68fa556d729ed0897a30d6c7 to your computer and use it in GitHub Desktop.
react-native-voice type definition file
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
declare module "react-native-voice" { | |
type Locale = 'en-US' | 'ko-KR' | 'ja-JP' | 'zh-CN' | 'zh_HK' | 'zh' | |
type Option = { | |
EXTRA_LANGUAGE_MODEL: string, | |
EXTRA_MAX_RESULTS: number, | |
EXTRA_PARTIAL_RESULTS: boolean, | |
REQUEST_PERMISSIONS_AUTO: boolean | |
} | |
type StartEvent = { | |
error: boolean | |
} | |
type RecognizedEvent = { | |
error: boolean | |
} | |
type EndEvent = { | |
error: boolean | |
} | |
type ErrorEvent = { | |
error: string | |
} | |
type Results = { | |
value: [string] | |
} | |
type PartialResults = { | |
value: [string] | |
} | |
function removeAllListeners(): void | |
function destroy(): Promise<{}> | |
function start(local: Locale, options?: Option): Promise<{}> | |
function stop(): Promise<{}> | |
function cancel(): Promise<{}> | |
function isAvailable(): Promise<{}> | |
function isRecognizing(): Promise<{}> | |
function onSpeechStart(e: StartEvent): void | |
function onSpeechRecognized(e: RecognizedEvent): void | |
function onSpeechEnd(e: EndEvent): void | |
function onSpeechError(e: ErrorEvent): void | |
function onSpeechResults(e: Results): void | |
function onSpeechPartialResults(e: PartialResults): void | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment