expo-speech-recognition 0.3.0 → 0.3.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/build/index.d.ts CHANGED
@@ -1,5 +1,6 @@
1
+ import type { ExpoSpeechRecognitionNativeEventMap } from "./ExpoSpeechRecognitionModule.types";
1
2
  export { ExpoWebSpeechRecognition, ExpoWebSpeechGrammar, ExpoWebSpeechGrammarList, } from "./ExpoWebSpeechRecognition";
2
- export { ExpoSpeechRecognitionModule } from "./ExpoSpeechRecognitionModule";
3
+ export { ExpoSpeechRecognitionModule, ExpoSpeechRecognitionModuleEmitter, } from "./ExpoSpeechRecognitionModule";
3
4
  export { useSpeechRecognitionEvent } from "./useSpeechRecognitionEvent";
4
5
  export { AVAudioSessionCategory, AVAudioSessionCategoryOptions, AVAudioSessionMode, RecognizerIntentExtraLanguageModel, RecognizerIntentEnableLanguageSwitch, AudioEncodingAndroid, TaskHintIOS, } from "./constants";
5
6
  export declare const getSupportedLocales: (options?: {
@@ -33,6 +34,6 @@ export declare const getDefaultRecognitionService: () => {
33
34
  export declare const getAssistantService: () => {
34
35
  packageName: string;
35
36
  };
36
- export declare const addSpeechRecognitionListener: (eventType: string) => void;
37
- export { type ExpoSpeechRecognitionOptions, type AndroidIntentOptions, type ExpoSpeechRecognitionNativeEventMap, type AVAudioSessionCategoryOptionsValue, type AVAudioSessionModeValue, type AVAudioSessionCategoryValue, type AudioEncodingAndroidValue, type AudioSourceOptions, type RecordingOptions, type IOSTaskHintValue, type SetCategoryOptions, type ExpoSpeechRecognitionErrorCode, type ExpoSpeechRecognitionErrorEvent, type ExpoSpeechRecognitionResultEvent, type ExpoSpeechRecognitionResult, type ExpoSpeechRecognitionResultSegment, } from "./ExpoSpeechRecognitionModule.types";
37
+ export declare const addSpeechRecognitionListener: <T extends keyof ExpoSpeechRecognitionNativeEventMap>(eventName: T, listener: (ev: ExpoSpeechRecognitionNativeEventMap[T]) => void) => import("expo-modules-core").Subscription;
38
+ export type { ExpoSpeechRecognitionOptions, AndroidIntentOptions, ExpoSpeechRecognitionNativeEventMap, AVAudioSessionCategoryOptionsValue, AVAudioSessionModeValue, AVAudioSessionCategoryValue, AudioEncodingAndroidValue, AudioSourceOptions, RecordingOptions, IOSTaskHintValue, SetCategoryOptions, ExpoSpeechRecognitionErrorCode, ExpoSpeechRecognitionErrorEvent, ExpoSpeechRecognitionResultEvent, ExpoSpeechRecognitionResult, ExpoSpeechRecognitionResultSegment, } from "./ExpoSpeechRecognitionModule.types";
38
39
  //# sourceMappingURL=index.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAIA,OAAO,EACL,wBAAwB,EACxB,oBAAoB,EACpB,wBAAwB,GACzB,MAAM,4BAA4B,CAAC;AAGpC,OAAO,EAAE,2BAA2B,EAAE,MAAM,+BAA+B,CAAC;AAG5E,OAAO,EAAE,yBAAyB,EAAE,MAAM,6BAA6B,CAAC;AAGxE,OAAO,EACL,sBAAsB,EACtB,6BAA6B,EAC7B,kBAAkB,EAClB,kCAAkC,EAClC,oCAAoC,EACpC,oBAAoB,EACpB,WAAW,GACZ,MAAM,aAAa,CAAC;AAErB,eAAO,MAAM,mBAAmB,aAAc;IAC5C,gCAAgC,CAAC,EAAE,MAAM,CAAC;CAC3C;;;EAAmE,CAAC;AAErE,eAAO,MAAM,4BAA4B,gBACiB,CAAC;AAE3D,eAAO,MAAM,2BAA2B,eACiB,CAAC;AAE1D,eAAO,MAAM,iBAAiB,eAAgD,CAAC;AAE/E,eAAO,MAAM,cAAc,qFAA6C,CAAC;AAEzE,eAAO,MAAM,oCAAoC;;;;CACiB,CAAC;AAEnE,eAAO,MAAM,wBAAwB;;UACiB,CAAC;AAEvD,eAAO,MAAM,kCAAkC;;;;;EACiB,CAAC;AAEjE,eAAO,MAAM,sBAAsB,eACiB,CAAC;AAErD,eAAO,MAAM,4BAA4B;;CACiB,CAAC;AAE3D,eAAO,MAAM,mBAAmB;;CACiB,CAAC;AAElD,eAAO,MAAM,4BAA4B,6BACA,CAAC;AAE1C,OAAO,EACL,KAAK,4BAA4B,EACjC,KAAK,oBAAoB,EACzB,KAAK,mCAAmC,EACxC,KAAK,kCAAkC,EACvC,KAAK,uBAAuB,EAC5B,KAAK,2BAA2B,EAChC,KAAK,yBAAyB,EAC9B,KAAK,kBAAkB,EACvB,KAAK,gBAAgB,EACrB,KAAK,gBAAgB,EACrB,KAAK,kBAAkB,EACvB,KAAK,8BAA8B,EACnC,KAAK,+BAA+B,EACpC,KAAK,gCAAgC,EACrC,KAAK,2BAA2B,EAChC,KAAK,kCAAkC,GACxC,MAAM,qCAAqC,CAAC"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAIA,OAAO,KAAK,EAAE,mCAAmC,EAAE,MAAM,qCAAqC,CAAC;AAG/F,OAAO,EACL,wBAAwB,EACxB,oBAAoB,EACpB,wBAAwB,GACzB,MAAM,4BAA4B,CAAC;AAGpC,OAAO,EACL,2BAA2B,EAC3B,kCAAkC,GACnC,MAAM,+BAA+B,CAAC;AAGvC,OAAO,EAAE,yBAAyB,EAAE,MAAM,6BAA6B,CAAC;AAGxE,OAAO,EACL,sBAAsB,EACtB,6BAA6B,EAC7B,kBAAkB,EAClB,kCAAkC,EAClC,oCAAoC,EACpC,oBAAoB,EACpB,WAAW,GACZ,MAAM,aAAa,CAAC;AAErB,eAAO,MAAM,mBAAmB,aAAc;IAC5C,gCAAgC,CAAC,EAAE,MAAM,CAAC;CAC3C;;;EAAmE,CAAC;AAErE,eAAO,MAAM,4BAA4B,gBACiB,CAAC;AAE3D,eAAO,MAAM,2BAA2B,eACiB,CAAC;AAE1D,eAAO,MAAM,iBAAiB,eAAgD,CAAC;AAE/E,eAAO,MAAM,cAAc,qFAA6C,CAAC;AAEzE,eAAO,MAAM,oCAAoC;;;;CACiB,CAAC;AAEnE,eAAO,MAAM,wBAAwB;;UACiB,CAAC;AAEvD,eAAO,MAAM,kCAAkC;;;;;EACiB,CAAC;AAEjE,eAAO,MAAM,sBAAsB,eACiB,CAAC;AAErD,eAAO,MAAM,4BAA4B;;CACiB,CAAC;AAE3D,eAAO,MAAM,mBAAmB;;CACiB,CAAC;AAElD,eAAO,MAAM,4BAA4B,GACvC,CAAC,SAAS,MAAM,mCAAmC,aAExC,CAAC,YACF,CAAC,EAAE,EAAE,mCAAmC,CAAC,CAAC,CAAC,KAAK,IAAI,6CACQ,CAAC;AAEzE,YAAY,EACV,4BAA4B,EAC5B,oBAAoB,EACpB,mCAAmC,EACnC,kCAAkC,EAClC,uBAAuB,EACvB,2BAA2B,EAC3B,yBAAyB,EACzB,kBAAkB,EAClB,gBAAgB,EAChB,gBAAgB,EAChB,kBAAkB,EAClB,8BAA8B,EAC9B,+BAA+B,EAC/B,gCAAgC,EAChC,2BAA2B,EAC3B,kCAAkC,GACnC,MAAM,qCAAqC,CAAC"}
package/build/index.js CHANGED
@@ -1,8 +1,8 @@
1
- import { ExpoSpeechRecognitionModule } from "./ExpoSpeechRecognitionModule";
1
+ import { ExpoSpeechRecognitionModule, ExpoSpeechRecognitionModuleEmitter, } from "./ExpoSpeechRecognitionModule";
2
2
  // Export the SpeechRecognition APIs
3
3
  export { ExpoWebSpeechRecognition, ExpoWebSpeechGrammar, ExpoWebSpeechGrammarList, } from "./ExpoWebSpeechRecognition";
4
4
  // Native module
5
- export { ExpoSpeechRecognitionModule } from "./ExpoSpeechRecognitionModule";
5
+ export { ExpoSpeechRecognitionModule, ExpoSpeechRecognitionModuleEmitter, } from "./ExpoSpeechRecognitionModule";
6
6
  // Hooks
7
7
  export { useSpeechRecognitionEvent } from "./useSpeechRecognitionEvent";
8
8
  // Constants
@@ -18,5 +18,5 @@ export const androidTriggerOfflineModelDownload = ExpoSpeechRecognitionModule.an
18
18
  export const isRecognitionAvailable = ExpoSpeechRecognitionModule.isRecognitionAvailable;
19
19
  export const getDefaultRecognitionService = ExpoSpeechRecognitionModule.getDefaultRecognitionService;
20
20
  export const getAssistantService = ExpoSpeechRecognitionModule.getAssistantService;
21
- export const addSpeechRecognitionListener = ExpoSpeechRecognitionModule.addListener;
21
+ export const addSpeechRecognitionListener = (eventName, listener) => ExpoSpeechRecognitionModuleEmitter.addListener(eventName, listener);
22
22
  //# sourceMappingURL=index.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,2BAA2B,EAAE,MAAM,+BAA+B,CAAC;AAG5E,oCAAoC;AACpC,OAAO,EACL,wBAAwB,EACxB,oBAAoB,EACpB,wBAAwB,GACzB,MAAM,4BAA4B,CAAC;AAEpC,gBAAgB;AAChB,OAAO,EAAE,2BAA2B,EAAE,MAAM,+BAA+B,CAAC;AAE5E,QAAQ;AACR,OAAO,EAAE,yBAAyB,EAAE,MAAM,6BAA6B,CAAC;AAExE,YAAY;AACZ,OAAO,EACL,sBAAsB,EACtB,6BAA6B,EAC7B,kBAAkB,EAClB,kCAAkC,EAClC,oCAAoC,EACpC,oBAAoB,EACpB,WAAW,GACZ,MAAM,aAAa,CAAC;AAErB,MAAM,CAAC,MAAM,mBAAmB,GAAG,CAAC,OAEnC,EAAE,EAAE,CAAC,2BAA2B,CAAC,mBAAmB,CAAC,OAAO,IAAI,EAAE,CAAC,CAAC;AAErE,MAAM,CAAC,MAAM,4BAA4B,GACvC,2BAA2B,CAAC,4BAA4B,CAAC;AAE3D,MAAM,CAAC,MAAM,2BAA2B,GACtC,2BAA2B,CAAC,2BAA2B,CAAC;AAE1D,MAAM,CAAC,MAAM,iBAAiB,GAAG,2BAA2B,CAAC,iBAAiB,CAAC;AAE/E,MAAM,CAAC,MAAM,cAAc,GAAG,2BAA2B,CAAC,cAAc,CAAC;AAEzE,MAAM,CAAC,MAAM,oCAAoC,GAC/C,2BAA2B,CAAC,oCAAoC,CAAC;AAEnE,MAAM,CAAC,MAAM,wBAAwB,GACnC,2BAA2B,CAAC,wBAAwB,CAAC;AAEvD,MAAM,CAAC,MAAM,kCAAkC,GAC7C,2BAA2B,CAAC,kCAAkC,CAAC;AAEjE,MAAM,CAAC,MAAM,sBAAsB,GACjC,2BAA2B,CAAC,sBAAsB,CAAC;AAErD,MAAM,CAAC,MAAM,4BAA4B,GACvC,2BAA2B,CAAC,4BAA4B,CAAC;AAE3D,MAAM,CAAC,MAAM,mBAAmB,GAC9B,2BAA2B,CAAC,mBAAmB,CAAC;AAElD,MAAM,CAAC,MAAM,4BAA4B,GACvC,2BAA2B,CAAC,WAAW,CAAC","sourcesContent":["import { ExpoSpeechRecognitionModule } from \"./ExpoSpeechRecognitionModule\";\nimport type { ExpoSpeechRecognitionNativeEventMap } from \"./ExpoSpeechRecognitionModule.types\";\n\n// Export the SpeechRecognition APIs\nexport {\n ExpoWebSpeechRecognition,\n ExpoWebSpeechGrammar,\n ExpoWebSpeechGrammarList,\n} from \"./ExpoWebSpeechRecognition\";\n\n// Native module\nexport { ExpoSpeechRecognitionModule } from \"./ExpoSpeechRecognitionModule\";\n\n// Hooks\nexport { useSpeechRecognitionEvent } from \"./useSpeechRecognitionEvent\";\n\n// Constants\nexport {\n AVAudioSessionCategory,\n AVAudioSessionCategoryOptions,\n AVAudioSessionMode,\n RecognizerIntentExtraLanguageModel,\n RecognizerIntentEnableLanguageSwitch,\n AudioEncodingAndroid,\n TaskHintIOS,\n} from \"./constants\";\n\nexport const getSupportedLocales = (options?: {\n androidRecognitionServicePackage?: string;\n}) => ExpoSpeechRecognitionModule.getSupportedLocales(options ?? {});\n\nexport const getSpeechRecognitionServices =\n ExpoSpeechRecognitionModule.getSpeechRecognitionServices;\n\nexport const supportsOnDeviceRecognition =\n ExpoSpeechRecognitionModule.supportsOnDeviceRecognition;\n\nexport const supportsRecording = ExpoSpeechRecognitionModule.supportsRecording;\n\nexport const setCategoryIOS = ExpoSpeechRecognitionModule.setCategoryIOS;\n\nexport const getAudioSessionCategoryAndOptionsIOS =\n ExpoSpeechRecognitionModule.getAudioSessionCategoryAndOptionsIOS;\n\nexport const setAudioSessionActiveIOS =\n ExpoSpeechRecognitionModule.setAudioSessionActiveIOS;\n\nexport const androidTriggerOfflineModelDownload =\n ExpoSpeechRecognitionModule.androidTriggerOfflineModelDownload;\n\nexport const isRecognitionAvailable =\n ExpoSpeechRecognitionModule.isRecognitionAvailable;\n\nexport const getDefaultRecognitionService =\n ExpoSpeechRecognitionModule.getDefaultRecognitionService;\n\nexport const getAssistantService =\n ExpoSpeechRecognitionModule.getAssistantService;\n\nexport const addSpeechRecognitionListener =\n ExpoSpeechRecognitionModule.addListener;\n\nexport {\n type ExpoSpeechRecognitionOptions,\n type AndroidIntentOptions,\n type ExpoSpeechRecognitionNativeEventMap,\n type AVAudioSessionCategoryOptionsValue,\n type AVAudioSessionModeValue,\n type AVAudioSessionCategoryValue,\n type AudioEncodingAndroidValue,\n type AudioSourceOptions,\n type RecordingOptions,\n type IOSTaskHintValue,\n type SetCategoryOptions,\n type ExpoSpeechRecognitionErrorCode,\n type ExpoSpeechRecognitionErrorEvent,\n type ExpoSpeechRecognitionResultEvent,\n type ExpoSpeechRecognitionResult,\n type ExpoSpeechRecognitionResultSegment,\n} from \"./ExpoSpeechRecognitionModule.types\";\n"]}
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,2BAA2B,EAC3B,kCAAkC,GACnC,MAAM,+BAA+B,CAAC;AAGvC,oCAAoC;AACpC,OAAO,EACL,wBAAwB,EACxB,oBAAoB,EACpB,wBAAwB,GACzB,MAAM,4BAA4B,CAAC;AAEpC,gBAAgB;AAChB,OAAO,EACL,2BAA2B,EAC3B,kCAAkC,GACnC,MAAM,+BAA+B,CAAC;AAEvC,QAAQ;AACR,OAAO,EAAE,yBAAyB,EAAE,MAAM,6BAA6B,CAAC;AAExE,YAAY;AACZ,OAAO,EACL,sBAAsB,EACtB,6BAA6B,EAC7B,kBAAkB,EAClB,kCAAkC,EAClC,oCAAoC,EACpC,oBAAoB,EACpB,WAAW,GACZ,MAAM,aAAa,CAAC;AAErB,MAAM,CAAC,MAAM,mBAAmB,GAAG,CAAC,OAEnC,EAAE,EAAE,CAAC,2BAA2B,CAAC,mBAAmB,CAAC,OAAO,IAAI,EAAE,CAAC,CAAC;AAErE,MAAM,CAAC,MAAM,4BAA4B,GACvC,2BAA2B,CAAC,4BAA4B,CAAC;AAE3D,MAAM,CAAC,MAAM,2BAA2B,GACtC,2BAA2B,CAAC,2BAA2B,CAAC;AAE1D,MAAM,CAAC,MAAM,iBAAiB,GAAG,2BAA2B,CAAC,iBAAiB,CAAC;AAE/E,MAAM,CAAC,MAAM,cAAc,GAAG,2BAA2B,CAAC,cAAc,CAAC;AAEzE,MAAM,CAAC,MAAM,oCAAoC,GAC/C,2BAA2B,CAAC,oCAAoC,CAAC;AAEnE,MAAM,CAAC,MAAM,wBAAwB,GACnC,2BAA2B,CAAC,wBAAwB,CAAC;AAEvD,MAAM,CAAC,MAAM,kCAAkC,GAC7C,2BAA2B,CAAC,kCAAkC,CAAC;AAEjE,MAAM,CAAC,MAAM,sBAAsB,GACjC,2BAA2B,CAAC,sBAAsB,CAAC;AAErD,MAAM,CAAC,MAAM,4BAA4B,GACvC,2BAA2B,CAAC,4BAA4B,CAAC;AAE3D,MAAM,CAAC,MAAM,mBAAmB,GAC9B,2BAA2B,CAAC,mBAAmB,CAAC;AAElD,MAAM,CAAC,MAAM,4BAA4B,GAAG,CAG1C,SAAY,EACZ,QAA8D,EAC9D,EAAE,CAAC,kCAAkC,CAAC,WAAW,CAAC,SAAS,EAAE,QAAQ,CAAC,CAAC","sourcesContent":["import {\n ExpoSpeechRecognitionModule,\n ExpoSpeechRecognitionModuleEmitter,\n} from \"./ExpoSpeechRecognitionModule\";\nimport type { ExpoSpeechRecognitionNativeEventMap } from \"./ExpoSpeechRecognitionModule.types\";\n\n// Export the SpeechRecognition APIs\nexport {\n ExpoWebSpeechRecognition,\n ExpoWebSpeechGrammar,\n ExpoWebSpeechGrammarList,\n} from \"./ExpoWebSpeechRecognition\";\n\n// Native module\nexport {\n ExpoSpeechRecognitionModule,\n ExpoSpeechRecognitionModuleEmitter,\n} from \"./ExpoSpeechRecognitionModule\";\n\n// Hooks\nexport { useSpeechRecognitionEvent } from \"./useSpeechRecognitionEvent\";\n\n// Constants\nexport {\n AVAudioSessionCategory,\n AVAudioSessionCategoryOptions,\n AVAudioSessionMode,\n RecognizerIntentExtraLanguageModel,\n RecognizerIntentEnableLanguageSwitch,\n AudioEncodingAndroid,\n TaskHintIOS,\n} from \"./constants\";\n\nexport const getSupportedLocales = (options?: {\n androidRecognitionServicePackage?: string;\n}) => ExpoSpeechRecognitionModule.getSupportedLocales(options ?? {});\n\nexport const getSpeechRecognitionServices =\n ExpoSpeechRecognitionModule.getSpeechRecognitionServices;\n\nexport const supportsOnDeviceRecognition =\n ExpoSpeechRecognitionModule.supportsOnDeviceRecognition;\n\nexport const supportsRecording = ExpoSpeechRecognitionModule.supportsRecording;\n\nexport const setCategoryIOS = ExpoSpeechRecognitionModule.setCategoryIOS;\n\nexport const getAudioSessionCategoryAndOptionsIOS =\n ExpoSpeechRecognitionModule.getAudioSessionCategoryAndOptionsIOS;\n\nexport const setAudioSessionActiveIOS =\n ExpoSpeechRecognitionModule.setAudioSessionActiveIOS;\n\nexport const androidTriggerOfflineModelDownload =\n ExpoSpeechRecognitionModule.androidTriggerOfflineModelDownload;\n\nexport const isRecognitionAvailable =\n ExpoSpeechRecognitionModule.isRecognitionAvailable;\n\nexport const getDefaultRecognitionService =\n ExpoSpeechRecognitionModule.getDefaultRecognitionService;\n\nexport const getAssistantService =\n ExpoSpeechRecognitionModule.getAssistantService;\n\nexport const addSpeechRecognitionListener = <\n T extends keyof ExpoSpeechRecognitionNativeEventMap,\n>(\n eventName: T,\n listener: (ev: ExpoSpeechRecognitionNativeEventMap[T]) => void,\n) => ExpoSpeechRecognitionModuleEmitter.addListener(eventName, listener);\n\nexport type {\n ExpoSpeechRecognitionOptions,\n AndroidIntentOptions,\n ExpoSpeechRecognitionNativeEventMap,\n AVAudioSessionCategoryOptionsValue,\n AVAudioSessionModeValue,\n AVAudioSessionCategoryValue,\n AudioEncodingAndroidValue,\n AudioSourceOptions,\n RecordingOptions,\n IOSTaskHintValue,\n SetCategoryOptions,\n ExpoSpeechRecognitionErrorCode,\n ExpoSpeechRecognitionErrorEvent,\n ExpoSpeechRecognitionResultEvent,\n ExpoSpeechRecognitionResult,\n ExpoSpeechRecognitionResultSegment,\n} from \"./ExpoSpeechRecognitionModule.types\";\n"]}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "expo-speech-recognition",
3
- "version": "0.3.0",
3
+ "version": "0.3.2",
4
4
  "description": "Speech Recognition for React Native Expo projects",
5
5
  "main": "build/index.js",
6
6
  "types": "build/index.d.ts",
package/src/index.ts CHANGED
@@ -1,4 +1,7 @@
1
- import { ExpoSpeechRecognitionModule } from "./ExpoSpeechRecognitionModule";
1
+ import {
2
+ ExpoSpeechRecognitionModule,
3
+ ExpoSpeechRecognitionModuleEmitter,
4
+ } from "./ExpoSpeechRecognitionModule";
2
5
  import type { ExpoSpeechRecognitionNativeEventMap } from "./ExpoSpeechRecognitionModule.types";
3
6
 
4
7
  // Export the SpeechRecognition APIs
@@ -9,7 +12,10 @@ export {
9
12
  } from "./ExpoWebSpeechRecognition";
10
13
 
11
14
  // Native module
12
- export { ExpoSpeechRecognitionModule } from "./ExpoSpeechRecognitionModule";
15
+ export {
16
+ ExpoSpeechRecognitionModule,
17
+ ExpoSpeechRecognitionModuleEmitter,
18
+ } from "./ExpoSpeechRecognitionModule";
13
19
 
14
20
  // Hooks
15
21
  export { useSpeechRecognitionEvent } from "./useSpeechRecognitionEvent";
@@ -57,24 +63,28 @@ export const getDefaultRecognitionService =
57
63
  export const getAssistantService =
58
64
  ExpoSpeechRecognitionModule.getAssistantService;
59
65
 
60
- export const addSpeechRecognitionListener =
61
- ExpoSpeechRecognitionModule.addListener;
62
-
63
- export {
64
- type ExpoSpeechRecognitionOptions,
65
- type AndroidIntentOptions,
66
- type ExpoSpeechRecognitionNativeEventMap,
67
- type AVAudioSessionCategoryOptionsValue,
68
- type AVAudioSessionModeValue,
69
- type AVAudioSessionCategoryValue,
70
- type AudioEncodingAndroidValue,
71
- type AudioSourceOptions,
72
- type RecordingOptions,
73
- type IOSTaskHintValue,
74
- type SetCategoryOptions,
75
- type ExpoSpeechRecognitionErrorCode,
76
- type ExpoSpeechRecognitionErrorEvent,
77
- type ExpoSpeechRecognitionResultEvent,
78
- type ExpoSpeechRecognitionResult,
79
- type ExpoSpeechRecognitionResultSegment,
66
+ export const addSpeechRecognitionListener = <
67
+ T extends keyof ExpoSpeechRecognitionNativeEventMap,
68
+ >(
69
+ eventName: T,
70
+ listener: (ev: ExpoSpeechRecognitionNativeEventMap[T]) => void,
71
+ ) => ExpoSpeechRecognitionModuleEmitter.addListener(eventName, listener);
72
+
73
+ export type {
74
+ ExpoSpeechRecognitionOptions,
75
+ AndroidIntentOptions,
76
+ ExpoSpeechRecognitionNativeEventMap,
77
+ AVAudioSessionCategoryOptionsValue,
78
+ AVAudioSessionModeValue,
79
+ AVAudioSessionCategoryValue,
80
+ AudioEncodingAndroidValue,
81
+ AudioSourceOptions,
82
+ RecordingOptions,
83
+ IOSTaskHintValue,
84
+ SetCategoryOptions,
85
+ ExpoSpeechRecognitionErrorCode,
86
+ ExpoSpeechRecognitionErrorEvent,
87
+ ExpoSpeechRecognitionResultEvent,
88
+ ExpoSpeechRecognitionResult,
89
+ ExpoSpeechRecognitionResultSegment,
80
90
  } from "./ExpoSpeechRecognitionModule.types";