@capgo/capacitor-speech-recognition 8.0.9 → 8.1.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.
@@ -37,17 +37,64 @@ export interface SpeechRecognitionStartOptions {
37
37
  * Enables native punctuation handling where supported (iOS 16+).
38
38
  */
39
39
  addPunctuation?: boolean;
40
+ /**
41
+ * Opt in to the platform's newer on-device recognition path when available.
42
+ *
43
+ * On iOS 26+, this uses Apple's `SpeechAnalyzer` / `SpeechTranscriber` pipeline.
44
+ * On recent Android versions, this uses the on-device `SpeechRecognizer` path.
45
+ *
46
+ * It is intentionally opt-in so existing apps keep the legacy flow unless they choose
47
+ * to roll out the new behavior.
48
+ *
49
+ * Use {@link SpeechRecognitionPlugin.isOnDeviceRecognitionAvailable} before enabling it in production.
50
+ *
51
+ * Platform SDK docs:
52
+ * iOS: [Speech](https://developer.apple.com/documentation/speech),
53
+ * [SpeechAnalyzer](https://developer.apple.com/documentation/speech/speechanalyzer),
54
+ * [SpeechTranscriber](https://developer.apple.com/documentation/speech/speechtranscriber)
55
+ * Android: [SpeechRecognizer](https://developer.android.com/reference/android/speech/SpeechRecognizer)
56
+ *
57
+ * Defaults to `false`.
58
+ */
59
+ useOnDeviceRecognition?: boolean;
40
60
  /**
41
61
  * Allow a number of milliseconds of silence before splitting the recognition session into segments.
42
62
  * Required to be greater than zero and currently supported on Android only.
43
63
  */
44
64
  allowForSilence?: number;
65
+ /**
66
+ * EXPERIMENTAL: Keep a PTT session alive across silence by restarting recognition while the button stays held.
67
+ *
68
+ * This restart behavior is implemented for Android inline recognition and iOS native recognition.
69
+ */
70
+ continuousPTT?: boolean;
45
71
  }
46
72
  /**
47
73
  * Raised whenever a partial transcription is produced.
48
74
  */
49
75
  export interface SpeechRecognitionPartialResultEvent {
50
- matches: string[];
76
+ /**
77
+ * Current recognition matches when the native recognizer reports them.
78
+ *
79
+ * This can be omitted for forced or accumulated-only payloads.
80
+ */
81
+ matches?: string[];
82
+ /**
83
+ * Accumulated transcription from earlier continuous PTT cycles.
84
+ */
85
+ accumulated?: string;
86
+ /**
87
+ * Final accumulated text including the current result.
88
+ */
89
+ accumulatedText?: string;
90
+ /**
91
+ * `true` when the plugin is restarting recognition inside a continuous PTT session.
92
+ */
93
+ isRestarting?: boolean;
94
+ /**
95
+ * `true` when the payload was emitted by `forceStop()`.
96
+ */
97
+ forced?: boolean;
51
98
  }
52
99
  /**
53
100
  * Raised whenever a segmented result is produced (Android only).
@@ -55,11 +102,55 @@ export interface SpeechRecognitionPartialResultEvent {
55
102
  export interface SpeechRecognitionSegmentResultEvent {
56
103
  matches: string[];
57
104
  }
105
+ /**
106
+ * Finite state values for the recognition session lifecycle.
107
+ */
108
+ export type ListeningFiniteState = 'startingListening' | 'started' | 'stoppingListening' | 'stopped';
109
+ /**
110
+ * Why a listening state transition happened.
111
+ */
112
+ export type ListeningReason = 'userStart' | 'userStop' | 'forceStop' | 'results' | 'silence' | 'error' | 'unknown';
58
113
  /**
59
114
  * Raised when the listening state changes.
115
+ *
116
+ * The original `status` field is preserved for backward compatibility and is present
117
+ * on the binary `started` / `stopped` states.
60
118
  */
61
119
  export interface SpeechRecognitionListeningEvent {
62
- status: 'started' | 'stopped';
120
+ /**
121
+ * Finite state of the recognition session.
122
+ */
123
+ state?: ListeningFiniteState;
124
+ /**
125
+ * Unique identifier for the current listening session.
126
+ */
127
+ sessionId?: number;
128
+ /**
129
+ * Why this state transition occurred.
130
+ */
131
+ reason?: ListeningReason;
132
+ /**
133
+ * Error code when the transition is caused by an error.
134
+ */
135
+ errorCode?: string;
136
+ /**
137
+ * Backward-compatible binary state used by earlier releases.
138
+ */
139
+ status?: 'started' | 'stopped';
140
+ }
141
+ /**
142
+ * Raised whenever native recognition reports an error.
143
+ */
144
+ export interface SpeechRecognitionErrorEvent {
145
+ code: string;
146
+ message: string;
147
+ sessionId: number;
148
+ }
149
+ /**
150
+ * Emitted after native resources have been torn down and the plugin is ready for another session.
151
+ */
152
+ export interface SpeechRecognitionReadyEvent {
153
+ sessionId: number;
63
154
  }
