react-native-voice-ts 1.0.2 โ†’ 1.0.4

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.
Files changed (59) hide show
  1. package/README.md +287 -77
  2. package/dist/NativeVoiceAndroid.d.ts +0 -1
  3. package/dist/NativeVoiceAndroid.js +0 -1
  4. package/dist/NativeVoiceIOS.d.ts +0 -1
  5. package/dist/NativeVoiceIOS.js +0 -1
  6. package/dist/VoiceModuleTypes.d.ts +0 -1
  7. package/dist/VoiceModuleTypes.js +0 -1
  8. package/dist/VoiceUtilTypes.d.ts +0 -1
  9. package/dist/VoiceUtilTypes.js +0 -1
  10. package/dist/components/MicIcon.d.ts +24 -5
  11. package/dist/components/MicIcon.js +71 -13
  12. package/dist/components/VoiceMicrophone.d.ts +0 -1
  13. package/dist/components/VoiceMicrophone.js +27 -17
  14. package/dist/components/index.d.ts +1 -2
  15. package/dist/components/index.js +1 -2
  16. package/dist/hooks/index.d.ts +0 -1
  17. package/dist/hooks/index.js +0 -1
  18. package/dist/hooks/useVoiceRecognition.d.ts +0 -1
  19. package/dist/hooks/useVoiceRecognition.js +26 -25
  20. package/dist/index.d.ts +1 -2
  21. package/dist/index.js +1 -2
  22. package/package.json +4 -8
  23. package/CONTRIBUTING.md +0 -293
  24. package/dist/NativeVoiceAndroid.d.ts.map +0 -1
  25. package/dist/NativeVoiceAndroid.js.map +0 -1
  26. package/dist/NativeVoiceIOS.d.ts.map +0 -1
  27. package/dist/NativeVoiceIOS.js.map +0 -1
  28. package/dist/VoiceModuleTypes.d.ts.map +0 -1
  29. package/dist/VoiceModuleTypes.js.map +0 -1
  30. package/dist/VoiceUtilTypes.d.ts.map +0 -1
  31. package/dist/VoiceUtilTypes.js.map +0 -1
  32. package/dist/components/MicIcon.d.ts.map +0 -1
  33. package/dist/components/MicIcon.js.map +0 -1
  34. package/dist/components/VoiceMicrophone.d.ts.map +0 -1
  35. package/dist/components/VoiceMicrophone.js.map +0 -1
  36. package/dist/components/index.d.ts.map +0 -1
  37. package/dist/components/index.js.map +0 -1
  38. package/dist/hooks/index.d.ts.map +0 -1
  39. package/dist/hooks/index.js.map +0 -1
  40. package/dist/hooks/useVoiceRecognition.d.ts.map +0 -1
  41. package/dist/hooks/useVoiceRecognition.js.map +0 -1
  42. package/dist/index.d.ts.map +0 -1
  43. package/dist/index.js.map +0 -1
  44. package/ios/Voice.xcodeproj/project.xcworkspace/xcuserdata/olumayowadaniel.xcuserdatad/UserInterfaceState.xcuserstate +0 -0
  45. package/ios/Voice.xcodeproj/project.xcworkspace/xcuserdata/rudie_shahinian.xcuserdatad/UserInterfaceState.xcuserstate +0 -0
  46. package/plugin/src/withVoice.ts +0 -74
  47. package/plugin/tsconfig.json +0 -10
  48. package/plugin/tsconfig.tsbuildinfo +0 -1
  49. package/src/NativeVoiceAndroid.ts +0 -28
  50. package/src/NativeVoiceIOS.ts +0 -24
  51. package/src/VoiceModuleTypes.ts +0 -64
  52. package/src/VoiceUtilTypes.ts +0 -46
  53. package/src/components/MicIcon.tsx +0 -72
  54. package/src/components/VoiceMicrophone.tsx +0 -345
  55. package/src/components/index.ts +0 -4
  56. package/src/hooks/index.ts +0 -5
  57. package/src/hooks/useVoiceRecognition.ts +0 -333
  58. package/src/images/mic.svg +0 -16
  59. package/src/index.ts +0 -515
