expo-speech-recognition 2.1.5 → 3.0.0

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/CHANGELOG.md CHANGED
@@ -1,5 +1,99 @@
1
1
  # expo-speech-recognition
2
2
 
3
+ ## 3.0.0
4
+
5
+ ### Major Changes
6
+
7
+ - 3b48113: With this major version change, we've removed some top-level exports from the base `expo-speech-recognition` library.
8
+ Instead you'll now need to call the function directly from `ExpoSpeechRecognitionModule`. This was changed to address
9
+ issues with regards to symbol bindings.
10
+
11
+ The list of removed exports:
12
+
13
+ ```ts
14
+ // Removed
15
+ import { getSupportedLocales } from "expo-speech-recognition";
16
+ // Instead use:
17
+ ExpoSpeechRecognitionModule.getSupportedLocales();
18
+ ```
19
+
20
+ ```ts
21
+ // Removed
22
+ import { getSpeechRecognitionServices } from "expo-speech-recognition";
23
+ // Instead use:
24
+ ExpoSpeechRecognitionModule.getSpeechRecognitionServices();
25
+ ```
26
+
27
+ ```ts
28
+ // Removed
29
+ import { supportsOnDeviceRecognition } from "expo-speech-recognition";
30
+ // Instead use:
31
+ ExpoSpeechRecognitionModule.supportsOnDeviceRecognition();
32
+ ```
33
+
34
+ ```ts
35
+ // Removed
36
+ import { supportsRecording } from "expo-speech-recognition";
37
+ // Instead use:
38
+ ExpoSpeechRecognitionModule.supportsRecording();
39
+ ```
40
+
41
+ ```ts
42
+ // Removed
43
+ import { setCategoryIOS } from "expo-speech-recognition";
44
+ // Instead use:
45
+ ExpoSpeechRecognitionModule.setCategoryIOS({ ... });
46
+ ```
47
+
48
+ ```ts
49
+ // Removed
50
+ import { getAudioSessionCategoryAndOptionsIOS } from "expo-speech-recognition";
51
+ // Instead use:
52
+ ExpoSpeechRecognitionModule.getAudioSessionCategoryAndOptionsIOS();
53
+ ```
54
+
55
+ ```ts
56
+ // Removed
57
+ import { setAudioSessionActiveIOS } from "expo-speech-recognition";
58
+ // Instead use:
59
+ ExpoSpeechRecognitionModule.setAudioSessionActiveIOS(true, { ... });
60
+ ```
61
+
62
+ ```ts
63
+ // Removed
64
+ import { androidTriggerOfflineModelDownload } from "expo-speech-recognition";
65
+ // Instead use:
66
+ ExpoSpeechRecognitionModule.androidTriggerOfflineModelDownload({ ... });
67
+ ```
68
+
69
+ ```ts
70
+ // Removed
71
+ import { isRecognitionAvailable } from "expo-speech-recognition";
72
+ // Instead use:
73
+ ExpoSpeechRecognitionModule.isRecognitionAvailable();
74
+ ```
75
+
76
+ ```ts
77
+ // Removed
78
+ import { getDefaultRecognitionService } from "expo-speech-recognition";
79
+ // Instead use:
80
+ ExpoSpeechRecognitionModule.getDefaultRecognitionService();
81
+ ```
82
+
83
+ ```ts
84
+ // Removed
85
+ import { getAssistantService } from "expo-speech-recognition";
86
+ // Instead use:
87
+ ExpoSpeechRecognitionModule.getAssistantService();
88
+ ```
89
+
90
+ ```ts
91
+ // Removed
92
+ import { addSpeechRecognitionListener } from "expo-speech-recognition";
93
+ // Instead use:
94
+ ExpoSpeechRecognitionModule.addListener("foo", (event) => { ... });
95
+ ```
96
+
3
97
  ## 2.1.5
4
98
 
5
99
  ### Patch Changes
