expo-speech-recognition 1.1.0 → 1.1.1

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,11 @@
1
1
  # expo-speech-recognition
2
2
 
3
+ ## 1.1.1
4
+
5
+ ### Patch Changes
6
+
7
+ - 46d8490: Add type guards to Web Speech API to avoid unresolved references
8
+
3
9
  ## 1.1.0
4
10
 
5
11
  ### Minor Changes
@@ -1 +1 @@
1
- {"version":3,"file":"ExpoWebSpeechRecognition.web.d.ts","sourceRoot":"","sources":["../src/ExpoWebSpeechRecognition.web.ts"],"names":[],"mappings":"AAcA,eAAO,MAAM,wBAAwB;;;QAA2B,CAAC;AACjE,eAAO,MAAM,wBAAwB;;;QAA2B,CAAC;AACjE,eAAO,MAAM,6BAA6B;;;QAAgC,CAAC"}
1
+ {"version":3,"file":"ExpoWebSpeechRecognition.web.d.ts","sourceRoot":"","sources":["../src/ExpoWebSpeechRecognition.web.ts"],"names":[],"mappings":"AAwBA,eAAO,MAAM,wBAAwB;;;QAA2B,CAAC;AACjE,eAAO,MAAM,wBAAwB;;;QAA2B,CAAC;AACjE,eAAO,MAAM,6BAA6B;;;QAAgC,CAAC"}
@@ -3,13 +3,23 @@ let browserSpeechGrammarList = null;
3
3
  let browserSpeechRecognitionEvent = null;
4
4
  if (typeof webkitSpeechRecognition !== "undefined") {
5
5
  browserSpeechRecognition = webkitSpeechRecognition;
6
- browserSpeechGrammarList = webkitSpeechGrammarList;
7
- browserSpeechRecognitionEvent = webkitSpeechRecognitionEvent;
6
+ browserSpeechGrammarList =
7
+ typeof webkitSpeechGrammarList !== "undefined"
8
+ ? webkitSpeechGrammarList
9
+ : null;
10
+ browserSpeechRecognitionEvent =
11
+ typeof webkitSpeechRecognitionEvent !== "undefined"
12
+ ? webkitSpeechRecognitionEvent
13
+ : null;
8
14
  }
9
15
  else if (typeof SpeechRecognition !== "undefined") {
10
16
  browserSpeechRecognition = SpeechRecognition;
11
- browserSpeechGrammarList = SpeechGrammarList;
12
- browserSpeechRecognitionEvent = SpeechRecognitionEvent;
17
+ browserSpeechGrammarList =
18
+ typeof SpeechGrammarList !== "undefined" ? SpeechGrammarList : null;
19
+ browserSpeechRecognitionEvent =
20
+ typeof SpeechRecognitionEvent !== "undefined"
21
+ ? SpeechRecognitionEvent
22
+ : null;
13
23
  }
14
24
  export const ExpoWebSpeechRecognition = browserSpeechRecognition;
15
25
  export const ExpoWebSpeechGrammarList = browserSpeechGrammarList;
