Skip to content

Commit c71ded0

Browse files
committed
fix: typo in "segments" property
1 parent f660dec commit c71ded0

9 files changed

+109
-24
lines changed

README.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -97,7 +97,7 @@ function App() {
9797
useSpeechRecognitionEvent("start", () => setRecognizing(true));
9898
useSpeechRecognitionEvent("end", () => setRecognizing(false));
9999
useSpeechRecognitionEvent("result", (event) => {
100-
setTranscript(event.results[0].transcript);
100+
setTranscript(event.results[0]?.transcript);
101101
});
102102
useSpeechRecognitionEvent("error", (event) => {
103103
console.log("error code:", event.error, "error messsage:", event.message);

example/ios/Podfile.lock

+2-2
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@ PODS:
3939
- ReactCommon/turbomodule/bridging
4040
- ReactCommon/turbomodule/core
4141
- Yoga
42-
- ExpoSpeechRecognition (0.2.15):
42+
- ExpoSpeechRecognition (0.2.17):
4343
- ExpoModulesCore
4444
- EXSplashScreen (0.27.5):
4545
- DoubleConversion
@@ -1443,7 +1443,7 @@ SPEC CHECKSUMS:
14431443
ExpoFont: 00756e6c796d8f7ee8d211e29c8b619e75cbf238
14441444
ExpoKeepAwake: 3b8815d9dd1d419ee474df004021c69fdd316d08
14451445
ExpoModulesCore: a113755f96c40590671f01cfcdce8ebdf0cf5f83
1446-
ExpoSpeechRecognition: 8dd88aa1af16251924232f0b90bed0bd90a7835a
1446+
ExpoSpeechRecognition: 66f2525786fd2fe299eb001e84b0176fd9c4252b
14471447
EXSplashScreen: a7e8d13c476f9937e39d654af4235758b567a1be
14481448
FBLazyVector: ac12dc084d1c8ec4cc4d7b3cf1b0ebda6dab85af
14491449
fmt: 4c2741a687cc09f0634a2e2c72a838b99f1ff120

example/package-lock.json

+91-6
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

example/package.json

+5-5
Original file line numberDiff line numberDiff line change
@@ -9,20 +9,20 @@
99
"web": "expo start --web"
1010
},
1111
"dependencies": {
12+
"@expo/metro-runtime": "~3.2.3",
13+
"@types/dom-speech-recognition": "^0.0.4",
1214
"babel-plugin-module-resolver": "^5.0.2",
13-
"expo": "~51.0.31",
15+
"expo": "~51.0.32",
1416
"expo-asset": "~10.0.10",
1517
"expo-av": "~14.0.7",
1618
"expo-build-properties": "~0.12.5",
1719
"expo-file-system": "~17.0.1",
1820
"expo-splash-screen": "~0.27.5",
1921
"expo-status-bar": "~1.12.1",
2022
"react": "18.2.0",
21-
"react-native": "0.74.5",
2223
"react-dom": "18.2.0",
23-
"react-native-web": "~0.19.10",
24-
"@expo/metro-runtime": "~3.2.3",
25-
"@types/dom-speech-recognition": "^0.0.4"
24+
"react-native": "0.74.5",
25+
"react-native-web": "~0.19.10"
2626
},
2727
"devDependencies": {
2828
"@babel/core": "^7.24.0",

package-lock.json

+2-2
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "expo-speech-recognition",
3-
"version": "0.2.17",
3+
"version": "0.2.18",
44
"description": "Speech Recognition for React Native Expo projects",
55
"main": "build/index.js",
66
"types": "build/index.d.ts",

src/ExpoSpeechRecognitionModule.types.ts

+2-2
Original file line numberDiff line numberDiff line change
@@ -59,14 +59,14 @@ export type ExpoSpeechRecognitionNativeEventMap = {
5959
* - The segment parts are split up by words.
6060
* - The segments are only available for the first transcript
6161
*/
62-
segements: {
62+
segments: {
6363
/** The start timestamp of the utterance, e.g. 1000 */
6464
startTimeMillis: number;
6565
/** The end timestamp of the utterance, e.g. 1500 */
6666
endTimeMillis: number;
6767
/** The text portion of the transcript, e.g. "Hello world" */
6868
segment: string;
69-
/** Value ranging between between 0.0, 1.0, and -1 (unavailable) indicating the confidence of the specific segement */
69+
/** Value ranging between between 0.0, 1.0, and -1 (unavailable) indicating the confidence of the specific segment */
7070
confidence: number;
7171
}[];
7272
}[];

src/ExpoSpeechRecognitionModule.web.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -161,7 +161,7 @@ const webToNativeEventMap: {
161161
nativeResults.push({
162162
transcript: result.transcript,
163163
confidence: result.confidence,
164-
segements: [],
164+
segments: [],
165165
});
166166
}
167167

src/ExpoWebSpeechRecognition.ts

+4-4
Original file line numberDiff line numberDiff line change
@@ -161,12 +161,12 @@ type SpeechListener<K extends keyof SpeechRecognitionEventMap> = (
161161

162162
/** A compatibility wrapper that implements the web SpeechRecognition API for React Native. */
163163
export class ExpoWebSpeechRecognition implements SpeechRecognition {
164-
lang: string = "en-US";
164+
lang = "en-US";
165165
grammars: SpeechGrammarList = new ExpoWebSpeechGrammarList();
166-
maxAlternatives: number = 1;
167-
continuous: boolean = false;
166+
maxAlternatives = 1;
167+
continuous = false;
168168

169-
#interimResults: boolean = false;
169+
#interimResults = false;
170170

171171
get interimResults(): boolean {
172172
return this.#interimResults;

0 commit comments

Comments
 (0)