@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.
- package/.rush/temp/81e0881271ff236956b2f52e8ca99da6574c6e1e.tar.log +223 -0
- package/.rush/temp/chunked-rush-logs/ts-web-extras.build.chunks.jsonl +35 -25
- package/.rush/temp/operation/build/all.log +35 -25
- package/.rush/temp/operation/build/log-chunks.jsonl +35 -25
- package/.rush/temp/operation/build/state.json +1 -1
- package/.rush/temp/shrinkwrap-deps.json +175 -163
- package/config/jest.config.json +4 -1
- package/config/typedoc.json +6 -0
- package/dist/index.js +2 -2
- package/dist/index.js.map +1 -1
- package/dist/packlets/crypto-utils/browserCryptoProvider.js +254 -0
- package/dist/packlets/crypto-utils/browserCryptoProvider.js.map +1 -0
- package/dist/packlets/crypto-utils/browserHashProvider.js.map +1 -0
- package/dist/packlets/{crypto → crypto-utils}/index.js +1 -0
- package/dist/packlets/crypto-utils/index.js.map +1 -0
- package/dist/packlets/file-api-types/index.js +27 -3
- package/dist/packlets/file-api-types/index.js.map +1 -1
- package/dist/packlets/file-tree/directoryHandleStore.js +124 -0
- package/dist/packlets/file-tree/directoryHandleStore.js.map +1 -0
- package/dist/packlets/file-tree/fileApiTreeAccessors.js +76 -0
- package/dist/packlets/file-tree/fileApiTreeAccessors.js.map +1 -1
- package/dist/packlets/file-tree/fileSystemAccessTreeAccessors.js +345 -0
- package/dist/packlets/file-tree/fileSystemAccessTreeAccessors.js.map +1 -0
- package/dist/packlets/file-tree/index.js +3 -0
- package/dist/packlets/file-tree/index.js.map +1 -1
- package/dist/packlets/file-tree/localStorageTreeAccessors.js +308 -0
- package/dist/packlets/file-tree/localStorageTreeAccessors.js.map +1 -0
- package/dist/test/mocks/idb-keyval.js +6 -0
- package/dist/test/mocks/idb-keyval.js.map +1 -0
- package/dist/test/unit/browserHashProvider.test.js +1 -1
- package/dist/test/unit/browserHashProvider.test.js.map +1 -1
- package/dist/test/unit/directoryHandleStore.test.js +190 -0
- package/dist/test/unit/directoryHandleStore.test.js.map +1 -0
- package/dist/test/unit/fileApiTypes.test.js +30 -0
- package/dist/test/unit/fileApiTypes.test.js.map +1 -1
- package/dist/test/unit/fileSystemAccessTreeAccessors.test.js +517 -0
- package/dist/test/unit/fileSystemAccessTreeAccessors.test.js.map +1 -0
- package/dist/test/unit/localStorageTreeAccessors.test.js +595 -0
- package/dist/test/unit/localStorageTreeAccessors.test.js.map +1 -0
- package/dist/test/utils/fileSystemAccessMocks.js +271 -0
- package/dist/test/utils/fileSystemAccessMocks.js.map +1 -0
- package/dist/ts-web-extras.d.ts +460 -1
- package/dist/tsdoc-metadata.json +1 -1
- package/docs/ts-web-extras.cryptoutils.browsercryptoprovider._constructor_.md +50 -0
- package/docs/ts-web-extras.cryptoutils.browsercryptoprovider.decrypt.md +104 -0
- package/docs/ts-web-extras.cryptoutils.browsercryptoprovider.derivekey.md +88 -0
- package/docs/ts-web-extras.cryptoutils.browsercryptoprovider.encrypt.md +72 -0
- package/docs/ts-web-extras.cryptoutils.browsercryptoprovider.frombase64.md +56 -0
- package/docs/ts-web-extras.cryptoutils.browsercryptoprovider.generatekey.md +19 -0
- package/docs/ts-web-extras.cryptoutils.browsercryptoprovider.generaterandombytes.md +56 -0
- package/docs/ts-web-extras.cryptoutils.browsercryptoprovider.md +169 -0
- package/docs/ts-web-extras.cryptoutils.browsercryptoprovider.tobase64.md +56 -0
- package/docs/{ts-web-extras.browserhashprovider.hashparts.md → ts-web-extras.cryptoutils.browserhashprovider.hashparts.md} +2 -2
- package/docs/{ts-web-extras.browserhashprovider.hashstring.md → ts-web-extras.cryptoutils.browserhashprovider.hashstring.md} +2 -2
- package/docs/{ts-web-extras.browserhashprovider.md → ts-web-extras.cryptoutils.browserhashprovider.md} +4 -4
- package/docs/ts-web-extras.cryptoutils.createbrowsercryptoprovider.md +19 -0
- package/docs/ts-web-extras.cryptoutils.md +71 -0
- package/docs/ts-web-extras.fileapitreeaccessors.createfromlocalstorage.md +74 -0
- package/docs/ts-web-extras.fileapitreeaccessors.createpersistent.md +76 -0
- package/docs/ts-web-extras.fileapitreeaccessors.md +32 -0
- package/docs/ts-web-extras.filesystemaccesstreeaccessors._constructor_.md +114 -0
- package/docs/ts-web-extras.filesystemaccesstreeaccessors.fileismutable.md +52 -0
- package/docs/ts-web-extras.filesystemaccesstreeaccessors.fromdirectoryhandle.md +72 -0
- package/docs/ts-web-extras.filesystemaccesstreeaccessors.getdirtypaths.md +17 -0
- package/docs/ts-web-extras.filesystemaccesstreeaccessors.isdirty.md +17 -0
- package/docs/ts-web-extras.filesystemaccesstreeaccessors.md +159 -0
- package/docs/ts-web-extras.filesystemaccesstreeaccessors.savefilecontents.md +66 -0
- package/docs/ts-web-extras.filesystemaccesstreeaccessors.synctodisk.md +17 -0
- package/docs/ts-web-extras.ifilesystemaccesstreeparams.autosync.md +13 -0
- package/docs/ts-web-extras.ifilesystemaccesstreeparams.md +78 -0
- package/docs/ts-web-extras.ifilesystemaccesstreeparams.requirewritepermission.md +13 -0
- package/docs/ts-web-extras.ilocalstoragetreeparams.autosync.md +13 -0
- package/docs/ts-web-extras.ilocalstoragetreeparams.md +97 -0
- package/docs/ts-web-extras.ilocalstoragetreeparams.pathtokeymap.md +13 -0
- package/docs/ts-web-extras.ilocalstoragetreeparams.storage.md +13 -0
- package/docs/ts-web-extras.localstoragetreeaccessors.fileismutable.md +56 -0
- package/docs/ts-web-extras.localstoragetreeaccessors.fromstorage.md +56 -0
- package/docs/ts-web-extras.localstoragetreeaccessors.getdirtypaths.md +19 -0
- package/docs/ts-web-extras.localstoragetreeaccessors.isdirty.md +19 -0
- package/docs/ts-web-extras.localstoragetreeaccessors.md +131 -0
- package/docs/ts-web-extras.localstoragetreeaccessors.savefilecontents.md +72 -0
- package/docs/ts-web-extras.localstoragetreeaccessors.synctodisk.md +19 -0
- package/docs/ts-web-extras.md +50 -4
- package/etc/ts-web-extras.api.md +91 -1
- package/lib/index.d.ts +2 -1
- package/lib/index.d.ts.map +1 -1
- package/lib/index.js +25 -2
- package/lib/index.js.map +1 -1
- package/lib/packlets/crypto-utils/browserCryptoProvider.d.ts +77 -0
- package/lib/packlets/crypto-utils/browserCryptoProvider.d.ts.map +1 -0
- package/lib/packlets/crypto-utils/browserCryptoProvider.js +259 -0
- package/lib/packlets/crypto-utils/browserCryptoProvider.js.map +1 -0
- package/lib/packlets/crypto-utils/browserHashProvider.d.ts.map +1 -0
- package/lib/packlets/crypto-utils/browserHashProvider.js.map +1 -0
- package/lib/packlets/{crypto → crypto-utils}/index.d.ts +1 -0
- package/lib/packlets/crypto-utils/index.d.ts.map +1 -0
- package/lib/packlets/{crypto → crypto-utils}/index.js +1 -0
- package/lib/packlets/crypto-utils/index.js.map +1 -0
- package/lib/packlets/file-api-types/index.d.ts.map +1 -1
- package/lib/packlets/file-api-types/index.js +27 -3
- package/lib/packlets/file-api-types/index.js.map +1 -1
- package/lib/packlets/file-tree/directoryHandleStore.d.ts +59 -0
- package/lib/packlets/file-tree/directoryHandleStore.d.ts.map +1 -0
- package/lib/packlets/file-tree/directoryHandleStore.js +128 -0
- package/lib/packlets/file-tree/directoryHandleStore.js.map +1 -0
- package/lib/packlets/file-tree/fileApiTreeAccessors.d.ts +57 -0
- package/lib/packlets/file-tree/fileApiTreeAccessors.d.ts.map +1 -1
- package/lib/packlets/file-tree/fileApiTreeAccessors.js +76 -0
- package/lib/packlets/file-tree/fileApiTreeAccessors.js.map +1 -1
- package/lib/packlets/file-tree/fileSystemAccessTreeAccessors.d.ts +136 -0
- package/lib/packlets/file-tree/fileSystemAccessTreeAccessors.d.ts.map +1 -0
- package/lib/packlets/file-tree/fileSystemAccessTreeAccessors.js +349 -0
- package/lib/packlets/file-tree/fileSystemAccessTreeAccessors.js.map +1 -0
- package/lib/packlets/file-tree/index.d.ts +3 -0
- package/lib/packlets/file-tree/index.d.ts.map +1 -1
- package/lib/packlets/file-tree/index.js +3 -0
- package/lib/packlets/file-tree/index.js.map +1 -1
- package/lib/packlets/file-tree/localStorageTreeAccessors.d.ts +129 -0
- package/lib/packlets/file-tree/localStorageTreeAccessors.d.ts.map +1 -0
- package/lib/packlets/file-tree/localStorageTreeAccessors.js +312 -0
- package/lib/packlets/file-tree/localStorageTreeAccessors.js.map +1 -0
- package/lib/test/mocks/idb-keyval.d.ts +6 -0
- package/lib/test/mocks/idb-keyval.d.ts.map +1 -0
- package/lib/test/mocks/idb-keyval.js +9 -0
- package/lib/test/mocks/idb-keyval.js.map +1 -0
- package/lib/test/unit/browserHashProvider.test.js +21 -21
- package/lib/test/unit/browserHashProvider.test.js.map +1 -1
- package/lib/test/unit/directoryHandleStore.test.d.ts +2 -0
- package/lib/test/unit/directoryHandleStore.test.d.ts.map +1 -0
- package/lib/test/unit/directoryHandleStore.test.js +192 -0
- package/lib/test/unit/directoryHandleStore.test.js.map +1 -0
- package/lib/test/unit/fileApiTypes.test.js +30 -0
- package/lib/test/unit/fileApiTypes.test.js.map +1 -1
- package/lib/test/unit/fileSystemAccessTreeAccessors.test.d.ts +2 -0
- package/lib/test/unit/fileSystemAccessTreeAccessors.test.d.ts.map +1 -0
- package/lib/test/unit/fileSystemAccessTreeAccessors.test.js +519 -0
- package/lib/test/unit/fileSystemAccessTreeAccessors.test.js.map +1 -0
- package/lib/test/unit/localStorageTreeAccessors.test.d.ts +2 -0
- package/lib/test/unit/localStorageTreeAccessors.test.d.ts.map +1 -0
- package/lib/test/unit/localStorageTreeAccessors.test.js +597 -0
- package/lib/test/unit/localStorageTreeAccessors.test.js.map +1 -0
- package/lib/test/utils/fileSystemAccessMocks.d.ts +53 -0
- package/lib/test/utils/fileSystemAccessMocks.d.ts.map +1 -0
- package/lib/test/utils/fileSystemAccessMocks.js +277 -0
- package/lib/test/utils/fileSystemAccessMocks.js.map +1 -0
- package/package.json +27 -20
- package/rush-logs/ts-web-extras.build.cache.log +3 -1
- package/rush-logs/ts-web-extras.build.log +35 -25
- package/src/index.ts +2 -2
- package/src/packlets/crypto-utils/browserCryptoProvider.ts +311 -0
- package/src/packlets/{crypto → crypto-utils}/index.ts +1 -0
- package/src/packlets/file-api-types/index.ts +24 -3
- package/src/packlets/file-tree/directoryHandleStore.ts +136 -0
- package/src/packlets/file-tree/fileApiTreeAccessors.ts +90 -0
- package/src/packlets/file-tree/fileSystemAccessTreeAccessors.ts +427 -0
- package/src/packlets/file-tree/index.ts +3 -0
- package/src/packlets/file-tree/localStorageTreeAccessors.ts +377 -0
- package/src/test/mocks/idb-keyval.ts +5 -0
- package/src/test/unit/browserHashProvider.test.ts +1 -1
- package/src/test/unit/directoryHandleStore.test.ts +251 -0
- package/src/test/unit/fileApiTypes.test.ts +36 -0
- package/src/test/unit/fileSystemAccessTreeAccessors.test.ts +732 -0
- package/src/test/unit/localStorageTreeAccessors.test.ts +746 -0
- package/src/test/utils/fileSystemAccessMocks.ts +353 -0
- package/temp/build/typescript/ts_8nwakTlr.json +1 -0
- package/temp/coverage/crypto-utils/browserCryptoProvider.ts.html +1018 -0
- package/temp/coverage/{crypto → crypto-utils}/browserHashProvider.ts.html +3 -3
- package/temp/coverage/{lcov-report/crypto → crypto-utils}/index.html +21 -6
- package/temp/coverage/file-tree/directoryHandleStore.ts.html +493 -0
- package/temp/coverage/file-tree/fileApiTreeAccessors.ts.html +276 -6
- package/temp/coverage/file-tree/fileSystemAccessTreeAccessors.ts.html +1366 -0
- package/temp/coverage/file-tree/index.html +55 -10
- package/temp/coverage/file-tree/localStorageTreeAccessors.ts.html +1216 -0
- package/temp/coverage/helpers/fileTreeHelpers.ts.html +1 -1
- package/temp/coverage/helpers/index.html +1 -1
- package/temp/coverage/index.html +15 -15
- package/temp/coverage/lcov-report/crypto-utils/browserCryptoProvider.ts.html +1018 -0
- package/temp/coverage/lcov-report/{crypto → crypto-utils}/browserHashProvider.ts.html +3 -3
- package/temp/coverage/{crypto → lcov-report/crypto-utils}/index.html +21 -6
- package/temp/coverage/lcov-report/file-tree/directoryHandleStore.ts.html +493 -0
- package/temp/coverage/lcov-report/file-tree/fileApiTreeAccessors.ts.html +276 -6
- package/temp/coverage/lcov-report/file-tree/fileSystemAccessTreeAccessors.ts.html +1366 -0
- package/temp/coverage/lcov-report/file-tree/index.html +55 -10
- package/temp/coverage/lcov-report/file-tree/localStorageTreeAccessors.ts.html +1216 -0
- package/temp/coverage/lcov-report/helpers/fileTreeHelpers.ts.html +1 -1
- package/temp/coverage/lcov-report/helpers/index.html +1 -1
- package/temp/coverage/lcov-report/index.html +15 -15
- package/temp/coverage/lcov-report/url-utils/index.html +1 -1
- package/temp/coverage/lcov-report/url-utils/urlParams.ts.html +1 -1
- package/temp/coverage/lcov.info +2128 -451
- package/temp/coverage/url-utils/index.html +1 -1
- package/temp/coverage/url-utils/urlParams.ts.html +1 -1
- package/temp/test/jest/haste-map-7492f1b44480e0cdd1f220078fb3afd8-c8dd6c3430605adeb2f1cadf4f75e791-8c9336785555d572065b28c111982ba4 +0 -0
- package/temp/test/jest/perf-cache-7492f1b44480e0cdd1f220078fb3afd8-da39a3ee5e6b4b0d3255bfef95601890 +1 -1
- package/temp/ts-web-extras.api.json +3236 -385
- package/temp/ts-web-extras.api.md +91 -1
- package/dist/packlets/crypto/browserHashProvider.js.map +0 -1
- package/dist/packlets/crypto/index.js.map +0 -1
- package/lib/packlets/crypto/browserHashProvider.d.ts.map +0 -1
- package/lib/packlets/crypto/browserHashProvider.js.map +0 -1
- package/lib/packlets/crypto/index.d.ts.map +0 -1
- package/lib/packlets/crypto/index.js.map +0 -1
- package/temp/build/typescript/ts_vnCx6LlY.json +0 -1
- /package/dist/packlets/{crypto → crypto-utils}/browserHashProvider.js +0 -0
- /package/lib/packlets/{crypto → crypto-utils}/browserHashProvider.d.ts +0 -0
- /package/lib/packlets/{crypto → crypto-utils}/browserHashProvider.js +0 -0
- /package/src/packlets/{crypto → crypto-utils}/browserHashProvider.ts +0 -0
- /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) > [@fgv/ts-web-extras](./ts-web-extras.md) > [IFileSystemAccessTreeParams](./ts-web-extras.ifilesystemaccesstreeparams.md) > [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) > [@fgv/ts-web-extras](./ts-web-extras.md) > [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<TCT>
|
|
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) > [@fgv/ts-web-extras](./ts-web-extras.md) > [IFileSystemAccessTreeParams](./ts-web-extras.ifilesystemaccesstreeparams.md) > [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) > [@fgv/ts-web-extras](./ts-web-extras.md) > [ILocalStorageTreeParams](./ts-web-extras.ilocalstoragetreeparams.md) > [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) > [@fgv/ts-web-extras](./ts-web-extras.md) > [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<TCT>
|
|
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<string, string>
|
|
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) > [@fgv/ts-web-extras](./ts-web-extras.md) > [ILocalStorageTreeParams](./ts-web-extras.ilocalstoragetreeparams.md) > [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) > [@fgv/ts-web-extras](./ts-web-extras.md) > [ILocalStorageTreeParams](./ts-web-extras.ilocalstoragetreeparams.md) > [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) > [@fgv/ts-web-extras](./ts-web-extras.md) > [LocalStorageTreeAccessors](./ts-web-extras.localstoragetreeaccessors.md) > [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<boolean, FileTree.SaveDetail>
|
|
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) > [@fgv/ts-web-extras](./ts-web-extras.md) > [LocalStorageTreeAccessors](./ts-web-extras.localstoragetreeaccessors.md) > [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)<!-- --><TCT>
|
|
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<[LocalStorageTreeAccessors](./ts-web-extras.localstoragetreeaccessors.md)<!-- --><TCT>>
|
|
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) > [@fgv/ts-web-extras](./ts-web-extras.md) > [LocalStorageTreeAccessors](./ts-web-extras.localstoragetreeaccessors.md) > [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) > [@fgv/ts-web-extras](./ts-web-extras.md) > [LocalStorageTreeAccessors](./ts-web-extras.localstoragetreeaccessors.md) > [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) > [@fgv/ts-web-extras](./ts-web-extras.md) > [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<TCT>
|
|
19
|
+
|
|
20
|
+
**Implements:** FileTree.IPersistentFileTreeAccessors<TCT>
|
|
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) > [@fgv/ts-web-extras](./ts-web-extras.md) > [LocalStorageTreeAccessors](./ts-web-extras.localstoragetreeaccessors.md) > [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<string>
|
|
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) > [@fgv/ts-web-extras](./ts-web-extras.md) > [LocalStorageTreeAccessors](./ts-web-extras.localstoragetreeaccessors.md) > [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<Result<void>>
|
|
17
|
+
|
|
18
|
+
Result indicating success or failure
|
|
19
|
+
|