@fgv/ts-web-extras 5.0.2 → 5.1.0-0

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 (208) hide show
  1. package/.rush/temp/81e0881271ff236956b2f52e8ca99da6574c6e1e.tar.log +223 -0
  2. package/.rush/temp/chunked-rush-logs/ts-web-extras.build.chunks.jsonl +35 -25
  3. package/.rush/temp/operation/build/all.log +35 -25
  4. package/.rush/temp/operation/build/log-chunks.jsonl +35 -25
  5. package/.rush/temp/operation/build/state.json +1 -1
  6. package/.rush/temp/shrinkwrap-deps.json +175 -163
  7. package/config/jest.config.json +4 -1
  8. package/config/typedoc.json +6 -0
  9. package/dist/index.js +2 -2
  10. package/dist/index.js.map +1 -1
  11. package/dist/packlets/crypto-utils/browserCryptoProvider.js +254 -0
  12. package/dist/packlets/crypto-utils/browserCryptoProvider.js.map +1 -0
  13. package/dist/packlets/crypto-utils/browserHashProvider.js.map +1 -0
  14. package/dist/packlets/{crypto → crypto-utils}/index.js +1 -0
  15. package/dist/packlets/crypto-utils/index.js.map +1 -0
  16. package/dist/packlets/file-api-types/index.js +27 -3
  17. package/dist/packlets/file-api-types/index.js.map +1 -1
  18. package/dist/packlets/file-tree/directoryHandleStore.js +124 -0
  19. package/dist/packlets/file-tree/directoryHandleStore.js.map +1 -0
  20. package/dist/packlets/file-tree/fileApiTreeAccessors.js +76 -0
  21. package/dist/packlets/file-tree/fileApiTreeAccessors.js.map +1 -1
  22. package/dist/packlets/file-tree/fileSystemAccessTreeAccessors.js +345 -0
  23. package/dist/packlets/file-tree/fileSystemAccessTreeAccessors.js.map +1 -0
  24. package/dist/packlets/file-tree/index.js +3 -0
  25. package/dist/packlets/file-tree/index.js.map +1 -1
  26. package/dist/packlets/file-tree/localStorageTreeAccessors.js +308 -0
  27. package/dist/packlets/file-tree/localStorageTreeAccessors.js.map +1 -0
  28. package/dist/test/mocks/idb-keyval.js +6 -0
  29. package/dist/test/mocks/idb-keyval.js.map +1 -0
  30. package/dist/test/unit/browserHashProvider.test.js +1 -1
  31. package/dist/test/unit/browserHashProvider.test.js.map +1 -1
  32. package/dist/test/unit/directoryHandleStore.test.js +190 -0
  33. package/dist/test/unit/directoryHandleStore.test.js.map +1 -0
  34. package/dist/test/unit/fileApiTypes.test.js +30 -0
  35. package/dist/test/unit/fileApiTypes.test.js.map +1 -1
  36. package/dist/test/unit/fileSystemAccessTreeAccessors.test.js +517 -0
  37. package/dist/test/unit/fileSystemAccessTreeAccessors.test.js.map +1 -0
  38. package/dist/test/unit/localStorageTreeAccessors.test.js +595 -0
  39. package/dist/test/unit/localStorageTreeAccessors.test.js.map +1 -0
  40. package/dist/test/utils/fileSystemAccessMocks.js +271 -0
  41. package/dist/test/utils/fileSystemAccessMocks.js.map +1 -0
  42. package/dist/ts-web-extras.d.ts +460 -1
  43. package/dist/tsdoc-metadata.json +1 -1
  44. package/docs/ts-web-extras.cryptoutils.browsercryptoprovider._constructor_.md +50 -0
  45. package/docs/ts-web-extras.cryptoutils.browsercryptoprovider.decrypt.md +104 -0
  46. package/docs/ts-web-extras.cryptoutils.browsercryptoprovider.derivekey.md +88 -0
  47. package/docs/ts-web-extras.cryptoutils.browsercryptoprovider.encrypt.md +72 -0
  48. package/docs/ts-web-extras.cryptoutils.browsercryptoprovider.frombase64.md +56 -0
  49. package/docs/ts-web-extras.cryptoutils.browsercryptoprovider.generatekey.md +19 -0
  50. package/docs/ts-web-extras.cryptoutils.browsercryptoprovider.generaterandombytes.md +56 -0
  51. package/docs/ts-web-extras.cryptoutils.browsercryptoprovider.md +169 -0
  52. package/docs/ts-web-extras.cryptoutils.browsercryptoprovider.tobase64.md +56 -0
  53. package/docs/{ts-web-extras.browserhashprovider.hashparts.md → ts-web-extras.cryptoutils.browserhashprovider.hashparts.md} +2 -2
  54. package/docs/{ts-web-extras.browserhashprovider.hashstring.md → ts-web-extras.cryptoutils.browserhashprovider.hashstring.md} +2 -2
  55. package/docs/{ts-web-extras.browserhashprovider.md → ts-web-extras.cryptoutils.browserhashprovider.md} +4 -4
  56. package/docs/ts-web-extras.cryptoutils.createbrowsercryptoprovider.md +19 -0
  57. package/docs/ts-web-extras.cryptoutils.md +71 -0
  58. package/docs/ts-web-extras.fileapitreeaccessors.createfromlocalstorage.md +74 -0
  59. package/docs/ts-web-extras.fileapitreeaccessors.createpersistent.md +76 -0
  60. package/docs/ts-web-extras.fileapitreeaccessors.md +32 -0
  61. package/docs/ts-web-extras.filesystemaccesstreeaccessors._constructor_.md +114 -0
  62. package/docs/ts-web-extras.filesystemaccesstreeaccessors.fileismutable.md +52 -0
  63. package/docs/ts-web-extras.filesystemaccesstreeaccessors.fromdirectoryhandle.md +72 -0
  64. package/docs/ts-web-extras.filesystemaccesstreeaccessors.getdirtypaths.md +17 -0
  65. package/docs/ts-web-extras.filesystemaccesstreeaccessors.isdirty.md +17 -0
  66. package/docs/ts-web-extras.filesystemaccesstreeaccessors.md +159 -0
  67. package/docs/ts-web-extras.filesystemaccesstreeaccessors.savefilecontents.md +66 -0
  68. package/docs/ts-web-extras.filesystemaccesstreeaccessors.synctodisk.md +17 -0
  69. package/docs/ts-web-extras.ifilesystemaccesstreeparams.autosync.md +13 -0
  70. package/docs/ts-web-extras.ifilesystemaccesstreeparams.md +78 -0
  71. package/docs/ts-web-extras.ifilesystemaccesstreeparams.requirewritepermission.md +13 -0
  72. package/docs/ts-web-extras.ilocalstoragetreeparams.autosync.md +13 -0
  73. package/docs/ts-web-extras.ilocalstoragetreeparams.md +97 -0
  74. package/docs/ts-web-extras.ilocalstoragetreeparams.pathtokeymap.md +13 -0
  75. package/docs/ts-web-extras.ilocalstoragetreeparams.storage.md +13 -0
  76. package/docs/ts-web-extras.localstoragetreeaccessors.fileismutable.md +56 -0
  77. package/docs/ts-web-extras.localstoragetreeaccessors.fromstorage.md +56 -0
  78. package/docs/ts-web-extras.localstoragetreeaccessors.getdirtypaths.md +19 -0
  79. package/docs/ts-web-extras.localstoragetreeaccessors.isdirty.md +19 -0
  80. package/docs/ts-web-extras.localstoragetreeaccessors.md +131 -0
  81. package/docs/ts-web-extras.localstoragetreeaccessors.savefilecontents.md +72 -0
  82. package/docs/ts-web-extras.localstoragetreeaccessors.synctodisk.md +19 -0
  83. package/docs/ts-web-extras.md +50 -4
  84. package/etc/ts-web-extras.api.md +91 -1
  85. package/lib/index.d.ts +2 -1
  86. package/lib/index.d.ts.map +1 -1
  87. package/lib/index.js +25 -2
  88. package/lib/index.js.map +1 -1
  89. package/lib/packlets/crypto-utils/browserCryptoProvider.d.ts +77 -0
  90. package/lib/packlets/crypto-utils/browserCryptoProvider.d.ts.map +1 -0
  91. package/lib/packlets/crypto-utils/browserCryptoProvider.js +259 -0
  92. package/lib/packlets/crypto-utils/browserCryptoProvider.js.map +1 -0
  93. package/lib/packlets/crypto-utils/browserHashProvider.d.ts.map +1 -0
  94. package/lib/packlets/crypto-utils/browserHashProvider.js.map +1 -0
  95. package/lib/packlets/{crypto → crypto-utils}/index.d.ts +1 -0
  96. package/lib/packlets/crypto-utils/index.d.ts.map +1 -0
  97. package/lib/packlets/{crypto → crypto-utils}/index.js +1 -0
  98. package/lib/packlets/crypto-utils/index.js.map +1 -0
  99. package/lib/packlets/file-api-types/index.d.ts.map +1 -1
  100. package/lib/packlets/file-api-types/index.js +27 -3
  101. package/lib/packlets/file-api-types/index.js.map +1 -1
  102. package/lib/packlets/file-tree/directoryHandleStore.d.ts +59 -0
  103. package/lib/packlets/file-tree/directoryHandleStore.d.ts.map +1 -0
  104. package/lib/packlets/file-tree/directoryHandleStore.js +128 -0
  105. package/lib/packlets/file-tree/directoryHandleStore.js.map +1 -0
  106. package/lib/packlets/file-tree/fileApiTreeAccessors.d.ts +57 -0
  107. package/lib/packlets/file-tree/fileApiTreeAccessors.d.ts.map +1 -1
  108. package/lib/packlets/file-tree/fileApiTreeAccessors.js +76 -0
  109. package/lib/packlets/file-tree/fileApiTreeAccessors.js.map +1 -1
  110. package/lib/packlets/file-tree/fileSystemAccessTreeAccessors.d.ts +136 -0
  111. package/lib/packlets/file-tree/fileSystemAccessTreeAccessors.d.ts.map +1 -0
  112. package/lib/packlets/file-tree/fileSystemAccessTreeAccessors.js +349 -0
  113. package/lib/packlets/file-tree/fileSystemAccessTreeAccessors.js.map +1 -0
  114. package/lib/packlets/file-tree/index.d.ts +3 -0
  115. package/lib/packlets/file-tree/index.d.ts.map +1 -1
  116. package/lib/packlets/file-tree/index.js +3 -0
  117. package/lib/packlets/file-tree/index.js.map +1 -1
  118. package/lib/packlets/file-tree/localStorageTreeAccessors.d.ts +129 -0
  119. package/lib/packlets/file-tree/localStorageTreeAccessors.d.ts.map +1 -0
  120. package/lib/packlets/file-tree/localStorageTreeAccessors.js +312 -0
  121. package/lib/packlets/file-tree/localStorageTreeAccessors.js.map +1 -0
  122. package/lib/test/mocks/idb-keyval.d.ts +6 -0
  123. package/lib/test/mocks/idb-keyval.d.ts.map +1 -0
  124. package/lib/test/mocks/idb-keyval.js +9 -0
  125. package/lib/test/mocks/idb-keyval.js.map +1 -0
  126. package/lib/test/unit/browserHashProvider.test.js +21 -21
  127. package/lib/test/unit/browserHashProvider.test.js.map +1 -1
  128. package/lib/test/unit/directoryHandleStore.test.d.ts +2 -0
  129. package/lib/test/unit/directoryHandleStore.test.d.ts.map +1 -0
  130. package/lib/test/unit/directoryHandleStore.test.js +192 -0
  131. package/lib/test/unit/directoryHandleStore.test.js.map +1 -0
  132. package/lib/test/unit/fileApiTypes.test.js +30 -0
  133. package/lib/test/unit/fileApiTypes.test.js.map +1 -1
  134. package/lib/test/unit/fileSystemAccessTreeAccessors.test.d.ts +2 -0
  135. package/lib/test/unit/fileSystemAccessTreeAccessors.test.d.ts.map +1 -0
  136. package/lib/test/unit/fileSystemAccessTreeAccessors.test.js +519 -0
  137. package/lib/test/unit/fileSystemAccessTreeAccessors.test.js.map +1 -0
  138. package/lib/test/unit/localStorageTreeAccessors.test.d.ts +2 -0
  139. package/lib/test/unit/localStorageTreeAccessors.test.d.ts.map +1 -0
  140. package/lib/test/unit/localStorageTreeAccessors.test.js +597 -0
  141. package/lib/test/unit/localStorageTreeAccessors.test.js.map +1 -0
  142. package/lib/test/utils/fileSystemAccessMocks.d.ts +53 -0
  143. package/lib/test/utils/fileSystemAccessMocks.d.ts.map +1 -0
  144. package/lib/test/utils/fileSystemAccessMocks.js +277 -0
  145. package/lib/test/utils/fileSystemAccessMocks.js.map +1 -0
  146. package/package.json +27 -20
  147. package/rush-logs/ts-web-extras.build.cache.log +3 -1
  148. package/rush-logs/ts-web-extras.build.log +35 -25
  149. package/src/index.ts +2 -2
  150. package/src/packlets/crypto-utils/browserCryptoProvider.ts +311 -0
  151. package/src/packlets/{crypto → crypto-utils}/index.ts +1 -0
  152. package/src/packlets/file-api-types/index.ts +24 -3
  153. package/src/packlets/file-tree/directoryHandleStore.ts +136 -0
  154. package/src/packlets/file-tree/fileApiTreeAccessors.ts +90 -0
  155. package/src/packlets/file-tree/fileSystemAccessTreeAccessors.ts +427 -0
  156. package/src/packlets/file-tree/index.ts +3 -0
  157. package/src/packlets/file-tree/localStorageTreeAccessors.ts +377 -0
  158. package/src/test/mocks/idb-keyval.ts +5 -0
  159. package/src/test/unit/browserHashProvider.test.ts +1 -1
  160. package/src/test/unit/directoryHandleStore.test.ts +251 -0
  161. package/src/test/unit/fileApiTypes.test.ts +36 -0
  162. package/src/test/unit/fileSystemAccessTreeAccessors.test.ts +732 -0
  163. package/src/test/unit/localStorageTreeAccessors.test.ts +746 -0
  164. package/src/test/utils/fileSystemAccessMocks.ts +353 -0
  165. package/temp/build/typescript/ts_8nwakTlr.json +1 -0
  166. package/temp/coverage/crypto-utils/browserCryptoProvider.ts.html +1018 -0
  167. package/temp/coverage/{crypto → crypto-utils}/browserHashProvider.ts.html +3 -3
  168. package/temp/coverage/{lcov-report/crypto → crypto-utils}/index.html +21 -6
  169. package/temp/coverage/file-tree/directoryHandleStore.ts.html +493 -0
  170. package/temp/coverage/file-tree/fileApiTreeAccessors.ts.html +276 -6
  171. package/temp/coverage/file-tree/fileSystemAccessTreeAccessors.ts.html +1366 -0
  172. package/temp/coverage/file-tree/index.html +55 -10
  173. package/temp/coverage/file-tree/localStorageTreeAccessors.ts.html +1216 -0
  174. package/temp/coverage/helpers/fileTreeHelpers.ts.html +1 -1
  175. package/temp/coverage/helpers/index.html +1 -1
  176. package/temp/coverage/index.html +15 -15
  177. package/temp/coverage/lcov-report/crypto-utils/browserCryptoProvider.ts.html +1018 -0
  178. package/temp/coverage/lcov-report/{crypto → crypto-utils}/browserHashProvider.ts.html +3 -3
  179. package/temp/coverage/{crypto → lcov-report/crypto-utils}/index.html +21 -6
  180. package/temp/coverage/lcov-report/file-tree/directoryHandleStore.ts.html +493 -0
  181. package/temp/coverage/lcov-report/file-tree/fileApiTreeAccessors.ts.html +276 -6
  182. package/temp/coverage/lcov-report/file-tree/fileSystemAccessTreeAccessors.ts.html +1366 -0
  183. package/temp/coverage/lcov-report/file-tree/index.html +55 -10
  184. package/temp/coverage/lcov-report/file-tree/localStorageTreeAccessors.ts.html +1216 -0
  185. package/temp/coverage/lcov-report/helpers/fileTreeHelpers.ts.html +1 -1
  186. package/temp/coverage/lcov-report/helpers/index.html +1 -1
  187. package/temp/coverage/lcov-report/index.html +15 -15
  188. package/temp/coverage/lcov-report/url-utils/index.html +1 -1
  189. package/temp/coverage/lcov-report/url-utils/urlParams.ts.html +1 -1
  190. package/temp/coverage/lcov.info +2128 -451
  191. package/temp/coverage/url-utils/index.html +1 -1
  192. package/temp/coverage/url-utils/urlParams.ts.html +1 -1
  193. package/temp/test/jest/haste-map-7492f1b44480e0cdd1f220078fb3afd8-c8dd6c3430605adeb2f1cadf4f75e791-8c9336785555d572065b28c111982ba4 +0 -0
  194. package/temp/test/jest/perf-cache-7492f1b44480e0cdd1f220078fb3afd8-da39a3ee5e6b4b0d3255bfef95601890 +1 -1
  195. package/temp/ts-web-extras.api.json +3236 -385
  196. package/temp/ts-web-extras.api.md +91 -1
  197. package/dist/packlets/crypto/browserHashProvider.js.map +0 -1
  198. package/dist/packlets/crypto/index.js.map +0 -1
  199. package/lib/packlets/crypto/browserHashProvider.d.ts.map +0 -1
  200. package/lib/packlets/crypto/browserHashProvider.js.map +0 -1
  201. package/lib/packlets/crypto/index.d.ts.map +0 -1
  202. package/lib/packlets/crypto/index.js.map +0 -1
  203. package/temp/build/typescript/ts_vnCx6LlY.json +0 -1
  204. /package/dist/packlets/{crypto → crypto-utils}/browserHashProvider.js +0 -0
  205. /package/lib/packlets/{crypto → crypto-utils}/browserHashProvider.d.ts +0 -0
  206. /package/lib/packlets/{crypto → crypto-utils}/browserHashProvider.js +0 -0
  207. /package/src/packlets/{crypto → crypto-utils}/browserHashProvider.ts +0 -0
  208. /package/temp/test/jest/jest-transform-cache-7492f1b44480e0cdd1f220078fb3afd8-79ef2876fae7ca75eedb2aa53dc48338/{0e/package_0eb6535f5987849d93ea51ef33a14cf6 → 8d/package_8dcbedef69e4299f0f51fcda8f4f1c8e} +0 -0