64
155
  export interface SpeechRecognitionAvailability {
65
156
  available: boolean;
@@ -73,22 +164,98 @@ export interface SpeechRecognitionLanguages {
73
164
  export interface SpeechRecognitionListening {
74
165
  listening: boolean;
75
166
  }
167
+ /**
168
+ * Options for {@link SpeechRecognitionPlugin.forceStop}.
169
+ */
170
+ export interface ForceStopOptions {
171
+ /**
172
+ * Android only: timeout in milliseconds before forcing stop via destroy/recreate.
173
+ *
174
+ * On iOS, the current session is stopped immediately and this value is ignored.
175
+ *
176
+ * Defaults to `1500`.
177
+ */
178
+ timeout?: number;
179
+ }
180
+ /**
181
+ * Result from {@link SpeechRecognitionPlugin.getLastPartialResult}.
182
+ */
183
+ export interface LastPartialResult {
184
+ /**
185
+ * Whether a partial result is currently cached.
186
+ */
187
+ available: boolean;
188
+ /**
189
+ * The most recent transcript text known to the native recognizer.
190
+ */
191
+ text: string;
192
+ /**
193
+ * All current match alternatives when available.
194
+ */
195
+ matches?: string[];
196
+ }
197
+ /**
198
+ * Options for {@link SpeechRecognitionPlugin.setPTTState}.
199
+ */
200
+ export interface PTTStateOptions {
201
+ /**
202
+ * Whether the PTT button is currently held.
203
+ */
204
+ held: boolean;
205
+ }
76
206
  export interface SpeechRecognitionPlugin {
77
207
  /**
78
208
  * Checks whether the native speech recognition service is usable on the current device.
79
209
  */
80
210
  available(): Promise<SpeechRecognitionAvailability>;
211
+ /**
212
+ * Checks whether the platform's newer on-device recognition path is available for the selected locale.
213
+ *
214
+ * This is the capability check you should use before enabling `useOnDeviceRecognition`.
215
+ * A `true` result means the current device, OS version, and locale can use the newer
216
+ * on-device path for that platform.
217
+ *
218
+ * Returns `false` when the device only supports the legacy recognizer path.
219
+ *
220
+ * Platform SDK docs:
221
+ * iOS: [Speech](https://developer.apple.com/documentation/speech)
222
+ * Android: [SpeechRecognizer](https://developer.android.com/reference/android/speech/SpeechRecognizer)
223
+ */
224
+ isOnDeviceRecognitionAvailable(options?: Pick<SpeechRecognitionStartOptions, 'language'>): Promise<SpeechRecognitionAvailability>;
81
225
  /**
82
226
  * Begins capturing audio and transcribing speech.
83
227
  *
84
228
  * When `partialResults` is `true`, the returned promise resolves immediately and updates are
85
- * streamed through the `partialResults` listener until {@link stop} is called.
229
+ * streamed through the `partialResults` listener until the session ends.
230
+ *
231
+ * The default path keeps the legacy recognizer behavior for backward compatibility.
232
+ * Pass `useOnDeviceRecognition: true` only after checking
233
+ * {@link SpeechRecognitionPlugin.isOnDeviceRecognitionAvailable}.
86
234
  */
87
235
  start(options?: SpeechRecognitionStartOptions): Promise<SpeechRecognitionMatches>;
88
236
  /**
89
237
  * Stops listening and tears down native resources.
90
238
  */
91
239
  stop(): Promise<void>;
240
+ /**
241
+ * Force stops the current session.
242
+ *
243
+ * On Android, this first tries a normal stop and then falls back to destroy/recreate after `timeout`.
244
+ * On iOS, the current session is stopped immediately.
245
+ *
246
+ * If a partial transcript is cached, it is emitted through the `partialResults` listener with `forced: true`.
247
+ */
248
+ forceStop(options?: ForceStopOptions): Promise<void>;
249
+ /**
250
+ * Gets the last cached partial transcription result.
251
+ */
252
+ getLastPartialResult(): Promise<LastPartialResult>;
253
+ /**
254
+ * Updates the current push-to-talk button state.
255
+ *
256
+ * Use this together with `continuousPTT` or with a custom hold-to-talk flow.
257
+ */
258
+ setPTTState(options: PTTStateOptions): Promise<void>;
92
259
  /**
93
260
  * Gets the locales supported by the underlying recognizer.
94
261
  *
@@ -131,6 +298,14 @@ export interface SpeechRecognitionPlugin {
131
298
  * Listen for changes to the native listening state.
132
299
  */
133
300
  addListener(eventName: 'listeningState', listenerFunc: (event: SpeechRecognitionListeningEvent) => void): Promise<PluginListenerHandle>;
301
+ /**
302
+ * Listen for recognition errors.
303
+ */
304
+ addListener(eventName: 'error', listenerFunc: (event: SpeechRecognitionErrorEvent) => void): Promise<PluginListenerHandle>;
305
+ /**
306
+ * Listen for the recognizer becoming ready for another session.
307
+ */
308
+ addListener(eventName: 'readyForNextSession', listenerFunc: (event: SpeechRecognitionReadyEvent) => void): Promise<PluginListenerHandle>;
134
309
  /**
135
310
  * Removes every registered listener.
136
311
  */
@@ -1 +1 @@
1
- {"version":3,"file":"definitions.js","sourceRoot":"","sources":["../../src/definitions.ts"],"names":[],"mappings":"","sourcesContent":["import type { PermissionState, PluginListenerHandle } from '@capacitor/core';\n\n/**\n * Permission map returned by `checkPermissions` and `requestPermissions`.\n *\n * On Android the state maps to the `RECORD_AUDIO` permission.\n * On iOS it combines speech recognition plus microphone permission.\n */\nexport interface SpeechRecognitionPermissionStatus {\n speechRecognition: PermissionState;\n}\n\n/**\n * Configure how the recognizer behaves when calling {@link SpeechRecognitionPlugin.start}.\n */\nexport interface SpeechRecognitionStartOptions {\n /**\n * Locale identifier such as `en-US`. When omitted the device language is used.\n */\n language?: string;\n /**\n * Maximum number of final matches returned by native APIs. Defaults to `5`.\n */\n maxResults?: number;\n /**\n * Prompt message shown inside the Android system dialog (ignored on iOS).\n */\n prompt?: string;\n /**\n * When `true`, Android shows the OS speech dialog instead of running inline recognition.\n * Defaults to `false`.\n */\n popup?: boolean;\n /**\n * Emits partial transcription updates through the `partialResults` listener while audio is captured.\n */\n partialResults?: boolean;\n /**\n * Enables native punctuation handling where supported (iOS 16+).\n */\n addPunctuation?: boolean;\n /**\n * Allow a number of milliseconds of silence before splitting the recognition session into segments.\n * Required to be greater than zero and currently supported on Android only.\n */\n allowForSilence?: number;\n}\n\n/**\n * Raised whenever a partial transcription is produced.\n */\nexport interface SpeechRecognitionPartialResultEvent {\n matches: string[];\n}\n\n/**\n * Raised whenever a segmented result is produced (Android only).\n */\nexport interface SpeechRecognitionSegmentResultEvent {\n matches: string[];\n}\n\n/**\n * Raised when the listening state changes.\n */\nexport interface SpeechRecognitionListeningEvent {\n status: 'started' | 'stopped';\n}\n\nexport interface SpeechRecognitionAvailability {\n available: boolean;\n}\n\nexport interface SpeechRecognitionMatches {\n matches?: string[];\n}\n\nexport interface SpeechRecognitionLanguages {\n languages: string[];\n}\n\nexport interface SpeechRecognitionListening {\n listening: boolean;\n}\n\nexport interface SpeechRecognitionPlugin {\n /**\n * Checks whether the native speech recognition service is usable on the current device.\n */\n available(): Promise<SpeechRecognitionAvailability>;\n /**\n * Begins capturing audio and transcribing speech.\n *\n * When `partialResults` is `true`, the returned promise resolves immediately and updates are\n * streamed through the `partialResults` listener until {@link stop} is called.\n */\n start(options?: SpeechRecognitionStartOptions): Promise<SpeechRecognitionMatches>;\n /**\n * Stops listening and tears down native resources.\n */\n stop(): Promise<void>;\n /**\n * Gets the locales supported by the underlying recognizer.\n *\n * Android 13+ devices no longer expose this list; in that case `languages` is empty.\n */\n getSupportedLanguages(): Promise<SpeechRecognitionLanguages>;\n /**\n * Returns whether the plugin is actively listening for speech.\n */\n isListening(): Promise<SpeechRecognitionListening>;\n /**\n * Gets the current permission state.\n */\n checkPermissions(): Promise<SpeechRecognitionPermissionStatus>;\n /**\n * Requests the microphone + speech recognition permissions.\n */\n requestPermissions(): Promise<SpeechRecognitionPermissionStatus>;\n /**\n * Returns the native plugin version bundled with this package.\n *\n * Useful when reporting issues to confirm that native and JS versions match.\n */\n getPluginVersion(): Promise<{ version: string }>;\n /**\n * Listen for segmented session completion events (Android only).\n */\n addListener(eventName: 'endOfSegmentedSession', listenerFunc: () => void): Promise<PluginListenerHandle>;\n /**\n * Listen for segmented recognition results (Android only).\n */\n addListener(\n eventName: 'segmentResults',\n listenerFunc: (event: SpeechRecognitionSegmentResultEvent) => void,\n ): Promise<PluginListenerHandle>;\n /**\n * Listen for partial transcription updates emitted while `partialResults` is enabled.\n */\n addListener(\n eventName: 'partialResults',\n listenerFunc: (event: SpeechRecognitionPartialResultEvent) => void,\n ): Promise<PluginListenerHandle>;\n /**\n * Listen for changes to the native listening state.\n */\n addListener(\n eventName: 'listeningState',\n listenerFunc: (event: SpeechRecognitionListeningEvent) => void,\n ): Promise<PluginListenerHandle>;\n /**\n * Removes every registered listener.\n */\n removeAllListeners(): Promise<void>;\n}\n"]}
1
+ {"version":3,"file":"definitions.js","sourceRoot":"","sources":["../../src/definitions.ts"],"names":[],"mappings":"","sourcesContent":["import type { PermissionState, PluginListenerHandle } from '@capacitor/core';\n\n/**\n * Permission map returned by `checkPermissions` and `requestPermissions`.\n *\n * On Android the state maps to the `RECORD_AUDIO` permission.\n * On iOS it combines speech recognition plus microphone permission.\n */\nexport interface SpeechRecognitionPermissionStatus {\n speechRecognition: PermissionState;\n}\n\n/**\n * Configure how the recognizer behaves when calling {@link SpeechRecognitionPlugin.start}.\n */\nexport interface SpeechRecognitionStartOptions {\n /**\n * Locale identifier such as `en-US`. When omitted the device language is used.\n */\n language?: string;\n /**\n * Maximum number of final matches returned by native APIs. Defaults to `5`.\n */\n maxResults?: number;\n /**\n * Prompt message shown inside the Android system dialog (ignored on iOS).\n */\n prompt?: string;\n /**\n * When `true`, Android shows the OS speech dialog instead of running inline recognition.\n * Defaults to `false`.\n */\n popup?: boolean;\n /**\n * Emits partial transcription updates through the `partialResults` listener while audio is captured.\n */\n partialResults?: boolean;\n /**\n * Enables native punctuation handling where supported (iOS 16+).\n */\n addPunctuation?: boolean;\n /**\n * Opt in to the platform's newer on-device recognition path when available.\n *\n * On iOS 26+, this uses Apple's `SpeechAnalyzer` / `SpeechTranscriber` pipeline.\n * On recent Android versions, this uses the on-device `SpeechRecognizer` path.\n *\n * It is intentionally opt-in so existing apps keep the legacy flow unless they choose\n * to roll out the new behavior.\n *\n * Use {@link SpeechRecognitionPlugin.isOnDeviceRecognitionAvailable} before enabling it in production.\n *\n * Platform SDK docs:\n * iOS: [Speech](https://developer.apple.com/documentation/speech),\n * [SpeechAnalyzer](https://developer.apple.com/documentation/speech/speechanalyzer),\n * [SpeechTranscriber](https://developer.apple.com/documentation/speech/speechtranscriber)\n * Android: [SpeechRecognizer](https://developer.android.com/reference/android/speech/SpeechRecognizer)\n *\n * Defaults to `false`.\n */\n useOnDeviceRecognition?: boolean;\n /**\n * Allow a number of milliseconds of silence before splitting the recognition session into segments.\n * Required to be greater than zero and currently supported on Android only.\n */\n allowForSilence?: number;\n /**\n * EXPERIMENTAL: Keep a PTT session alive across silence by restarting recognition while the button stays held.\n *\n * This restart behavior is implemented for Android inline recognition and iOS native recognition.\n */\n continuousPTT?: boolean;\n}\n\n/**\n * Raised whenever a partial transcription is produced.\n */\nexport interface SpeechRecognitionPartialResultEvent {\n /**\n * Current recognition matches when the native recognizer reports them.\n *\n * This can be omitted for forced or accumulated-only payloads.\n */\n matches?: string[];\n /**\n * Accumulated transcription from earlier continuous PTT cycles.\n */\n accumulated?: string;\n /**\n * Final accumulated text including the current result.\n */\n accumulatedText?: string;\n /**\n * `true` when the plugin is restarting recognition inside a continuous PTT session.\n */\n isRestarting?: boolean;\n /**\n * `true` when the payload was emitted by `forceStop()`.\n */\n forced?: boolean;\n}\n\n/**\n * Raised whenever a segmented result is produced (Android only).\n */\nexport interface SpeechRecognitionSegmentResultEvent {\n matches: string[];\n}\n\n/**\n * Finite state values for the recognition session lifecycle.\n */\nexport type ListeningFiniteState = 'startingListening' | 'started' | 'stoppingListening' | 'stopped';\n\n/**\n * Why a listening state transition happened.\n */\nexport type ListeningReason = 'userStart' | 'userStop' | 'forceStop' | 'results' | 'silence' | 'error' | 'unknown';\n\n/**\n * Raised when the listening state changes.\n *\n * The original `status` field is preserved for backward compatibility and is present\n * on the binary `started` / `stopped` states.\n */\nexport interface SpeechRecognitionListeningEvent {\n /**\n * Finite state of the recognition session.\n */\n state?: ListeningFiniteState;\n /**\n * Unique identifier for the current listening session.\n */\n sessionId?: number;\n /**\n * Why this state transition occurred.\n */\n reason?: ListeningReason;\n /**\n * Error code when the transition is caused by an error.\n */\n errorCode?: string;\n /**\n * Backward-compatible binary state used by earlier releases.\n */\n status?: 'started' | 'stopped';\n}\n\n/**\n * Raised whenever native recognition reports an error.\n */\nexport interface SpeechRecognitionErrorEvent {\n code: string;\n message: string;\n sessionId: number;\n}\n\n/**\n * Emitted after native resources have been torn down and the plugin is ready for another session.\n */\nexport interface SpeechRecognitionReadyEvent {\n sessionId: number;\n}\n\nexport interface SpeechRecognitionAvailability {\n available: boolean;\n}\n\nexport interface SpeechRecognitionMatches {\n matches?: string[];\n}\n\nexport interface SpeechRecognitionLanguages {\n languages: string[];\n}\n\nexport interface SpeechRecognitionListening {\n listening: boolean;\n}\n\n/**\n * Options for {@link SpeechRecognitionPlugin.forceStop}.\n */\nexport interface ForceStopOptions {\n /**\n * Android only: timeout in milliseconds before forcing stop via destroy/recreate.\n *\n * On iOS, the current session is stopped immediately and this value is ignored.\n *\n * Defaults to `1500`.\n */\n timeout?: number;\n}\n\n/**\n * Result from {@link SpeechRecognitionPlugin.getLastPartialResult}.\n */\nexport interface LastPartialResult {\n /**\n * Whether a partial result is currently cached.\n */\n available: boolean;\n /**\n * The most recent transcript text known to the native recognizer.\n */\n text: string;\n /**\n * All current match alternatives when available.\n */\n matches?: string[];\n}\n\n/**\n * Options for {@link SpeechRecognitionPlugin.setPTTState}.\n */\nexport interface PTTStateOptions {\n /**\n * Whether the PTT button is currently held.\n */\n held: boolean;\n}\n\nexport interface SpeechRecognitionPlugin {\n /**\n * Checks whether the native speech recognition service is usable on the current device.\n */\n available(): Promise<SpeechRecognitionAvailability>;\n /**\n * Checks whether the platform's newer on-device recognition path is available for the selected locale.\n *\n * This is the capability check you should use before enabling `useOnDeviceRecognition`.\n * A `true` result means the current device, OS version, and locale can use the newer\n * on-device path for that platform.\n *\n * Returns `false` when the device only supports the legacy recognizer path.\n *\n * Platform SDK docs:\n * iOS: [Speech](https://developer.apple.com/documentation/speech)\n * Android: [SpeechRecognizer](https://developer.android.com/reference/android/speech/SpeechRecognizer)\n */\n isOnDeviceRecognitionAvailable(\n options?: Pick<SpeechRecognitionStartOptions, 'language'>,\n ): Promise<SpeechRecognitionAvailability>;\n /**\n * Begins capturing audio and transcribing speech.\n *\n * When `partialResults` is `true`, the returned promise resolves immediately and updates are\n * streamed through the `partialResults` listener until the session ends.\n *\n * The default path keeps the legacy recognizer behavior for backward compatibility.\n * Pass `useOnDeviceRecognition: true` only after checking\n * {@link SpeechRecognitionPlugin.isOnDeviceRecognitionAvailable}.\n */\n start(options?: SpeechRecognitionStartOptions): Promise<SpeechRecognitionMatches>;\n /**\n * Stops listening and tears down native resources.\n */\n stop(): Promise<void>;\n /**\n * Force stops the current session.\n *\n * On Android, this first tries a normal stop and then falls back to destroy/recreate after `timeout`.\n * On iOS, the current session is stopped immediately.\n *\n * If a partial transcript is cached, it is emitted through the `partialResults` listener with `forced: true`.\n */\n forceStop(options?: ForceStopOptions): Promise<void>;\n /**\n * Gets the last cached partial transcription result.\n */\n getLastPartialResult(): Promise<LastPartialResult>;\n /**\n * Updates the current push-to-talk button state.\n *\n * Use this together with `continuousPTT` or with a custom hold-to-talk flow.\n */\n setPTTState(options: PTTStateOptions): Promise<void>;\n /**\n * Gets the locales supported by the underlying recognizer.\n *\n * Android 13+ devices no longer expose this list; in that case `languages` is empty.\n */\n getSupportedLanguages(): Promise<SpeechRecognitionLanguages>;\n /**\n * Returns whether the plugin is actively listening for speech.\n */\n isListening(): Promise<SpeechRecognitionListening>;\n /**\n * Gets the current permission state.\n */\n checkPermissions(): Promise<SpeechRecognitionPermissionStatus>;\n /**\n * Requests the microphone + speech recognition permissions.\n */\n requestPermissions(): Promise<SpeechRecognitionPermissionStatus>;\n /**\n * Returns the native plugin version bundled with this package.\n *\n * Useful when reporting issues to confirm that native and JS versions match.\n */\n getPluginVersion(): Promise<{ version: string }>;\n /**\n * Listen for segmented session completion events (Android only).\n */\n addListener(eventName: 'endOfSegmentedSession', listenerFunc: () => void): Promise<PluginListenerHandle>;\n /**\n * Listen for segmented recognition results (Android only).\n */\n addListener(\n eventName: 'segmentResults',\n listenerFunc: (event: SpeechRecognitionSegmentResultEvent) => void,\n ): Promise<PluginListenerHandle>;\n /**\n * Listen for partial transcription updates emitted while `partialResults` is enabled.\n */\n addListener(\n eventName: 'partialResults',\n listenerFunc: (event: SpeechRecognitionPartialResultEvent) => void,\n ): Promise<PluginListenerHandle>;\n /**\n * Listen for changes to the native listening state.\n */\n addListener(\n eventName: 'listeningState',\n listenerFunc: (event: SpeechRecognitionListeningEvent) => void,\n ): Promise<PluginListenerHandle>;\n /**\n * Listen for recognition errors.\n */\n addListener(\n eventName: 'error',\n listenerFunc: (event: SpeechRecognitionErrorEvent) => void,\n ): Promise<PluginListenerHandle>;\n /**\n * Listen for the recognizer becoming ready for another session.\n */\n addListener(\n eventName: 'readyForNextSession',\n listenerFunc: (event: SpeechRecognitionReadyEvent) => void,\n ): Promise<PluginListenerHandle>;\n /**\n * Removes every registered listener.\n */\n removeAllListeners(): Promise<void>;\n}\n"]}
package/dist/esm/web.d.ts CHANGED
@@ -1,9 +1,13 @@
1
1
  import { WebPlugin } from '@capacitor/core';
2
- import type { SpeechRecognitionAvailability, SpeechRecognitionLanguages, SpeechRecognitionListening, SpeechRecognitionMatches, SpeechRecognitionPermissionStatus, SpeechRecognitionPlugin, SpeechRecognitionStartOptions } from './definitions';
2
+ import type { ForceStopOptions, LastPartialResult, PTTStateOptions, SpeechRecognitionAvailability, SpeechRecognitionLanguages, SpeechRecognitionListening, SpeechRecognitionMatches, SpeechRecognitionPermissionStatus, SpeechRecognitionPlugin, SpeechRecognitionStartOptions } from './definitions';
3
3
  export declare class SpeechRecognitionWeb extends WebPlugin implements SpeechRecognitionPlugin {
4
4
  available(): Promise<SpeechRecognitionAvailability>;
5
+ isOnDeviceRecognitionAvailable(): Promise<SpeechRecognitionAvailability>;
5
6
  start(_options?: SpeechRecognitionStartOptions): Promise<SpeechRecognitionMatches>;
6
7
  stop(): Promise<void>;
8
+ forceStop(_options?: ForceStopOptions): Promise<void>;
9
+ getLastPartialResult(): Promise<LastPartialResult>;
10
+ setPTTState(_options: PTTStateOptions): Promise<void>;
7
11
  getSupportedLanguages(): Promise<SpeechRecognitionLanguages>;
8
12
  isListening(): Promise<SpeechRecognitionListening>;
9
13
  checkPermissions(): Promise<SpeechRecognitionPermissionStatus>;
package/dist/esm/web.js CHANGED
@@ -3,12 +3,24 @@ export class SpeechRecognitionWeb extends WebPlugin {
3
3
  available() {
4
4
  throw this.unimplemented('Speech recognition is not available on the web.');
5
5
  }
6
+ async isOnDeviceRecognitionAvailable() {
7
+ return { available: false };
8
+ }
6
9
  start(_options) {
7
10
  throw this.unimplemented('Speech recognition is not available on the web.');
8
11
  }
9
12
  stop() {
10
13
  throw this.unimplemented('Speech recognition is not available on the web.');
11
14
  }
15
+ forceStop(_options) {
16
+ throw this.unimplemented('Speech recognition is not available on the web.');
17
+ }
18
+ async getLastPartialResult() {
19
+ return { available: false, text: '' };
20
+ }
21
+ setPTTState(_options) {
22
+ throw this.unimplemented('Speech recognition is not available on the web.');
23
+ }
12
24
  getSupportedLanguages() {
13
25
  throw this.unimplemented('Speech recognition is not available on the web.');
14
26
  }
@@ -1 +1 @@
1
- {"version":3,"file":"web.js","sourceRoot":"","sources":["../../src/web.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,MAAM,iBAAiB,CAAC;AAY5C,MAAM,OAAO,oBAAqB,SAAQ,SAAS;IACjD,SAAS;QACP,MAAM,IAAI,CAAC,aAAa,CAAC,iDAAiD,CAAC,CAAC;IAC9E,CAAC;IAED,KAAK,CAAC,QAAwC;QAC5C,MAAM,IAAI,CAAC,aAAa,CAAC,iDAAiD,CAAC,CAAC;IAC9E,CAAC;IAED,IAAI;QACF,MAAM,IAAI,CAAC,aAAa,CAAC,iDAAiD,CAAC,CAAC;IAC9E,CAAC;IAED,qBAAqB;QACnB,MAAM,IAAI,CAAC,aAAa,CAAC,iDAAiD,CAAC,CAAC;IAC9E,CAAC;IAED,WAAW;QACT,MAAM,IAAI,CAAC,aAAa,CAAC,iDAAiD,CAAC,CAAC;IAC9E,CAAC;IAED,gBAAgB;QACd,MAAM,IAAI,CAAC,aAAa,CAAC,4DAA4D,CAAC,CAAC;IACzF,CAAC;IAED,kBAAkB;QAChB,MAAM,IAAI,CAAC,aAAa,CAAC,4DAA4D,CAAC,CAAC;IACzF,CAAC;IAED,KAAK,CAAC,gBAAgB;QACpB,OAAO,EAAE,OAAO,EAAE,KAAK,EAAE,CAAC;IAC5B,CAAC;CACF","sourcesContent":["import { WebPlugin } from '@capacitor/core';\n\nimport type {\n SpeechRecognitionAvailability,\n SpeechRecognitionLanguages,\n SpeechRecognitionListening,\n SpeechRecognitionMatches,\n SpeechRecognitionPermissionStatus,\n SpeechRecognitionPlugin,\n SpeechRecognitionStartOptions,\n} from './definitions';\n\nexport class SpeechRecognitionWeb extends WebPlugin implements SpeechRecognitionPlugin {\n available(): Promise<SpeechRecognitionAvailability> {\n throw this.unimplemented('Speech recognition is not available on the web.');\n }\n\n start(_options?: SpeechRecognitionStartOptions): Promise<SpeechRecognitionMatches> {\n throw this.unimplemented('Speech recognition is not available on the web.');\n }\n\n stop(): Promise<void> {\n throw this.unimplemented('Speech recognition is not available on the web.');\n }\n\n getSupportedLanguages(): Promise<SpeechRecognitionLanguages> {\n throw this.unimplemented('Speech recognition is not available on the web.');\n }\n\n isListening(): Promise<SpeechRecognitionListening> {\n throw this.unimplemented('Speech recognition is not available on the web.');\n }\n\n checkPermissions(): Promise<SpeechRecognitionPermissionStatus> {\n throw this.unimplemented('Speech recognition permissions are not handled on the web.');\n }\n\n requestPermissions(): Promise<SpeechRecognitionPermissionStatus> {\n throw this.unimplemented('Speech recognition permissions are not handled on the web.');\n }\n\n async getPluginVersion(): Promise<{ version: string }> {\n return { version: 'web' };\n }\n}\n"]}
1
+ {"version":3,"file":"web.js","sourceRoot":"","sources":["../../src/web.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,MAAM,iBAAiB,CAAC;AAe5C,MAAM,OAAO,oBAAqB,SAAQ,SAAS;IACjD,SAAS;QACP,MAAM,IAAI,CAAC,aAAa,CAAC,iDAAiD,CAAC,CAAC;IAC9E,CAAC;IAED,KAAK,CAAC,8BAA8B;QAClC,OAAO,EAAE,SAAS,EAAE,KAAK,EAAE,CAAC;IAC9B,CAAC;IAED,KAAK,CAAC,QAAwC;QAC5C,MAAM,IAAI,CAAC,aAAa,CAAC,iDAAiD,CAAC,CAAC;IAC9E,CAAC;IAED,IAAI;QACF,MAAM,IAAI,CAAC,aAAa,CAAC,iDAAiD,CAAC,CAAC;IAC9E,CAAC;IAED,SAAS,CAAC,QAA2B;QACnC,MAAM,IAAI,CAAC,aAAa,CAAC,iDAAiD,CAAC,CAAC;IAC9E,CAAC;IAED,KAAK,CAAC,oBAAoB;QACxB,OAAO,EAAE,SAAS,EAAE,KAAK,EAAE,IAAI,EAAE,EAAE,EAAE,CAAC;IACxC,CAAC;IAED,WAAW,CAAC,QAAyB;QACnC,MAAM,IAAI,CAAC,aAAa,CAAC,iDAAiD,CAAC,CAAC;IAC9E,CAAC;IAED,qBAAqB;QACnB,MAAM,IAAI,CAAC,aAAa,CAAC,iDAAiD,CAAC,CAAC;IAC9E,CAAC;IAED,WAAW;QACT,MAAM,IAAI,CAAC,aAAa,CAAC,iDAAiD,CAAC,CAAC;IAC9E,CAAC;IAED,gBAAgB;QACd,MAAM,IAAI,CAAC,aAAa,CAAC,4DAA4D,CAAC,CAAC;IACzF,CAAC;IAED,kBAAkB;QAChB,MAAM,IAAI,CAAC,aAAa,CAAC,4DAA4D,CAAC,CAAC;IACzF,CAAC;IAED,KAAK,CAAC,gBAAgB;QACpB,OAAO,EAAE,OAAO,EAAE,KAAK,EAAE,CAAC;IAC5B,CAAC;CACF","sourcesContent":["import { WebPlugin } from '@capacitor/core';\n\nimport type {\n ForceStopOptions,\n LastPartialResult,\n PTTStateOptions,\n SpeechRecognitionAvailability,\n SpeechRecognitionLanguages,\n SpeechRecognitionListening,\n SpeechRecognitionMatches,\n SpeechRecognitionPermissionStatus,\n SpeechRecognitionPlugin,\n SpeechRecognitionStartOptions,\n} from './definitions';\n\nexport class SpeechRecognitionWeb extends WebPlugin implements SpeechRecognitionPlugin {\n available(): Promise<SpeechRecognitionAvailability> {\n throw this.unimplemented('Speech recognition is not available on the web.');\n }\n\n async isOnDeviceRecognitionAvailable(): Promise<SpeechRecognitionAvailability> {\n return { available: false };\n }\n\n start(_options?: SpeechRecognitionStartOptions): Promise<SpeechRecognitionMatches> {\n throw this.unimplemented('Speech recognition is not available on the web.');\n }\n\n stop(): Promise<void> {\n throw this.unimplemented('Speech recognition is not available on the web.');\n }\n\n forceStop(_options?: ForceStopOptions): Promise<void> {\n throw this.unimplemented('Speech recognition is not available on the web.');\n }\n\n async getLastPartialResult(): Promise<LastPartialResult> {\n return { available: false, text: '' };\n }\n\n setPTTState(_options: PTTStateOptions): Promise<void> {\n throw this.unimplemented('Speech recognition is not available on the web.');\n }\n\n getSupportedLanguages(): Promise<SpeechRecognitionLanguages> {\n throw this.unimplemented('Speech recognition is not available on the web.');\n }\n\n isListening(): Promise<SpeechRecognitionListening> {\n throw this.unimplemented('Speech recognition is not available on the web.');\n }\n\n checkPermissions(): Promise<SpeechRecognitionPermissionStatus> {\n throw this.unimplemented('Speech recognition permissions are not handled on the web.');\n }\n\n requestPermissions(): Promise<SpeechRecognitionPermissionStatus> {\n throw this.unimplemented('Speech recognition permissions are not handled on the web.');\n }\n\n async getPluginVersion(): Promise<{ version: string }> {\n return { version: 'web' };\n }\n}\n"]}
@@ -10,12 +10,24 @@ class SpeechRecognitionWeb extends core.WebPlugin {
10
10
  available() {
11
11
  throw this.unimplemented('Speech recognition is not available on the web.');
12
12
  }
13
+ async isOnDeviceRecognitionAvailable() {
14
+ return { available: false };
15
+ }
13
16
  start(_options) {
14
17
  throw this.unimplemented('Speech recognition is not available on the web.');
15
18
  }
16
19
  stop() {
17
20
  throw this.unimplemented('Speech recognition is not available on the web.');
18
21
  }
22
+ forceStop(_options) {
23
+ throw this.unimplemented('Speech recognition is not available on the web.');
24
+ }
25
+ async getLastPartialResult() {
26
+ return { available: false, text: '' };
27
+ }
28
+ setPTTState(_options) {
29
+ throw this.unimplemented('Speech recognition is not available on the web.');
30
+ }
19
31
  getSupportedLanguages() {
20
32
  throw this.unimplemented('Speech recognition is not available on the web.');
21
33
  }
@@ -1 +1 @@
1
- {"version":3,"file":"plugin.cjs.js","sources":["esm/index.js","esm/web.js"],"sourcesContent":["import { registerPlugin } from '@capacitor/core';\nconst SpeechRecognition = registerPlugin('SpeechRecognition', {\n web: () => import('./web').then((m) => new m.SpeechRecognitionWeb()),\n});\nexport * from './definitions';\nexport { SpeechRecognition };\n//# sourceMappingURL=index.js.map","import { WebPlugin } from '@capacitor/core';\nexport class SpeechRecognitionWeb extends WebPlugin {\n available() {\n throw this.unimplemented('Speech recognition is not available on the web.');\n }\n start(_options) {\n throw this.unimplemented('Speech recognition is not available on the web.');\n }\n stop() {\n throw this.unimplemented('Speech recognition is not available on the web.');\n }\n getSupportedLanguages() {\n throw this.unimplemented('Speech recognition is not available on the web.');\n }\n isListening() {\n throw this.unimplemented('Speech recognition is not available on the web.');\n }\n checkPermissions() {\n throw this.unimplemented('Speech recognition permissions are not handled on the web.');\n }\n requestPermissions() {\n throw this.unimplemented('Speech recognition permissions are not handled on the web.');\n }\n async getPluginVersion() {\n return { version: 'web' };\n }\n}\n//# sourceMappingURL=web.js.map"],"names":["registerPlugin","WebPlugin"],"mappings":";;;;AACK,MAAC,iBAAiB,GAAGA,mBAAc,CAAC,mBAAmB,EAAE;AAC9D,IAAI,GAAG,EAAE,MAAM,mDAAe,CAAC,IAAI,CAAC,CAAC,CAAC,KAAK,IAAI,CAAC,CAAC,oBAAoB,EAAE,CAAC;AACxE,CAAC;;ACFM,MAAM,oBAAoB,SAASC,cAAS,CAAC;AACpD,IAAI,SAAS,GAAG;AAChB,QAAQ,MAAM,IAAI,CAAC,aAAa,CAAC,iDAAiD,CAAC;AACnF,IAAI;AACJ,IAAI,KAAK,CAAC,QAAQ,EAAE;AACpB,QAAQ,MAAM,IAAI,CAAC,aAAa,CAAC,iDAAiD,CAAC;AACnF,IAAI;AACJ,IAAI,IAAI,GAAG;AACX,QAAQ,MAAM,IAAI,CAAC,aAAa,CAAC,iDAAiD,CAAC;AACnF,IAAI;AACJ,IAAI,qBAAqB,GAAG;AAC5B,QAAQ,MAAM,IAAI,CAAC,aAAa,CAAC,iDAAiD,CAAC;AACnF,IAAI;AACJ,IAAI,WAAW,GAAG;AAClB,QAAQ,MAAM,IAAI,CAAC,aAAa,CAAC,iDAAiD,CAAC;AACnF,IAAI;AACJ,IAAI,gBAAgB,GAAG;AACvB,QAAQ,MAAM,IAAI,CAAC,aAAa,CAAC,4DAA4D,CAAC;AAC9F,IAAI;AACJ,IAAI,kBAAkB,GAAG;AACzB,QAAQ,MAAM,IAAI,CAAC,aAAa,CAAC,4DAA4D,CAAC;AAC9F,IAAI;AACJ,IAAI,MAAM,gBAAgB,GAAG;AAC7B,QAAQ,OAAO,EAAE,OAAO,EAAE,KAAK,EAAE;AACjC,IAAI;AACJ;;;;;;;;;"}
1
+ {"version":3,"file":"plugin.cjs.js","sources":["esm/index.js","esm/web.js"],"sourcesContent":["import { registerPlugin } from '@capacitor/core';\nconst SpeechRecognition = registerPlugin('SpeechRecognition', {\n web: () => import('./web').then((m) => new m.SpeechRecognitionWeb()),\n});\nexport * from './definitions';\nexport { SpeechRecognition };\n//# sourceMappingURL=index.js.map","import { WebPlugin } from '@capacitor/core';\nexport class SpeechRecognitionWeb extends WebPlugin {\n available() {\n throw this.unimplemented('Speech recognition is not available on the web.');\n }\n async isOnDeviceRecognitionAvailable() {\n return { available: false };\n }\n start(_options) {\n throw this.unimplemented('Speech recognition is not available on the web.');\n }\n stop() {\n throw this.unimplemented('Speech recognition is not available on the web.');\n }\n forceStop(_options) {\n throw this.unimplemented('Speech recognition is not available on the web.');\n }\n async getLastPartialResult() {\n return { available: false, text: '' };\n }\n setPTTState(_options) {\n throw this.unimplemented('Speech recognition is not available on the web.');\n }\n getSupportedLanguages() {\n throw this.unimplemented('Speech recognition is not available on the web.');\n }\n isListening() {\n throw this.unimplemented('Speech recognition is not available on the web.');\n }\n checkPermissions() {\n throw this.unimplemented('Speech recognition permissions are not handled on the web.');\n }\n requestPermissions() {\n throw this.unimplemented('Speech recognition permissions are not handled on the web.');\n }\n async getPluginVersion() {\n return { version: 'web' };\n }\n}\n//# sourceMappingURL=web.js.map"],"names":["registerPlugin","WebPlugin"],"mappings":";;;;AACK,MAAC,iBAAiB,GAAGA,mBAAc,CAAC,mBAAmB,EAAE;AAC9D,IAAI,GAAG,EAAE,MAAM,mDAAe,CAAC,IAAI,CAAC,CAAC,CAAC,KAAK,IAAI,CAAC,CAAC,oBAAoB,EAAE,CAAC;AACxE,CAAC;;ACFM,MAAM,oBAAoB,SAASC,cAAS,CAAC;AACpD,IAAI,SAAS,GAAG;AAChB,QAAQ,MAAM,IAAI,CAAC,aAAa,CAAC,iDAAiD,CAAC;AACnF,IAAI;AACJ,IAAI,MAAM,8BAA8B,GAAG;AAC3C,QAAQ,OAAO,EAAE,SAAS,EAAE,KAAK,EAAE;AACnC,IAAI;AACJ,IAAI,KAAK,CAAC,QAAQ,EAAE;AACpB,QAAQ,MAAM,IAAI,CAAC,aAAa,CAAC,iDAAiD,CAAC;AACnF,IAAI;AACJ,IAAI,IAAI,GAAG;AACX,QAAQ,MAAM,IAAI,CAAC,aAAa,CAAC,iDAAiD,CAAC;AACnF,IAAI;AACJ,IAAI,SAAS,CAAC,QAAQ,EAAE;AACxB,QAAQ,MAAM,IAAI,CAAC,aAAa,CAAC,iDAAiD,CAAC;AACnF,IAAI;AACJ,IAAI,MAAM,oBAAoB,GAAG;AACjC,QAAQ,OAAO,EAAE,SAAS,EAAE,KAAK,EAAE,IAAI,EAAE,EAAE,EAAE;AAC7C,IAAI;AACJ,IAAI,WAAW,CAAC,QAAQ,EAAE;AAC1B,QAAQ,MAAM,IAAI,CAAC,aAAa,CAAC,iDAAiD,CAAC;AACnF,IAAI;AACJ,IAAI,qBAAqB,GAAG;AAC5B,QAAQ,MAAM,IAAI,CAAC,aAAa,CAAC,iDAAiD,CAAC;AACnF,IAAI;AACJ,IAAI,WAAW,GAAG;AAClB,QAAQ,MAAM,IAAI,CAAC,aAAa,CAAC,iDAAiD,CAAC;AACnF,IAAI;AACJ,IAAI,gBAAgB,GAAG;AACvB,QAAQ,MAAM,IAAI,CAAC,aAAa,CAAC,4DAA4D,CAAC;AAC9F,IAAI;AACJ,IAAI,kBAAkB,GAAG;AACzB,QAAQ,MAAM,IAAI,CAAC,aAAa,CAAC,4DAA4D,CAAC;AAC9F,IAAI;AACJ,IAAI,MAAM,gBAAgB,GAAG;AAC7B,QAAQ,OAAO,EAAE,OAAO,EAAE,KAAK,EAAE;AACjC,IAAI;AACJ;;;;;;;;;"}
package/dist/plugin.js CHANGED
@@ -9,12 +9,24 @@ var capacitorCapacitorSpeechRecognition = (function (exports, core) {
9
9
  available() {
10
10
  throw this.unimplemented('Speech recognition is not available on the web.');
11
11
  }
12
+ async isOnDeviceRecognitionAvailable() {
13
+ return { available: false };
14
+ }
12
15
  start(_options) {
13
16
  throw this.unimplemented('Speech recognition is not available on the web.');
14
17
  }
15
18
  stop() {
16
19
  throw this.unimplemented('Speech recognition is not available on the web.');
17
20
  }
21
+ forceStop(_options) {
22
+ throw this.unimplemented('Speech recognition is not available on the web.');
23
+ }
24
+ async getLastPartialResult() {
25
+ return { available: false, text: '' };
26
+ }
27
+ setPTTState(_options) {
28
+ throw this.unimplemented('Speech recognition is not available on the web.');
29
+ }
18
30
  getSupportedLanguages() {
19
31
  throw this.unimplemented('Speech recognition is not available on the web.');
20
32
  }
@@ -1 +1 @@
1
- {"version":3,"file":"plugin.js","sources":["esm/index.js","esm/web.js"],"sourcesContent":["import { registerPlugin } from '@capacitor/core';\nconst SpeechRecognition = registerPlugin('SpeechRecognition', {\n web: () => import('./web').then((m) => new m.SpeechRecognitionWeb()),\n});\nexport * from './definitions';\nexport { SpeechRecognition };\n//# sourceMappingURL=index.js.map","import { WebPlugin } from '@capacitor/core';\nexport class SpeechRecognitionWeb extends WebPlugin {\n available() {\n throw this.unimplemented('Speech recognition is not available on the web.');\n }\n start(_options) {\n throw this.unimplemented('Speech recognition is not available on the web.');\n }\n stop() {\n throw this.unimplemented('Speech recognition is not available on the web.');\n }\n getSupportedLanguages() {\n throw this.unimplemented('Speech recognition is not available on the web.');\n }\n isListening() {\n throw this.unimplemented('Speech recognition is not available on the web.');\n }\n checkPermissions() {\n throw this.unimplemented('Speech recognition permissions are not handled on the web.');\n }\n requestPermissions() {\n throw this.unimplemented('Speech recognition permissions are not handled on the web.');\n }\n async getPluginVersion() {\n return { version: 'web' };\n }\n}\n//# sourceMappingURL=web.js.map"],"names":["registerPlugin","WebPlugin"],"mappings":";;;AACK,UAAC,iBAAiB,GAAGA,mBAAc,CAAC,mBAAmB,EAAE;IAC9D,IAAI,GAAG,EAAE,MAAM,mDAAe,CAAC,IAAI,CAAC,CAAC,CAAC,KAAK,IAAI,CAAC,CAAC,oBAAoB,EAAE,CAAC;IACxE,CAAC;;ICFM,MAAM,oBAAoB,SAASC,cAAS,CAAC;IACpD,IAAI,SAAS,GAAG;IAChB,QAAQ,MAAM,IAAI,CAAC,aAAa,CAAC,iDAAiD,CAAC;IACnF,IAAI;IACJ,IAAI,KAAK,CAAC,QAAQ,EAAE;IACpB,QAAQ,MAAM,IAAI,CAAC,aAAa,CAAC,iDAAiD,CAAC;IACnF,IAAI;IACJ,IAAI,IAAI,GAAG;IACX,QAAQ,MAAM,IAAI,CAAC,aAAa,CAAC,iDAAiD,CAAC;IACnF,IAAI;IACJ,IAAI,qBAAqB,GAAG;IAC5B,QAAQ,MAAM,IAAI,CAAC,aAAa,CAAC,iDAAiD,CAAC;IACnF,IAAI;IACJ,IAAI,WAAW,GAAG;IAClB,QAAQ,MAAM,IAAI,CAAC,aAAa,CAAC,iDAAiD,CAAC;IACnF,IAAI;IACJ,IAAI,gBAAgB,GAAG;IACvB,QAAQ,MAAM,IAAI,CAAC,aAAa,CAAC,4DAA4D,CAAC;IAC9F,IAAI;IACJ,IAAI,kBAAkB,GAAG;IACzB,QAAQ,MAAM,IAAI,CAAC,aAAa,CAAC,4DAA4D,CAAC;IAC9F,IAAI;IACJ,IAAI,MAAM,gBAAgB,GAAG;IAC7B,QAAQ,OAAO,EAAE,OAAO,EAAE,KAAK,EAAE;IACjC,IAAI;IACJ;;;;;;;;;;;;;;;"}
1
+ {"version":3,"file":"plugin.js","sources":["esm/index.js","esm/web.js"],"sourcesContent":["import { registerPlugin } from '@capacitor/core';\nconst SpeechRecognition = registerPlugin('SpeechRecognition', {\n web: () => import('./web').then((m) => new m.SpeechRecognitionWeb()),\n});\nexport * from './definitions';\nexport { SpeechRecognition };\n//# sourceMappingURL=index.js.map","import { WebPlugin } from '@capacitor/core';\nexport class SpeechRecognitionWeb extends WebPlugin {\n available() {\n throw this.unimplemented('Speech recognition is not available on the web.');\n }\n async isOnDeviceRecognitionAvailable() {\n return { available: false };\n }\n start(_options) {\n throw this.unimplemented('Speech recognition is not available on the web.');\n }\n stop() {\n throw this.unimplemented('Speech recognition is not available on the web.');\n }\n forceStop(_options) {\n throw this.unimplemented('Speech recognition is not available on the web.');\n }\n async getLastPartialResult() {\n return { available: false, text: '' };\n }\n setPTTState(_options) {\n throw this.unimplemented('Speech recognition is not available on the web.');\n }\n getSupportedLanguages() {\n throw this.unimplemented('Speech recognition is not available on the web.');\n }\n isListening() {\n throw this.unimplemented('Speech recognition is not available on the web.');\n }\n checkPermissions() {\n throw this.unimplemented('Speech recognition permissions are not handled on the web.');\n }\n requestPermissions() {\n throw this.unimplemented('Speech recognition permissions are not handled on the web.');\n }\n async getPluginVersion() {\n return { version: 'web' };\n }\n}\n//# sourceMappingURL=web.js.map"],"names":["registerPlugin","WebPlugin"],"mappings":";;;AACK,UAAC,iBAAiB,GAAGA,mBAAc,CAAC,mBAAmB,EAAE;IAC9D,IAAI,GAAG,EAAE,MAAM,mDAAe,CAAC,IAAI,CAAC,CAAC,CAAC,KAAK,IAAI,CAAC,CAAC,oBAAoB,EAAE,CAAC;IACxE,CAAC;;ICFM,MAAM,oBAAoB,SAASC,cAAS,CAAC;IACpD,IAAI,SAAS,GAAG;IAChB,QAAQ,MAAM,IAAI,CAAC,aAAa,CAAC,iDAAiD,CAAC;IACnF,IAAI;IACJ,IAAI,MAAM,8BAA8B,GAAG;IAC3C,QAAQ,OAAO,EAAE,SAAS,EAAE,KAAK,EAAE;IACnC,IAAI;IACJ,IAAI,KAAK,CAAC,QAAQ,EAAE;IACpB,QAAQ,MAAM,IAAI,CAAC,aAAa,CAAC,iDAAiD,CAAC;IACnF,IAAI;IACJ,IAAI,IAAI,GAAG;IACX,QAAQ,MAAM,IAAI,CAAC,aAAa,CAAC,iDAAiD,CAAC;IACnF,IAAI;IACJ,IAAI,SAAS,CAAC,QAAQ,EAAE;IACxB,QAAQ,MAAM,IAAI,CAAC,aAAa,CAAC,iDAAiD,CAAC;IACnF,IAAI;IACJ,IAAI,MAAM,oBAAoB,GAAG;IACjC,QAAQ,OAAO,EAAE,SAAS,EAAE,KAAK,EAAE,IAAI,EAAE,EAAE,EAAE;IAC7C,IAAI;IACJ,IAAI,WAAW,CAAC,QAAQ,EAAE;IAC1B,QAAQ,MAAM,IAAI,CAAC,aAAa,CAAC,iDAAiD,CAAC;IACnF,IAAI;IACJ,IAAI,qBAAqB,GAAG;IAC5B,QAAQ,MAAM,IAAI,CAAC,aAAa,CAAC,iDAAiD,CAAC;IACnF,IAAI;IACJ,IAAI,WAAW,GAAG;IAClB,QAAQ,MAAM,IAAI,CAAC,aAAa,CAAC,iDAAiD,CAAC;IACnF,IAAI;IACJ,IAAI,gBAAgB,GAAG;IACvB,QAAQ,MAAM,IAAI,CAAC,aAAa,CAAC,4DAA4D,CAAC;IAC9F,IAAI;IACJ,IAAI,kBAAkB,GAAG;IACzB,QAAQ,MAAM,IAAI,CAAC,aAAa,CAAC,4DAA4D,CAAC;IAC9F,IAAI;IACJ,IAAI,MAAM,gBAAgB,GAAG;IAC7B,QAAQ,OAAO,EAAE,OAAO,EAAE,KAAK,EAAE;IACjC,IAAI;IACJ;;;;;;;;;;;;;;;"}