expo-file-system 19.0.18 → 19.0.20

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 (61) hide show
  1. package/CHANGELOG.md +14 -0
  2. package/android/build.gradle +2 -2
  3. package/android/src/main/java/expo/modules/filesystem/FileSystemExceptions.kt +5 -0
  4. package/android/src/main/java/expo/modules/filesystem/FileSystemFile.kt +6 -0
  5. package/android/src/main/java/expo/modules/filesystem/FileSystemModule.kt +4 -0
  6. package/android/src/main/java/expo/modules/filesystem/unifiedfile/AssetFile.kt +17 -0
  7. package/android/src/main/java/expo/modules/filesystem/unifiedfile/JavaFile.kt +10 -0
  8. package/android/src/main/java/expo/modules/filesystem/unifiedfile/SAFDocumentFile.kt +5 -0
  9. package/android/src/main/java/expo/modules/filesystem/unifiedfile/UnifiedFileInterface.kt +2 -0
  10. package/build/ExpoFileSystem.types.d.ts +18 -5
  11. package/build/ExpoFileSystem.types.d.ts.map +1 -1
  12. package/build/index.d.ts +1 -1
  13. package/build/index.d.ts.map +1 -1
  14. package/expo-module.config.json +1 -1
  15. package/ios/FileSystemModule.swift +12 -0
  16. package/ios/FileSystemPath.swift +1 -1
  17. package/local-maven-repo/host/exp/exponent/expo.modules.filesystem/{19.0.18/expo.modules.filesystem-19.0.18-sources.jar → 19.0.20/expo.modules.filesystem-19.0.20-sources.jar} +0 -0
  18. package/local-maven-repo/host/exp/exponent/expo.modules.filesystem/19.0.20/expo.modules.filesystem-19.0.20-sources.jar.md5 +1 -0
  19. package/local-maven-repo/host/exp/exponent/expo.modules.filesystem/19.0.20/expo.modules.filesystem-19.0.20-sources.jar.sha1 +1 -0
  20. package/local-maven-repo/host/exp/exponent/expo.modules.filesystem/19.0.20/expo.modules.filesystem-19.0.20-sources.jar.sha256 +1 -0
  21. package/local-maven-repo/host/exp/exponent/expo.modules.filesystem/19.0.20/expo.modules.filesystem-19.0.20-sources.jar.sha512 +1 -0
  22. package/local-maven-repo/host/exp/exponent/expo.modules.filesystem/19.0.20/expo.modules.filesystem-19.0.20.aar +0 -0
  23. package/local-maven-repo/host/exp/exponent/expo.modules.filesystem/19.0.20/expo.modules.filesystem-19.0.20.aar.md5 +1 -0
  24. package/local-maven-repo/host/exp/exponent/expo.modules.filesystem/19.0.20/expo.modules.filesystem-19.0.20.aar.sha1 +1 -0
  25. package/local-maven-repo/host/exp/exponent/expo.modules.filesystem/19.0.20/expo.modules.filesystem-19.0.20.aar.sha256 +1 -0
  26. package/local-maven-repo/host/exp/exponent/expo.modules.filesystem/19.0.20/expo.modules.filesystem-19.0.20.aar.sha512 +1 -0
  27. package/local-maven-repo/host/exp/exponent/expo.modules.filesystem/{19.0.18/expo.modules.filesystem-19.0.18.module → 19.0.20/expo.modules.filesystem-19.0.20.module} +22 -22
  28. package/local-maven-repo/host/exp/exponent/expo.modules.filesystem/19.0.20/expo.modules.filesystem-19.0.20.module.md5 +1 -0
  29. package/local-maven-repo/host/exp/exponent/expo.modules.filesystem/19.0.20/expo.modules.filesystem-19.0.20.module.sha1 +1 -0
  30. package/local-maven-repo/host/exp/exponent/expo.modules.filesystem/19.0.20/expo.modules.filesystem-19.0.20.module.sha256 +1 -0
  31. package/local-maven-repo/host/exp/exponent/expo.modules.filesystem/19.0.20/expo.modules.filesystem-19.0.20.module.sha512 +1 -0
  32. package/local-maven-repo/host/exp/exponent/expo.modules.filesystem/{19.0.18/expo.modules.filesystem-19.0.18.pom → 19.0.20/expo.modules.filesystem-19.0.20.pom} +1 -1
  33. package/local-maven-repo/host/exp/exponent/expo.modules.filesystem/19.0.20/expo.modules.filesystem-19.0.20.pom.md5 +1 -0
  34. package/local-maven-repo/host/exp/exponent/expo.modules.filesystem/19.0.20/expo.modules.filesystem-19.0.20.pom.sha1 +1 -0
  35. package/local-maven-repo/host/exp/exponent/expo.modules.filesystem/19.0.20/expo.modules.filesystem-19.0.20.pom.sha256 +1 -0
  36. package/local-maven-repo/host/exp/exponent/expo.modules.filesystem/19.0.20/expo.modules.filesystem-19.0.20.pom.sha512 +1 -0
  37. package/local-maven-repo/host/exp/exponent/expo.modules.filesystem/maven-metadata.xml +4 -4
  38. package/local-maven-repo/host/exp/exponent/expo.modules.filesystem/maven-metadata.xml.md5 +1 -1
  39. package/local-maven-repo/host/exp/exponent/expo.modules.filesystem/maven-metadata.xml.sha1 +1 -1
  40. package/local-maven-repo/host/exp/exponent/expo.modules.filesystem/maven-metadata.xml.sha256 +1 -1
  41. package/local-maven-repo/host/exp/exponent/expo.modules.filesystem/maven-metadata.xml.sha512 +1 -1
  42. package/package.json +4 -4
  43. package/src/ExpoFileSystem.types.ts +18 -5
  44. package/src/index.ts +1 -0
  45. package/local-maven-repo/host/exp/exponent/expo.modules.filesystem/19.0.18/expo.modules.filesystem-19.0.18-sources.jar.md5 +0 -1
  46. package/local-maven-repo/host/exp/exponent/expo.modules.filesystem/19.0.18/expo.modules.filesystem-19.0.18-sources.jar.sha1 +0 -1
  47. package/local-maven-repo/host/exp/exponent/expo.modules.filesystem/19.0.18/expo.modules.filesystem-19.0.18-sources.jar.sha256 +0 -1
  48. package/local-maven-repo/host/exp/exponent/expo.modules.filesystem/19.0.18/expo.modules.filesystem-19.0.18-sources.jar.sha512 +0 -1
  49. package/local-maven-repo/host/exp/exponent/expo.modules.filesystem/19.0.18/expo.modules.filesystem-19.0.18.aar +0 -0
  50. package/local-maven-repo/host/exp/exponent/expo.modules.filesystem/19.0.18/expo.modules.filesystem-19.0.18.aar.md5 +0 -1
  51. package/local-maven-repo/host/exp/exponent/expo.modules.filesystem/19.0.18/expo.modules.filesystem-19.0.18.aar.sha1 +0 -1
  52. package/local-maven-repo/host/exp/exponent/expo.modules.filesystem/19.0.18/expo.modules.filesystem-19.0.18.aar.sha256 +0 -1
  53. package/local-maven-repo/host/exp/exponent/expo.modules.filesystem/19.0.18/expo.modules.filesystem-19.0.18.aar.sha512 +0 -1
  54. package/local-maven-repo/host/exp/exponent/expo.modules.filesystem/19.0.18/expo.modules.filesystem-19.0.18.module.md5 +0 -1
  55. package/local-maven-repo/host/exp/exponent/expo.modules.filesystem/19.0.18/expo.modules.filesystem-19.0.18.module.sha1 +0 -1
  56. package/local-maven-repo/host/exp/exponent/expo.modules.filesystem/19.0.18/expo.modules.filesystem-19.0.18.module.sha256 +0 -1
  57. package/local-maven-repo/host/exp/exponent/expo.modules.filesystem/19.0.18/expo.modules.filesystem-19.0.18.module.sha512 +0 -1
  58. package/local-maven-repo/host/exp/exponent/expo.modules.filesystem/19.0.18/expo.modules.filesystem-19.0.18.pom.md5 +0 -1
  59. package/local-maven-repo/host/exp/exponent/expo.modules.filesystem/19.0.18/expo.modules.filesystem-19.0.18.pom.sha1 +0 -1
  60. package/local-maven-repo/host/exp/exponent/expo.modules.filesystem/19.0.18/expo.modules.filesystem-19.0.18.pom.sha256 +0 -1
  61. package/local-maven-repo/host/exp/exponent/expo.modules.filesystem/19.0.18/expo.modules.filesystem-19.0.18.pom.sha512 +0 -1