@@ -0,0 +1,13 @@
1
+ <!-- Do not edit this file. It is automatically generated by API Documenter. -->
2
+
3
+ [Home](./index.md) &gt; [@fgv/ts-web-extras](./ts-web-extras.md) &gt; [IFileSystemAccessTreeParams](./ts-web-extras.ifilesystemaccesstreeparams.md) &gt; [autoSync](./ts-web-extras.ifilesystemaccesstreeparams.autosync.md)
4
+
5
+ ## IFileSystemAccessTreeParams.autoSync property
6
+
7
+ Automatically sync changes to disk immediately after each save. If false, changes are batched and written on explicit syncToDisk() call.
8
+
9
+ **Signature:**
10
+
11
+ ```typescript
12
+ autoSync?: boolean;
13
+ ```
@@ -0,0 +1,78 @@
1
+ <!-- Do not edit this file. It is automatically generated by API Documenter. -->
2
+
3
+ [Home](./index.md) &gt; [@fgv/ts-web-extras](./ts-web-extras.md) &gt; [IFileSystemAccessTreeParams](./ts-web-extras.ifilesystemaccesstreeparams.md)
4
+
5
+ ## IFileSystemAccessTreeParams interface
6
+
7
+ Options for creating persistent file trees.
8
+
9
+ **Signature:**
10
+
11
+ ```typescript
12
+ export interface IFileSystemAccessTreeParams<TCT extends string = string> extends FileTree.IFileTreeInitParams<TCT>
13
+ ```
14
+ **Extends:** FileTree.IFileTreeInitParams&lt;TCT&gt;
15
+
16
+ ## Properties
17
+
18
+ <table><thead><tr><th>
19
+
20
+ Property
21
+
22
+
23
+ </th><th>
24
+
25
+ Modifiers
26
+
27
+
28
+ </th><th>
29
+
30
+ Type
31
+
32
+
33
+ </th><th>
34
+
35
+ Description
36
+
37
+
38
+ </th></tr></thead>
39
+ <tbody><tr><td>
40
+
41
+ [autoSync?](./ts-web-extras.ifilesystemaccesstreeparams.autosync.md)
42
+
43
+
44
+ </td><td>
45
+
46
+
47
+ </td><td>
48
+
49
+ boolean
50
+
51
+
52
+ </td><td>
53
+
54
+ _(Optional)_ Automatically sync changes to disk immediately after each save. If false, changes are batched and written on explicit syncToDisk() call.
55
+
56
+
57
+ </td></tr>
58
+ <tr><td>
59
+
60
+ [requireWritePermission?](./ts-web-extras.ifilesystemaccesstreeparams.requirewritepermission.md)
61
+
62
+
63
+ </td><td>
64
+
65
+
66
+ </td><td>
67
+
68
+ boolean
69
+
70
+
71
+ </td><td>
72
+
73
+ _(Optional)_ Require write permission on the directory handle. If true, fails if write permission cannot be obtained. If false, falls back to read-only mode.
74
+
75
+
76
+ </td></tr>
77
+ </tbody></table>
78
+
@@ -0,0 +1,13 @@
1
+ <!-- Do not edit this file. It is automatically generated by API Documenter. -->
2
+
3
+ [Home](./index.md) &gt; [@fgv/ts-web-extras](./ts-web-extras.md) &gt; [IFileSystemAccessTreeParams](./ts-web-extras.ifilesystemaccesstreeparams.md) &gt; [requireWritePermission](./ts-web-extras.ifilesystemaccesstreeparams.requirewritepermission.md)
4
+
5
+ ## IFileSystemAccessTreeParams.requireWritePermission property
6
+
7
+ Require write permission on the directory handle. If true, fails if write permission cannot be obtained. If false, falls back to read-only mode.
8
+
9
+ **Signature:**
10
+
11
+ ```typescript
12
+ requireWritePermission?: boolean;
13
+ ```
@@ -0,0 +1,13 @@
1
+ <!-- Do not edit this file. It is automatically generated by API Documenter. -->
2
+
3
+ [Home](./index.md) &gt; [@fgv/ts-web-extras](./ts-web-extras.md) &gt; [ILocalStorageTreeParams](./ts-web-extras.ilocalstoragetreeparams.md) &gt; [autoSync](./ts-web-extras.ilocalstoragetreeparams.autosync.md)
4
+
5
+ ## ILocalStorageTreeParams.autoSync property
6
+
7
+ If true, automatically sync changes to localStorage on every modification. If false (default), changes are only synced when syncToDisk() is called.
8
+
9
+ **Signature:**
10
+
11
+ ```typescript
12
+ autoSync?: boolean;
13
+ ```
@@ -0,0 +1,97 @@
1
+ <!-- Do not edit this file. It is automatically generated by API Documenter. -->
2
+
3
+ [Home](./index.md) &gt; [@fgv/ts-web-extras](./ts-web-extras.md) &gt; [ILocalStorageTreeParams](./ts-web-extras.ilocalstoragetreeparams.md)
4
+
5
+ ## ILocalStorageTreeParams interface
6
+
7
+ Configuration for LocalStorageTreeAccessors.
8
+
9
+ **Signature:**
10
+
11
+ ```typescript
12
+ export interface ILocalStorageTreeParams<TCT extends string = string> extends FileTree.IFileTreeInitParams<TCT>
13
+ ```
14
+ **Extends:** FileTree.IFileTreeInitParams&lt;TCT&gt;
15
+
16
+ ## Properties
17
+
18
+ <table><thead><tr><th>
19
+
20
+ Property
21
+
22
+
23
+ </th><th>
24
+
25
+ Modifiers
26
+
27
+
28
+ </th><th>
29
+
30
+ Type
31
+
32
+
33
+ </th><th>
34
+
35
+ Description
36
+
37
+
38
+ </th></tr></thead>
39
+ <tbody><tr><td>
40
+
41
+ [autoSync?](./ts-web-extras.ilocalstoragetreeparams.autosync.md)
42
+
43
+
44
+ </td><td>
45
+
46
+
47
+ </td><td>
48
+
49
+ boolean
50
+
51
+
52
+ </td><td>
53
+
54
+ _(Optional)_ If true, automatically sync changes to localStorage on every modification. If false (default), changes are only synced when syncToDisk() is called.
55
+
56
+
57
+ </td></tr>
58
+ <tr><td>
59
+
60
+ [pathToKeyMap](./ts-web-extras.ilocalstoragetreeparams.pathtokeymap.md)
61
+
62
+
63
+ </td><td>
64
+
65
+
66
+ </td><td>
67
+
68
+ Record&lt;string, string&gt;
69
+
70
+
71
+ </td><td>
72
+
73
+ Map of directory path prefixes to localStorage keys. Files under each prefix are stored in the corresponding localStorage key. Example: { '/data/ingredients': 'myapp:ingredients:v1' }
74
+
75
+
76
+ </td></tr>
77
+ <tr><td>
78
+
79
+ [storage?](./ts-web-extras.ilocalstoragetreeparams.storage.md)
80
+
81
+
82
+ </td><td>
83
+
84
+
85
+ </td><td>
86
+
87
+ Storage
88
+
89
+
90
+ </td><td>
91
+
92
+ _(Optional)_ Storage instance to use. Defaults to window.localStorage. Can be overridden for testing with mock storage.
93
+
94
+
95
+ </td></tr>
96
+ </tbody></table>
97
+
@@ -0,0 +1,13 @@
1
+ <!-- Do not edit this file. It is automatically generated by API Documenter. -->
2
+
3
+ [Home](./index.md) &gt; [@fgv/ts-web-extras](./ts-web-extras.md) &gt; [ILocalStorageTreeParams](./ts-web-extras.ilocalstoragetreeparams.md) &gt; [pathToKeyMap](./ts-web-extras.ilocalstoragetreeparams.pathtokeymap.md)
4
+
5
+ ## ILocalStorageTreeParams.pathToKeyMap property
6
+
7
+ Map of directory path prefixes to localStorage keys. Files under each prefix are stored in the corresponding localStorage key. Example: { '/data/ingredients': 'myapp:ingredients:v1' }
8
+
9
+ **Signature:**
10
+
11
+ ```typescript
12
+ pathToKeyMap: Record<string, string>;
13
+ ```
@@ -0,0 +1,13 @@
1
+ <!-- Do not edit this file. It is automatically generated by API Documenter. -->
2
+
3
+ [Home](./index.md) &gt; [@fgv/ts-web-extras](./ts-web-extras.md) &gt; [ILocalStorageTreeParams](./ts-web-extras.ilocalstoragetreeparams.md) &gt; [storage](./ts-web-extras.ilocalstoragetreeparams.storage.md)
4
+
5
+ ## ILocalStorageTreeParams.storage property
6
+
7
+ Storage instance to use. Defaults to window.localStorage. Can be overridden for testing with mock storage.
8
+
9
+ **Signature:**
10
+
11
+ ```typescript
12
+ storage?: Storage;
13
+ ```
@@ -0,0 +1,56 @@
1
+ <!-- Do not edit this file. It is automatically generated by API Documenter. -->
2
+
3
+ [Home](./index.md) &gt; [@fgv/ts-web-extras](./ts-web-extras.md) &gt; [LocalStorageTreeAccessors](./ts-web-extras.localstoragetreeaccessors.md) &gt; [fileIsMutable](./ts-web-extras.localstoragetreeaccessors.fileismutable.md)
4
+
5
+ ## LocalStorageTreeAccessors.fileIsMutable() method
6
+
7
+ Check if a file is mutable and return persistence detail.
8
+
9
+ **Signature:**
10
+
11
+ ```typescript
12
+ fileIsMutable(path: string): DetailedResult<boolean, FileTree.SaveDetail>;
13
+ ```
14
+
15
+ ## Parameters
16
+
17
+ <table><thead><tr><th>
18
+
19
+ Parameter
20
+
21
+
22
+ </th><th>
23
+
24
+ Type
25
+
26
+
27
+ </th><th>
28
+
29
+ Description
30
+
31
+
32
+ </th></tr></thead>
33
+ <tbody><tr><td>
34
+
35
+ path
36
+
37
+
38
+ </td><td>
39
+
40
+ string
41
+
42
+
43
+ </td><td>
44
+
45
+ File path to check
46
+
47
+
48
+ </td></tr>
49
+ </tbody></table>
50
+
51
+ **Returns:**
52
+
53
+ DetailedResult&lt;boolean, FileTree.SaveDetail&gt;
54
+
55
+ DetailedResult with mutability status and 'persistent' detail if mutable
56
+
@@ -0,0 +1,56 @@
1
+ <!-- Do not edit this file. It is automatically generated by API Documenter. -->
2
+
3
+ [Home](./index.md) &gt; [@fgv/ts-web-extras](./ts-web-extras.md) &gt; [LocalStorageTreeAccessors](./ts-web-extras.localstoragetreeaccessors.md) &gt; [fromStorage](./ts-web-extras.localstoragetreeaccessors.fromstorage.md)
4
+
5
+ ## LocalStorageTreeAccessors.fromStorage() method
6
+
7
+ Create LocalStorageTreeAccessors from browser localStorage. Loads all collections from the configured storage keys.
8
+
9
+ **Signature:**
10
+
11
+ ```typescript
12
+ static fromStorage<TCT extends string = string>(params: ILocalStorageTreeParams<TCT>): Result<LocalStorageTreeAccessors<TCT>>;
13
+ ```
14
+
15
+ ## Parameters
16
+
17
+ <table><thead><tr><th>
18
+
19
+ Parameter
20
+
21
+
22
+ </th><th>
23
+
24
+ Type
25
+
26
+
27
+ </th><th>
28
+
29
+ Description
30
+
31
+
32
+ </th></tr></thead>
33
+ <tbody><tr><td>
34
+
35
+ params
36
+
37
+
38
+ </td><td>
39
+
40
+ [ILocalStorageTreeParams](./ts-web-extras.ilocalstoragetreeparams.md)<!-- -->&lt;TCT&gt;
41
+
42
+
43
+ </td><td>
44
+
45
+ Configuration including path-to-key mappings
46
+
47
+
48
+ </td></tr>
49
+ </tbody></table>
50
+
51
+ **Returns:**
52
+
53
+ Result&lt;[LocalStorageTreeAccessors](./ts-web-extras.localstoragetreeaccessors.md)<!-- -->&lt;TCT&gt;&gt;
54
+
55
+ Result containing the accessors or an error
56
+
@@ -0,0 +1,19 @@
1
+ <!-- Do not edit this file. It is automatically generated by API Documenter. -->
2
+
3
+ [Home](./index.md) &gt; [@fgv/ts-web-extras](./ts-web-extras.md) &gt; [LocalStorageTreeAccessors](./ts-web-extras.localstoragetreeaccessors.md) &gt; [getDirtyPaths](./ts-web-extras.localstoragetreeaccessors.getdirtypaths.md)
4
+
5
+ ## LocalStorageTreeAccessors.getDirtyPaths() method
6
+
7
+ Get list of file paths with unsaved changes.
8
+
9
+ **Signature:**
10
+
11
+ ```typescript
12
+ getDirtyPaths(): string[];
13
+ ```
14
+ **Returns:**
15
+
16
+ string\[\]
17
+
18
+ Array of dirty file paths
19
+
@@ -0,0 +1,19 @@
1
+ <!-- Do not edit this file. It is automatically generated by API Documenter. -->
2
+
3
+ [Home](./index.md) &gt; [@fgv/ts-web-extras](./ts-web-extras.md) &gt; [LocalStorageTreeAccessors](./ts-web-extras.localstoragetreeaccessors.md) &gt; [isDirty](./ts-web-extras.localstoragetreeaccessors.isdirty.md)
4
+
5
+ ## LocalStorageTreeAccessors.isDirty() method
6
+
7
+ Check if there are unsaved changes.
8
+
9
+ **Signature:**
10
+
11
+ ```typescript
12
+ isDirty(): boolean;
13
+ ```
14
+ **Returns:**
15
+
16
+ boolean
17
+
18
+ True if there are dirty files
19
+
@@ -0,0 +1,131 @@
1
+ <!-- Do not edit this file. It is automatically generated by API Documenter. -->
2
+
3
+ [Home](./index.md) &gt; [@fgv/ts-web-extras](./ts-web-extras.md) &gt; [LocalStorageTreeAccessors](./ts-web-extras.localstoragetreeaccessors.md)
4
+
5
+ ## LocalStorageTreeAccessors class
6
+
7
+ Browser localStorage-backed file tree accessors with persistence support.
8
+
9
+ Maps filesystem-like directory paths to localStorage keys, where each key stores multiple collections as a JSON object. This provides a general-purpose implementation for browser-based file tree persistence without requiring File System Access API.
10
+
11
+ Storage format per key: `{ "collection-id": { ...collectionData }, ... }` File paths map as: `/data/ingredients/collection-id.json` → stored in key for `/data/ingredients`
12
+
13
+ **Signature:**
14
+
15
+ ```typescript
16
+ export declare class LocalStorageTreeAccessors<TCT extends string = string> extends FileTree.InMemoryTreeAccessors<TCT> implements FileTree.IPersistentFileTreeAccessors<TCT>
17
+ ```
18
+ **Extends:** FileTree.InMemoryTreeAccessors&lt;TCT&gt;
19
+
20
+ **Implements:** FileTree.IPersistentFileTreeAccessors&lt;TCT&gt;
21
+
22
+ ## Remarks
23
+
24
+ The constructor for this class is marked as internal. Third-party code should not call the constructor directly or create subclasses that extend the `LocalStorageTreeAccessors` class.
25
+
26
+ ## Methods
27
+
28
+ <table><thead><tr><th>
29
+
30
+ Method
31
+
32
+
33
+ </th><th>
34
+
35
+ Modifiers
36
+
37
+
38
+ </th><th>
39
+
40
+ Description
41
+
42
+
43
+ </th></tr></thead>
44
+ <tbody><tr><td>
45
+
46
+ [fileIsMutable(path)](./ts-web-extras.localstoragetreeaccessors.fileismutable.md)
47
+
48
+
49
+ </td><td>
50
+
51
+
52
+ </td><td>
53
+
54
+ Check if a file is mutable and return persistence detail.
55
+
56
+
57
+ </td></tr>
58
+ <tr><td>
59
+
60
+ [fromStorage(params)](./ts-web-extras.localstoragetreeaccessors.fromstorage.md)
61
+
62
+
63
+ </td><td>
64
+
65
+ `static`
66
+
67
+
68
+ </td><td>
69
+
70
+ Create LocalStorageTreeAccessors from browser localStorage. Loads all collections from the configured storage keys.
71
+
72
+
73
+ </td></tr>
74
+ <tr><td>
75
+
76
+ [getDirtyPaths()](./ts-web-extras.localstoragetreeaccessors.getdirtypaths.md)
77
+
78
+
79
+ </td><td>
80
+
81
+
82
+ </td><td>
83
+
84
+ Get list of file paths with unsaved changes.
85
+
86
+
87
+ </td></tr>
88
+ <tr><td>
89
+
90
+ [isDirty()](./ts-web-extras.localstoragetreeaccessors.isdirty.md)
91
+
92
+
93
+ </td><td>
94
+
95
+
96
+ </td><td>
97
+
98
+ Check if there are unsaved changes.
99
+
100
+
101
+ </td></tr>
102
+ <tr><td>
103
+
104
+ [saveFileContents(path, contents)](./ts-web-extras.localstoragetreeaccessors.savefilecontents.md)
105
+
106
+
107
+ </td><td>
108
+
109
+
110
+ </td><td>
111
+
112
+ Save file contents. Marks file as dirty and optionally auto-syncs.
113
+
114
+
115
+ </td></tr>
116
+ <tr><td>
117
+
118
+ [syncToDisk()](./ts-web-extras.localstoragetreeaccessors.synctodisk.md)
119
+
120
+
121
+ </td><td>
122
+
123
+
124
+ </td><td>
125
+
126
+ Sync all dirty files to localStorage.
127
+
128
+
129
+ </td></tr>
130
+ </tbody></table>
131
+
@@ -0,0 +1,72 @@
1
+ <!-- Do not edit this file. It is automatically generated by API Documenter. -->
2
+
3
+ [Home](./index.md) &gt; [@fgv/ts-web-extras](./ts-web-extras.md) &gt; [LocalStorageTreeAccessors](./ts-web-extras.localstoragetreeaccessors.md) &gt; [saveFileContents](./ts-web-extras.localstoragetreeaccessors.savefilecontents.md)
4
+
5
+ ## LocalStorageTreeAccessors.saveFileContents() method
6
+
7
+ Save file contents. Marks file as dirty and optionally auto-syncs.
8
+
9
+ **Signature:**
10
+
11
+ ```typescript
12
+ saveFileContents(path: string, contents: string): Result<string>;
13
+ ```
14
+
15
+ ## Parameters
16
+
17
+ <table><thead><tr><th>
18
+
19
+ Parameter
20
+
21
+
22
+ </th><th>
23
+
24
+ Type
25
+
26
+
27
+ </th><th>
28
+
29
+ Description
30
+
31
+
32
+ </th></tr></thead>
33
+ <tbody><tr><td>
34
+
35
+ path
36
+
37
+
38
+ </td><td>
39
+
40
+ string
41
+
42
+
43
+ </td><td>
44
+
45
+ File path
46
+
47
+
48
+ </td></tr>
49
+ <tr><td>
50
+
51
+ contents
52
+
53
+
54
+ </td><td>
55
+
56
+ string
57
+
58
+
59
+ </td><td>
60
+
61
+ New file contents
62
+
63
+
64
+ </td></tr>
65
+ </tbody></table>
66
+
67
+ **Returns:**
68
+
69
+ Result&lt;string&gt;
70
+
71
+ Result with the saved contents or error
72
+
@@ -0,0 +1,19 @@
1
+ <!-- Do not edit this file. It is automatically generated by API Documenter. -->
2
+
3
+ [Home](./index.md) &gt; [@fgv/ts-web-extras](./ts-web-extras.md) &gt; [LocalStorageTreeAccessors](./ts-web-extras.localstoragetreeaccessors.md) &gt; [syncToDisk](./ts-web-extras.localstoragetreeaccessors.synctodisk.md)
4
+
5
+ ## LocalStorageTreeAccessors.syncToDisk() method
6
+
7
+ Sync all dirty files to localStorage.
8
+
9
+ **Signature:**
10
+
11
+ ```typescript
12
+ syncToDisk(): Promise<Result<void>>;
13
+ ```
14
+ **Returns:**
15
+
16
+ Promise&lt;Result&lt;void&gt;&gt;
17
+
18
+ Result indicating success or failure
19
+