@themartiancompany/opfs 1.8.11

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 (114) hide show
  1. package/COPYING +674 -0
  2. package/README.cn.md +301 -0
  3. package/README.md +241 -0
  4. package/dist/main.cjs +1840 -0
  5. package/dist/main.cjs.map +1 -0
  6. package/dist/main.mjs +1751 -0
  7. package/dist/main.mjs.map +1 -0
  8. package/dist/types.d.ts +920 -0
  9. package/dist/types.d.ts.map +1 -0
  10. package/docs/README.md +115 -0
  11. package/docs/classes/SyncMessenger.md +42 -0
  12. package/docs/functions/appendFile.md +29 -0
  13. package/docs/functions/appendFileSync.md +26 -0
  14. package/docs/functions/assertAbsolutePath.md +29 -0
  15. package/docs/functions/assertFileUrl.md +29 -0
  16. package/docs/functions/connectSyncAgent.md +25 -0
  17. package/docs/functions/copy.md +35 -0
  18. package/docs/functions/copySync.md +30 -0
  19. package/docs/functions/createFile.md +27 -0
  20. package/docs/functions/createFileSync.md +25 -0
  21. package/docs/functions/deleteTemp.md +23 -0
  22. package/docs/functions/deleteTempSync.md +19 -0
  23. package/docs/functions/downloadFile.md +58 -0
  24. package/docs/functions/emptyDir.md +28 -0
  25. package/docs/functions/emptyDirSync.md +25 -0
  26. package/docs/functions/exists.md +29 -0
  27. package/docs/functions/existsSync.md +26 -0
  28. package/docs/functions/generateTempPath.md +27 -0
  29. package/docs/functions/getFileDataByHandle.md +27 -0
  30. package/docs/functions/getSyncMessenger.md +22 -0
  31. package/docs/functions/isDirectoryHandle.md +27 -0
  32. package/docs/functions/isFileHandle.md +27 -0
  33. package/docs/functions/isFileHandleLike.md +27 -0
  34. package/docs/functions/isOPFSSupported.md +21 -0
  35. package/docs/functions/isTempPath.md +27 -0
  36. package/docs/functions/mkTemp.md +28 -0
  37. package/docs/functions/mkTempSync.md +25 -0
  38. package/docs/functions/mkdir.md +27 -0
  39. package/docs/functions/mkdirSync.md +25 -0
  40. package/docs/functions/move.md +34 -0
  41. package/docs/functions/moveSync.md +30 -0
  42. package/docs/functions/pruneTemp.md +28 -0
  43. package/docs/functions/pruneTempSync.md +25 -0
  44. package/docs/functions/readBlobFile.md +28 -0
  45. package/docs/functions/readBlobFileSync.md +25 -0
  46. package/docs/functions/readDir.md +28 -0
  47. package/docs/functions/readDirSync.md +26 -0
  48. package/docs/functions/readFile.md +132 -0
  49. package/docs/functions/readFileSync.md +70 -0
  50. package/docs/functions/readJsonFile.md +35 -0
  51. package/docs/functions/readJsonFileSync.md +31 -0
  52. package/docs/functions/readTextFile.md +28 -0
  53. package/docs/functions/readTextFileSync.md +25 -0
  54. package/docs/functions/remove.md +27 -0
  55. package/docs/functions/removeSync.md +25 -0
  56. package/docs/functions/setSyncMessenger.md +26 -0
  57. package/docs/functions/startSyncAgent.md +21 -0
  58. package/docs/functions/stat.md +27 -0
  59. package/docs/functions/statSync.md +25 -0
  60. package/docs/functions/toFileSystemHandleLike.md +27 -0
  61. package/docs/functions/unzip.md +32 -0
  62. package/docs/functions/unzipFromUrl.md +36 -0
  63. package/docs/functions/unzipSync.md +26 -0
  64. package/docs/functions/uploadFile.md +33 -0
  65. package/docs/functions/writeFile.md +32 -0
  66. package/docs/functions/writeFileSync.md +30 -0
  67. package/docs/functions/zip.md +65 -0
  68. package/docs/functions/zipFromUrl.md +63 -0
  69. package/docs/functions/zipSync.md +55 -0
  70. package/docs/interfaces/CopyOptions.md +17 -0
  71. package/docs/interfaces/DownloadFileTempResponse.md +18 -0
  72. package/docs/interfaces/ErrorLike.md +18 -0
  73. package/docs/interfaces/ExistsOptions.md +18 -0
  74. package/docs/interfaces/FileLike.md +21 -0
  75. package/docs/interfaces/FileSystemFileHandleLike.md +25 -0
  76. package/docs/interfaces/FileSystemHandleLike.md +22 -0
  77. package/docs/interfaces/MoveOptions.md +17 -0
  78. package/docs/interfaces/ReadDirEntry.md +18 -0
  79. package/docs/interfaces/ReadDirEntrySync.md +18 -0
  80. package/docs/interfaces/ReadDirOptions.md +17 -0
  81. package/docs/interfaces/ReadOptions.md +17 -0
  82. package/docs/interfaces/SyncAgentOptions.md +19 -0
  83. package/docs/interfaces/TempOptions.md +19 -0
  84. package/docs/interfaces/UploadRequestInit.md +21 -0
  85. package/docs/interfaces/WriteOptions.md +19 -0
  86. package/docs/interfaces/ZipOptions.md +17 -0
  87. package/docs/type-aliases/FileEncoding.md +15 -0
  88. package/docs/type-aliases/FsRequestInit.md +15 -0
  89. package/docs/type-aliases/ReadFileContent.md +15 -0
  90. package/docs/type-aliases/WriteFileContent.md +15 -0
  91. package/docs/type-aliases/WriteSyncFileContent.md +16 -0
  92. package/docs/variables/CURRENT_DIR.md +15 -0
  93. package/docs/variables/NOT_FOUND_ERROR.md +18 -0
  94. package/docs/variables/ROOT_DIR.md +15 -0
  95. package/docs/variables/TMP_DIR.md +15 -0
  96. package/package.json +141 -0
  97. package/src/fs/assertions.ts +63 -0
  98. package/src/fs/constants.ts +63 -0
  99. package/src/fs/defines.ts +352 -0
  100. package/src/fs/helpers.ts +338 -0
  101. package/src/fs/opfs_core.ts +413 -0
  102. package/src/fs/opfs_download.ts +174 -0
  103. package/src/fs/opfs_ext.ts +504 -0
  104. package/src/fs/opfs_tmp.ts +131 -0
  105. package/src/fs/opfs_unzip.ts +168 -0
  106. package/src/fs/opfs_upload.ts +126 -0
  107. package/src/fs/opfs_zip.ts +314 -0
  108. package/src/fs/support.ts +36 -0
  109. package/src/fs/utils.ts +176 -0
  110. package/src/mod.ts +41 -0
  111. package/src/worker/helpers.ts +168 -0
  112. package/src/worker/opfs_worker.ts +298 -0
  113. package/src/worker/opfs_worker_adapter.ts +666 -0
  114. package/src/worker/shared.ts +400 -0