package/README.md CHANGED
@@ -294,9 +294,9 @@ ExpoSpeechRecognitionModule.start({
294
294
  recordingOptions: {
295
295
  // [Default: false] Whether to persist the audio to a local file path.
296
296
  persist: false,
297
- // [Default: FileSystem.CacheDirectory]
297
+ // [Default: Paths.cache.uri]
298
298
  // Changes the default storage location for the audio file.
299
- // e.g. `FileSystem.documentDirectory` (from `expo-file-system`)
299
+ // e.g. `Paths.document.uri` (from `expo-file-system`)
300
300
  outputDirectory: undefined,
301
301
  // [Default: `"recording_${timestamp|uuid}.[wav|caf]"`]
302
302
  // Changes the file name for the audio file.
@@ -458,7 +458,7 @@ function RecordAudio() {
458
458
  recordingOptions: {
459
459
  persist: true,
460
460
  // Optional: Specify the output file path to save the recording to
461
- // e.g. `FileSystem.documentDirectory` (from `expo-file-system`)
461
+ // e.g. `Paths.document.uri` (from `expo-file-system`)
462
462
  outputDirectory:
463
463
  "/data/user/0/expo.modules.speechrecognition.example/files",
464
464
  // Optional: Specify the output file name to save the recording to
@@ -25,6 +25,8 @@ import expo.modules.kotlin.modules.Module
25
25
  import expo.modules.kotlin.modules.ModuleDefinition
26
26
  import java.util.concurrent.Executors
27
27
 
28
+ private const val TAG = "ESRModule"
29
+
28
30
  class ExpoSpeechRecognitionModule : Module() {
29
31
  private val expoSpeechService by lazy {
30
32
  ExpoSpeechService(appContext.reactContext!!) { name, body ->
@@ -34,7 +36,7 @@ class ExpoSpeechRecognitionModule : Module() {
34
36
  } catch (e: IllegalArgumentException) {
35
37
  // "Cannot create an event emitter for the module that isn't present in the module registry."
36
38
  // Likely can occur after destroying the module
37
- Log.e("ExpoSpeechRecognitionModule", "Failed to send event: $name", e)
39
+ Log.e(TAG, "Failed to send event: $name", e)
38
40
  }
39
41
  }
40
42
  }
@@ -42,6 +44,7 @@ class ExpoSpeechRecognitionModule : Module() {
42
44
  // Each module class must implement the definition function. The definition consists of components
43
45
  // that describes the module's functionality and behavior.
44
46
  // See https://docs.expo.dev/modules/module-api for more details about available components.
47
+ @RequiresApi(Build.VERSION_CODES.FROYO)
45
48
  override fun definition() =
46
49
  ModuleDefinition {
47
50
  // Sets the name of the module that JavaScript code will use to refer to the module. Takes a
@@ -162,7 +165,7 @@ class ExpoSpeechRecognitionModule : Module() {
162
165
  }
163
166
 
164
167
  AsyncFunction("getSpeechRecognizerPermissionsAsync") { promise: Promise ->
165
- Log.w("ExpoSpeechRecognitionModule", "getSpeechRecognizerPermissionsAsync is not supported on Android. Returning a granted permission response.")
168
+ Log.w(TAG, "getSpeechRecognizerPermissionsAsync is not supported on Android. Returning a granted permission response.")
166
169
  promise.resolve(
167
170
  Bundle().apply {
168
171
  putString(PermissionsResponse.EXPIRES_KEY, "never")
@@ -174,7 +177,7 @@ class ExpoSpeechRecognitionModule : Module() {
174
177
  }
175
178
 
176
179
  AsyncFunction("requestSpeechRecognizerPermissionsAsync") { promise: Promise ->
177
- Log.w("ExpoSpeechRecognitionModule", "requestSpeechRecognizerPermissionsAsync is not supported on Android. Returning a granted permission response.")
180
+ Log.w(TAG, "requestSpeechRecognizerPermissionsAsync is not supported on Android. Returning a granted permission response.")
178
181
  promise.resolve(
179
182
  Bundle().apply {
180
183
  putString(PermissionsResponse.EXPIRES_KEY, "never")
@@ -347,6 +350,7 @@ class ExpoSpeechRecognitionModule : Module() {
347
350
 
348
351
  private fun hasNotGrantedRecordPermissions(): Boolean = appContext.permissions?.hasGrantedPermissions(RECORD_AUDIO)?.not() ?: false
349
352
 
353
+ @RequiresApi(Build.VERSION_CODES.CUPCAKE)
350
354
  private fun getDefaultAssistantService(): ComponentName? {
351
355
  val contentResolver = appContext.reactContext?.contentResolver ?: return null
352
356
  val defaultAssistant = Settings.Secure.getString(contentResolver, "assistant")
@@ -356,6 +360,7 @@ class ExpoSpeechRecognitionModule : Module() {
356
360
  return ComponentName.unflattenFromString(defaultAssistant)
357
361
  }
358
362
 
363
+ @RequiresApi(Build.VERSION_CODES.CUPCAKE)
359
364
  private fun getDefaultVoiceRecognitionService(): ComponentName? {
360
365
  val contentResolver = appContext.reactContext?.contentResolver ?: return null
361
366
  val defaultVoiceRecognitionService = Settings.Secure.getString(contentResolver, "voice_recognition_service")
package/build/index.d.ts CHANGED
@@ -2,37 +2,5 @@ export { ExpoWebSpeechRecognition, ExpoWebSpeechGrammar, ExpoWebSpeechGrammarLis
2
2
  export { ExpoSpeechRecognitionModule } from "./ExpoSpeechRecognitionModule";
3
3
  export { useSpeechRecognitionEvent } from "./useSpeechRecognitionEvent";
4
4
  export { AVAudioSessionCategory, AVAudioSessionCategoryOptions, AVAudioSessionMode, RecognizerIntentExtraLanguageModel, RecognizerIntentEnableLanguageSwitch, AudioEncodingAndroid, TaskHintIOS, SpeechRecognizerErrorAndroid, } from "./constants";
5
- export declare const getSupportedLocales: (options?: {
6
- androidRecognitionServicePackage?: string;
7
- }) => Promise<{
8
- locales: string[];
9
- installedLocales: string[];
10
- }>;
11
- export declare const getSpeechRecognitionServices: () => string[];
12
- export declare const supportsOnDeviceRecognition: () => boolean;
13
- export declare const supportsRecording: () => boolean;
14
- export declare const setCategoryIOS: (options: import("./ExpoSpeechRecognitionModule.types").SetCategoryOptions) => void;
15
- export declare const getAudioSessionCategoryAndOptionsIOS: () => {
16
- category: import("./ExpoSpeechRecognitionModule.types").AVAudioSessionCategoryValue;
17
- categoryOptions: import("./ExpoSpeechRecognitionModule.types").AVAudioSessionCategoryOptionsValue[];
18
- mode: import("./ExpoSpeechRecognitionModule.types").AVAudioSessionModeValue;
19
- };
20
- export declare const setAudioSessionActiveIOS: (value: boolean, options?: {
21
- notifyOthersOnDeactivation: boolean;
22
- }) => void;
23
- export declare const androidTriggerOfflineModelDownload: (options: {
24
- locale: string;
25
- }) => Promise<{
26
- status: "download_success" | "opened_dialog" | "download_canceled";
27
- message: string;
28
- }>;
29
- export declare const isRecognitionAvailable: () => boolean;
30
- export declare const getDefaultRecognitionService: () => {
31
- packageName: string;
32
- };
33
- export declare const getAssistantService: () => {
34
- packageName: string;
35
- };
36
- export declare const addSpeechRecognitionListener: <EventName extends keyof import("./ExpoSpeechRecognitionModule.types").ExpoSpeechRecognitionNativeEventMap>(eventName: EventName, listener: import("./ExpoSpeechRecognitionModule.types").ExpoSpeechRecognitionNativeEvents[EventName]) => import("expo-modules-core/build/ts-declarations/EventEmitter").EventSubscription;
37
5
  export type { ExpoSpeechRecognitionOptions, AndroidIntentOptions, ExpoSpeechRecognitionNativeEventMap, AVAudioSessionCategoryOptionsValue, AVAudioSessionModeValue, AVAudioSessionCategoryValue, AudioEncodingAndroidValue, AudioSourceOptions, RecordingOptions, IOSTaskHintValue, SetCategoryOptions, ExpoSpeechRecognitionErrorCode, ExpoSpeechRecognitionErrorEvent, ExpoSpeechRecognitionResultEvent, ExpoSpeechRecognitionResult, ExpoSpeechRecognitionResultSegment, } from "./ExpoSpeechRecognitionModule.types";
38
6
  //# sourceMappingURL=index.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAGA,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,EACX,4BAA4B,GAC7B,MAAM,aAAa,CAAC;AAErB,eAAO,MAAM,mBAAmB,GAAI,UAAU;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,6TACA,CAAC;AAE1C,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"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AACA,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,EACX,4BAA4B,GAC7B,MAAM,aAAa,CAAC;AAErB,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,3 @@
1
- import { ExpoSpeechRecognitionModule } from "./ExpoSpeechRecognitionModule";
2
1
  // Export the SpeechRecognition APIs
3
2
  export { ExpoWebSpeechRecognition, ExpoWebSpeechGrammar, ExpoWebSpeechGrammarList, } from "./ExpoWebSpeechRecognition";
4
3
  // Native module
@@ -7,16 +6,4 @@ export { ExpoSpeechRecognitionModule } from "./ExpoSpeechRecognitionModule";
7
6
  export { useSpeechRecognitionEvent } from "./useSpeechRecognitionEvent";
8
7
  // Constants
9
8
  export { AVAudioSessionCategory, AVAudioSessionCategoryOptions, AVAudioSessionMode, RecognizerIntentExtraLanguageModel, RecognizerIntentEnableLanguageSwitch, AudioEncodingAndroid, TaskHintIOS, SpeechRecognizerErrorAndroid, } from "./constants";
10
- export const getSupportedLocales = (options) => ExpoSpeechRecognitionModule.getSupportedLocales(options ?? {});
11
- export const getSpeechRecognitionServices = ExpoSpeechRecognitionModule.getSpeechRecognitionServices;
12
- export const supportsOnDeviceRecognition = ExpoSpeechRecognitionModule.supportsOnDeviceRecognition;
13
- export const supportsRecording = ExpoSpeechRecognitionModule.supportsRecording;
14
- export const setCategoryIOS = ExpoSpeechRecognitionModule.setCategoryIOS;
15
- export const getAudioSessionCategoryAndOptionsIOS = ExpoSpeechRecognitionModule.getAudioSessionCategoryAndOptionsIOS;
16
- export const setAudioSessionActiveIOS = ExpoSpeechRecognitionModule.setAudioSessionActiveIOS;
17
- export const androidTriggerOfflineModelDownload = ExpoSpeechRecognitionModule.androidTriggerOfflineModelDownload;
18
- export const isRecognitionAvailable = ExpoSpeechRecognitionModule.isRecognitionAvailable;
19
- export const getDefaultRecognitionService = ExpoSpeechRecognitionModule.getDefaultRecognitionService;
20
- export const getAssistantService = ExpoSpeechRecognitionModule.getAssistantService;
21
- export const addSpeechRecognitionListener = ExpoSpeechRecognitionModule.addListener;
22
9
  //# 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;AAE5E,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,EACX,4BAA4B,GAC7B,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\";\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 SpeechRecognizerErrorAndroid,\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 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"]}
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,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,EACX,4BAA4B,GAC7B,MAAM,aAAa,CAAC","sourcesContent":["// 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 SpeechRecognizerErrorAndroid,\n} from \"./constants\";\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/eslint.config.mjs CHANGED
@@ -6,9 +6,11 @@ import tseslint from "typescript-eslint";
6
6
  export default tseslint.config([
7
7
  tseslint.configs.recommended,
8
8
  js.configs.recommended,
9
+ {
10
+ ignores: ["build/**", "app.plugin.js", "example/**"],
11
+ },
9
12
  {
10
13
  files: ["src/**/*.{js,jsx,ts,tsx}"],
11
- ignores: ["build/**"],
12
14
  languageOptions: {
13
15
  globals: globals.node,
14
16
  },
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "expo-speech-recognition",
3
- "version": "2.1.5",
3
+ "version": "3.0.0",
4
4
  "description": "Speech Recognition for React Native Expo projects",
5
5
  "main": "build/index.js",
6
6
  "types": "build/index.d.ts",
@@ -40,14 +40,14 @@
40
40
  "license": "MIT",
41
41
  "homepage": "https://github.com/jamsch/expo-speech-recognition#readme",
42
42
  "devDependencies": {
43
- "@changesets/cli": "^2.29.2",
44
- "@types/dom-speech-recognition": "^0.0.6",
45
- "@types/react": "~19.0.14",
46
- "expo": "~53.0.0",
47
- "expo-module-scripts": "^4.1.6",
48
- "globals": "16.2.0",
49
- "typescript": "~5.8.3",
50
- "typescript-eslint": "8.33.1"
43
+ "@changesets/cli": "^2.29.7",
44
+ "@types/dom-speech-recognition": "^0.0.7",
45
+ "@types/react": "~19.1.15",
46
+ "expo": "~54.0.0",
47
+ "expo-module-scripts": "^5.0.7",
48
+ "globals": "16.4.0",
49
+ "typescript": "~5.9.3",
50
+ "typescript-eslint": "8.46.3"
51
51
  },
52
52
  "prettier": {
53
53
  "trailingComma": "all"
package/src/index.ts CHANGED
@@ -1,5 +1,3 @@
1
- import { ExpoSpeechRecognitionModule } from "./ExpoSpeechRecognitionModule";
2
-
3
1
  // Export the SpeechRecognition APIs
4
2
  export {
5
3
  ExpoWebSpeechRecognition,
@@ -25,41 +23,6 @@ export {
25
23
  SpeechRecognizerErrorAndroid,
26
24
  } from "./constants";
27
25
 
28
- export const getSupportedLocales = (options?: {
29
- androidRecognitionServicePackage?: string;
30
- }) => ExpoSpeechRecognitionModule.getSupportedLocales(options ?? {});
31
-
32
- export const getSpeechRecognitionServices =
33
- ExpoSpeechRecognitionModule.getSpeechRecognitionServices;
34
-
35
- export const supportsOnDeviceRecognition =
36
- ExpoSpeechRecognitionModule.supportsOnDeviceRecognition;
37
-
38
- export const supportsRecording = ExpoSpeechRecognitionModule.supportsRecording;
39
-
40
- export const setCategoryIOS = ExpoSpeechRecognitionModule.setCategoryIOS;
41
-
42
- export const getAudioSessionCategoryAndOptionsIOS =
43
- ExpoSpeechRecognitionModule.getAudioSessionCategoryAndOptionsIOS;
44
-
45
- export const setAudioSessionActiveIOS =
46
- ExpoSpeechRecognitionModule.setAudioSessionActiveIOS;
47
-
48
- export const androidTriggerOfflineModelDownload =
49
- ExpoSpeechRecognitionModule.androidTriggerOfflineModelDownload;
50
-
51
- export const isRecognitionAvailable =
52
- ExpoSpeechRecognitionModule.isRecognitionAvailable;
53
-
54
- export const getDefaultRecognitionService =
55
- ExpoSpeechRecognitionModule.getDefaultRecognitionService;
56
-
57
- export const getAssistantService =
58
- ExpoSpeechRecognitionModule.getAssistantService;
59
-
60
- export const addSpeechRecognitionListener =
61
- ExpoSpeechRecognitionModule.addListener;
62
-
63
26
  export type {
64
27
  ExpoSpeechRecognitionOptions,
65
28
  AndroidIntentOptions,