You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
* This module provides functions to download and work with downloaded files stored in the application's document directory inside the `react-native-executorch/` directory.
99
+
* These utilities can help you manage your storage and clean up the downloaded files when they are no longer needed.
downloads: newMap<ResourceSource,DownloadResource>(),//map of currently downloading (or paused) files, if the download was started by .fetch() method.
67
105
106
+
/**
107
+
* Fetches resources (remote URLs, local files or embedded assets), downloads or stores them locally for use by React Native ExecuTorch.
108
+
*
109
+
* @param callback - Optional callback to track progress of all downloads, reported between 0 and 1.
110
+
* @param sources - Multiple resources that can be strings, asset references, or objects.
111
+
* @returns If the fetch was successful, it returns a promise which resolves to an array of local file paths for the downloaded/stored resources (without file:// prefix).
112
+
* If the fetch was interrupted by `pauseFetching` or `cancelFetching`, it returns a promise which resolves to `null`.
* @param sources - The resource identifiers used when calling `fetch`.
320
+
* @returns A promise that resolves once the download is paused.
321
+
*/
270
322
asyncpauseFetching(...sources: ResourceSource[]){
271
323
constsource=this.findActive(sources);
272
324
awaitthis.pause(source);
273
325
},
274
326
327
+
/**
328
+
* Resumes a paused download of files.
329
+
*
330
+
* @param sources - The resource identifiers used when calling fetch.
331
+
* @returns If the fetch was successful, it returns a promise which resolves to an array of local file paths for the downloaded resources (without file:// prefix).
332
+
* If the fetch was again interrupted by `pauseFetching` or `cancelFetching`, it returns a promise which resolves to `null`.
* This module provides functions to download and work with downloaded files stored in the application's document directory inside the `react-native-executorch/` directory.
96
+
* These utilities can help you manage your storage and clean up the downloaded files when they are no longer needed.
downloads: newMap<ResourceSource,DownloadResource>(),//map of currently downloading (or paused) files, if the download was started by .fetch() method.
64
102
103
+
/**
104
+
* Fetches resources (remote URLs, local files or embedded assets), downloads or stores them locally for use by React Native ExecuTorch.
105
+
*
106
+
* @param callback - Optional callback to track progress of all downloads, reported between 0 and 1.
107
+
* @param sources - Multiple resources that can be strings, asset references, or objects.
108
+
* @returns If the fetch was successful, it returns a promise which resolves to an array of local file paths for the downloaded/stored resources (without file:// prefix).
109
+
* If the fetch was interrupted by `pauseFetching` or `cancelFetching`, it returns a promise which resolves to `null`.
* @param sources - The resource identifiers used when calling `fetch`.
293
+
* @returns A promise that resolves once the download is paused.
294
+
*/
243
295
asyncpauseFetching(...sources: ResourceSource[]){
244
296
constsource=this.findActive(sources);
245
297
awaitthis.pause(source);
246
298
},
247
299
300
+
/**
301
+
* Resumes a paused download of files.
302
+
*
303
+
* @param sources - The resource identifiers used when calling fetch.
304
+
* @returns If the fetch was successful, it returns a promise which resolves to an array of local file paths for the downloaded resources (without file:// prefix).
305
+
* If the fetch was again interrupted by `pauseFetching` or `cancelFetching`, it returns a promise which resolves to `null`.
0 commit comments