@@ -0,0 +1,36 @@
1
+ [**@themartiancompany/opfs**](../README.md)
2
+
3
+ ***
4
+
5
+ [@themartiancompany/opfs](../README.md) / unzipFromUrl
6
+
7
+ # Function: unzipFromUrl()
8
+
9
+ ```ts
10
+ function unzipFromUrl(
11
+ zipFileUrl,
12
+ targetPath,
13
+ requestInit?): AsyncVoidIOResult
14
+ ```
15
+
16
+ Defined in: fs/opfs\_unzip.ts:139
17
+
18
+ Unzip a remote zip file to a directory.
19
+ Equivalent to `unzip -o <zipFilePath> -d <targetPath>
20
+
21
+ Use [fflate](https://github.com/101arrowz/fflate) as the unzip backend.
22
+
23
+ ## Parameters
24
+
25
+ | Parameter | Type | Description |
26
+ | ------ | ------ | ------ |
27
+ | `zipFileUrl` | `string` | Zip file url. |
28
+ | `targetPath` | `string` | The directory to unzip to. |
29
+ | `requestInit`? | [`FsRequestInit`](../type-aliases/FsRequestInit.md) | Optional request initialization parameters. |
30
+
31
+ ## Returns
32
+
33
+ `AsyncVoidIOResult`
34
+
35
+ A promise that resolves to an `AsyncIOResult`
36
+ indicating whether the zip file was successfully unzipped.
@@ -0,0 +1,26 @@
1
+ [**@themartiancompany/opfs**](../README.md)
2
+
3
+ ***
4
+
5
+ [@themartiancompany/opfs](../README.md) / unzipSync
6
+
7
+ # Function: unzipSync()
8
+
9
+ ```ts
10
+ function unzipSync(zipFilePath, targetPath): VoidIOResult
11
+ ```
12
+
13
+ Defined in: worker/opfs\_worker\_adapter.ts:602
14
+
15
+ Sync version of `unzip`.
16
+
17
+ ## Parameters
18
+
19
+ | Parameter | Type |
20
+ | ------ | ------ |
21
+ | `zipFilePath` | `string` |
22
+ | `targetPath` | `string` |
23
+
24
+ ## Returns
25
+
26
+ `VoidIOResult`
@@ -0,0 +1,33 @@
1
+ [**@themartiancompany/opfs**](../README.md)
2
+
3
+ ***
4
+
5
+ [@themartiancompany/opfs](../README.md) / uploadFile
6
+
7
+ # Function: uploadFile()
8
+
9
+ ```ts
10
+ function uploadFile(
11
+ filePath,
12
+ fileUrl,
13
+ requestInit?): FetchTask<Response>
14
+ ```
15
+
16
+ Defined in: fs/opfs\_upload.ts:47
17
+
18
+ Uploads a file from the specified path to a URL.
19
+
20
+ ## Parameters
21
+
22
+ | Parameter | Type | Description |
23
+ | ------ | ------ | ------ |
24
+ | `filePath` | `string` | The path of the file to upload. |
25
+ | `fileUrl` | `string` | The URL where the file will be uploaded. |
26
+ | `requestInit`? | [`UploadRequestInit`](../interfaces/UploadRequestInit.md) | Optional request initialization parameters. |
27
+
28
+ ## Returns
29
+
30
+ `FetchTask`\<`Response`\>
31
+
32
+ A promise that resolves to an `AsyncIOResult`
33
+ indicating whether the file was successfully uploaded.
@@ -0,0 +1,32 @@
1
+ [**@themartiancompany/opfs**](../README.md)
2
+
3
+ ***
4
+
5
+ [@themartiancompany/opfs](../README.md) / writeFile
6
+
7
+ # Function: writeFile()
8
+
9
+ ```ts
10
+ function writeFile(
11
+ filePath,
12
+ contents,
13
+ options?): AsyncVoidIOResult
14
+ ```
15
+
16
+ Defined in: fs/opfs\_core.ts:369
17
+
18
+ Writes content to a file at the specified path.
19
+
20
+ ## Parameters
21
+
22
+ | Parameter | Type | Description |
23
+ | ------ | ------ | ------ |
24
+ | `filePath` | `string` | The path of the file to write to. |
25
+ | `contents` | [`WriteFileContent`](../type-aliases/WriteFileContent.md) | The content to write to the file. |
26
+ | `options`? | [`WriteOptions`](../interfaces/WriteOptions.md) | Optional write options. |
27
+
28
+ ## Returns
29
+
30
+ `AsyncVoidIOResult`
31
+
32
+ A promise that resolves to an `AsyncIOResult` indicating whether the file was successfully written.
@@ -0,0 +1,30 @@
1
+ [**@themartiancompany/opfs**](../README.md)
2
+
3
+ ***
4
+
5
+ [@themartiancompany/opfs](../README.md) / writeFileSync
6
+
7
+ # Function: writeFileSync()
8
+
9
+ ```ts
10
+ function writeFileSync(
11
+ filePath,
12
+ contents,
13
+ options?): VoidIOResult
14
+ ```
15
+
16
+ Defined in: worker/opfs\_worker\_adapter.ts:418
17
+
18
+ Sync version of `writeFile`.
19
+
20
+ ## Parameters
21
+
22
+ | Parameter | Type |
23
+ | ------ | ------ |
24
+ | `filePath` | `string` |
25
+ | `contents` | [`WriteSyncFileContent`](../type-aliases/WriteSyncFileContent.md) |
26
+ | `options`? | [`WriteOptions`](../interfaces/WriteOptions.md) |
27
+
28
+ ## Returns
29
+
30
+ `VoidIOResult`
@@ -0,0 +1,65 @@
1
+ [**@themartiancompany/opfs**](../README.md)
2
+
3
+ ***
4
+
5
+ [@themartiancompany/opfs](../README.md) / zip
6
+
7
+ # Function: zip()
8
+
9
+ ## Call Signature
10
+
11
+ ```ts
12
+ function zip(
13
+ sourcePath,
14
+ zipFilePath,
15
+ options?): AsyncVoidIOResult
16
+ ```
17
+
18
+ Defined in: fs/opfs\_zip.ts:105
19
+
20
+ Zip a file or directory and write to a zip file.
21
+ Equivalent to `zip -r <zipFilePath> <targetPath>`.
22
+
23
+ Use [fflate](https://github.com/101arrowz/fflate) as the zip backend.
24
+
25
+ ### Parameters
26
+
27
+ | Parameter | Type | Description |
28
+ | ------ | ------ | ------ |
29
+ | `sourcePath` | `string` | The path to be zipped. |
30
+ | `zipFilePath` | `string` | The path to the zip file. |
31
+ | `options`? | [`ZipOptions`](../interfaces/ZipOptions.md) | Options of zip. |
32
+
33
+ ### Returns
34
+
35
+ `AsyncVoidIOResult`
36
+
37
+ A promise that resolves to an `AsyncIOResult`
38
+ indicating whether the source was successfully zipped.
39
+
40
+ ## Call Signature
41
+
42
+ ```ts
43
+ function zip(sourcePath, options?): AsyncIOResult<Uint8Array<ArrayBufferLike>>
44
+ ```
45
+
46
+ Defined in: fs/opfs\_zip.ts:126
47
+
48
+ Zip a file or directory and return the zip file data.
49
+ Equivalent to `zip -r <zipFilePath> <targetPath>`.
50
+
51
+ Use [fflate](https://github.com/101arrowz/fflate) as the zip backend.
52
+
53
+ ### Parameters
54
+
55
+ | Parameter | Type | Description |
56
+ | ------ | ------ | ------ |
57
+ | `sourcePath` | `string` | The path to be zipped. |
58
+ | `options`? | [`ZipOptions`](../interfaces/ZipOptions.md) | Options of zip. |
59
+
60
+ ### Returns
61
+
62
+ `AsyncIOResult`\<`Uint8Array`\<`ArrayBufferLike`\>\>
63
+
64
+ A promise that resolves to an `AsyncIOResult` indicating
65
+ whether the source was successfully zipped.
@@ -0,0 +1,63 @@
1
+ [**@themartiancompany/opfs**](../README.md)
2
+
3
+ ***
4
+
5
+ [@themartiancompany/opfs](../README.md) / zipFromUrl
6
+
7
+ # Function: zipFromUrl()
8
+
9
+ ## Call Signature
10
+
11
+ ```ts
12
+ function zipFromUrl(
13
+ sourceUrl,
14
+ zipFilePath,
15
+ requestInit?): AsyncVoidIOResult
16
+ ```
17
+
18
+ Defined in: fs/opfs\_zip.ts:234
19
+
20
+ Zip a remote file and write to a zip file.
21
+
22
+ Use [fflate](https://github.com/101arrowz/fflate) as the zip backend.
23
+
24
+ ### Parameters
25
+
26
+ | Parameter | Type | Description |
27
+ | ------ | ------ | ------ |
28
+ | `sourceUrl` | `string` | The url to be zipped. |
29
+ | `zipFilePath` | `string` | The path to the zip file. |
30
+ | `requestInit`? | [`FsRequestInit`](../type-aliases/FsRequestInit.md) | Optional request initialization parameters. |
31
+
32
+ ### Returns
33
+
34
+ `AsyncVoidIOResult`
35
+
36
+ A promise that resolves to an `AsyncIOResult`
37
+ indicating whether the source was successfully zipped.
38
+
39
+ ## Call Signature
40
+
41
+ ```ts
42
+ function zipFromUrl(sourceUrl, requestInit?): AsyncIOResult<Uint8Array<ArrayBufferLike>>
43
+ ```
44
+
45
+ Defined in: fs/opfs\_zip.ts:254
46
+
47
+ Zip a remote file and return the zip file data.
48
+
49
+ Use [fflate](https://github.com/101arrowz/fflate) as the zip backend.
50
+
51
+ ### Parameters
52
+
53
+ | Parameter | Type | Description |
54
+ | ------ | ------ | ------ |
55
+ | `sourceUrl` | `string` | The url to be zipped. |
56
+ | `requestInit`? | [`FsRequestInit`](../type-aliases/FsRequestInit.md) | Optional request initialization parameters. |
57
+
58
+ ### Returns
59
+
60
+ `AsyncIOResult`\<`Uint8Array`\<`ArrayBufferLike`\>\>
61
+
62
+ A promise that resolves to an `AsyncIOResult` indicating
63
+ whether the source was successfully zipped.
@@ -0,0 +1,55 @@
1
+ [**@themartiancompany/opfs**](../README.md)
2
+
3
+ ***
4
+
5
+ [@themartiancompany/opfs](../README.md) / zipSync
6
+
7
+ # Function: zipSync()
8
+
9
+ Sync version of `zip`.
10
+
11
+ ## Call Signature
12
+
13
+ ```ts
14
+ function zipSync(
15
+ sourcePath,
16
+ zipFilePath,
17
+ options?): VoidIOResult
18
+ ```
19
+
20
+ Defined in: worker/opfs\_worker\_adapter.ts:619
21
+
22
+ Sync version of `zip`.
23
+
24
+ ### Parameters
25
+
26
+ | Parameter | Type |
27
+ | ------ | ------ |
28
+ | `sourcePath` | `string` |
29
+ | `zipFilePath` | `string` |
30
+ | `options`? | [`ZipOptions`](../interfaces/ZipOptions.md) |
31
+
32
+ ### Returns
33
+
34
+ `VoidIOResult`
35
+
36
+ ## Call Signature
37
+
38
+ ```ts
39
+ function zipSync(sourcePath, options?): IOResult<Uint8Array<ArrayBufferLike>>
40
+ ```
41
+
42
+ Defined in: worker/opfs\_worker\_adapter.ts:633
43
+
44
+ Sync version of `zip`.
45
+
46
+ ### Parameters
47
+
48
+ | Parameter | Type |
49
+ | ------ | ------ |
50
+ | `sourcePath` | `string` |
51
+ | `options`? | [`ZipOptions`](../interfaces/ZipOptions.md) |
52
+
53
+ ### Returns
54
+
55
+ `IOResult`\<`Uint8Array`\<`ArrayBufferLike`\>\>
@@ -0,0 +1,17 @@
1
+ [**@themartiancompany/opfs**](../README.md)
2
+
3
+ ***
4
+
5
+ [@themartiancompany/opfs](../README.md) / CopyOptions
6
+
7
+ # Interface: CopyOptions
8
+
9
+ Defined in: fs/defines.ts:317
10
+
11
+ Options for `copy`.
12
+
13
+ ## Properties
14
+
15
+ | Property | Type | Default value | Description | Defined in |
16
+ | ------ | ------ | ------ | ------ | ------ |
17
+ | <a id="overwrite"></a> `overwrite?` | `boolean` | `true` | Whether to overwrite the destination file if it already exists. | fs/defines.ts:322 |
@@ -0,0 +1,18 @@
1
+ [**@themartiancompany/opfs**](../README.md)
2
+
3
+ ***
4
+
5
+ [@themartiancompany/opfs](../README.md) / DownloadFileTempResponse
6
+
7
+ # Interface: DownloadFileTempResponse
8
+
9
+ Defined in: fs/defines.ts:329
10
+
11
+ Result of `downloadFile` when the file is saved to a temporary path.
12
+
13
+ ## Properties
14
+
15
+ | Property | Type | Description | Defined in |
16
+ | ------ | ------ | ------ | ------ |
17
+ | <a id="rawresponse"></a> `rawResponse` | `Response` | The raw response. | fs/defines.ts:338 |
18
+ | <a id="tempfilepath"></a> `tempFilePath` | `string` | The temporary path of the downloaded file to be saved. | fs/defines.ts:333 |
@@ -0,0 +1,18 @@
1
+ [**@themartiancompany/opfs**](../README.md)
2
+
3
+ ***
4
+
5
+ [@themartiancompany/opfs](../README.md) / ErrorLike
6
+
7
+ # Interface: ErrorLike
8
+
9
+ Defined in: fs/defines.ts:209
10
+
11
+ Serializable version of Error.
12
+
13
+ ## Properties
14
+
15
+ | Property | Type | Description | Defined in |
16
+ | ------ | ------ | ------ | ------ |
17
+ | <a id="message"></a> `message` | `string` | The message of the error. | fs/defines.ts:218 |
18
+ | <a id="name"></a> `name` | `string` | The name of the error. | fs/defines.ts:213 |
@@ -0,0 +1,18 @@
1
+ [**@themartiancompany/opfs**](../README.md)
2
+
3
+ ***
4
+
5
+ [@themartiancompany/opfs](../README.md) / ExistsOptions
6
+
7
+ # Interface: ExistsOptions
8
+
9
+ Defined in: fs/defines.ts:87
10
+
11
+ Options to determine the existence of a file or directory.
12
+
13
+ ## Properties
14
+
15
+ | Property | Type | Default value | Description | Defined in |
16
+ | ------ | ------ | ------ | ------ | ------ |
17
+ | <a id="isdirectory"></a> `isDirectory?` | `boolean` | `false` | Whether to check for the existence of a directory. | fs/defines.ts:92 |
18
+ | <a id="isfile"></a> `isFile?` | `boolean` | `false` | Whether to check for the existence of a file. | fs/defines.ts:98 |
@@ -0,0 +1,21 @@
1
+ [**@themartiancompany/opfs**](../README.md)
2
+
3
+ ***
4
+
5
+ [@themartiancompany/opfs](../README.md) / FileLike
6
+
7
+ # Interface: FileLike
8
+
9
+ Defined in: fs/defines.ts:225
10
+
11
+ Serializable version of File.
12
+
13
+ ## Properties
14
+
15
+ | Property | Type | Description | Defined in |
16
+ | ------ | ------ | ------ | ------ |
17
+ | <a id="data"></a> `data` | `ArrayBuffer` | The binary data of the file. | fs/defines.ts:249 |
18
+ | <a id="lastmodified"></a> `lastModified` | `number` | The last modified time of the file. | fs/defines.ts:239 |
19
+ | <a id="name"></a> `name` | `string` | The name of the file. | fs/defines.ts:229 |
20
+ | <a id="size"></a> `size` | `number` | The size of the file. | fs/defines.ts:244 |
21
+ | <a id="type"></a> `type` | `string` | The type of the file. | fs/defines.ts:234 |
@@ -0,0 +1,25 @@
1
+ [**@themartiancompany/opfs**](../README.md)
2
+
3
+ ***
4
+
5
+ [@themartiancompany/opfs](../README.md) / FileSystemFileHandleLike
6
+
7
+ # Interface: FileSystemFileHandleLike
8
+
9
+ Defined in: fs/defines.ts:188
10
+
11
+ A handle to a file or directory returned by `statSync`.
12
+
13
+ ## Extends
14
+
15
+ - [`FileSystemHandleLike`](FileSystemHandleLike.md)
16
+
17
+ ## Properties
18
+
19
+ | Property | Type | Description | Inherited from | Defined in |
20
+ | ------ | ------ | ------ | ------ | ------ |
21
+ | <a id="kind"></a> `kind` | `FileSystemHandleKind` | The kind of the entry. | [`FileSystemHandleLike`](FileSystemHandleLike.md).[`kind`](FileSystemHandleLike.md#kind) | fs/defines.ts:184 |
22
+ | <a id="lastmodified"></a> `lastModified` | `number` | The last modified time of the file. | - | fs/defines.ts:202 |
23
+ | <a id="name"></a> `name` | `string` | The name of the entry. | [`FileSystemHandleLike`](FileSystemHandleLike.md).[`name`](FileSystemHandleLike.md#name) | fs/defines.ts:179 |
24
+ | <a id="size"></a> `size` | `number` | The size of the file. | - | fs/defines.ts:197 |
25
+ | <a id="type"></a> `type` | `string` | The type of the file. | - | fs/defines.ts:192 |
@@ -0,0 +1,22 @@
1
+ [**@themartiancompany/opfs**](../README.md)
2
+
3
+ ***
4
+
5
+ [@themartiancompany/opfs](../README.md) / FileSystemHandleLike
6
+
7
+ # Interface: FileSystemHandleLike
8
+
9
+ Defined in: fs/defines.ts:175
10
+
11
+ A handle to a file or directory returned by `statSync`.
12
+
13
+ ## Extended by
14
+
15
+ - [`FileSystemFileHandleLike`](FileSystemFileHandleLike.md)
16
+
17
+ ## Properties
18
+
19
+ | Property | Type | Description | Defined in |
20
+ | ------ | ------ | ------ | ------ |
21
+ | <a id="kind"></a> `kind` | `FileSystemHandleKind` | The kind of the entry. | fs/defines.ts:184 |
22
+ | <a id="name"></a> `name` | `string` | The name of the entry. | fs/defines.ts:179 |
@@ -0,0 +1,17 @@
1
+ [**@themartiancompany/opfs**](../README.md)
2
+
3
+ ***
4
+
5
+ [@themartiancompany/opfs](../README.md) / MoveOptions
6
+
7
+ # Interface: MoveOptions
8
+
9
+ Defined in: fs/defines.ts:345
10
+
11
+ Options for `move`.
12
+
13
+ ## Properties
14
+
15
+ | Property | Type | Default value | Description | Defined in |
16
+ | ------ | ------ | ------ | ------ | ------ |
17
+ | <a id="overwrite"></a> `overwrite?` | `boolean` | `true` | Whether to overwrite the destination file if it already exists. | fs/defines.ts:350 |
@@ -0,0 +1,18 @@
1
+ [**@themartiancompany/opfs**](../README.md)
2
+
3
+ ***
4
+
5
+ [@themartiancompany/opfs](../README.md) / ReadDirEntry
6
+
7
+ # Interface: ReadDirEntry
8
+
9
+ Defined in: fs/defines.ts:143
10
+
11
+ An entry returned by `readDir`.
12
+
13
+ ## Properties
14
+
15
+ | Property | Type | Description | Defined in |
16
+ | ------ | ------ | ------ | ------ |
17
+ | <a id="handle"></a> `handle` | `FileSystemHandle` | The handle of the entry. | fs/defines.ts:152 |
18
+ | <a id="path"></a> `path` | `string` | The relative path of the entry from readDir the path parameter. | fs/defines.ts:147 |
@@ -0,0 +1,18 @@
1
+ [**@themartiancompany/opfs**](../README.md)
2
+
3
+ ***
4
+
5
+ [@themartiancompany/opfs](../README.md) / ReadDirEntrySync
6
+
7
+ # Interface: ReadDirEntrySync
8
+
9
+ Defined in: fs/defines.ts:159
10
+
11
+ An entry returned by `readDirSync`.
12
+
13
+ ## Properties
14
+
15
+ | Property | Type | Description | Defined in |
16
+ | ------ | ------ | ------ | ------ |
17
+ | <a id="handle"></a> `handle` | [`FileSystemHandleLike`](FileSystemHandleLike.md) | The handle of the entry. | fs/defines.ts:168 |
18
+ | <a id="path"></a> `path` | `string` | The relative path of the entry from readDir the path parameter. | fs/defines.ts:163 |
@@ -0,0 +1,17 @@
1
+ [**@themartiancompany/opfs**](../README.md)
2
+
3
+ ***
4
+
5
+ [@themartiancompany/opfs](../README.md) / ReadDirOptions
6
+
7
+ # Interface: ReadDirOptions
8
+
9
+ Defined in: fs/defines.ts:132
10
+
11
+ Options for reading directories.
12
+
13
+ ## Properties
14
+
15
+ | Property | Type | Description | Defined in |
16
+ | ------ | ------ | ------ | ------ |
17
+ | <a id="recursive"></a> `recursive` | `boolean` | Whether to recursively read the contents of directories. | fs/defines.ts:136 |
@@ -0,0 +1,17 @@
1
+ [**@themartiancompany/opfs**](../README.md)
2
+
3
+ ***
4
+
5
+ [@themartiancompany/opfs](../README.md) / ReadOptions
6
+
7
+ # Interface: ReadOptions
8
+
9
+ Defined in: fs/defines.ts:56
10
+
11
+ Options for reading files with specified encoding.
12
+
13
+ ## Properties
14
+
15
+ | Property | Type | Default value | Description | Defined in |
16
+ | ------ | ------ | ------ | ------ | ------ |
17
+ | <a id="encoding"></a> `encoding?` | [`FileEncoding`](../type-aliases/FileEncoding.md) | `'binary'` | The encoding to use for reading the file's content. | fs/defines.ts:61 |
@@ -0,0 +1,19 @@
1
+ [**@themartiancompany/opfs**](../README.md)
2
+
3
+ ***
4
+
5
+ [@themartiancompany/opfs](../README.md) / SyncAgentOptions
6
+
7
+ # Interface: SyncAgentOptions
8
+
9
+ Defined in: fs/defines.ts:256
10
+
11
+ Setup options of `connectSyncAgent`.
12
+
13
+ ## Properties
14
+
15
+ | Property | Type | Description | Defined in |
16
+ | ------ | ------ | ------ | ------ |
17
+ | <a id="bufferlength"></a> `bufferLength?` | `number` | The length of the buffer to use for communication. | fs/defines.ts:267 |
18
+ | <a id="optimeout"></a> `opTimeout?` | `number` | The timeout for operations. | fs/defines.ts:272 |
19
+ | <a id="worker"></a> `worker` | `string` \| `Worker` \| `URL` | The worker to communicate with. | fs/defines.ts:260 |
@@ -0,0 +1,19 @@
1
+ [**@themartiancompany/opfs**](../README.md)
2
+
3
+ ***
4
+
5
+ [@themartiancompany/opfs](../README.md) / TempOptions
6
+
7
+ # Interface: TempOptions
8
+
9
+ Defined in: fs/defines.ts:291
10
+
11
+ Options for `mkTemp`.
12
+
13
+ ## Properties
14
+
15
+ | Property | Type | Default value | Description | Defined in |
16
+ | ------ | ------ | ------ | ------ | ------ |
17
+ | <a id="basename"></a> `basename?` | `string` | `tmp` | The basename of the file or directory. eg: `mktemp -t basename.XXX` | fs/defines.ts:304 |
18
+ | <a id="extname"></a> `extname?` | `string` | `undefined` | The extension of the file. eg: `mktemp --suffix .txt` | fs/defines.ts:310 |
19
+ | <a id="isdirectory"></a> `isDirectory?` | `boolean` | `false` | Whether to create a directory. eg: `mktemp -d` | fs/defines.ts:297 |
@@ -0,0 +1,21 @@
1
+ [**@themartiancompany/opfs**](../README.md)
2
+
3
+ ***
4
+
5
+ [@themartiancompany/opfs](../README.md) / UploadRequestInit
6
+
7
+ # Interface: UploadRequestInit
8
+
9
+ Defined in: fs/defines.ts:121
10
+
11
+ fetch-t request options for uploading files.
12
+
13
+ ## Extends
14
+
15
+ - [`FsRequestInit`](../type-aliases/FsRequestInit.md)
16
+
17
+ ## Properties
18
+
19
+ | Property | Type | Description | Defined in |
20
+ | ------ | ------ | ------ | ------ |
21
+ | <a id="filename"></a> `filename?` | `string` | The filename to use when uploading the file. | fs/defines.ts:125 |
@@ -0,0 +1,19 @@
1
+ [**@themartiancompany/opfs**](../README.md)
2
+
3
+ ***
4
+
5
+ [@themartiancompany/opfs](../README.md) / WriteOptions
6
+
7
+ # Interface: WriteOptions
8
+
9
+ Defined in: fs/defines.ts:69
10
+
11
+ Options for writing files, including flags for creation
12
+ and appending.
13
+
14
+ ## Properties
15
+
16
+ | Property | Type | Default value | Description | Defined in |
17
+ | ------ | ------ | ------ | ------ | ------ |
18
+ | <a id="append"></a> `append?` | `boolean` | `false` | Whether to append to the file if it already exists. | fs/defines.ts:80 |
19
+ | <a id="create"></a> `create?` | `boolean` | `true` | Whether to create the file if it does not exist. | fs/defines.ts:74 |