react-native-sherpa-onnx 0.3.7 → 0.3.9

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 (118) hide show
  1. package/README.md +7 -2
  2. package/SherpaOnnx.podspec +4 -1
  3. package/android/prebuilt-download.gradle +23 -23
  4. package/android/src/main/assets/model_licenses/asr-models-license-status.csv +1 -0
  5. package/android/src/main/cpp/jni/model_detect/sherpa-onnx-model-detect-helper.cpp +23 -0
  6. package/android/src/main/cpp/jni/model_detect/sherpa-onnx-model-detect-helper.h +9 -0
  7. package/android/src/main/cpp/jni/model_detect/sherpa-onnx-model-detect-stt.cpp +51 -8
  8. package/android/src/main/cpp/jni/model_detect/sherpa-onnx-model-detect-tts.cpp +31 -4
  9. package/android/src/main/cpp/jni/model_detect/sherpa-onnx-model-detect.h +19 -1
  10. package/android/src/main/cpp/jni/model_detect/sherpa-onnx-stt-wrapper.cpp +5 -0
  11. package/android/src/main/cpp/jni/model_detect/sherpa-onnx-tts-wrapper.cpp +7 -0
  12. package/android/src/main/cpp/jni/model_detect/sherpa-onnx-validate-stt.cpp +11 -0
  13. package/android/src/main/cpp/jni/model_detect/sherpa-onnx-validate-tts.cpp +14 -0
  14. package/android/src/main/java/com/sherpaonnx/SherpaOnnxArchiveHelper.kt +110 -35
  15. package/android/src/main/java/com/sherpaonnx/SherpaOnnxExtractionNotificationHelper.kt +102 -0
  16. package/android/src/main/java/com/sherpaonnx/SherpaOnnxModule.kt +92 -18
  17. package/android/src/main/java/com/sherpaonnx/SherpaOnnxSttHelper.kt +22 -0
  18. package/android/src/main/java/com/sherpaonnx/SherpaOnnxTtsHelper.kt +15 -0
  19. package/ios/Resources/model_licenses/asr-models-license-status.csv +1 -0
  20. package/ios/SherpaOnnx+STT.mm +13 -1
  21. package/ios/SherpaOnnx+TTS.mm +1 -0
  22. package/ios/SherpaOnnx.mm +87 -17
  23. package/ios/model_detect/sherpa-onnx-model-detect-helper.h +5 -0
  24. package/ios/model_detect/sherpa-onnx-model-detect-helper.mm +23 -0
  25. package/ios/model_detect/sherpa-onnx-model-detect-stt.mm +51 -7
  26. package/ios/model_detect/sherpa-onnx-model-detect-tts.mm +36 -4
  27. package/ios/model_detect/sherpa-onnx-model-detect.h +19 -1
  28. package/ios/model_detect/sherpa-onnx-validate-stt.mm +11 -0
  29. package/ios/model_detect/sherpa-onnx-validate-tts.mm +14 -0
  30. package/ios/stt/sherpa-onnx-stt-wrapper.h +11 -1
  31. package/ios/stt/sherpa-onnx-stt-wrapper.mm +30 -2
  32. package/ios/tts/sherpa-onnx-tts-wrapper.mm +25 -0
  33. package/lib/module/NativeSherpaOnnx.js.map +1 -1
  34. package/lib/module/download/ModelDownloadManager.js +1 -1
  35. package/lib/module/download/ModelDownloadManager.js.map +1 -1
  36. package/lib/module/download/background-downloader-types.js +2 -0
  37. package/lib/module/download/background-downloader-types.js.map +1 -0
  38. package/lib/module/download/downloadTask.js +54 -1
  39. package/lib/module/download/downloadTask.js.map +1 -1
  40. package/lib/module/download/index.js +1 -1
  41. package/lib/module/download/index.js.map +1 -1
  42. package/lib/module/download/postDownloadProcessing.js +17 -4
  43. package/lib/module/download/postDownloadProcessing.js.map +1 -1
  44. package/lib/module/download/registry.js +1 -0
  45. package/lib/module/download/registry.js.map +1 -1
  46. package/lib/module/extraction/extractTarBz2.js +2 -2
  47. package/lib/module/extraction/extractTarBz2.js.map +1 -1
  48. package/lib/module/extraction/extractTarZst.js +2 -2
  49. package/lib/module/extraction/extractTarZst.js.map +1 -1
  50. package/lib/module/extraction/index.js +10 -5
  51. package/lib/module/extraction/index.js.map +1 -1
  52. package/lib/module/stt/index.js +4 -2
  53. package/lib/module/stt/index.js.map +1 -1
  54. package/lib/module/stt/streaming.js +2 -1
  55. package/lib/module/stt/streaming.js.map +1 -1
  56. package/lib/module/stt/types.js +3 -1
  57. package/lib/module/stt/types.js.map +1 -1
  58. package/lib/module/tts/index.js +5 -3
  59. package/lib/module/tts/index.js.map +1 -1
  60. package/lib/module/tts/streaming.js +4 -2
  61. package/lib/module/tts/streaming.js.map +1 -1
  62. package/lib/module/tts/types.js +4 -1
  63. package/lib/module/tts/types.js.map +1 -1
  64. package/lib/typescript/src/NativeSherpaOnnx.d.ts +26 -10
  65. package/lib/typescript/src/NativeSherpaOnnx.d.ts.map +1 -1
  66. package/lib/typescript/src/download/ModelDownloadManager.d.ts +2 -1
  67. package/lib/typescript/src/download/ModelDownloadManager.d.ts.map +1 -1
  68. package/lib/typescript/src/download/background-downloader-types.d.ts +64 -0
  69. package/lib/typescript/src/download/background-downloader-types.d.ts.map +1 -0
  70. package/lib/typescript/src/download/downloadTask.d.ts +10 -0
  71. package/lib/typescript/src/download/downloadTask.d.ts.map +1 -1
  72. package/lib/typescript/src/download/index.d.ts +2 -2
  73. package/lib/typescript/src/download/index.d.ts.map +1 -1
  74. package/lib/typescript/src/download/postDownloadProcessing.d.ts +9 -0
  75. package/lib/typescript/src/download/postDownloadProcessing.d.ts.map +1 -1
  76. package/lib/typescript/src/download/registry.d.ts.map +1 -1
  77. package/lib/typescript/src/extraction/extractTarBz2.d.ts +2 -1
  78. package/lib/typescript/src/extraction/extractTarBz2.d.ts.map +1 -1
  79. package/lib/typescript/src/extraction/extractTarZst.d.ts +2 -1
  80. package/lib/typescript/src/extraction/extractTarZst.d.ts.map +1 -1
  81. package/lib/typescript/src/extraction/index.d.ts +1 -1
  82. package/lib/typescript/src/extraction/index.d.ts.map +1 -1
  83. package/lib/typescript/src/extraction/types.d.ts +12 -0
  84. package/lib/typescript/src/extraction/types.d.ts.map +1 -1
  85. package/lib/typescript/src/stt/index.d.ts +1 -1
  86. package/lib/typescript/src/stt/index.d.ts.map +1 -1
  87. package/lib/typescript/src/stt/streaming.d.ts.map +1 -1
  88. package/lib/typescript/src/stt/types.d.ts +16 -1
  89. package/lib/typescript/src/stt/types.d.ts.map +1 -1
  90. package/lib/typescript/src/tts/index.d.ts +1 -1
  91. package/lib/typescript/src/tts/index.d.ts.map +1 -1
  92. package/lib/typescript/src/tts/streaming.d.ts.map +1 -1
  93. package/lib/typescript/src/tts/types.d.ts +6 -1
  94. package/lib/typescript/src/tts/types.d.ts.map +1 -1
  95. package/package.json +1 -1
  96. package/scripts/ci/update_model_license_csv.sh +16 -16
  97. package/src/NativeSherpaOnnx.ts +38 -11
  98. package/src/download/ModelDownloadManager.ts +2 -0
  99. package/src/download/background-downloader-types.ts +73 -0
  100. package/src/download/downloadTask.ts +68 -0
  101. package/src/download/index.ts +2 -0
  102. package/src/download/postDownloadProcessing.ts +24 -1
  103. package/src/download/registry.ts +1 -0
  104. package/src/extraction/extractTarBz2.ts +7 -2
  105. package/src/extraction/extractTarZst.ts +7 -2
  106. package/src/extraction/index.ts +29 -6
  107. package/src/extraction/types.ts +16 -0
  108. package/src/stt/index.ts +8 -7
  109. package/src/stt/streaming.ts +7 -1
  110. package/src/stt/types.ts +18 -0
  111. package/src/tts/index.ts +10 -7
  112. package/src/tts/streaming.ts +8 -3
  113. package/src/tts/types.ts +9 -0
  114. package/third_party/sherpa-onnx-prebuilt/ANDROID_RELEASE_TAG +1 -1
  115. package/third_party/sherpa-onnx-prebuilt/IOS_RELEASE_TAG +1 -1
  116. package/lib/module/download/background-downloader.d.js +0 -2
  117. package/lib/module/download/background-downloader.d.js.map +0 -1
  118. package/src/download/background-downloader.d.ts +0 -43