package/CHANGELOG.md CHANGED
@@ -10,6 +10,20 @@
10
10
 
11
11
  ### 💡 Others
12
12
 
13
+ ## 19.0.20 — 2025-12-05
14
+
15
+ _This version does not introduce any user-facing changes._
16
+
17
+ ## 19.0.19 — 2025-11-18
18
+
19
+ ### 🎉 New features
20
+
21
+ - [Android] Add contentUri property. ([#40002](https://github.com/expo/expo/pull/40002) by [@aleqsio](https://github.com/aleqsio))
22
+
23
+ ### 🐛 Bug fixes
24
+
25
+ - [iOS] Add missing `createFile` and `createDirectory` methods. ([#40314](https://github.com/expo/expo/pull/40314) by [@jakex7](https://github.com/jakex7))
26
+
13
27
  ## 19.0.18 — 2025-11-17
14
28
 
15
29
  _This version does not introduce any user-facing changes._
@@ -4,13 +4,13 @@ plugins {
4
4
  }
5
5
 
6
6
  group = 'host.exp.exponent'
7
- version = '19.0.18'
7
+ version = '19.0.20'
8
8
 
9
9
  android {
10
10
  namespace "expo.modules.filesystem"
11
11
  defaultConfig {
12
12
  versionCode 30
13
- versionName "19.0.18"
13
+ versionName "19.0.20"
14
14
  }
15
15
  }
16
16
 
@@ -44,6 +44,11 @@ internal class UnableToWriteHandleException(reason: String) :
44
44
  "Unable to write to a file handle: '$reason'"
45
45
  )
46
46
 
47
+ internal class MissingAppContextException :
48
+ CodedException(
49
+ "The app context is missing."
50
+ )
51
+
47
52
  internal class PickerCancelledException :
48
53
  CodedException("The file picker was cancelled by the user")
49
54
 
@@ -126,6 +126,12 @@ class FileSystemFile(uri: Uri) : FileSystemPath(uri) {
126
126
  }
127
127
  }
128
128
 
129
+ fun asContentUri(): Uri {
130
+ validateType()
131
+ validatePermission(Permission.READ)
132
+ return file.getContentUri(appContext ?: throw MissingAppContextException())
133
+ }
134
+
129
135
  @OptIn(ExperimentalStdlibApi::class)
130
136
  val md5: String get() {
131
137
  validatePermission(Permission.READ)
@@ -215,6 +215,10 @@ class FileSystemModule : Module() {
215
215
  file.asString()
216
216
  }
217
217
 
218
+ Property("contentUri") { file ->
219
+ file.asContentUri()
220
+ }
221
+
218
222
  Property("md5") { file ->
219
223
  try {
220
224
  file.md5
@@ -4,7 +4,9 @@ import android.content.Context
4
4
  import android.net.Uri
5
5
  import android.webkit.MimeTypeMap
6
6
  import androidx.core.net.toUri
7
+ import expo.modules.kotlin.AppContext
7
8
  import java.io.File
9
+ import java.io.FileOutputStream
8
10
  import java.io.InputStream
9
11
  import java.io.OutputStream
10
12
 
@@ -25,6 +27,21 @@ class AssetFile(private val context: Context, override val uri: Uri) : UnifiedFi
25
27
  }
26
28
  }
27
29
 
30
+ // Cache the content URI to avoid redundant file writes – assets are read-only
31
+ var contentUri: Uri? = null
32
+ override fun getContentUri(appContext: AppContext): Uri {
33
+ inputStream().use { inputStream ->
34
+ val outputFile = File(context.cacheDir, "expo_shared_assets/$fileName")
35
+ outputFile.parentFile?.mkdirs() // Create directories if needed
36
+ FileOutputStream(outputFile).use { outputStream ->
37
+ inputStream.copyTo(outputStream)
38
+ }
39
+ val newContentUri = JavaFile(outputFile.toUri()).getContentUri(appContext)
40
+ contentUri = newContentUri
41
+ return newContentUri
42
+ }
43
+ }
44
+
28
45
  override val parentFile: UnifiedFileInterface?
29
46
  get() {
30
47
  val currentPath = uri.path.orEmpty()
@@ -3,7 +3,9 @@ package expo.modules.filesystem.unifiedfile
3
3
  import android.net.Uri
4
4
  import android.os.Build
5
5
  import android.webkit.MimeTypeMap
6
+ import androidx.core.content.FileProvider
6
7
  import androidx.core.net.toUri
8
+ import expo.modules.kotlin.AppContext
7
9
  import java.io.File
8
10
  import java.io.FileInputStream
9
11
  import java.io.FileOutputStream
@@ -38,6 +40,14 @@ class JavaFile(override val uri: Uri) : UnifiedFileInterface, File(URI.create(ur
38
40
  return super<File>.delete()
39
41
  }
40
42
 
43
+ override fun getContentUri(appContext: AppContext): Uri {
44
+ return FileProvider.getUriForFile(
45
+ appContext.throwingActivity.application,
46
+ "${appContext.throwingActivity.application.packageName}.FileSystemFileProvider",
47
+ this
48
+ )
49
+ }
50
+
41
51
  override fun listFilesAsUnified(): List<UnifiedFileInterface> =
42
52
  super<File>.listFiles()?.map { JavaFile(it.toUri()) } ?: emptyList()
43
53
 
@@ -3,6 +3,7 @@ package expo.modules.filesystem.unifiedfile
3
3
  import android.content.Context
4
4
  import android.net.Uri
5
5
  import androidx.documentfile.provider.DocumentFile
6
+ import expo.modules.kotlin.AppContext
6
7
  import java.io.InputStream
7
8
  import java.io.OutputStream
8
9
 
@@ -60,6 +61,10 @@ class SAFDocumentFile(private val context: Context, override val uri: Uri) : Uni
60
61
  override val fileName: String?
61
62
  get() = documentFile?.name
62
63
 
64
+ override fun getContentUri(appContext: AppContext): Uri {
65
+ return uri
66
+ }
67
+
63
68
  override val creationTime: Long? get() {
64
69
  // It seems there's no way to get this
65
70
  return null
@@ -1,6 +1,7 @@
1
1
  package expo.modules.filesystem.unifiedfile
2
2
 
3
3
  import android.net.Uri
4
+ import expo.modules.kotlin.AppContext
4
5
 
5
6
  interface UnifiedFileInterface {
6
7
  fun exists(): Boolean
@@ -17,6 +18,7 @@ interface UnifiedFileInterface {
17
18
  fun lastModified(): Long?
18
19
  val creationTime: Long?
19
20
  val fileName: String?
21
+ fun getContentUri(appContext: AppContext): Uri
20
22
  fun outputStream(): java.io.OutputStream
21
23
  fun inputStream(): java.io.InputStream
22
24
  fun length(): Long
@@ -184,7 +184,7 @@ export declare class File {
184
184
  * Retrieves content of the file as base64.
185
185
  * @returns A promise that resolves with the contents of the file as a base64 string.
186
186
  */
187
- base64(): string;
187
+ base64(): Promise<string>;
188
188
  /**
189
189
  * Retrieves content of the file as base64.
190
190
  * @returns The contents of the file as a base64 string.
@@ -192,12 +192,12 @@ export declare class File {
192
192
  base64Sync(): string;
193
193
  /**
194
194
  * Retrieves byte content of the entire file.
195
- * @returns A promise that resolves with the contents of the file as a Uint8Array.
195
+ * @returns A promise that resolves with the contents of the file as a `Uint8Array`.
196
196
  */
197
197
  bytes(): Promise<Uint8Array<ArrayBuffer>>;
198
198
  /**
199
199
  * Retrieves byte content of the entire file.
200
- * @returns A promise that resolves with the contents of the file as a Uint8Array.
200
+ * @returns The contents of the file as a `Uint8Array`.
201
201
  */
202
202
  bytesSync(): Uint8Array;
203
203
  /**
@@ -248,10 +248,18 @@ export declare class File {
248
248
  /**
249
249
  * A static method that downloads a file from the network.
250
250
  *
251
+ * On Android, the response body streams directly into the target file. If the download fails after
252
+ * it starts, a partially written file may remain at the destination. On iOS, the download first
253
+ * completes in a temporary location and the file is moved into place only after success, so no
254
+ * file is left behind when the request fails.
255
+ *
251
256
  * @param url - The URL of the file to download.
252
257
  * @param destination - The destination directory or file. If a directory is provided, the resulting filename will be determined based on the response headers.
258
+ * @param options - Download options. When the destination already contains a file, the promise rejects with a `DestinationAlreadyExists` error unless `options.idempotent` is set to `true`. With `idempotent: true`, the download overwrites the existing file instead of failing.
253
259
  *
254
- * @returns A promise that resolves to the downloaded file.
260
+ * @returns A promise that resolves to the downloaded file. When the server responds with
261
+ * a non-2xx HTTP status, the promise rejects with an `UnableToDownload` error whose
262
+ * message includes the status code. No file is created in that scenario.
255
263
  *
256
264
  * @example
257
265
  * ```ts
@@ -266,7 +274,7 @@ export declare class File {
266
274
  *
267
275
  * @param initialUri An optional URI pointing to an initial folder on which the file picker is opened.
268
276
  * @param mimeType A mime type that is used to filter out files that can be picked out.
269
- * @returns a `File` instance or an array of `File` instances.
277
+ * @returns A `File` instance or an array of `File` instances.
270
278
  */
271
279
  static pickFileAsync(initialUri?: string, mimeType?: string): Promise<File | File[]>;
272
280
  /**
@@ -289,6 +297,11 @@ export declare class File {
289
297
  * A mime type of the file. An empty string if the file does not exist, or it cannot be read.
290
298
  */
291
299
  type: string;
300
+ /**
301
+ * A content URI to the file that can be shared to external applications.
302
+ * @platform android
303
+ */
304
+ contentUri: string;
292
305
  }
293
306
  export declare class FileHandle {
294
307
  close(): void;
@@ -1 +1 @@
1
- {"version":3,"file":"ExpoFileSystem.types.d.ts","sourceRoot":"","sources":["../src/ExpoFileSystem.types.ts"],"names":[],"mappings":"AAAA,MAAM,MAAM,iBAAiB,GAAG;IAC9B;;;OAGG;IACH,aAAa,CAAC,EAAE,OAAO,CAAC;IACxB;;;OAGG;IACH,SAAS,CAAC,EAAE,OAAO,CAAC;CACrB,CAAC;AAEF,oBAAY,YAAY;IACtB;;OAEG;IACH,IAAI,SAAS;IACb;;OAEG;IACH,MAAM,WAAW;CAClB;AAED,MAAM,MAAM,gBAAgB,GAAG;IAC7B;;;OAGG;IACH,QAAQ,CAAC,EAAE,YAAY,GAAG,MAAM,GAAG,QAAQ,CAAC;CAC7C,CAAC;AAEF,MAAM,MAAM,sBAAsB,GAAG;IACnC;;;OAGG;IACH,aAAa,CAAC,EAAE,OAAO,CAAC;IACxB;;;OAGG;IACH,SAAS,CAAC,EAAE,OAAO,CAAC;IACpB;;;;;;;;OAQG;IACH,UAAU,CAAC,EAAE,OAAO,CAAC;CACtB,CAAC;AAEF,MAAM,CAAC,OAAO,OAAO,SAAS;IAC5B;;;;;;;OAOG;gBACS,GAAG,IAAI,EAAE,CAAC,M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IACH,GAAG,CAAC,EAAE,MAAM,CAAC;IACb;;OAEG;IACH,IAAI,CAAC,EAAE,MAAM,CAAC;IACd;;OAEG;IACH,gBAAgB,CAAC,EAAE,MAAM,CAAC;IAC1B;;OAEG;IACH,YAAY,CAAC,EAAE,MAAM,CAAC;IACtB;;OAEG;IACH,KAAK,CAAC,EAAE,MAAM,EAAE,CAAC;CAClB,CAAC"}
package/build/index.d.ts CHANGED
@@ -1,4 +1,4 @@
1
1
  export * from './FileSystem';
2
- export { type FileCreateOptions, type DirectoryCreateOptions, type FileHandle, type FileInfo, type InfoOptions, type PathInfo, type DirectoryInfo, } from './ExpoFileSystem.types';
2
+ export { type FileCreateOptions, type DirectoryCreateOptions, type FileHandle, type FileInfo, type InfoOptions, type PathInfo, type DirectoryInfo, type DownloadOptions, } from './ExpoFileSystem.types';
3
3
  export * from './legacyWarnings';
4
4
  //# sourceMappingURL=index.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,cAAc,cAAc,CAAC;AAE7B,OAAO,EACL,KAAK,iBAAiB,EACtB,KAAK,sBAAsB,EAC3B,KAAK,UAAU,EACf,KAAK,QAAQ,EACb,KAAK,WAAW,EAChB,KAAK,QAAQ,EACb,KAAK,aAAa,GACnB,MAAM,wBAAwB,CAAC;AAEhC,cAAc,kBAAkB,CAAC"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,cAAc,cAAc,CAAC;AAE7B,OAAO,EACL,KAAK,iBAAiB,EACtB,KAAK,sBAAsB,EAC3B,KAAK,UAAU,EACf,KAAK,QAAQ,EACb,KAAK,WAAW,EAChB,KAAK,QAAQ,EACb,KAAK,aAAa,EAClB,KAAK,eAAe,GACrB,MAAM,wBAAwB,CAAC;AAEhC,cAAc,kBAAkB,CAAC"}
@@ -12,7 +12,7 @@
12
12
  "publication": {
13
13
  "groupId": "host.exp.exponent",
14
14
  "artifactId": "expo.modules.filesystem",
15
- "version": "19.0.18",
15
+ "version": "19.0.20",
16
16
  "repository": "local-maven-repo"
17
17
  }
18
18
  }
@@ -335,6 +335,18 @@ public final class FileSystemModule: Module {
335
335
  try directory.listAsRecords()
336
336
  }
337
337
 
338
+ Function("createFile") { (directory, name: String, content: String?) in
339
+ let file = FileSystemFile(url: directory.url.appendingPathComponent(name))
340
+ try file.create(CreateOptions())
341
+ return file
342
+ }
343
+
344
+ Function("createDirectory") { (directory, name: String) in
345
+ let newDirectory = FileSystemDirectory(url: directory.url.appendingPathComponent(name))
346
+ try newDirectory.create(CreateOptions())
347
+ return newDirectory
348
+ }
349
+
338
350
  Property("uri") { directory in
339
351
  return directory.url.absoluteString
340
352
  }
@@ -25,7 +25,7 @@ internal class FileSystemPath: SharedObject {
25
25
 
26
26
  func validateCanCreate(_ options: CreateOptions) throws {
27
27
  if try !options.overwrite && exists {
28
- throw FileAlreadyExistsException("File already exists")
28
+ throw FileAlreadyExistsException(url.absoluteString)
29
29
  }
30
30
  }
31
31
 
@@ -0,0 +1 @@
1
+ 4177d9bd9a22a528b97cc2f2bd7ba47f6cbf7fb1c09d93a1cacdce6f553b05d6
@@ -0,0 +1 @@
1
+ 6cac7b2fa58a18696e1468e4e9afe7e6092ca1a404351400345349e028cbaeda51386f4303d05372a2be2baf8de77fd97490ea91caa74bfc2a8cfe7b62619bfe
@@ -0,0 +1 @@
1
+ addebabe9511120923e9a0f4490c31306162dc95ae60cb64867a27847d99dfaf
@@ -0,0 +1 @@
1
+ 66cca546f6f55437628c6fad443bb817e5c0eef007414292fed3f907c68b11d718a3f3d816ee0ea78835567fdaa5686f525ab9f1a27137d5f799b9459d9719d1
@@ -3,7 +3,7 @@
3
3
  "component": {
4
4
  "group": "host.exp.exponent",
5
5
  "module": "expo.modules.filesystem",
6
- "version": "19.0.18",
6
+ "version": "19.0.20",
7
7
  "attributes": {
8
8
  "org.gradle.status": "release"
9
9
  }
@@ -75,13 +75,13 @@
75
75
  ],
76
76
  "files": [
77
77
  {
78
- "name": "expo.modules.filesystem-19.0.18.aar",
79
- "url": "expo.modules.filesystem-19.0.18.aar",
80
- "size": 391292,
81
- "sha512": "d60c88e7f21f358f02194c14c3927265dfe2d1d87fc6b95752762eac2e0b58aacd0e978c76b0dcf63a8307024d4c456905e7e6e8525b69311b92c4e923ee1877",
82
- "sha256": "202752b28c46047281346722d634f17d97177e857bee9905d2637127213146b3",
83
- "sha1": "b04ea6436b34d528574e89f14e16e0f214d73d01",
84
- "md5": "676ac9e485b903778ac23c483eac4cf5"
78
+ "name": "expo.modules.filesystem-19.0.20.aar",
79
+ "url": "expo.modules.filesystem-19.0.20.aar",
80
+ "size": 393129,
81
+ "sha512": "66cca546f6f55437628c6fad443bb817e5c0eef007414292fed3f907c68b11d718a3f3d816ee0ea78835567fdaa5686f525ab9f1a27137d5f799b9459d9719d1",
82
+ "sha256": "addebabe9511120923e9a0f4490c31306162dc95ae60cb64867a27847d99dfaf",
83
+ "sha1": "0d42a8415fa94ce162b33e740bb63f1602d7cc21",
84
+ "md5": "083a9a998bd18c4424272ba3827a26ee"
85
85
  }
86
86
  ]
87
87
  },
@@ -153,13 +153,13 @@
153
153
  ],
154
154
  "files": [
155
155
  {
156
- "name": "expo.modules.filesystem-19.0.18.aar",
157
- "url": "expo.modules.filesystem-19.0.18.aar",
158
- "size": 391292,
159
- "sha512": "d60c88e7f21f358f02194c14c3927265dfe2d1d87fc6b95752762eac2e0b58aacd0e978c76b0dcf63a8307024d4c456905e7e6e8525b69311b92c4e923ee1877",
160
- "sha256": "202752b28c46047281346722d634f17d97177e857bee9905d2637127213146b3",
161
- "sha1": "b04ea6436b34d528574e89f14e16e0f214d73d01",
162
- "md5": "676ac9e485b903778ac23c483eac4cf5"
156
+ "name": "expo.modules.filesystem-19.0.20.aar",
157
+ "url": "expo.modules.filesystem-19.0.20.aar",
158
+ "size": 393129,
159
+ "sha512": "66cca546f6f55437628c6fad443bb817e5c0eef007414292fed3f907c68b11d718a3f3d816ee0ea78835567fdaa5686f525ab9f1a27137d5f799b9459d9719d1",
160
+ "sha256": "addebabe9511120923e9a0f4490c31306162dc95ae60cb64867a27847d99dfaf",
161
+ "sha1": "0d42a8415fa94ce162b33e740bb63f1602d7cc21",
162
+ "md5": "083a9a998bd18c4424272ba3827a26ee"
163
163
  }
164
164
  ]
165
165
  },
@@ -173,13 +173,13 @@
173
173
  },
174
174
  "files": [
175
175
  {
176
- "name": "expo.modules.filesystem-19.0.18-sources.jar",
177
- "url": "expo.modules.filesystem-19.0.18-sources.jar",
178
- "size": 28829,
179
- "sha512": "2f568bfaeec3afab683022062a45f4bc0b36c57b34b03c594770668d0b7a85542a7c8ef9d7ea015a0ca2b1cefdfdd6c81af52d5a8cb986734006c731cbd2efb0",
180
- "sha256": "fd56e8219c4f981d84e5dfa36830c59279bf486acfcc80c143b18ec1860260e3",
181
- "sha1": "a4e0092c3207d31f4b1117eddee4bf753fdb96f0",
182
- "md5": "4524189007ee5743a9177629d95ce8f7"
176
+ "name": "expo.modules.filesystem-19.0.20-sources.jar",
177
+ "url": "expo.modules.filesystem-19.0.20-sources.jar",
178
+ "size": 29329,
179
+ "sha512": "6cac7b2fa58a18696e1468e4e9afe7e6092ca1a404351400345349e028cbaeda51386f4303d05372a2be2baf8de77fd97490ea91caa74bfc2a8cfe7b62619bfe",
180
+ "sha256": "4177d9bd9a22a528b97cc2f2bd7ba47f6cbf7fb1c09d93a1cacdce6f553b05d6",
181
+ "sha1": "464959bdf2015e626f82e9af6c6c28a6498240e3",
182
+ "md5": "d3f99d83252bbc8fcf013f07d3d86ea8"
183
183
  }
184
184
  ]
185
185
  }
@@ -0,0 +1 @@
1
+ 4556183ff6f893f0e922f60e81727787162ddeb50fe171b89e2f0e4b5294799c
@@ -0,0 +1 @@
1
+ cc834281d4a8058c1d1d6418931086ea6c222adde6d1abf39efedcddd00a48534842a3cdb14cb3b600b8f6159bdd4d3ca2d22b34dbdbcbb1de6783e5b513e755
@@ -9,7 +9,7 @@
9
9
  <modelVersion>4.0.0</modelVersion>
10
10
  <groupId>host.exp.exponent</groupId>
11
11
  <artifactId>expo.modules.filesystem</artifactId>
12
- <version>19.0.18</version>
12
+ <version>19.0.20</version>
13
13
  <packaging>aar</packaging>
14
14
  <name>expo.modules.filesystem</name>
15
15
  <url>https://github.com/expo/expo</url>
@@ -0,0 +1 @@
1
+ d09aa17abc8b88a5dd2ac40d04629dbd0f312081a6f0e16e1f12bfd2338033bc
@@ -0,0 +1 @@
1
+ 27e59d8f55047a37824637b053d11f06216a97c5661e498e6c82f20ece064db1b5c13bab4cbcbd001c1803a7036f9414b2562163a2ee778ddc60baa47bc31d1e
@@ -3,11 +3,11 @@
3
3
  <groupId>host.exp.exponent</groupId>
4
4
  <artifactId>expo.modules.filesystem</artifactId>
5
5
  <versioning>
6
- <latest>19.0.18</latest>
7
- <release>19.0.18</release>
6
+ <latest>19.0.20</latest>
7
+ <release>19.0.20</release>
8
8
  <versions>
9
- <version>19.0.18</version>
9
+ <version>19.0.20</version>
10
10
  </versions>
11
- <lastUpdated>20251117153705</lastUpdated>
11
+ <lastUpdated>20251205064601</lastUpdated>
12
12
  </versioning>
13
13
  </metadata>
@@ -1 +1 @@
1
- 8db5533008ffc381919cb4cd21477269
1
+ 5d9d2ee98042af347badd51da0c4aa23
@@ -1 +1 @@
1
- e73be3856ea441a67a1fc04cfe324c49ae3c6b43
1
+ f8ce7295c9cb666f34750fde98cb43d3628bd2b0
@@ -1 +1 @@
1
- ccb2518a9cacfc4c13a428d518fe26bf4fe3cf1fff55049ee6b1c04c2def775a
1
+ 44a1ffc1ec96e9ce9139d46fc0ee6abf83add397a66726bb1e95b46729064504
@@ -1 +1 @@
1
- ef734da87bb54ce6f3439ea9f5852b896340ac7ea194caf7bdc7ecae602a69b93704e2182c661fb76e6e1f7c11e7e0e86a830886c12cc40055e6f30419b84546
1
+ 5208f8a8e421837815d0c0dfe9094246e7a2b52f28a381cb722b514eaf0e369740bee5c9843a00752fee578467c1507677101cc0f2149d3b62ff2b66a3747c72
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "expo-file-system",
3
- "version": "19.0.18",
3
+ "version": "19.0.20",
4
4
  "description": "Provides access to the local file system on the device.",
5
5
  "main": "src/index.ts",
6
6
  "types": "build/index.d.ts",
@@ -35,12 +35,12 @@
35
35
  "preset": "expo-module-scripts"
36
36
  },
37
37
  "devDependencies": {
38
- "expo-module-scripts": "^5.0.7",
39
- "jest-expo": "~54.0.13"
38
+ "expo-module-scripts": "^5.0.8",
39
+ "jest-expo": "~54.0.14"
40
40
  },
41
41
  "peerDependencies": {
42
42
  "expo": "*",
43
43
  "react-native": "*"
44
44
  },
45
- "gitHead": "6d7c221dc8a1994043c4f2ddcf33a16bf3e508dc"
45
+ "gitHead": "172a69f5f70c1d0e043e1532f924de97210cabc3"
46
46
  }
@@ -207,7 +207,7 @@ export declare class File {
207
207
  * Retrieves content of the file as base64.
208
208
  * @returns A promise that resolves with the contents of the file as a base64 string.
209
209
  */
210
- base64(): string;
210
+ base64(): Promise<string>;
211
211
 
212
212
  /**
213
213
  * Retrieves content of the file as base64.
@@ -217,13 +217,13 @@ export declare class File {
217
217
 
218
218
  /**
219
219
  * Retrieves byte content of the entire file.
220
- * @returns A promise that resolves with the contents of the file as a Uint8Array.
220
+ * @returns A promise that resolves with the contents of the file as a `Uint8Array`.
221
221
  */
222
222
  bytes(): Promise<Uint8Array<ArrayBuffer>>;
223
223
 
224
224
  /**
225
225
  * Retrieves byte content of the entire file.
226
- * @returns A promise that resolves with the contents of the file as a Uint8Array.
226
+ * @returns The contents of the file as a `Uint8Array`.
227
227
  */
228
228
  bytesSync(): Uint8Array;
229
229
 
@@ -284,10 +284,18 @@ export declare class File {
284
284
  /**
285
285
  * A static method that downloads a file from the network.
286
286
  *
287
+ * On Android, the response body streams directly into the target file. If the download fails after
288
+ * it starts, a partially written file may remain at the destination. On iOS, the download first
289
+ * completes in a temporary location and the file is moved into place only after success, so no
290
+ * file is left behind when the request fails.
291
+ *
287
292
  * @param url - The URL of the file to download.
288
293
  * @param destination - The destination directory or file. If a directory is provided, the resulting filename will be determined based on the response headers.
294
+ * @param options - Download options. When the destination already contains a file, the promise rejects with a `DestinationAlreadyExists` error unless `options.idempotent` is set to `true`. With `idempotent: true`, the download overwrites the existing file instead of failing.
289
295
  *
290
- * @returns A promise that resolves to the downloaded file.
296
+ * @returns A promise that resolves to the downloaded file. When the server responds with
297
+ * a non-2xx HTTP status, the promise rejects with an `UnableToDownload` error whose
298
+ * message includes the status code. No file is created in that scenario.
291
299
  *
292
300
  * @example
293
301
  * ```ts
@@ -307,7 +315,7 @@ export declare class File {
307
315
  *
308
316
  * @param initialUri An optional URI pointing to an initial folder on which the file picker is opened.
309
317
  * @param mimeType A mime type that is used to filter out files that can be picked out.
310
- * @returns a `File` instance or an array of `File` instances.
318
+ * @returns A `File` instance or an array of `File` instances.
311
319
  */
312
320
  static pickFileAsync(initialUri?: string, mimeType?: string): Promise<File | File[]>;
313
321
 
@@ -335,6 +343,11 @@ export declare class File {
335
343
  * A mime type of the file. An empty string if the file does not exist, or it cannot be read.
336
344
  */
337
345
  type: string;
346
+ /**
347
+ * A content URI to the file that can be shared to external applications.
348
+ * @platform android
349
+ */
350
+ contentUri: string;
338
351
  }
339
352
 
340
353
  export declare class FileHandle {
package/src/index.ts CHANGED
@@ -8,6 +8,7 @@ export {
8
8
  type InfoOptions,
9
9
  type PathInfo,
10
10
  type DirectoryInfo,
11
+ type DownloadOptions,
11
12
  } from './ExpoFileSystem.types';
12
13
 
13
14
  export * from './legacyWarnings';
@@ -1 +0,0 @@
1
- fd56e8219c4f981d84e5dfa36830c59279bf486acfcc80c143b18ec1860260e3
@@ -1 +0,0 @@
1
- 2f568bfaeec3afab683022062a45f4bc0b36c57b34b03c594770668d0b7a85542a7c8ef9d7ea015a0ca2b1cefdfdd6c81af52d5a8cb986734006c731cbd2efb0
@@ -1 +0,0 @@
1
- 202752b28c46047281346722d634f17d97177e857bee9905d2637127213146b3
@@ -1 +0,0 @@
1
- d60c88e7f21f358f02194c14c3927265dfe2d1d87fc6b95752762eac2e0b58aacd0e978c76b0dcf63a8307024d4c456905e7e6e8525b69311b92c4e923ee1877
@@ -1 +0,0 @@
1
- 96cddf04f0e45e8dfce4f0fbbc793c6b55afa8a55405b99edc219e5bb728e453
@@ -1 +0,0 @@
1
- 922aa61af92925bba9e2969bed8aa22a811d89a6a521bd1e2e1df2d9dfd1f16d32617338b1f8d73f1e174261e6bc7449b4b7442ca074a634fb5f52102502bd25
@@ -1 +0,0 @@
1
- afb0ac02c4f2628974a286eb1cf14b9168195d1176fdd3a514b633b8a36a5850
@@ -1 +0,0 @@
1
- 536ed054e93b501e5884581d1b7b8e91e3a602761126b35e892f66690e007b3f86c95554d3ea3ff322c9e9449c2f7b8948a47563a358cdacdcb139ba0f8d5465