capacitor-native-speech-recognition 1.0.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/dist/docs.json ADDED
@@ -0,0 +1,448 @@
1
+ {
2
+ "api": {
3
+ "name": "SpeechRecognitionPlugin",
4
+ "slug": "speechrecognitionplugin",
5
+ "docs": "",
6
+ "tags": [],
7
+ "methods": [
8
+ {
9
+ "name": "available",
10
+ "signature": "() => Promise<SpeechRecognitionAvailability>",
11
+ "parameters": [],
12
+ "returns": "Promise<SpeechRecognitionAvailability>",
13
+ "tags": [],
14
+ "docs": "Checks whether the native speech recognition service is usable on the current device.",
15
+ "complexTypes": [
16
+ "SpeechRecognitionAvailability"
17
+ ],
18
+ "slug": "available"
19
+ },
20
+ {
21
+ "name": "start",
22
+ "signature": "(options?: SpeechRecognitionStartOptions | undefined) => Promise<SpeechRecognitionMatches>",
23
+ "parameters": [
24
+ {
25
+ "name": "options",
26
+ "docs": "",
27
+ "type": "SpeechRecognitionStartOptions | undefined"
28
+ }
29
+ ],
30
+ "returns": "Promise<SpeechRecognitionMatches>",
31
+ "tags": [],
32
+ "docs": "Begins capturing audio and transcribing speech.\n\nWhen `partialResults` is `true`, the returned promise resolves immediately and updates are\nstreamed through the `partialResults` listener until {@link stop} is called.",
33
+ "complexTypes": [
34
+ "SpeechRecognitionMatches",
35
+ "SpeechRecognitionStartOptions"
36
+ ],
37
+ "slug": "start"
38
+ },
39
+ {
40
+ "name": "stop",
41
+ "signature": "() => Promise<void>",
42
+ "parameters": [],
43
+ "returns": "Promise<void>",
44
+ "tags": [],
45
+ "docs": "Stops listening and tears down native resources.",
46
+ "complexTypes": [],
47
+ "slug": "stop"
48
+ },
49
+ {
50
+ "name": "getSupportedLanguages",
51
+ "signature": "() => Promise<SpeechRecognitionLanguages>",
52
+ "parameters": [],
53
+ "returns": "Promise<SpeechRecognitionLanguages>",
54
+ "tags": [],
55
+ "docs": "Gets the locales supported by the underlying recognizer.\n\nAndroid 13+ devices no longer expose this list; in that case `languages` is empty.",
56
+ "complexTypes": [
57
+ "SpeechRecognitionLanguages"
58
+ ],
59
+ "slug": "getsupportedlanguages"
60
+ },
61
+ {
62
+ "name": "isListening",
63
+ "signature": "() => Promise<SpeechRecognitionListening>",
64
+ "parameters": [],
65
+ "returns": "Promise<SpeechRecognitionListening>",
66
+ "tags": [],
67
+ "docs": "Returns whether the plugin is actively listening for speech.",
68
+ "complexTypes": [
69
+ "SpeechRecognitionListening"
70
+ ],
71
+ "slug": "islistening"
72
+ },
73
+ {
74
+ "name": "checkPermissions",
75
+ "signature": "() => Promise<SpeechRecognitionPermissionStatus>",
76
+ "parameters": [],
77
+ "returns": "Promise<SpeechRecognitionPermissionStatus>",
78
+ "tags": [],
79
+ "docs": "Gets the current permission state.",
80
+ "complexTypes": [
81
+ "SpeechRecognitionPermissionStatus"
82
+ ],
83
+ "slug": "checkpermissions"
84
+ },
85
+ {
86
+ "name": "requestPermissions",
87
+ "signature": "() => Promise<SpeechRecognitionPermissionStatus>",
88
+ "parameters": [],
89
+ "returns": "Promise<SpeechRecognitionPermissionStatus>",
90
+ "tags": [],
91
+ "docs": "Requests the microphone + speech recognition permissions.",
92
+ "complexTypes": [
93
+ "SpeechRecognitionPermissionStatus"
94
+ ],
95
+ "slug": "requestpermissions"
96
+ },
97
+ {
98
+ "name": "getPluginVersion",
99
+ "signature": "() => Promise<{ version: string; }>",
100
+ "parameters": [],
101
+ "returns": "Promise<{ version: string; }>",
102
+ "tags": [],
103
+ "docs": "Returns the native plugin version bundled with this package.\n\nUseful when reporting issues to confirm that native and JS versions match.",
104
+ "complexTypes": [],
105
+ "slug": "getpluginversion"
106
+ },
107
+ {
108
+ "name": "addListener",
109
+ "signature": "(eventName: 'endOfSegmentedSession', listenerFunc: () => void) => Promise<PluginListenerHandle>",
110
+ "parameters": [
111
+ {
112
+ "name": "eventName",
113
+ "docs": "",
114
+ "type": "'endOfSegmentedSession'"
115
+ },
116
+ {
117
+ "name": "listenerFunc",
118
+ "docs": "",
119
+ "type": "() => void"
120
+ }
121
+ ],
122
+ "returns": "Promise<PluginListenerHandle>",
123
+ "tags": [],
124
+ "docs": "Listen for segmented session completion events (Android only).",
125
+ "complexTypes": [
126
+ "PluginListenerHandle"
127
+ ],
128
+ "slug": "addlistenerendofsegmentedsession-"
129
+ },
130
+ {
131
+ "name": "addListener",
132
+ "signature": "(eventName: 'segmentResults', listenerFunc: (event: SpeechRecognitionSegmentResultEvent) => void) => Promise<PluginListenerHandle>",
133
+ "parameters": [
134
+ {
135
+ "name": "eventName",
136
+ "docs": "",
137
+ "type": "'segmentResults'"
138
+ },
139
+ {
140
+ "name": "listenerFunc",
141
+ "docs": "",
142
+ "type": "(event: SpeechRecognitionSegmentResultEvent) => void"
143
+ }
144
+ ],
145
+ "returns": "Promise<PluginListenerHandle>",
146
+ "tags": [],
147
+ "docs": "Listen for segmented recognition results (Android only).",
148
+ "complexTypes": [
149
+ "PluginListenerHandle",
150
+ "SpeechRecognitionSegmentResultEvent"
151
+ ],
152
+ "slug": "addlistenersegmentresults-"
153
+ },
154
+ {
155
+ "name": "addListener",
156
+ "signature": "(eventName: 'partialResults', listenerFunc: (event: SpeechRecognitionPartialResultEvent) => void) => Promise<PluginListenerHandle>",
157
+ "parameters": [
158
+ {
159
+ "name": "eventName",
160
+ "docs": "",
161
+ "type": "'partialResults'"
162
+ },
163
+ {
164
+ "name": "listenerFunc",
165
+ "docs": "",
166
+ "type": "(event: SpeechRecognitionPartialResultEvent) => void"
167
+ }
168
+ ],
169
+ "returns": "Promise<PluginListenerHandle>",
170
+ "tags": [],
171
+ "docs": "Listen for partial transcription updates emitted while `partialResults` is enabled.",
172
+ "complexTypes": [
173
+ "PluginListenerHandle",
174
+ "SpeechRecognitionPartialResultEvent"
175
+ ],
176
+ "slug": "addlistenerpartialresults-"
177
+ },
178
+ {
179
+ "name": "addListener",
180
+ "signature": "(eventName: 'listeningState', listenerFunc: (event: SpeechRecognitionListeningEvent) => void) => Promise<PluginListenerHandle>",
181
+ "parameters": [
182
+ {
183
+ "name": "eventName",
184
+ "docs": "",
185
+ "type": "'listeningState'"
186
+ },
187
+ {
188
+ "name": "listenerFunc",
189
+ "docs": "",
190
+ "type": "(event: SpeechRecognitionListeningEvent) => void"
191
+ }
192
+ ],
193
+ "returns": "Promise<PluginListenerHandle>",
194
+ "tags": [],
195
+ "docs": "Listen for changes to the native listening state.",
196
+ "complexTypes": [
197
+ "PluginListenerHandle",
198
+ "SpeechRecognitionListeningEvent"
199
+ ],
200
+ "slug": "addlistenerlisteningstate-"
201
+ },
202
+ {
203
+ "name": "removeAllListeners",
204
+ "signature": "() => Promise<void>",
205
+ "parameters": [],
206
+ "returns": "Promise<void>",
207
+ "tags": [],
208
+ "docs": "Removes every registered listener.",
209
+ "complexTypes": [],
210
+ "slug": "removealllisteners"
211
+ }
212
+ ],
213
+ "properties": []
214
+ },
215
+ "interfaces": [
216
+ {
217
+ "name": "SpeechRecognitionAvailability",
218
+ "slug": "speechrecognitionavailability",
219
+ "docs": "",
220
+ "tags": [],
221
+ "methods": [],
222
+ "properties": [
223
+ {
224
+ "name": "available",
225
+ "tags": [],
226
+ "docs": "",
227
+ "complexTypes": [],
228
+ "type": "boolean"
229
+ }
230
+ ]
231
+ },
232
+ {
233
+ "name": "SpeechRecognitionMatches",
234
+ "slug": "speechrecognitionmatches",
235
+ "docs": "",
236
+ "tags": [],
237
+ "methods": [],
238
+ "properties": [
239
+ {
240
+ "name": "matches",
241
+ "tags": [],
242
+ "docs": "",
243
+ "complexTypes": [],
244
+ "type": "string[] | undefined"
245
+ }
246
+ ]
247
+ },
248
+ {
249
+ "name": "SpeechRecognitionStartOptions",
250
+ "slug": "speechrecognitionstartoptions",
251
+ "docs": "Configure how the recognizer behaves when calling {@link SpeechRecognitionPlugin.start}.",
252
+ "tags": [],
253
+ "methods": [],
254
+ "properties": [
255
+ {
256
+ "name": "language",
257
+ "tags": [],
258
+ "docs": "Locale identifier such as `en-US`. When omitted the device language is used.",
259
+ "complexTypes": [],
260
+ "type": "string | undefined"
261
+ },
262
+ {
263
+ "name": "maxResults",
264
+ "tags": [],
265
+ "docs": "Maximum number of final matches returned by native APIs. Defaults to `5`.",
266
+ "complexTypes": [],
267
+ "type": "number | undefined"
268
+ },
269
+ {
270
+ "name": "prompt",
271
+ "tags": [],
272
+ "docs": "Prompt message shown inside the Android system dialog (ignored on iOS).",
273
+ "complexTypes": [],
274
+ "type": "string | undefined"
275
+ },
276
+ {
277
+ "name": "popup",
278
+ "tags": [],
279
+ "docs": "When `true`, Android shows the OS speech dialog instead of running inline recognition.\nDefaults to `false`.",
280
+ "complexTypes": [],
281
+ "type": "boolean | undefined"
282
+ },
283
+ {
284
+ "name": "partialResults",
285
+ "tags": [],
286
+ "docs": "Emits partial transcription updates through the `partialResults` listener while audio is captured.",
287
+ "complexTypes": [],
288
+ "type": "boolean | undefined"
289
+ },
290
+ {
291
+ "name": "addPunctuation",
292
+ "tags": [],
293
+ "docs": "Enables native punctuation handling where supported (iOS 16+).",
294
+ "complexTypes": [],
295
+ "type": "boolean | undefined"
296
+ },
297
+ {
298
+ "name": "allowForSilence",
299
+ "tags": [],
300
+ "docs": "Allow a number of milliseconds of silence before splitting the recognition session into segments.\nRequired to be greater than zero and currently supported on Android only.",
301
+ "complexTypes": [],
302
+ "type": "number | undefined"
303
+ }
304
+ ]
305
+ },
306
+ {
307
+ "name": "SpeechRecognitionLanguages",
308
+ "slug": "speechrecognitionlanguages",
309
+ "docs": "",
310
+ "tags": [],
311
+ "methods": [],
312
+ "properties": [
313
+ {
314
+ "name": "languages",
315
+ "tags": [],
316
+ "docs": "",
317
+ "complexTypes": [],
318
+ "type": "string[]"
319
+ }
320
+ ]
321
+ },
322
+ {
323
+ "name": "SpeechRecognitionListening",
324
+ "slug": "speechrecognitionlistening",
325
+ "docs": "",
326
+ "tags": [],
327
+ "methods": [],
328
+ "properties": [
329
+ {
330
+ "name": "listening",
331
+ "tags": [],
332
+ "docs": "",
333
+ "complexTypes": [],
334
+ "type": "boolean"
335
+ }
336
+ ]
337
+ },
338
+ {
339
+ "name": "SpeechRecognitionPermissionStatus",
340
+ "slug": "speechrecognitionpermissionstatus",
341
+ "docs": "Permission map returned by `checkPermissions` and `requestPermissions`.\n\nOn Android the state maps to the `RECORD_AUDIO` permission.\nOn iOS it combines speech recognition plus microphone permission.",
342
+ "tags": [],
343
+ "methods": [],
344
+ "properties": [
345
+ {
346
+ "name": "speechRecognition",
347
+ "tags": [],
348
+ "docs": "",
349
+ "complexTypes": [
350
+ "PermissionState"
351
+ ],
352
+ "type": "PermissionState"
353
+ }
354
+ ]
355
+ },
356
+ {
357
+ "name": "PluginListenerHandle",
358
+ "slug": "pluginlistenerhandle",
359
+ "docs": "",
360
+ "tags": [],
361
+ "methods": [],
362
+ "properties": [
363
+ {
364
+ "name": "remove",
365
+ "tags": [],
366
+ "docs": "",
367
+ "complexTypes": [],
368
+ "type": "() => Promise<void>"
369
+ }
370
+ ]
371
+ },
372
+ {
373
+ "name": "SpeechRecognitionSegmentResultEvent",
374
+ "slug": "speechrecognitionsegmentresultevent",
375
+ "docs": "Raised whenever a segmented result is produced (Android only).",
376
+ "tags": [],
377
+ "methods": [],
378
+ "properties": [
379
+ {
380
+ "name": "matches",
381
+ "tags": [],
382
+ "docs": "",
383
+ "complexTypes": [],
384
+ "type": "string[]"
385
+ }
386
+ ]
387
+ },
388
+ {
389
+ "name": "SpeechRecognitionPartialResultEvent",
390
+ "slug": "speechrecognitionpartialresultevent",
391
+ "docs": "Raised whenever a partial transcription is produced.",
392
+ "tags": [],
393
+ "methods": [],
394
+ "properties": [
395
+ {
396
+ "name": "matches",
397
+ "tags": [],
398
+ "docs": "",
399
+ "complexTypes": [],
400
+ "type": "string[]"
401
+ }
402
+ ]
403
+ },
404
+ {
405
+ "name": "SpeechRecognitionListeningEvent",
406
+ "slug": "speechrecognitionlisteningevent",
407
+ "docs": "Raised when the listening state changes.",
408
+ "tags": [],
409
+ "methods": [],
410
+ "properties": [
411
+ {
412
+ "name": "status",
413
+ "tags": [],
414
+ "docs": "",
415
+ "complexTypes": [],
416
+ "type": "'started' | 'stopped'"
417
+ }
418
+ ]
419
+ }
420
+ ],
421
+ "enums": [],
422
+ "typeAliases": [
423
+ {
424
+ "name": "PermissionState",
425
+ "slug": "permissionstate",
426
+ "docs": "",
427
+ "types": [
428
+ {
429
+ "text": "'prompt'",
430
+ "complexTypes": []
431
+ },
432
+ {
433
+ "text": "'prompt-with-rationale'",
434
+ "complexTypes": []
435
+ },
436
+ {
437
+ "text": "'granted'",
438
+ "complexTypes": []
439
+ },
440
+ {
441
+ "text": "'denied'",
442
+ "complexTypes": []
443
+ }
444
+ ]
445
+ }
446
+ ],
447
+ "pluginConfigs": []
448
+ }
@@ -0,0 +1,138 @@
1
+ import type { PermissionState, PluginListenerHandle } from '@capacitor/core';
2
+ /**
3
+ * Permission map returned by `checkPermissions` and `requestPermissions`.
4
+ *
5
+ * On Android the state maps to the `RECORD_AUDIO` permission.
6
+ * On iOS it combines speech recognition plus microphone permission.
7
+ */
8
+ export interface SpeechRecognitionPermissionStatus {
9
+ speechRecognition: PermissionState;
10
+ }
11
+ /**
12
+ * Configure how the recognizer behaves when calling {@link SpeechRecognitionPlugin.start}.
13
+ */
14
+ export interface SpeechRecognitionStartOptions {
15
+ /**
16
+ * Locale identifier such as `en-US`. When omitted the device language is used.
17
+ */
18
+ language?: string;
19
+ /**
20
+ * Maximum number of final matches returned by native APIs. Defaults to `5`.
21
+ */
22
+ maxResults?: number;
23
+ /**
24
+ * Prompt message shown inside the Android system dialog (ignored on iOS).
25
+ */
26
+ prompt?: string;
27
+ /**
28
+ * When `true`, Android shows the OS speech dialog instead of running inline recognition.
29
+ * Defaults to `false`.
30
+ */
31
+ popup?: boolean;
32
+ /**
33
+ * Emits partial transcription updates through the `partialResults` listener while audio is captured.
34
+ */
35
+ partialResults?: boolean;
36
+ /**
37
+ * Enables native punctuation handling where supported (iOS 16+).
38
+ */
39
+ addPunctuation?: boolean;
40
+ /**
41
+ * Allow a number of milliseconds of silence before splitting the recognition session into segments.
42
+ * Required to be greater than zero and currently supported on Android only.
43
+ */
44
+ allowForSilence?: number;
45
+ }
46
+ /**
47
+ * Raised whenever a partial transcription is produced.
48
+ */
49
+ export interface SpeechRecognitionPartialResultEvent {
50
+ matches: string[];
51
+ }
52
+ /**
53
+ * Raised whenever a segmented result is produced (Android only).
54
+ */
55
+ export interface SpeechRecognitionSegmentResultEvent {
56
+ matches: string[];
57
+ }
58
+ /**
59
+ * Raised when the listening state changes.
60
+ */
61
+ export interface SpeechRecognitionListeningEvent {
62
+ status: 'started' | 'stopped';
63
+ }
64
+ export interface SpeechRecognitionAvailability {
65
+ available: boolean;
66
+ }
67
+ export interface SpeechRecognitionMatches {
68
+ matches?: string[];
69
+ }
70
+ export interface SpeechRecognitionLanguages {
71
+ languages: string[];
72
+ }
73
+ export interface SpeechRecognitionListening {
74
+ listening: boolean;
75
+ }
76
+ export interface SpeechRecognitionPlugin {
77
+ /**
78
+ * Checks whether the native speech recognition service is usable on the current device.
79
+ */
80
+ available(): Promise<SpeechRecognitionAvailability>;
81
+ /**
82
+ * Begins capturing audio and transcribing speech.
83
+ *
84
+ * When `partialResults` is `true`, the returned promise resolves immediately and updates are
85
+ * streamed through the `partialResults` listener until {@link stop} is called.
86
+ */
87
+ start(options?: SpeechRecognitionStartOptions): Promise<SpeechRecognitionMatches>;
88
+ /**
89
+ * Stops listening and tears down native resources.
90
+ */
91
+ stop(): Promise<void>;
92
+ /**
93
+ * Gets the locales supported by the underlying recognizer.
94
+ *
95
+ * Android 13+ devices no longer expose this list; in that case `languages` is empty.
96
+ */
97
+ getSupportedLanguages(): Promise<SpeechRecognitionLanguages>;
98
+ /**
99
+ * Returns whether the plugin is actively listening for speech.
100
+ */
101
+ isListening(): Promise<SpeechRecognitionListening>;
102
+ /**
103
+ * Gets the current permission state.
104
+ */
105
+ checkPermissions(): Promise<SpeechRecognitionPermissionStatus>;
106
+ /**
107
+ * Requests the microphone + speech recognition permissions.
108
+ */
109
+ requestPermissions(): Promise<SpeechRecognitionPermissionStatus>;
110
+ /**
111
+ * Returns the native plugin version bundled with this package.
112
+ *
113
+ * Useful when reporting issues to confirm that native and JS versions match.
114
+ */
115
+ getPluginVersion(): Promise<{
116
+ version: string;
117
+ }>;
118
+ /**
119
+ * Listen for segmented session completion events (Android only).
120
+ */
121
+ addListener(eventName: 'endOfSegmentedSession', listenerFunc: () => void): Promise<PluginListenerHandle>;
122
+ /**
123
+ * Listen for segmented recognition results (Android only).
124
+ */
125
+ addListener(eventName: 'segmentResults', listenerFunc: (event: SpeechRecognitionSegmentResultEvent) => void): Promise<PluginListenerHandle>;
126
+ /**
127
+ * Listen for partial transcription updates emitted while `partialResults` is enabled.
128
+ */
129
+ addListener(eventName: 'partialResults', listenerFunc: (event: SpeechRecognitionPartialResultEvent) => void): Promise<PluginListenerHandle>;
130
+ /**
131
+ * Listen for changes to the native listening state.
132
+ */
133
+ addListener(eventName: 'listeningState', listenerFunc: (event: SpeechRecognitionListeningEvent) => void): Promise<PluginListenerHandle>;
134
+ /**
135
+ * Removes every registered listener.
136
+ */
137
+ removeAllListeners(): Promise<void>;
138
+ }
@@ -0,0 +1,2 @@
1
+ export {};
2
+ //# sourceMappingURL=definitions.js.map
@@ -0,0 +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"]}
@@ -0,0 +1,4 @@
1
+ import type { SpeechRecognitionPlugin } from './definitions';
2
+ declare const SpeechRecognition: SpeechRecognitionPlugin;
3
+ export * from './definitions';
4
+ export { SpeechRecognition };
@@ -0,0 +1,7 @@
1
+ import { registerPlugin } from '@capacitor/core';
2
+ const SpeechRecognition = registerPlugin('SpeechRecognition', {
3
+ web: () => import('./web').then((m) => new m.SpeechRecognitionWeb()),
4
+ });
5
+ export * from './definitions';
6
+ export { SpeechRecognition };
7
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,cAAc,EAAE,MAAM,iBAAiB,CAAC;AAIjD,MAAM,iBAAiB,GAAG,cAAc,CAA0B,mBAAmB,EAAE;IACrF,GAAG,EAAE,GAAG,EAAE,CAAC,MAAM,CAAC,OAAO,CAAC,CAAC,IAAI,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,IAAI,CAAC,CAAC,oBAAoB,EAAE,CAAC;CACrE,CAAC,CAAC;AAEH,cAAc,eAAe,CAAC;AAC9B,OAAO,EAAE,iBAAiB,EAAE,CAAC","sourcesContent":["import { registerPlugin } from '@capacitor/core';\n\nimport type { SpeechRecognitionPlugin } from './definitions';\n\nconst SpeechRecognition = registerPlugin<SpeechRecognitionPlugin>('SpeechRecognition', {\n web: () => import('./web').then((m) => new m.SpeechRecognitionWeb()),\n});\n\nexport * from './definitions';\nexport { SpeechRecognition };\n"]}
@@ -0,0 +1,14 @@
1
+ import { WebPlugin } from '@capacitor/core';
2
+ import type { SpeechRecognitionAvailability, SpeechRecognitionLanguages, SpeechRecognitionListening, SpeechRecognitionMatches, SpeechRecognitionPermissionStatus, SpeechRecognitionPlugin, SpeechRecognitionStartOptions } from './definitions';
3
+ export declare class SpeechRecognitionWeb extends WebPlugin implements SpeechRecognitionPlugin {
4
+ available(): Promise<SpeechRecognitionAvailability>;
5
+ start(_options?: SpeechRecognitionStartOptions): Promise<SpeechRecognitionMatches>;
6
+ stop(): Promise<void>;
7
+ getSupportedLanguages(): Promise<SpeechRecognitionLanguages>;
8
+ isListening(): Promise<SpeechRecognitionListening>;
9
+ checkPermissions(): Promise<SpeechRecognitionPermissionStatus>;
10
+ requestPermissions(): Promise<SpeechRecognitionPermissionStatus>;
11
+ getPluginVersion(): Promise<{
12
+ version: string;
13
+ }>;
14
+ }
@@ -0,0 +1,28 @@
1
+ import { WebPlugin } from '@capacitor/core';
2
+ export class SpeechRecognitionWeb extends WebPlugin {
3
+ available() {
4
+ throw this.unimplemented('Speech recognition is not available on the web.');
5
+ }
6
+ start(_options) {
7
+ throw this.unimplemented('Speech recognition is not available on the web.');
8
+ }
9
+ stop() {
10
+ throw this.unimplemented('Speech recognition is not available on the web.');
11
+ }
12
+ getSupportedLanguages() {
13
+ throw this.unimplemented('Speech recognition is not available on the web.');
14
+ }
15
+ isListening() {
16
+ throw this.unimplemented('Speech recognition is not available on the web.');
17
+ }
18
+ checkPermissions() {
19
+ throw this.unimplemented('Speech recognition permissions are not handled on the web.');
20
+ }
21
+ requestPermissions() {
22
+ throw this.unimplemented('Speech recognition permissions are not handled on the web.');
23
+ }
24
+ async getPluginVersion() {
25
+ return { version: 'web' };
26
+ }
27
+ }
28
+ //# sourceMappingURL=web.js.map
@@ -0,0 +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"]}