@@ -32,7 +32,7 @@ const VoiceMicrophone = ({ onSpeechResult, onPartialResult, onStart, onStop, onE
32
32
  const [recognizedText, setRecognizedText] = useState('');
33
33
  const [partialText, setPartialText] = useState('');
34
34
  const [error, setError] = useState(null);
35
- const [shouldContinue, setShouldContinue] = useState(false);
35
+ const shouldContinueRef = React.useRef(false);
36
36
  const silenceTimerRef = React.useRef(null);
37
37
  useEffect(() => {
38
38
  // Clear any existing timers on cleanup
@@ -55,10 +55,10 @@ const VoiceMicrophone = ({ onSpeechResult, onPartialResult, onStart, onStop, onE
55
55
  Voice.onSpeechEnd = async () => {
56
56
  setIsRecording(false);
57
57
  // In continuous mode, restart listening after results
58
- if (continuous && shouldContinue) {
58
+ if (continuous && shouldContinueRef.current) {
59
59
  // Small delay before restarting
60
60
  setTimeout(async () => {
61
- if (shouldContinue) {
61
+ if (shouldContinueRef.current) {
62
62
  try {
63
63
  await Voice.start(locale, {
64
64
  EXTRA_PARTIAL_RESULTS: enablePartialResults,
@@ -78,7 +78,7 @@ const VoiceMicrophone = ({ onSpeechResult, onPartialResult, onStart, onStop, onE
78
78
  const errorMessage = e.error?.message || 'Unknown error';
79
79
  setError(errorMessage);
80
80
  setIsRecording(false);
81
- setShouldContinue(false);
81
+ shouldContinueRef.current = false;
82
82
  if (silenceTimerRef.current) {
83
83
  clearTimeout(silenceTimerRef.current);
84
84
  }
@@ -109,9 +109,15 @@ const VoiceMicrophone = ({ onSpeechResult, onPartialResult, onStart, onStop, onE
109
109
  // Reset silence timer on partial results (user is speaking)
110
110
  if (continuous && silenceTimerRef.current) {
111
111
  clearTimeout(silenceTimerRef.current);
112
- silenceTimerRef.current = setTimeout(() => {
113
- if (shouldContinue) {
114
- stop();
112
+ silenceTimerRef.current = setTimeout(async () => {
113
+ if (shouldContinueRef.current) {
114
+ shouldContinueRef.current = false;
115
+ if (silenceTimerRef.current) {
116
+ clearTimeout(silenceTimerRef.current);
117
+ silenceTimerRef.current = null;
118
+ }
119
+ await Voice.stop();
120
+ onStop?.();
115
121
  }
116
122
  }, maxSilenceDuration);
117
123
  }
@@ -130,7 +136,6 @@ const VoiceMicrophone = ({ onSpeechResult, onPartialResult, onStart, onStop, onE
130
136
  onError,
131
137
  enablePartialResults,
132
138
  continuous,
133
- shouldContinue,
134
139
  recognizedText,
135
140
  locale,
136
141
  maxSilenceDuration,
@@ -149,7 +154,7 @@ const VoiceMicrophone = ({ onSpeechResult, onPartialResult, onStart, onStop, onE
149
154
  setRecognizedText('');
150
155
  setPartialText('');
151
156
  }
152
- setShouldContinue(true);
157
+ shouldContinueRef.current = true;
153
158
  // Check permission (Android only)
154
159
  const hasPermission = await Voice.checkMicrophonePermission();
155
160
  if (!hasPermission) {
@@ -164,9 +169,15 @@ const VoiceMicrophone = ({ onSpeechResult, onPartialResult, onStart, onStop, onE
164
169
  });
165
170
  // Start silence timer if in continuous mode
166
171
  if (continuous) {
167
- silenceTimerRef.current = setTimeout(() => {
168
- if (shouldContinue) {
169
- stop();
172
+ silenceTimerRef.current = setTimeout(async () => {
173
+ if (shouldContinueRef.current) {
174
+ shouldContinueRef.current = false;
175
+ if (silenceTimerRef.current) {
176
+ clearTimeout(silenceTimerRef.current);
177
+ silenceTimerRef.current = null;
178
+ }
179
+ await Voice.stop();
180
+ onStop?.();
170
181
  }
171
182
  }, maxSilenceDuration);
172
183
  }
@@ -174,7 +185,7 @@ const VoiceMicrophone = ({ onSpeechResult, onPartialResult, onStart, onStop, onE
174
185
  catch (e) {
175
186
  const errorMessage = e instanceof Error ? e.message : 'Failed to start recording';
176
187
  setError(errorMessage);
177
- setShouldContinue(false);
188
+ shouldContinueRef.current = false;
178
189
  onError?.(errorMessage);
179
190
  }
180
191
  }, [
@@ -183,11 +194,11 @@ const VoiceMicrophone = ({ onSpeechResult, onPartialResult, onStart, onStop, onE
183
194
  onError,
184
195
  continuous,
185
196
  maxSilenceDuration,
186
- shouldContinue,
197
+ onStop,
187
198
  ]);
188
199
  const stop = useCallback(async () => {
189
200
  try {
190
- setShouldContinue(false);
201
+ shouldContinueRef.current = false;
191
202
  if (silenceTimerRef.current) {
192
203
  clearTimeout(silenceTimerRef.current);
193
204
  silenceTimerRef.current = null;
@@ -203,7 +214,7 @@ const VoiceMicrophone = ({ onSpeechResult, onPartialResult, onStart, onStop, onE
203
214
  }, [onError, onStop]);
204
215
  const cancel = useCallback(async () => {
205
216
  try {
206
- setShouldContinue(false);
217
+ shouldContinueRef.current = false;
207
218
  if (silenceTimerRef.current) {
208
219
  clearTimeout(silenceTimerRef.current);
209
220
  silenceTimerRef.current = null;
@@ -236,4 +247,3 @@ const VoiceMicrophone = ({ onSpeechResult, onPartialResult, onStart, onStop, onE
236
247
  return null;
237
248
  };
238
249
  export default VoiceMicrophone;
239
- //# sourceMappingURL=VoiceMicrophone.js.map
@@ -1,5 +1,4 @@
1
1
  export { default as VoiceMicrophone } from './VoiceMicrophone';
2
2
  export type { VoiceMicrophoneProps } from './VoiceMicrophone';
3
- export { MicIcon, MicOffIcon } from './MicIcon';
3
+ export { MicIcon, MicOffIcon, MicIconFilled, MicOffIconFilled, MicIconWave, MicOffIconWave, } from './MicIcon';
4
4
  export type { MicIconProps, MicOffIconProps } from './MicIcon';
5
- //# sourceMappingURL=index.d.ts.map
@@ -1,3 +1,2 @@
1
1
  export { default as VoiceMicrophone } from './VoiceMicrophone';
2
- export { MicIcon, MicOffIcon } from './MicIcon';
3
- //# sourceMappingURL=index.js.map
2
+ export { MicIcon, MicOffIcon, MicIconFilled, MicOffIconFilled, MicIconWave, MicOffIconWave, } from './MicIcon';
@@ -1,3 +1,2 @@
1
1
  export { useVoiceRecognition } from './useVoiceRecognition';
2
2
  export type { UseVoiceRecognitionOptions, UseVoiceRecognitionReturn, } from './useVoiceRecognition';
3
- //# sourceMappingURL=index.d.ts.map
@@ -1,2 +1 @@
1
1
  export { useVoiceRecognition } from './useVoiceRecognition';
2
- //# sourceMappingURL=index.js.map
@@ -86,4 +86,3 @@ export interface UseVoiceRecognitionReturn {
86
86
  * ```
87
87
  */
88
88
  export declare const useVoiceRecognition: (options?: UseVoiceRecognitionOptions) => UseVoiceRecognitionReturn;
89
- //# sourceMappingURL=useVoiceRecognition.d.ts.map
@@ -27,7 +27,7 @@ export const useVoiceRecognition = (options = {}) => {
27
27
  const [results, setResults] = useState([]);
28
28
  const [partialResults, setPartialResults] = useState([]);
29
29
  const [error, setError] = useState(null);
30
- const [shouldContinue, setShouldContinue] = useState(false);
30
+ const shouldContinueRef = React.useRef(false);
31
31
  const silenceTimerRef = React.useRef(null);
32
32
  const accumulatedTextRef = React.useRef('');
33
33
  useEffect(() => {
@@ -50,9 +50,9 @@ export const useVoiceRecognition = (options = {}) => {
50
50
  Voice.onSpeechEnd = async () => {
51
51
  setIsRecording(false);
52
52
  // In continuous mode, restart listening after results
53
- if (continuous && shouldContinue) {
53
+ if (continuous && shouldContinueRef.current) {
54
54
  setTimeout(async () => {
55
- if (shouldContinue) {
55
+ if (shouldContinueRef.current) {
56
56
  try {
57
57
  await Voice.start(locale, {
58
58
  EXTRA_PARTIAL_RESULTS: enablePartialResults,
@@ -69,7 +69,7 @@ export const useVoiceRecognition = (options = {}) => {
69
69
  const errorMessage = e.error?.message || 'Unknown error';
70
70
  setError(errorMessage);
71
71
  setIsRecording(false);
72
- setShouldContinue(false);
72
+ shouldContinueRef.current = false;
73
73
  if (silenceTimerRef.current) {
74
74
  clearTimeout(silenceTimerRef.current);
75
75
  }
@@ -102,9 +102,14 @@ export const useVoiceRecognition = (options = {}) => {
102
102
  // Reset silence timer on partial results (user is speaking)
103
103
  if (continuous && silenceTimerRef.current) {
104
104
  clearTimeout(silenceTimerRef.current);
105
- silenceTimerRef.current = setTimeout(() => {
106
- if (shouldContinue) {
107
- stop();
105
+ silenceTimerRef.current = setTimeout(async () => {
106
+ if (shouldContinueRef.current) {
107
+ shouldContinueRef.current = false;
108
+ if (silenceTimerRef.current) {
109
+ clearTimeout(silenceTimerRef.current);
110
+ silenceTimerRef.current = null;
111
+ }
112
+ await Voice.stop();
108
113
  }
109
114
  }, maxSilenceDuration);
110
115
  }
@@ -120,7 +125,6 @@ export const useVoiceRecognition = (options = {}) => {
120
125
  onResult,
121
126
  onError,
122
127
  continuous,
123
- shouldContinue,
124
128
  locale,
125
129
  maxSilenceDuration,
126
130
  ]);
@@ -132,7 +136,7 @@ export const useVoiceRecognition = (options = {}) => {
132
136
  setPartialResults([]);
133
137
  accumulatedTextRef.current = '';
134
138
  }
135
- setShouldContinue(true);
139
+ shouldContinueRef.current = true;
136
140
  // Check permission (Android only)
137
141
  const hasPermission = await Voice.checkMicrophonePermission();
138
142
  if (!hasPermission) {
@@ -147,9 +151,14 @@ export const useVoiceRecognition = (options = {}) => {
147
151
  });
148
152
  // Start silence timer if in continuous mode
149
153
  if (continuous) {
150
- silenceTimerRef.current = setTimeout(() => {
151
- if (shouldContinue) {
152
- stop();
154
+ silenceTimerRef.current = setTimeout(async () => {
155
+ if (shouldContinueRef.current) {
156
+ shouldContinueRef.current = false;
157
+ if (silenceTimerRef.current) {
158
+ clearTimeout(silenceTimerRef.current);
159
+ silenceTimerRef.current = null;
160
+ }
161
+ await Voice.stop();
153
162
  }
154
163
  }, maxSilenceDuration);
155
164
  }
@@ -157,20 +166,13 @@ export const useVoiceRecognition = (options = {}) => {
157
166
  catch (e) {
158
167
  const errorMessage = e instanceof Error ? e.message : 'Failed to start recording';
159
168
  setError(errorMessage);
160
- setShouldContinue(false);
169
+ shouldContinueRef.current = false;
161
170
  onError?.(errorMessage);
162
171
  }
163
- }, [
164
- locale,
165
- enablePartialResults,
166
- onError,
167
- continuous,
168
- maxSilenceDuration,
169
- shouldContinue,
170
- ]);
172
+ }, [locale, enablePartialResults, onError, continuous, maxSilenceDuration]);
171
173
  const stop = useCallback(async () => {
172
174
  try {
173
- setShouldContinue(false);
175
+ shouldContinueRef.current = false;
174
176
  if (silenceTimerRef.current) {
175
177
  clearTimeout(silenceTimerRef.current);
176
178
  silenceTimerRef.current = null;
@@ -185,7 +187,7 @@ export const useVoiceRecognition = (options = {}) => {
185
187
  }, [onError]);
186
188
  const cancel = useCallback(async () => {
187
189
  try {
188
- setShouldContinue(false);
190
+ shouldContinueRef.current = false;
189
191
  if (silenceTimerRef.current) {
190
192
  clearTimeout(silenceTimerRef.current);
191
193
  silenceTimerRef.current = null;
@@ -207,7 +209,7 @@ export const useVoiceRecognition = (options = {}) => {
207
209
  setError(null);
208
210
  setIsRecording(false);
209
211
  accumulatedTextRef.current = '';
210
- setShouldContinue(false);
212
+ shouldContinueRef.current = false;
211
213
  if (silenceTimerRef.current) {
212
214
  clearTimeout(silenceTimerRef.current);
213
215
  silenceTimerRef.current = null;
@@ -224,4 +226,3 @@ export const useVoiceRecognition = (options = {}) => {
224
226
  reset,
225
227
  };
226
228
  };
227
- //# sourceMappingURL=useVoiceRecognition.js.map
package/dist/index.d.ts CHANGED
@@ -67,10 +67,9 @@ declare class RCTVoice {
67
67
  }
68
68
  export type { SpeechEndEvent, SpeechErrorEvent, SpeechEvents, SpeechStartEvent, SpeechRecognizedEvent, SpeechResultsEvent, SpeechVolumeChangeEvent, TranscriptionEndEvent, TranscriptionErrorEvent, TranscriptionEvents, TranscriptionStartEvent, TranscriptionResultsEvent, };
69
69
  export type { VoiceOptions, RecognitionStats, PermissionResult, Language, } from './VoiceUtilTypes';
70
- export { VoiceMicrophone, MicIcon, MicOffIcon } from './components';
70
+ export { VoiceMicrophone, MicIcon, MicOffIcon, MicIconFilled, MicOffIconFilled, MicIconWave, MicOffIconWave, } from './components';
71
71
  export type { VoiceMicrophoneProps, MicIconProps, MicOffIconProps, } from './components';
72
72
  export { useVoiceRecognition } from './hooks';
73
73
  export type { UseVoiceRecognitionOptions, UseVoiceRecognitionReturn, } from './hooks';
74
74
  declare const _default: RCTVoice;
75
75
  export default _default;
76
- //# sourceMappingURL=index.d.ts.map
package/dist/index.js CHANGED
@@ -392,8 +392,7 @@ class RCTVoice {
392
392
  }
393
393
  }
394
394
  // Export components
395
- export { VoiceMicrophone, MicIcon, MicOffIcon } from './components';
395
+ export { VoiceMicrophone, MicIcon, MicOffIcon, MicIconFilled, MicOffIconFilled, MicIconWave, MicOffIconWave, } from './components';
396
396
  // Export hooks
397
397
  export { useVoiceRecognition } from './hooks';
398
398
  export default new RCTVoice();
399
- //# sourceMappingURL=index.js.map
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "react-native-voice-ts",
3
3
  "description": "Advanced Speech-to-Text library for React Native with TypeScript support. Features ready-to-use components (VoiceMicrophone), custom hooks (useVoiceRecognition), real-time transcription, multi-language support, and comprehensive voice recognition capabilities for iOS and Android.",
4
- "version": "1.0.2",
4
+ "version": "1.0.4",
5
5
  "author": "Noor Mohammad <noor.jsdivs@gmail.com>",
6
6
  "private": false,
7
7
  "homepage": "https://github.com/noorjsdivs/react-native-voice-ts",
@@ -46,17 +46,13 @@
46
46
  "types": "dist/index.d.ts",
47
47
  "files": [
48
48
  "dist",
49
- "src",
50
49
  "android",
51
50
  "ios",
52
- "plugin",
51
+ "plugin/build",
53
52
  "app.plugin.js",
54
53
  "react-native-voice.podspec",
55
54
  "README.md",
56
- "LICENSE",
57
- "COMPONENT_USAGE.md",
58
- "CONTRIBUTING.md",
59
- "MIGRATION_SUMMARY.md"
55
+ "LICENSE"
60
56
  ],
61
57
  "peerDependencies": {
62
58
  "expo": ">=48.0.0",
@@ -98,7 +94,7 @@
98
94
  "lint:plugin": "eslint plugin/src/* --fix",
99
95
  "clean": "rm -rf dist && rm -rf plugin/build",
100
96
  "prepack": "yarn clean && yarn build && yarn build:plugin",
101
- "test": "jest",
97
+ "test": "echo \"No tests in library root. Run 'yarn --cwd example test' to test the example app.\"",
102
98
  "validate": "yarn type-check && yarn lint:check && yarn format:check"
103
99
  },
104
100
  "dependencies": {
package/CONTRIBUTING.md DELETED
@@ -1,293 +0,0 @@
1
- # Contributing to React Native Voice
2
-
3
- Thank you for your interest in contributing to React Native Voice! This document provides guidelines and instructions for contributing to the project.
4
-
5
- ## ๐Ÿค Code of Conduct
6
-
7
- By participating in this project, you agree to abide by our Code of Conduct. Please be respectful and considerate of others.
8
-
9
- ## ๐Ÿ› Reporting Bugs
10
-
11
- Before creating bug reports, please check the existing issues to avoid duplicates. When creating a bug report, include:
12
-
13
- - **Clear title and description**
14
- - **Steps to reproduce** the issue
15
- - **Expected behavior** vs actual behavior
16
- - **Screenshots** (if applicable)
17
- - **Environment details**:
18
- - React Native version
19
- - Device/Emulator and OS version
20
- - Package version
21
- - Any relevant configuration
22
-
23
- ### Bug Report Template
24
-
25
- ```markdown
26
- **Describe the bug**
27
- A clear description of what the bug is.
28
-
29
- **To Reproduce**
30
- Steps to reproduce the behavior:
31
-
32
- 1. Go to '...'
33
- 2. Click on '....'
34
- 3. See error
35
-
36
- **Expected behavior**
37
- What you expected to happen.
38
-
39
- **Screenshots**
40
- If applicable, add screenshots.
41
-
42
- **Environment:**
43
-
44
- - Device: [e.g. iPhone 15, Samsung Galaxy S24]
45
- - OS: [e.g. iOS 17.2, Android 14]
46
- - React Native Version: [e.g. 0.76.9]
47
- - Package Version: [e.g. 3.2.4]
48
-
49
- **Additional context**
50
- Any other context about the problem.
51
- ```
52
-
53
- ## ๐Ÿ’ก Suggesting Features
54
-
55
- Feature suggestions are welcome! Before creating a feature request:
56
-
57
- 1. Check if the feature already exists
58
- 2. Search existing feature requests
59
- 3. Provide a clear use case and rationale
60
- 4. Consider backward compatibility
61
-
62
- ### Feature Request Template
63
-
64
- ```markdown
65
- **Is your feature request related to a problem?**
66
- A clear description of the problem.
67
-
68
- **Describe the solution you'd like**
69
- A clear description of what you want to happen.
70
-
71
- **Describe alternatives you've considered**
72
- Alternative solutions or features you've considered.
73
-
74
- **Additional context**
75
- Any other context, screenshots, or examples.
76
- ```
77
-
78
- ## ๐Ÿ”ง Development Setup
79
-
80
- ### Prerequisites
81
-
82
- - Node.js (>= 18.x)
83
- - Yarn package manager
84
- - React Native development environment set up
85
- - Xcode (for iOS development)
86
- - Android Studio (for Android development)
87
-
88
- ### Installation
89
-
90
- 1. Fork the repository
91
- 2. Clone your fork:
92
-
93
- ```bash
94
- git clone https://github.com/YOUR_USERNAME/react-native-voice-ts.git
95
- cd react-native-voice-ts
96
- ```
97
-
98
- 3. Install dependencies:
99
-
100
- ```bash
101
- yarn install
102
- ```
103
-
104
- 4. Set up the example project:
105
-
106
- ```bash
107
- cd example
108
- yarn install
109
- cd ios && pod install && cd ..
110
- ```
111
-
112
- ### Running the Example
113
-
114
- **iOS:**
115
-
116
- ```bash
117
- cd example
118
- yarn ios
119
- ```
120
-
121
- **Android:**
122
-
123
- ```bash
124
- cd example
125
- yarn android
126
- ```
127
-
128
- ## ๐Ÿ“ Pull Request Process
129
-
130
- 1. **Create a branch** from `main`:
131
-
132
- ```bash
133
- git checkout -b feature/your-feature-name
134
- # or
135
- git checkout -b fix/your-bug-fix
136
- ```
137
-
138
- 2. **Make your changes** following our coding standards
139
-
140
- 3. **Write or update tests** if applicable
141
-
142
- 4. **Update documentation** if you changed any public APIs
143
-
144
- 5. **Run linting and formatting**:
145
-
146
- ```bash
147
- yarn lint
148
- yarn format
149
- ```
150
-
151
- 6. **Build the project** to ensure no errors:
152
-
153
- ```bash
154
- yarn build
155
- ```
156
-
157
- 7. **Test thoroughly** on both iOS and Android
158
-
159
- 8. **Commit your changes** using conventional commits:
160
-
161
- ```bash
162
- git commit -m "feat: add new feature"
163
- # or
164
- git commit -m "fix: resolve issue with X"
165
- ```
166
-
167
- 9. **Push to your fork**:
168
-
169
- ```bash
170
- git push origin feature/your-feature-name
171
- ```
172
-
173
- 10. **Create a Pull Request** with:
174
- - Clear title and description
175
- - Reference to related issues
176
- - Screenshots/videos for UI changes
177
- - Test results on both platforms
178
-
179
- ### Commit Message Guidelines
180
-
181
- We follow [Conventional Commits](https://www.conventionalcommits.org/):
182
-
183
- - `feat:` New feature
184
- - `fix:` Bug fix
185
- - `docs:` Documentation changes
186
- - `style:` Code style changes (formatting, etc.)
187
- - `refactor:` Code refactoring
188
- - `perf:` Performance improvements
189
- - `test:` Adding or updating tests
190
- - `chore:` Build process or auxiliary tool changes
191
-
192
- Examples:
193
-
194
- ```
195
- feat: add volume monitoring callback
196
- fix: resolve Android permission crash
197
- docs: update API reference for new methods
198
- perf: optimize event listener cleanup
199
- ```
200
-
201
- ## ๐ŸŽจ Coding Standards
202
-
203
- ### TypeScript
204
-
205
- - Use TypeScript for all new code
206
- - Properly type all functions and variables
207
- - Avoid `any` types when possible
208
- - Export types for public APIs
209
-
210
- ### Code Style
211
-
212
- - Use 2 spaces for indentation
213
- - Use semicolons
214
- - Use single quotes for strings
215
- - Follow existing code patterns
216
- - Keep functions small and focused
217
-
218
- ### File Structure
219
-
220
- ```
221
- src/
222
- โ”œโ”€โ”€ index.ts # Main export file
223
- โ”œโ”€โ”€ VoiceModuleTypes.ts # Type definitions
224
- โ”œโ”€โ”€ NativeVoiceIOS.ts # iOS native module
225
- โ””โ”€โ”€ NativeVoiceAndroid.ts # Android native module
226
- ```
227
-
228
- ## ๐Ÿงช Testing
229
-
230
- ### Manual Testing
231
-
232
- Test your changes on:
233
-
234
- - โœ… iOS (physical device preferred)
235
- - โœ… Android (physical device preferred)
236
- - โœ… Different React Native versions (if applicable)
237
- - โœ… Different OS versions
238
-
239
- ### Checklist
240
-
241
- - [ ] Code follows the project's style guidelines
242
- - [ ] Self-review of code completed
243
- - [ ] Comments added for complex code
244
- - [ ] Documentation updated
245
- - [ ] No new warnings generated
246
- - [ ] Tested on iOS
247
- - [ ] Tested on Android
248
- - [ ] Breaking changes documented
249
-
250
- ## ๐Ÿ“š Documentation
251
-
252
- When adding or modifying features:
253
-
254
- 1. **Update README.md** with API changes
255
- 2. **Add examples** to EXAMPLES.md
256
- 3. **Update TypeScript definitions**
257
- 4. **Document breaking changes** in CHANGELOG.md
258
-
259
- ## ๐Ÿ” Review Process
260
-
261
- 1. Maintainers will review your PR
262
- 2. Address any feedback or requested changes
263
- 3. Once approved, your PR will be merged
264
- 4. Your contribution will be included in the next release
265
-
266
- ## ๐Ÿ“ฆ Release Process
267
-
268
- Releases are managed by maintainers:
269
-
270
- 1. Version bump following semantic versioning
271
- 2. Update CHANGELOG.md
272
- 3. Create GitHub release
273
- 4. Publish to npm
274
-
275
- ## ๐Ÿ™‹ Getting Help
276
-
277
- - **Questions?** Open a [Discussion](https://github.com/noorjsdivs/react-native-voice-ts/discussions)
278
- - **Issues?** Create an [Issue](https://github.com/noorjsdivs/react-native-voice-ts/issues)
279
- - **Security concerns?** Email noor.jsdivs@gmail.com
280
-
281
- ## ๐Ÿ† Recognition
282
-
283
- Contributors will be recognized in:
284
-
285
- - Release notes
286
- - Contributors section
287
- - Project documentation
288
-
289
- Thank you for contributing to React Native Voice! ๐ŸŽ‰
290
-
291
- ## ๐Ÿ“„ License
292
-
293
- By contributing, you agree that your contributions will be licensed under the MIT License.
@@ -1 +0,0 @@
1
- {"version":3,"file":"NativeVoiceAndroid.d.ts","sourceRoot":"","sources":["../src/NativeVoiceAndroid.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,cAAc,CAAC;AAEhD,KAAK,UAAU,GAAG;IAChB,oBAAoB,EAAE,MAAM,CAAC;IAC7B,iBAAiB,EAAE,MAAM,CAAC;IAC1B,qBAAqB,EAAE,MAAM,CAAC;IAC9B,wBAAwB,EAAE,MAAM,CAAC;IACjC,iBAAiB,EAAE,MAAM,CAAC;CAC3B,CAAC;AACF,MAAM,WAAW,IAAK,SAAQ,WAAW;IACvC,aAAa,EAAE,CAAC,QAAQ,EAAE,CAAC,KAAK,EAAE,MAAM,KAAK,IAAI,KAAK,IAAI,CAAC;IAC3D,WAAW,EAAE,CACX,MAAM,EAAE,MAAM,EACd,IAAI,EAAE,UAAU,EAChB,QAAQ,EAAE,CAAC,KAAK,EAAE,MAAM,KAAK,IAAI,KAC9B,IAAI,CAAC;IACV,UAAU,EAAE,CAAC,QAAQ,EAAE,CAAC,KAAK,EAAE,MAAM,KAAK,IAAI,KAAK,IAAI,CAAC;IACxD,YAAY,EAAE,CAAC,QAAQ,EAAE,CAAC,KAAK,EAAE,MAAM,KAAK,IAAI,KAAK,IAAI,CAAC;IAC1D,iBAAiB,EAAE,CACjB,QAAQ,EAAE,CAAC,WAAW,EAAE,OAAO,EAAE,KAAK,EAAE,MAAM,KAAK,IAAI,KACpD,IAAI,CAAC;IACV,4BAA4B,IAAI,OAAO,CAAC,MAAM,EAAE,CAAC,CAAC;IAClD,aAAa,EAAE,CAAC,QAAQ,EAAE,CAAC,WAAW,EAAE,OAAO,KAAK,IAAI,KAAK,IAAI,CAAC;IAClE,WAAW,EAAE,CAAC,SAAS,EAAE,MAAM,KAAK,IAAI,CAAC;IACzC,eAAe,EAAE,CAAC,KAAK,EAAE,MAAM,KAAK,IAAI,CAAC;CAC1C;;AAED,wBAA+D"}
@@ -1 +0,0 @@
1
- {"version":3,"file":"NativeVoiceAndroid.js","sourceRoot":"","sources":["../src/NativeVoiceAndroid.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,mBAAmB,EAAE,MAAM,cAAc,CAAC;AA0BnD,eAAe,mBAAmB,CAAC,YAAY,CAAO,OAAO,CAAC,CAAC"}
@@ -1 +0,0 @@
1
- {"version":3,"file":"NativeVoiceIOS.d.ts","sourceRoot":"","sources":["../src/NativeVoiceIOS.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,cAAc,CAAC;AAGhD,MAAM,WAAW,IAAK,SAAQ,WAAW;IACvC,aAAa,EAAE,CAAC,QAAQ,EAAE,CAAC,KAAK,EAAE,MAAM,KAAK,IAAI,KAAK,IAAI,CAAC;IAC3D,WAAW,EAAE,CAAC,MAAM,EAAE,MAAM,EAAE,QAAQ,EAAE,CAAC,KAAK,EAAE,MAAM,KAAK,IAAI,KAAK,IAAI,CAAC;IACzE,kBAAkB,EAAE,CAClB,MAAM,EAAE,MAAM,EACd,QAAQ,EAAE,CAAC,KAAK,EAAE,MAAM,KAAK,IAAI,KAC9B,IAAI,CAAC;IACV,UAAU,EAAE,CAAC,QAAQ,EAAE,CAAC,KAAK,EAAE,MAAM,KAAK,IAAI,KAAK,IAAI,CAAC;IACxD,iBAAiB,EAAE,CAAC,QAAQ,EAAE,CAAC,KAAK,EAAE,MAAM,KAAK,IAAI,KAAK,IAAI,CAAC;IAC/D,YAAY,EAAE,CAAC,QAAQ,EAAE,CAAC,KAAK,EAAE,MAAM,KAAK,IAAI,KAAK,IAAI,CAAC;IAC1D,mBAAmB,EAAE,CAAC,QAAQ,EAAE,CAAC,KAAK,EAAE,MAAM,KAAK,IAAI,KAAK,IAAI,CAAC;IACjE,iBAAiB,EAAE,CACjB,QAAQ,EAAE,CAAC,WAAW,EAAE,OAAO,EAAE,KAAK,EAAE,MAAM,KAAK,IAAI,KACpD,IAAI,CAAC;IACV,aAAa,EAAE,CAAC,QAAQ,EAAE,CAAC,WAAW,EAAE,OAAO,KAAK,IAAI,KAAK,IAAI,CAAC;IAClE,WAAW,EAAE,CAAC,SAAS,EAAE,MAAM,KAAK,IAAI,CAAC;IACzC,eAAe,EAAE,CAAC,KAAK,EAAE,MAAM,KAAK,IAAI,CAAC;IACzC,oBAAoB,EAAE,CAAC,QAAQ,EAAE,CAAC,KAAK,EAAE,MAAM,KAAK,IAAI,KAAK,IAAI,CAAC;CACnE;;AAED,wBAA+D"}
@@ -1 +0,0 @@
1
- {"version":3,"file":"NativeVoiceIOS.js","sourceRoot":"","sources":["../src/NativeVoiceIOS.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,mBAAmB,EAAE,MAAM,cAAc,CAAC;AAsBnD,eAAe,mBAAmB,CAAC,YAAY,CAAO,OAAO,CAAC,CAAC"}
@@ -1 +0,0 @@
1
- {"version":3,"file":"VoiceModuleTypes.d.ts","sourceRoot":"","sources":["../src/VoiceModuleTypes.ts"],"names":[],"mappings":"AAAA,MAAM,MAAM,YAAY,GAAG;IACzB,aAAa,CAAC,EAAE,CAAC,CAAC,EAAE,gBAAgB,KAAK,IAAI,CAAC;IAC9C,kBAAkB,CAAC,EAAE,CAAC,CAAC,EAAE,qBAAqB,KAAK,IAAI,CAAC;IACxD,WAAW,CAAC,EAAE,CAAC,CAAC,EAAE,cAAc,KAAK,IAAI,CAAC;IAC1C,aAAa,CAAC,EAAE,CAAC,CAAC,EAAE,gBAAgB,KAAK,IAAI,CAAC;IAC9C,eAAe,CAAC,EAAE,CAAC,CAAC,EAAE,kBAAkB,KAAK,IAAI,CAAC;IAClD,sBAAsB,CAAC,EAAE,CAAC,CAAC,EAAE,kBAAkB,KAAK,IAAI,CAAC;IACzD,qBAAqB,CAAC,EAAE,CAAC,CAAC,EAAE,uBAAuB,KAAK,IAAI,CAAC;CAC9D,CAAC;AAEF,MAAM,MAAM,mBAAmB,GAAG;IAChC,oBAAoB,CAAC,EAAE,CAAC,CAAC,EAAE,uBAAuB,KAAK,IAAI,CAAC;IAC5D,kBAAkB,CAAC,EAAE,CAAC,CAAC,EAAE,qBAAqB,KAAK,IAAI,CAAC;IACxD,oBAAoB,CAAC,EAAE,CAAC,CAAC,EAAE,uBAAuB,KAAK,IAAI,CAAC;IAC5D,sBAAsB,CAAC,EAAE,CAAC,CAAC,EAAE,yBAAyB,KAAK,IAAI,CAAC;CACjE,CAAC;AAEF,MAAM,MAAM,gBAAgB,GAAG;IAC7B,KAAK,CAAC,EAAE,OAAO,CAAC;CACjB,CAAC;AAEF,MAAM,MAAM,uBAAuB,GAAG;IACpC,KAAK,CAAC,EAAE,OAAO,CAAC;CACjB,CAAC;AAEF,MAAM,MAAM,qBAAqB,GAAG;IAClC,OAAO,CAAC,EAAE,OAAO,CAAC;CACnB,CAAC;AAEF,MAAM,MAAM,kBAAkB,GAAG;IAC/B,KAAK,CAAC,EAAE,MAAM,EAAE,CAAC;CAClB,CAAC;AAEF,MAAM,MAAM,yBAAyB,GAAG;IACtC,QAAQ,CAAC,EAAE,MAAM,EAAE,CAAC;IACpB,aAAa,CAAC,EAAE,MAAM,CAAC;IACvB,OAAO,CAAC,EAAE,OAAO,CAAC;CACnB,CAAC;AAEF,MAAM,MAAM,gBAAgB,GAAG;IAC7B,KAAK,CAAC,EAAE;QACN,IAAI,CAAC,EAAE,MAAM,CAAC;QACd,OAAO,CAAC,EAAE,MAAM,CAAC;KAClB,CAAC;CACH,CAAC;AAEF,MAAM,MAAM,uBAAuB,GAAG;IACpC,KAAK,CAAC,EAAE;QACN,IAAI,CAAC,EAAE,MAAM,CAAC;QACd,OAAO,CAAC,EAAE,MAAM,CAAC;KAClB,CAAC;CACH,CAAC;AAEF,MAAM,MAAM,cAAc,GAAG;IAC3B,KAAK,CAAC,EAAE,OAAO,CAAC;CACjB,CAAC;AAEF,MAAM,MAAM,qBAAqB,GAAG;IAClC,KAAK,CAAC,EAAE,OAAO,CAAC;CACjB,CAAC;AAEF,MAAM,MAAM,uBAAuB,GAAG;IACpC,KAAK,CAAC,EAAE,MAAM,CAAC;CAChB,CAAC"}
@@ -1 +0,0 @@
1
- {"version":3,"file":"VoiceModuleTypes.js","sourceRoot":"","sources":["../src/VoiceModuleTypes.ts"],"names":[],"mappings":""}
@@ -1 +0,0 @@
1
- {"version":3,"file":"VoiceUtilTypes.d.ts","sourceRoot":"","sources":["../src/VoiceUtilTypes.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAEH,MAAM,WAAW,YAAY;IAC3B,2FAA2F;IAC3F,oBAAoB,CAAC,EAAE,MAAM,CAAC;IAC9B,yCAAyC;IACzC,iBAAiB,CAAC,EAAE,MAAM,CAAC;IAC3B,sCAAsC;IACtC,qBAAqB,CAAC,EAAE,OAAO,CAAC;IAChC,wCAAwC;IACxC,wBAAwB,CAAC,EAAE,OAAO,CAAC;IACnC,8CAA8C;IAC9C,WAAW,CAAC,EAAE,MAAM,CAAC;CACtB;AAED,MAAM,WAAW,gBAAgB;IAC/B,8CAA8C;IAC9C,QAAQ,EAAE,MAAM,CAAC;IACjB,8CAA8C;IAC9C,QAAQ,EAAE,OAAO,CAAC;IAClB,8BAA8B;IAC9B,WAAW,EAAE,MAAM,EAAE,CAAC;IACtB,sBAAsB;IACtB,SAAS,EAAE,MAAM,CAAC;CACnB;AAED,MAAM,WAAW,gBAAgB;IAC/B,qCAAqC;IACrC,OAAO,EAAE,OAAO,CAAC;IACjB,+CAA+C;IAC/C,KAAK,CAAC,EAAE,MAAM,CAAC;CAChB;AAED,MAAM,WAAW,QAAQ;IACvB,oCAAoC;IACpC,IAAI,EAAE,MAAM,CAAC;IACb,mBAAmB;IACnB,IAAI,EAAE,MAAM,CAAC;IACb,oCAAoC;IACpC,SAAS,EAAE,OAAO,CAAC;CACpB"}
@@ -1 +0,0 @@
1
- {"version":3,"file":"VoiceUtilTypes.js","sourceRoot":"","sources":["../src/VoiceUtilTypes.ts"],"names":[],"mappings":"AAAA;;;;;GAKG"}
@@ -1 +0,0 @@
1
- {"version":3,"file":"MicIcon.d.ts","sourceRoot":"","sources":["../../src/components/MicIcon.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAC;AAG1B,MAAM,WAAW,YAAY;IAC3B,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,WAAW,CAAC,EAAE,MAAM,CAAC;CACtB;AAED;;;GAGG;AACH,eAAO,MAAM,OAAO,EAAE,KAAK,CAAC,EAAE,CAAC,YAAY,CAqB1C,CAAC;AAEF,MAAM,WAAW,eAAe;IAC9B,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,WAAW,CAAC,EAAE,MAAM,CAAC;CACtB;AAED;;;GAGG;AACH,eAAO,MAAM,UAAU,EAAE,KAAK,CAAC,EAAE,CAAC,eAAe,CAuBhD,CAAC;AAEF,eAAe,OAAO,CAAC"}