@@ -17,6 +17,7 @@ import { extractTarBz2 } from './extractTarBz2';
17
17
  import type {
18
18
  BundledArchive,
19
19
  ExtractArchiveOptions,
20
+ ExtractNotificationArgs,
20
21
  ExtractResult,
21
22
  ExtractProgressEvent,
22
23
  } from './types';
@@ -24,6 +25,7 @@ import type {
24
25
  export type {
25
26
  BundledArchive,
26
27
  ExtractArchiveOptions,
28
+ ExtractNotificationArgs,
27
29
  ExtractResult,
28
30
  ExtractProgressEvent,
29
31
  } from './types';
@@ -160,6 +162,11 @@ export async function extractArchive(
160
162
  const force = options?.force !== false;
161
163
  const onProgress = options?.onProgress;
162
164
  const signal = options?.signal;
165
+ const notification = {
166
+ showNotificationsEnabled: options?.showNotificationsEnabled,
167
+ notificationTitle: options?.notificationTitle,
168
+ notificationText: options?.notificationText,
169
+ };
163
170
 
164
171
  if (signal?.aborted) {
165
172
  const err = new Error('Extraction aborted');
@@ -173,7 +180,14 @@ export async function extractArchive(
173
180
  archive.archivePath.startsWith('asset_packs/'));
174
181
 
175
182
  if (useAssetStream) {
176
- return extractFromAsset(archive, targetPath, force, onProgress, signal);
183
+ return extractFromAsset(
184
+ archive,
185
+ targetPath,
186
+ force,
187
+ onProgress,
188
+ signal,
189
+ notification
190
+ );
177
191
  }
178
192
 
179
193
  if (archive.format === 'tar.zst') {
@@ -182,7 +196,8 @@ export async function extractArchive(
182
196
  targetPath,
183
197
  force,
184
198
  onProgress,
185
- signal
199
+ signal,
200
+ notification
186
201
  );
187
202
  }
188
203
  return extractTarBz2(
@@ -190,7 +205,8 @@ export async function extractArchive(
190
205
  targetPath,
191
206
  force,
192
207
  onProgress,
193
- signal
208
+ signal,
209
+ notification
194
210
  );
195
211
  }
196
212
 
@@ -201,7 +217,8 @@ async function extractFromAsset(
201
217
  targetPath: string,
202
218
  force: boolean,
203
219
  onProgress?: (event: ExtractProgressEvent) => void,
204
- signal?: AbortSignal
220
+ signal?: AbortSignal,
221
+ notification?: ExtractNotificationArgs
205
222
  ): Promise<ExtractResult> {
206
223
  const eventName =
207
224
  archive.format === 'tar.zst'
@@ -245,12 +262,18 @@ async function extractFromAsset(
245
262
  ? await SherpaOnnx.extractTarZstFromAsset(
246
263
  archive.archivePath,
247
264
  targetPath,
248
- force
265
+ force,
266
+ notification?.showNotificationsEnabled,
267
+ notification?.notificationTitle,
268
+ notification?.notificationText
249
269
  )
250
270
  : await SherpaOnnx.extractTarBz2FromAsset(
251
271
  archive.archivePath,
252
272
  targetPath,
253
- force
273
+ force,
274
+ notification?.showNotificationsEnabled,
275
+ notification?.notificationTitle,
276
+ notification?.notificationText
254
277
  );
255
278
 
256
279
  if (!result.success) {
@@ -60,4 +60,20 @@ export type ExtractArchiveOptions = {
60
60
  onProgress?: (event: ExtractProgressEvent) => void;
61
61
  /** AbortSignal to cancel the extraction. */
62
62
  signal?: AbortSignal;
63
+ /**
64
+ * **Android:** When true (default), the native layer posts a system notification with extraction
65
+ * progress. Set to false to disable (e.g. first-run bundled-model prep with in-app UI only).
66
+ * **iOS:** Accepted for API parity; no notification is shown.
67
+ */
68
+ showNotificationsEnabled?: boolean;
69
+ /** **Android:** Notification title. Default: generic “unpacking” title. Ignored on iOS. */
70
+ notificationTitle?: string;
71
+ /** **Android:** Notification body (progress text is appended). Default: generic. Ignored on iOS. */
72
+ notificationText?: string;
63
73
  };
74
+
75
+ /** Subset of `ExtractArchiveOptions` passed through to path- and asset-stream extractors. */
76
+ export type ExtractNotificationArgs = Pick<
77
+ ExtractArchiveOptions,
78
+ 'showNotificationsEnabled' | 'notificationTitle' | 'notificationText'
79
+ >;
package/src/stt/index.ts CHANGED
@@ -67,10 +67,7 @@ export async function detectSttModel(
67
67
  options?.preferInt8,
68
68
  options?.modelType
69
69
  );
70
- const err =
71
- typeof (raw as { error?: unknown }).error === 'string'
72
- ? String((raw as { error: string }).error).trim()
73
- : '';
70
+ const err = typeof raw.error === 'string' ? raw.error.trim() : '';
74
71
  return {
75
72
  success: raw.success,
76
73
  ...(err.length > 0 ? { error: err } : {}),
@@ -170,10 +167,13 @@ export async function createSTT(
170
167
  );
171
168
 
172
169
  if (!result.success) {
170
+ const nativeError =
171
+ typeof result.error === 'string' ? result.error.trim() : '';
172
+ const detected = JSON.stringify(result.detectedModels ?? []);
173
173
  throw new Error(
174
- `STT initialization failed: ${JSON.stringify(
175
- result.detectedModels ?? []
176
- )}`
174
+ nativeError.length > 0
175
+ ? `STT initialization failed: ${nativeError}`
176
+ : `STT initialization failed: ${detected}`
177
177
  );
178
178
  }
179
179
 
@@ -259,6 +259,7 @@ export type {
259
259
  STTInitializeOptions,
260
260
  STTModelType,
261
261
  SttModelOptions,
262
+ SttQwen3AsrModelOptions,
262
263
  SttRecognitionResult,
263
264
  SttRuntimeConfig,
264
265
  SttEngine,
@@ -231,7 +231,13 @@ export async function createStreamingSTT(
231
231
  );
232
232
 
233
233
  if (!result.success) {
234
- throw new Error(`Streaming STT initialization failed for ${instanceId}`);
234
+ const nativeError =
235
+ typeof result.error === 'string' ? result.error.trim() : '';
236
+ throw new Error(
237
+ nativeError.length > 0
238
+ ? `Streaming STT initialization failed: ${nativeError}`
239
+ : `Streaming STT initialization failed for ${instanceId}`
240
+ );
235
241
  }
236
242
 
237
243
  const enableInputNormalization = options.enableInputNormalization !== false;
package/src/stt/types.ts CHANGED
@@ -15,6 +15,7 @@ export type STTModelType =
15
15
  | 'ctc'
16
16
  | 'whisper'
17
17
  | 'funasr_nano'
18
+ | 'qwen3_asr'
18
19
  | 'fire_red_asr'
19
20
  | 'moonshine'
20
21
  | 'dolphin'
@@ -50,6 +51,7 @@ export const STT_MODEL_TYPES: readonly STTModelType[] = [
50
51
  'ctc',
51
52
  'whisper',
52
53
  'funasr_nano',
54
+ 'qwen3_asr',
53
55
  'fire_red_asr',
54
56
  'moonshine',
55
57
  'dolphin',
@@ -124,6 +126,20 @@ export interface SttFunAsrNanoModelOptions {
124
126
  hotwords?: string;
125
127
  }
126
128
 
129
+ /** Options for Qwen3 ASR models. Applied only when modelType is 'qwen3_asr'. */
130
+ export interface SttQwen3AsrModelOptions {
131
+ /** Max total sequence length. Default: 512. */
132
+ maxTotalLen?: number;
133
+ /** Max new tokens to generate. Default: 128. */
134
+ maxNewTokens?: number;
135
+ /** Sampling temperature. Default: 1e-6. */
136
+ temperature?: number;
137
+ /** Top-p sampling. Default: 0.8. */
138
+ topP?: number;
139
+ /** Random seed. Default: 42. */
140
+ seed?: number;
141
+ }
142
+
127
143
  /**
128
144
  * Model-specific STT options. Only the block for the actually loaded model type is applied;
129
145
  * others are ignored (e.g. whisper options have no effect when a paraformer model is loaded).
@@ -133,6 +149,7 @@ export interface SttModelOptions {
133
149
  senseVoice?: SttSenseVoiceModelOptions;
134
150
  canary?: SttCanaryModelOptions;
135
151
  funasrNano?: SttFunAsrNanoModelOptions;
152
+ qwen3Asr?: SttQwen3AsrModelOptions;
136
153
  }
137
154
 
138
155
  /**
@@ -162,6 +179,7 @@ export interface STTInitializeOptions {
162
179
  * - 'wenet_ctc': Force detection as WeNet CTC model
163
180
  * - 'sense_voice': Force detection as SenseVoice model
164
181
  * - 'funasr_nano': Force detection as FunASR Nano model
182
+ * - 'qwen3_asr': Force detection as Qwen3 ASR
165
183
  * - 'fire_red_asr': FireRed ASR (encoder/decoder)
166
184
  * - 'moonshine': Moonshine (preprocess, encode, uncached_decode, cached_decode)
167
185
  * - 'dolphin': Dolphin (single model)
package/src/tts/index.ts CHANGED
@@ -49,6 +49,8 @@ function flattenTtsModelOptionsForNative(
49
49
  ? modelOptions.kitten
50
50
  : modelType === 'pocket'
51
51
  ? modelOptions.pocket
52
+ : modelType === 'supertonic'
53
+ ? modelOptions.supertonic
52
54
  : undefined;
53
55
  if (!block)
54
56
  return {
@@ -110,10 +112,7 @@ export async function detectTtsModel(
110
112
  }> {
111
113
  const resolvedPath = await resolveModelPath(modelPath);
112
114
  const raw = await SherpaOnnx.detectTtsModel(resolvedPath, options?.modelType);
113
- const err =
114
- typeof (raw as { error?: unknown }).error === 'string'
115
- ? String((raw as { error: string }).error).trim()
116
- : '';
115
+ const err = typeof raw.error === 'string' ? raw.error.trim() : '';
117
116
  return {
118
117
  success: raw.success,
119
118
  ...(err.length > 0 ? { error: err } : {}),
@@ -241,10 +240,13 @@ export async function createTTS(
241
240
  );
242
241
 
243
242
  if (!result.success) {
243
+ const nativeError =
244
+ typeof result.error === 'string' ? result.error.trim() : '';
245
+ const detected = JSON.stringify(result.detectedModels ?? []);
244
246
  throw new Error(
245
- `TTS initialization failed: ${JSON.stringify(
246
- result.detectedModels ?? []
247
- )}`
247
+ nativeError.length > 0
248
+ ? `TTS initialization failed: ${nativeError}`
249
+ : `TTS initialization failed: ${detected}`
248
250
  );
249
251
  }
250
252
 
@@ -446,6 +448,7 @@ export type {
446
448
  TtsKokoroModelOptions,
447
449
  TtsKittenModelOptions,
448
450
  TtsPocketModelOptions,
451
+ TtsSupertonicModelOptions,
449
452
  TtsUpdateOptions,
450
453
  TtsGenerationOptions,
451
454
  GeneratedAudio,
@@ -52,6 +52,8 @@ function flattenTtsModelOptionsForNative(
52
52
  ? modelOptions.kitten
53
53
  : modelType === 'pocket'
54
54
  ? modelOptions.pocket
55
+ : modelType === 'supertonic'
56
+ ? modelOptions.supertonic
55
57
  : undefined;
56
58
  if (!block)
57
59
  return {
@@ -190,10 +192,13 @@ export async function createStreamingTTS(
190
192
  );
191
193
 
192
194
  if (!result.success) {
195
+ const nativeError =
196
+ typeof result.error === 'string' ? result.error.trim() : '';
197
+ const detected = JSON.stringify(result.detectedModels ?? []);
193
198
  throw new Error(
194
- `TTS initialization failed: ${JSON.stringify(
195
- result.detectedModels ?? []
196
- )}`
199
+ nativeError.length > 0
200
+ ? `Streaming TTS initialization failed: ${nativeError}`
201
+ : `Streaming TTS initialization failed: ${detected}`
197
202
  );
198
203
  }
199
204
 
package/src/tts/types.ts CHANGED
@@ -9,6 +9,7 @@ import type { ModelPathConfig } from '../types';
9
9
  * - 'kitten': KittenTTS models (lightweight, multi-speaker)
10
10
  * - 'pocket': Pocket TTS models
11
11
  * - 'zipvoice': Zipvoice models (voice cloning capable)
12
+ * - 'supertonic': Supertonic models
12
13
  * - 'auto': Auto-detect model type based on files present (default)
13
14
  */
14
15
  export type TTSModelType =
@@ -18,6 +19,7 @@ export type TTSModelType =
18
19
  | 'kitten'
19
20
  | 'pocket'
20
21
  | 'zipvoice'
22
+ | 'supertonic'
21
23
  | 'auto';
22
24
 
23
25
  /** Runtime list of supported TTS model types. */
@@ -28,6 +30,7 @@ export const TTS_MODEL_TYPES: readonly TTSModelType[] = [
28
30
  'kitten',
29
31
  'pocket',
30
32
  'zipvoice',
33
+ 'supertonic',
31
34
  'auto',
32
35
  ] as const;
33
36
 
@@ -68,6 +71,11 @@ export interface TtsPocketModelOptions {
68
71
  // No init-time options in Kotlin OfflineTtsPocketModelConfig; voice cloning is via GenerationConfig at generate time.
69
72
  }
70
73
 
74
+ /** Options for Supertonic models. Applied only when modelType is 'supertonic'. */
75
+ export interface TtsSupertonicModelOptions {
76
+ // No init-time model options exposed by sherpa-onnx currently.
77
+ }
78
+
71
79
  /**
72
80
  * Model-specific TTS options. Only the block for the actually loaded model type is applied;
73
81
  * others are ignored (e.g. vits options have no effect when a kokoro model is loaded).
@@ -78,6 +86,7 @@ export interface TtsModelOptions {
78
86
  kokoro?: TtsKokoroModelOptions;
79
87
  kitten?: TtsKittenModelOptions;
80
88
  pocket?: TtsPocketModelOptions;
89
+ supertonic?: TtsSupertonicModelOptions;
81
90
  }
82
91
 
83
92
  /**
@@ -1 +1 @@
1
- sherpa-onnx-android-v1.12.31-1
1
+ sherpa-onnx-android-v1.12.34-1
@@ -1 +1 @@
1
- sherpa-onnx-ios-v1.12.31-1
1
+ sherpa-onnx-ios-v1.12.34-1
@@ -1,2 +0,0 @@
1
- "use strict";
2
- //# sourceMappingURL=background-downloader.d.js.map
@@ -1 +0,0 @@
1
- {"version":3,"names":[],"sourceRoot":"../../../src","sources":["download/background-downloader.d.ts"],"mappings":"","ignoreList":[]}
@@ -1,43 +0,0 @@
1
- /**
2
- * Type declarations for @kesha-antonov/react-native-background-downloader
3
- * when the package is not installed (e.g. SDK build). The real package provides full types.
4
- */
5
- declare module '@kesha-antonov/react-native-background-downloader' {
6
- export interface DownloadTask {
7
- id: string;
8
- start(): void;
9
- stop(): void;
10
- pause(): Promise<void>;
11
- resume(): Promise<void>;
12
- begin(
13
- cb: (data: {
14
- expectedBytes?: number;
15
- headers?: Record<string, string>;
16
- }) => void
17
- ): DownloadTask;
18
- progress(
19
- cb: (data: { bytesDownloaded: number; bytesTotal: number }) => void
20
- ): DownloadTask;
21
- done(
22
- cb: (data: {
23
- location?: string;
24
- bytesDownloaded: number;
25
- bytesTotal: number;
26
- }) => void
27
- ): DownloadTask;
28
- error(
29
- cb: (data: { error?: string; errorCode?: number }) => void
30
- ): DownloadTask;
31
- }
32
-
33
- export function createDownloadTask(options: {
34
- id: string;
35
- url: string;
36
- destination: string;
37
- metadata?: Record<string, unknown>;
38
- }): DownloadTask;
39
-
40
- export function completeHandler(taskId: string): void;
41
-
42
- export function getExistingDownloadTasks(): Promise<DownloadTask[]>;
43
- }