@@ -1 +1 @@
1
- {"version":3,"file":"ExpoWebSpeechRecognition.web.js","sourceRoot":"","sources":["../src/ExpoWebSpeechRecognition.web.ts"],"names":[],"mappings":"AAAA,IAAI,wBAAwB,GAAoC,IAAI,CAAC;AACrE,IAAI,wBAAwB,GAAoC,IAAI,CAAC;AACrE,IAAI,6BAA6B,GAAyC,IAAI,CAAC;AAE/E,IAAI,OAAO,uBAAuB,KAAK,WAAW,EAAE,CAAC;IACnD,wBAAwB,GAAG,uBAAuB,CAAC;IACnD,wBAAwB,GAAG,uBAAuB,CAAC;IACnD,6BAA6B,GAAG,4BAA4B,CAAC;AAC/D,CAAC;KAAM,IAAI,OAAO,iBAAiB,KAAK,WAAW,EAAE,CAAC;IACpD,wBAAwB,GAAG,iBAAiB,CAAC;IAC7C,wBAAwB,GAAG,iBAAiB,CAAC;IAC7C,6BAA6B,GAAG,sBAAsB,CAAC;AACzD,CAAC;AAED,MAAM,CAAC,MAAM,wBAAwB,GAAG,wBAAwB,CAAC;AACjE,MAAM,CAAC,MAAM,wBAAwB,GAAG,wBAAwB,CAAC;AACjE,MAAM,CAAC,MAAM,6BAA6B,GAAG,6BAA6B,CAAC","sourcesContent":["let browserSpeechRecognition: typeof SpeechRecognition | null = null;\nlet browserSpeechGrammarList: typeof SpeechGrammarList | null = null;\nlet browserSpeechRecognitionEvent: typeof SpeechRecognitionEvent | null = null;\n\nif (typeof webkitSpeechRecognition !== \"undefined\") {\n browserSpeechRecognition = webkitSpeechRecognition;\n browserSpeechGrammarList = webkitSpeechGrammarList;\n browserSpeechRecognitionEvent = webkitSpeechRecognitionEvent;\n} else if (typeof SpeechRecognition !== \"undefined\") {\n browserSpeechRecognition = SpeechRecognition;\n browserSpeechGrammarList = SpeechGrammarList;\n browserSpeechRecognitionEvent = SpeechRecognitionEvent;\n}\n\nexport const ExpoWebSpeechRecognition = browserSpeechRecognition;\nexport const ExpoWebSpeechGrammarList = browserSpeechGrammarList;\nexport const ExpoWebSpeechRecognitionEvent = browserSpeechRecognitionEvent;\n"]}
1
+ {"version":3,"file":"ExpoWebSpeechRecognition.web.js","sourceRoot":"","sources":["../src/ExpoWebSpeechRecognition.web.ts"],"names":[],"mappings":"AAAA,IAAI,wBAAwB,GAAoC,IAAI,CAAC;AACrE,IAAI,wBAAwB,GAAoC,IAAI,CAAC;AACrE,IAAI,6BAA6B,GAAyC,IAAI,CAAC;AAE/E,IAAI,OAAO,uBAAuB,KAAK,WAAW,EAAE,CAAC;IACnD,wBAAwB,GAAG,uBAAuB,CAAC;IACnD,wBAAwB;QACtB,OAAO,uBAAuB,KAAK,WAAW;YAC5C,CAAC,CAAC,uBAAuB;YACzB,CAAC,CAAC,IAAI,CAAC;IACX,6BAA6B;QAC3B,OAAO,4BAA4B,KAAK,WAAW;YACjD,CAAC,CAAC,4BAA4B;YAC9B,CAAC,CAAC,IAAI,CAAC;AACb,CAAC;KAAM,IAAI,OAAO,iBAAiB,KAAK,WAAW,EAAE,CAAC;IACpD,wBAAwB,GAAG,iBAAiB,CAAC;IAC7C,wBAAwB;QACtB,OAAO,iBAAiB,KAAK,WAAW,CAAC,CAAC,CAAC,iBAAiB,CAAC,CAAC,CAAC,IAAI,CAAC;IACtE,6BAA6B;QAC3B,OAAO,sBAAsB,KAAK,WAAW;YAC3C,CAAC,CAAC,sBAAsB;YACxB,CAAC,CAAC,IAAI,CAAC;AACb,CAAC;AAED,MAAM,CAAC,MAAM,wBAAwB,GAAG,wBAAwB,CAAC;AACjE,MAAM,CAAC,MAAM,wBAAwB,GAAG,wBAAwB,CAAC;AACjE,MAAM,CAAC,MAAM,6BAA6B,GAAG,6BAA6B,CAAC","sourcesContent":["let browserSpeechRecognition: typeof SpeechRecognition | null = null;\nlet browserSpeechGrammarList: typeof SpeechGrammarList | null = null;\nlet browserSpeechRecognitionEvent: typeof SpeechRecognitionEvent | null = null;\n\nif (typeof webkitSpeechRecognition !== \"undefined\") {\n browserSpeechRecognition = webkitSpeechRecognition;\n browserSpeechGrammarList =\n typeof webkitSpeechGrammarList !== \"undefined\"\n ? webkitSpeechGrammarList\n : null;\n browserSpeechRecognitionEvent =\n typeof webkitSpeechRecognitionEvent !== \"undefined\"\n ? webkitSpeechRecognitionEvent\n : null;\n} else if (typeof SpeechRecognition !== \"undefined\") {\n browserSpeechRecognition = SpeechRecognition;\n browserSpeechGrammarList =\n typeof SpeechGrammarList !== \"undefined\" ? SpeechGrammarList : null;\n browserSpeechRecognitionEvent =\n typeof SpeechRecognitionEvent !== \"undefined\"\n ? SpeechRecognitionEvent\n : null;\n}\n\nexport const ExpoWebSpeechRecognition = browserSpeechRecognition;\nexport const ExpoWebSpeechGrammarList = browserSpeechGrammarList;\nexport const ExpoWebSpeechRecognitionEvent = browserSpeechRecognitionEvent;\n"]}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "expo-speech-recognition",
3
- "version": "1.1.0",
3
+ "version": "1.1.1",
4
4
  "description": "Speech Recognition for React Native Expo projects",
5
5
  "main": "build/index.js",
6
6
  "types": "build/index.d.ts",
@@ -17,6 +17,7 @@
17
17
  "expo-module": "expo-module",
18
18
  "open:ios": "open -a \"Xcode\" example/ios",
19
19
  "open:android": "open -a \"Android Studio\" example/android",
20
+ "changeset": "changeset",
20
21
  "release": "npm run prepare && changeset publish",
21
22
  "ts:check": "tsc -p . --noEmit"
22
23
  },
@@ -4,12 +4,22 @@ let browserSpeechRecognitionEvent: typeof SpeechRecognitionEvent | null = null;
4
4
 
5
5
  if (typeof webkitSpeechRecognition !== "undefined") {
6
6
  browserSpeechRecognition = webkitSpeechRecognition;
7
- browserSpeechGrammarList = webkitSpeechGrammarList;
8
- browserSpeechRecognitionEvent = webkitSpeechRecognitionEvent;
7
+ browserSpeechGrammarList =
8
+ typeof webkitSpeechGrammarList !== "undefined"
9
+ ? webkitSpeechGrammarList
10
+ : null;
11
+ browserSpeechRecognitionEvent =
12
+ typeof webkitSpeechRecognitionEvent !== "undefined"
13
+ ? webkitSpeechRecognitionEvent
14
+ : null;
9
15
  } else if (typeof SpeechRecognition !== "undefined") {
10
16
  browserSpeechRecognition = SpeechRecognition;
11
- browserSpeechGrammarList = SpeechGrammarList;
12
- browserSpeechRecognitionEvent = SpeechRecognitionEvent;
17
+ browserSpeechGrammarList =
18
+ typeof SpeechGrammarList !== "undefined" ? SpeechGrammarList : null;
19
+ browserSpeechRecognitionEvent =
20
+ typeof SpeechRecognitionEvent !== "undefined"
21
+ ? SpeechRecognitionEvent
22
+ : null;
13
23
  }
14
24
 
15
25
  export const ExpoWebSpeechRecognition = browserSpeechRecognition;