expo-speech-recognition 0.3.1 → 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 +2 -1
- package/build/index.d.ts.map +1 -1
- package/build/index.js +2 -2
- package/build/index.js.map +1 -1
- package/package.json +1 -1
- package/src/index.ts +11 -3
package/build/index.d.ts
CHANGED
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import type { ExpoSpeechRecognitionNativeEventMap } from "./ExpoSpeechRecognitionModule.types";
|
|
1
2
|
export { ExpoWebSpeechRecognition, ExpoWebSpeechGrammar, ExpoWebSpeechGrammarList, } from "./ExpoWebSpeechRecognition";
|
|
2
3
|
export { ExpoSpeechRecognitionModule, ExpoSpeechRecognitionModuleEmitter, } from "./ExpoSpeechRecognitionModule";
|
|
3
4
|
export { useSpeechRecognitionEvent } from "./useSpeechRecognitionEvent";
|
|
@@ -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: (
|
|
37
|
+
export declare const addSpeechRecognitionListener: <T extends keyof ExpoSpeechRecognitionNativeEventMap>(eventName: T, listener: (ev: ExpoSpeechRecognitionNativeEventMap[T]) => void) => import("expo-modules-core").Subscription;
|
|
37
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
|
package/build/index.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"
|
|
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,4 +1,4 @@
|
|
|
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
|
|
@@ -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 =
|
|
21
|
+
export const addSpeechRecognitionListener = (eventName, listener) => ExpoSpeechRecognitionModuleEmitter.addListener(eventName, listener);
|
|
22
22
|
//# sourceMappingURL=index.js.map
|
package/build/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,2BAA2B,EAC3B,kCAAkC,GACn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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
package/src/index.ts
CHANGED
|
@@ -1,4 +1,8 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import {
|
|
2
|
+
ExpoSpeechRecognitionModule,
|
|
3
|
+
ExpoSpeechRecognitionModuleEmitter,
|
|
4
|
+
} from "./ExpoSpeechRecognitionModule";
|
|
5
|
+
import type { ExpoSpeechRecognitionNativeEventMap } from "./ExpoSpeechRecognitionModule.types";
|
|
2
6
|
|
|
3
7
|
// Export the SpeechRecognition APIs
|
|
4
8
|
export {
|
|
@@ -59,8 +63,12 @@ export const getDefaultRecognitionService =
|
|
|
59
63
|
export const getAssistantService =
|
|
60
64
|
ExpoSpeechRecognitionModule.getAssistantService;
|
|
61
65
|
|
|
62
|
-
export const addSpeechRecognitionListener =
|
|
63
|
-
|
|
66
|
+
export const addSpeechRecognitionListener = <
|
|
67
|
+
T extends keyof ExpoSpeechRecognitionNativeEventMap,
|
|
68
|
+
>(
|
|
69
|
+
eventName: T,
|
|
70
|
+
listener: (ev: ExpoSpeechRecognitionNativeEventMap[T]) => void,
|
|
71
|
+
) => ExpoSpeechRecognitionModuleEmitter.addListener(eventName, listener);
|
|
64
72
|
|
|
65
73
|
export type {
|
|
66
74
|
ExpoSpeechRecognitionOptions,
|