@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
|
@@ -25,28 +25,28 @@
|
|
|
25
25
|
<div class='fl pad1y space-right2'>
|
|
26
26
|
<span class="strong">100% </span>
|
|
27
27
|
<span class="quiet">Statements</span>
|
|
28
|
-
<span class='fraction'>
|
|
28
|
+
<span class='fraction'>510/510</span>
|
|
29
29
|
</div>
|
|
30
30
|
|
|
31
31
|
|
|
32
32
|
<div class='fl pad1y space-right2'>
|
|
33
33
|
<span class="strong">100% </span>
|
|
34
34
|
<span class="quiet">Branches</span>
|
|
35
|
-
<span class='fraction'>
|
|
35
|
+
<span class='fraction'>116/116</span>
|
|
36
36
|
</div>
|
|
37
37
|
|
|
38
38
|
|
|
39
39
|
<div class='fl pad1y space-right2'>
|
|
40
40
|
<span class="strong">100% </span>
|
|
41
41
|
<span class="quiet">Functions</span>
|
|
42
|
-
<span class='fraction'>
|
|
42
|
+
<span class='fraction'>15/15</span>
|
|
43
43
|
</div>
|
|
44
44
|
|
|
45
45
|
|
|
46
46
|
<div class='fl pad1y space-right2'>
|
|
47
47
|
<span class="strong">100% </span>
|
|
48
48
|
<span class="quiet">Lines</span>
|
|
49
|
-
<span class='fraction'>
|
|
49
|
+
<span class='fraction'>510/510</span>
|
|
50
50
|
</div>
|
|
51
51
|
|
|
52
52
|
|
|
@@ -483,7 +483,99 @@
|
|
|
483
483
|
<a name='L418'></a><a href='#L418'>418</a>
|
|
484
484
|
<a name='L419'></a><a href='#L419'>419</a>
|
|
485
485
|
<a name='L420'></a><a href='#L420'>420</a>
|
|
486
|
-
<a name='L421'></a><a href='#L421'>421</a
|
|
486
|
+
<a name='L421'></a><a href='#L421'>421</a>
|
|
487
|
+
<a name='L422'></a><a href='#L422'>422</a>
|
|
488
|
+
<a name='L423'></a><a href='#L423'>423</a>
|
|
489
|
+
<a name='L424'></a><a href='#L424'>424</a>
|
|
490
|
+
<a name='L425'></a><a href='#L425'>425</a>
|
|
491
|
+
<a name='L426'></a><a href='#L426'>426</a>
|
|
492
|
+
<a name='L427'></a><a href='#L427'>427</a>
|
|
493
|
+
<a name='L428'></a><a href='#L428'>428</a>
|
|
494
|
+
<a name='L429'></a><a href='#L429'>429</a>
|
|
495
|
+
<a name='L430'></a><a href='#L430'>430</a>
|
|
496
|
+
<a name='L431'></a><a href='#L431'>431</a>
|
|
497
|
+
<a name='L432'></a><a href='#L432'>432</a>
|
|
498
|
+
<a name='L433'></a><a href='#L433'>433</a>
|
|
499
|
+
<a name='L434'></a><a href='#L434'>434</a>
|
|
500
|
+
<a name='L435'></a><a href='#L435'>435</a>
|
|
501
|
+
<a name='L436'></a><a href='#L436'>436</a>
|
|
502
|
+
<a name='L437'></a><a href='#L437'>437</a>
|
|
503
|
+
<a name='L438'></a><a href='#L438'>438</a>
|
|
504
|
+
<a name='L439'></a><a href='#L439'>439</a>
|
|
505
|
+
<a name='L440'></a><a href='#L440'>440</a>
|
|
506
|
+
<a name='L441'></a><a href='#L441'>441</a>
|
|
507
|
+
<a name='L442'></a><a href='#L442'>442</a>
|
|
508
|
+
<a name='L443'></a><a href='#L443'>443</a>
|
|
509
|
+
<a name='L444'></a><a href='#L444'>444</a>
|
|
510
|
+
<a name='L445'></a><a href='#L445'>445</a>
|
|
511
|
+
<a name='L446'></a><a href='#L446'>446</a>
|
|
512
|
+
<a name='L447'></a><a href='#L447'>447</a>
|
|
513
|
+
<a name='L448'></a><a href='#L448'>448</a>
|
|
514
|
+
<a name='L449'></a><a href='#L449'>449</a>
|
|
515
|
+
<a name='L450'></a><a href='#L450'>450</a>
|
|
516
|
+
<a name='L451'></a><a href='#L451'>451</a>
|
|
517
|
+
<a name='L452'></a><a href='#L452'>452</a>
|
|
518
|
+
<a name='L453'></a><a href='#L453'>453</a>
|
|
519
|
+
<a name='L454'></a><a href='#L454'>454</a>
|
|
520
|
+
<a name='L455'></a><a href='#L455'>455</a>
|
|
521
|
+
<a name='L456'></a><a href='#L456'>456</a>
|
|
522
|
+
<a name='L457'></a><a href='#L457'>457</a>
|
|
523
|
+
<a name='L458'></a><a href='#L458'>458</a>
|
|
524
|
+
<a name='L459'></a><a href='#L459'>459</a>
|
|
525
|
+
<a name='L460'></a><a href='#L460'>460</a>
|
|
526
|
+
<a name='L461'></a><a href='#L461'>461</a>
|
|
527
|
+
<a name='L462'></a><a href='#L462'>462</a>
|
|
528
|
+
<a name='L463'></a><a href='#L463'>463</a>
|
|
529
|
+
<a name='L464'></a><a href='#L464'>464</a>
|
|
530
|
+
<a name='L465'></a><a href='#L465'>465</a>
|
|
531
|
+
<a name='L466'></a><a href='#L466'>466</a>
|
|
532
|
+
<a name='L467'></a><a href='#L467'>467</a>
|
|
533
|
+
<a name='L468'></a><a href='#L468'>468</a>
|
|
534
|
+
<a name='L469'></a><a href='#L469'>469</a>
|
|
535
|
+
<a name='L470'></a><a href='#L470'>470</a>
|
|
536
|
+
<a name='L471'></a><a href='#L471'>471</a>
|
|
537
|
+
<a name='L472'></a><a href='#L472'>472</a>
|
|
538
|
+
<a name='L473'></a><a href='#L473'>473</a>
|
|
539
|
+
<a name='L474'></a><a href='#L474'>474</a>
|
|
540
|
+
<a name='L475'></a><a href='#L475'>475</a>
|
|
541
|
+
<a name='L476'></a><a href='#L476'>476</a>
|
|
542
|
+
<a name='L477'></a><a href='#L477'>477</a>
|
|
543
|
+
<a name='L478'></a><a href='#L478'>478</a>
|
|
544
|
+
<a name='L479'></a><a href='#L479'>479</a>
|
|
545
|
+
<a name='L480'></a><a href='#L480'>480</a>
|
|
546
|
+
<a name='L481'></a><a href='#L481'>481</a>
|
|
547
|
+
<a name='L482'></a><a href='#L482'>482</a>
|
|
548
|
+
<a name='L483'></a><a href='#L483'>483</a>
|
|
549
|
+
<a name='L484'></a><a href='#L484'>484</a>
|
|
550
|
+
<a name='L485'></a><a href='#L485'>485</a>
|
|
551
|
+
<a name='L486'></a><a href='#L486'>486</a>
|
|
552
|
+
<a name='L487'></a><a href='#L487'>487</a>
|
|
553
|
+
<a name='L488'></a><a href='#L488'>488</a>
|
|
554
|
+
<a name='L489'></a><a href='#L489'>489</a>
|
|
555
|
+
<a name='L490'></a><a href='#L490'>490</a>
|
|
556
|
+
<a name='L491'></a><a href='#L491'>491</a>
|
|
557
|
+
<a name='L492'></a><a href='#L492'>492</a>
|
|
558
|
+
<a name='L493'></a><a href='#L493'>493</a>
|
|
559
|
+
<a name='L494'></a><a href='#L494'>494</a>
|
|
560
|
+
<a name='L495'></a><a href='#L495'>495</a>
|
|
561
|
+
<a name='L496'></a><a href='#L496'>496</a>
|
|
562
|
+
<a name='L497'></a><a href='#L497'>497</a>
|
|
563
|
+
<a name='L498'></a><a href='#L498'>498</a>
|
|
564
|
+
<a name='L499'></a><a href='#L499'>499</a>
|
|
565
|
+
<a name='L500'></a><a href='#L500'>500</a>
|
|
566
|
+
<a name='L501'></a><a href='#L501'>501</a>
|
|
567
|
+
<a name='L502'></a><a href='#L502'>502</a>
|
|
568
|
+
<a name='L503'></a><a href='#L503'>503</a>
|
|
569
|
+
<a name='L504'></a><a href='#L504'>504</a>
|
|
570
|
+
<a name='L505'></a><a href='#L505'>505</a>
|
|
571
|
+
<a name='L506'></a><a href='#L506'>506</a>
|
|
572
|
+
<a name='L507'></a><a href='#L507'>507</a>
|
|
573
|
+
<a name='L508'></a><a href='#L508'>508</a>
|
|
574
|
+
<a name='L509'></a><a href='#L509'>509</a>
|
|
575
|
+
<a name='L510'></a><a href='#L510'>510</a>
|
|
576
|
+
<a name='L511'></a><a href='#L511'>511</a></td><td class="line-coverage quiet"><span class="cline-any cline-yes">1x</span>
|
|
577
|
+
<span class="cline-any cline-yes">1x</span>
|
|
578
|
+
<span class="cline-any cline-yes">1x</span>
|
|
487
579
|
<span class="cline-any cline-yes">1x</span>
|
|
488
580
|
<span class="cline-any cline-yes">1x</span>
|
|
489
581
|
<span class="cline-any cline-yes">1x</span>
|
|
@@ -593,6 +685,94 @@
|
|
|
593
685
|
<span class="cline-any cline-yes">1x</span>
|
|
594
686
|
<span class="cline-any cline-yes">1x</span>
|
|
595
687
|
<span class="cline-any cline-yes">1x</span>
|
|
688
|
+
<span class="cline-any cline-yes">1x</span>
|
|
689
|
+
<span class="cline-any cline-yes">1x</span>
|
|
690
|
+
<span class="cline-any cline-yes">1x</span>
|
|
691
|
+
<span class="cline-any cline-yes">1x</span>
|
|
692
|
+
<span class="cline-any cline-yes">1x</span>
|
|
693
|
+
<span class="cline-any cline-yes">1x</span>
|
|
694
|
+
<span class="cline-any cline-yes">1x</span>
|
|
695
|
+
<span class="cline-any cline-yes">1x</span>
|
|
696
|
+
<span class="cline-any cline-yes">1x</span>
|
|
697
|
+
<span class="cline-any cline-yes">3x</span>
|
|
698
|
+
<span class="cline-any cline-yes">3x</span>
|
|
699
|
+
<span class="cline-any cline-yes">3x</span>
|
|
700
|
+
<span class="cline-any cline-yes">3x</span>
|
|
701
|
+
<span class="cline-any cline-yes">3x</span>
|
|
702
|
+
<span class="cline-any cline-yes">1x</span>
|
|
703
|
+
<span class="cline-any cline-yes">1x</span>
|
|
704
|
+
<span class="cline-any cline-yes">2x</span>
|
|
705
|
+
<span class="cline-any cline-yes">2x</span>
|
|
706
|
+
<span class="cline-any cline-yes">2x</span>
|
|
707
|
+
<span class="cline-any cline-yes">1x</span>
|
|
708
|
+
<span class="cline-any cline-yes">1x</span>
|
|
709
|
+
<span class="cline-any cline-yes">1x</span>
|
|
710
|
+
<span class="cline-any cline-yes">1x</span>
|
|
711
|
+
<span class="cline-any cline-yes">1x</span>
|
|
712
|
+
<span class="cline-any cline-yes">1x</span>
|
|
713
|
+
<span class="cline-any cline-yes">1x</span>
|
|
714
|
+
<span class="cline-any cline-yes">1x</span>
|
|
715
|
+
<span class="cline-any cline-yes">1x</span>
|
|
716
|
+
<span class="cline-any cline-yes">1x</span>
|
|
717
|
+
<span class="cline-any cline-yes">1x</span>
|
|
718
|
+
<span class="cline-any cline-yes">1x</span>
|
|
719
|
+
<span class="cline-any cline-yes">2x</span>
|
|
720
|
+
<span class="cline-any cline-yes">2x</span>
|
|
721
|
+
<span class="cline-any cline-yes">2x</span>
|
|
722
|
+
<span class="cline-any cline-yes">2x</span>
|
|
723
|
+
<span class="cline-any cline-yes">2x</span>
|
|
724
|
+
<span class="cline-any cline-yes">1x</span>
|
|
725
|
+
<span class="cline-any cline-yes">1x</span>
|
|
726
|
+
<span class="cline-any cline-yes">1x</span>
|
|
727
|
+
<span class="cline-any cline-yes">1x</span>
|
|
728
|
+
<span class="cline-any cline-yes">1x</span>
|
|
729
|
+
<span class="cline-any cline-yes">1x</span>
|
|
730
|
+
<span class="cline-any cline-yes">1x</span>
|
|
731
|
+
<span class="cline-any cline-yes">1x</span>
|
|
732
|
+
<span class="cline-any cline-yes">1x</span>
|
|
733
|
+
<span class="cline-any cline-yes">1x</span>
|
|
734
|
+
<span class="cline-any cline-yes">1x</span>
|
|
735
|
+
<span class="cline-any cline-yes">1x</span>
|
|
736
|
+
<span class="cline-any cline-yes">1x</span>
|
|
737
|
+
<span class="cline-any cline-yes">1x</span>
|
|
738
|
+
<span class="cline-any cline-yes">1x</span>
|
|
739
|
+
<span class="cline-any cline-yes">1x</span>
|
|
740
|
+
<span class="cline-any cline-yes">1x</span>
|
|
741
|
+
<span class="cline-any cline-yes">1x</span>
|
|
742
|
+
<span class="cline-any cline-yes">1x</span>
|
|
743
|
+
<span class="cline-any cline-yes">1x</span>
|
|
744
|
+
<span class="cline-any cline-yes">1x</span>
|
|
745
|
+
<span class="cline-any cline-yes">1x</span>
|
|
746
|
+
<span class="cline-any cline-yes">1x</span>
|
|
747
|
+
<span class="cline-any cline-yes">1x</span>
|
|
748
|
+
<span class="cline-any cline-yes">1x</span>
|
|
749
|
+
<span class="cline-any cline-yes">1x</span>
|
|
750
|
+
<span class="cline-any cline-yes">1x</span>
|
|
751
|
+
<span class="cline-any cline-yes">1x</span>
|
|
752
|
+
<span class="cline-any cline-yes">1x</span>
|
|
753
|
+
<span class="cline-any cline-yes">1x</span>
|
|
754
|
+
<span class="cline-any cline-yes">1x</span>
|
|
755
|
+
<span class="cline-any cline-yes">1x</span>
|
|
756
|
+
<span class="cline-any cline-yes">1x</span>
|
|
757
|
+
<span class="cline-any cline-yes">1x</span>
|
|
758
|
+
<span class="cline-any cline-yes">4x</span>
|
|
759
|
+
<span class="cline-any cline-yes">4x</span>
|
|
760
|
+
<span class="cline-any cline-yes">4x</span>
|
|
761
|
+
<span class="cline-any cline-yes">1x</span>
|
|
762
|
+
<span class="cline-any cline-yes">1x</span>
|
|
763
|
+
<span class="cline-any cline-yes">1x</span>
|
|
764
|
+
<span class="cline-any cline-yes">1x</span>
|
|
765
|
+
<span class="cline-any cline-yes">3x</span>
|
|
766
|
+
<span class="cline-any cline-yes">3x</span>
|
|
767
|
+
<span class="cline-any cline-yes">3x</span>
|
|
768
|
+
<span class="cline-any cline-yes">1x</span>
|
|
769
|
+
<span class="cline-any cline-yes">1x</span>
|
|
770
|
+
<span class="cline-any cline-yes">1x</span>
|
|
771
|
+
<span class="cline-any cline-yes">1x</span>
|
|
772
|
+
<span class="cline-any cline-yes">1x</span>
|
|
773
|
+
<span class="cline-any cline-yes">1x</span>
|
|
774
|
+
<span class="cline-any cline-yes">1x</span>
|
|
775
|
+
<span class="cline-any cline-yes">1x</span>
|
|
596
776
|
<span class="cline-any cline-yes">44x</span>
|
|
597
777
|
<span class="cline-any cline-yes">44x</span>
|
|
598
778
|
<span class="cline-any cline-yes">44x</span>
|
|
@@ -934,6 +1114,8 @@ import {
|
|
|
934
1114
|
FileSystemFileHandle,
|
|
935
1115
|
FileSystemDirectoryHandle
|
|
936
1116
|
} from '../file-api-types';
|
|
1117
|
+
import { FileSystemAccessTreeAccessors, IFileSystemAccessTreeParams } from './fileSystemAccessTreeAccessors';
|
|
1118
|
+
import { LocalStorageTreeAccessors, ILocalStorageTreeParams } from './localStorageTreeAccessors';
|
|
937
1119
|
|
|
938
1120
|
/**
|
|
939
1121
|
* Interface for File objects that may have the webkitRelativePath property.
|
|
@@ -1006,6 +1188,94 @@ export interface IFileMetadata {
|
|
|
1006
1188
|
* @public
|
|
1007
1189
|
*/
|
|
1008
1190
|
export class FileApiTreeAccessors<TCT extends string = string> {
|
|
1191
|
+
/**
|
|
1192
|
+
* Create a persistent FileTree from a File System Access API directory handle.
|
|
1193
|
+
* Changes to files can be synced back to disk.
|
|
1194
|
+
*
|
|
1195
|
+
* @param dirHandle - FileSystemDirectoryHandle to load files from
|
|
1196
|
+
* @param params - Optional parameters including autoSync and permission settings
|
|
1197
|
+
* @returns Promise resolving to a FileTree with persistence capability
|
|
1198
|
+
*
|
|
1199
|
+
* @remarks
|
|
1200
|
+
* - Only works in browsers supporting File System Access API (Chrome, Edge, Opera)
|
|
1201
|
+
* - Requires 'readwrite' permission on the directory handle
|
|
1202
|
+
* - Falls back to read-only mode if permissions unavailable (unless requireWritePermission is true)
|
|
1203
|
+
*
|
|
1204
|
+
* @public
|
|
1205
|
+
*/
|
|
1206
|
+
public static async createPersistent<TCT extends string = string>(
|
|
1207
|
+
dirHandle: FileSystemDirectoryHandle,
|
|
1208
|
+
params?: IFileSystemAccessTreeParams<TCT>
|
|
1209
|
+
): Promise<Result<FileTree.FileTree<TCT>>> {
|
|
1210
|
+
const accessorsResult = await FileSystemAccessTreeAccessors.fromDirectoryHandle<TCT>(dirHandle, params);
|
|
1211
|
+
if (accessorsResult.isFailure()) {
|
|
1212
|
+
return fail(accessorsResult.message);
|
|
1213
|
+
}
|
|
1214
|
+
|
|
1215
|
+
return FileTree.FileTree.create<TCT>(accessorsResult.value);
|
|
1216
|
+
}
|
|
1217
|
+
|
|
1218
|
+
/**
|
|
1219
|
+
* Create a persistent FileTree from a single File System Access API file handle.
|
|
1220
|
+
* The tree contains exactly one file at `/<filename>`.
|
|
1221
|
+
* Changes can be synced back to the original file via `syncToDisk()`.
|
|
1222
|
+
*
|
|
1223
|
+
* @param fileHandle - FileSystemFileHandle to load
|
|
1224
|
+
* @param params - Optional parameters including autoSync and permission settings
|
|
1225
|
+
* @returns Promise resolving to a FileTree with persistence capability
|
|
1226
|
+
* @public
|
|
1227
|
+
*/
|
|
1228
|
+
public static async createPersistentFromFile<TCT extends string = string>(
|
|
1229
|
+
fileHandle: FileSystemFileHandle,
|
|
1230
|
+
params?: IFileSystemAccessTreeParams<TCT>
|
|
1231
|
+
): Promise<Result<FileTree.FileTree<TCT>>> {
|
|
1232
|
+
const accessorsResult = await FileSystemAccessTreeAccessors.fromFileHandle<TCT>(fileHandle, params);
|
|
1233
|
+
if (accessorsResult.isFailure()) {
|
|
1234
|
+
return fail(accessorsResult.message);
|
|
1235
|
+
}
|
|
1236
|
+
|
|
1237
|
+
return FileTree.FileTree.create<TCT>(accessorsResult.value);
|
|
1238
|
+
}
|
|
1239
|
+
|
|
1240
|
+
/**
|
|
1241
|
+
* Create a persistent FileTree from browser localStorage.
|
|
1242
|
+
* Changes to files can be synced back to localStorage.
|
|
1243
|
+
*
|
|
1244
|
+
* @param params - Configuration including path-to-key mappings and optional autoSync
|
|
1245
|
+
* @returns Result containing a FileTree with persistence capability
|
|
1246
|
+
*
|
|
1247
|
+
* @remarks
|
|
1248
|
+
* - Works in all browsers with localStorage support
|
|
1249
|
+
* - Maps directory paths to localStorage keys
|
|
1250
|
+
* - Each key stores multiple collections as JSON
|
|
1251
|
+
* - Files are automatically discovered from storage
|
|
1252
|
+
*
|
|
1253
|
+
* @example
|
|
1254
|
+
* ```typescript
|
|
1255
|
+
* const tree = FileApiTreeAccessors.createFromLocalStorage({
|
|
1256
|
+
* pathToKeyMap: {
|
|
1257
|
+
* '/data/ingredients': 'myapp:ingredients:v1',
|
|
1258
|
+
* '/data/fillings': 'myapp:fillings:v1'
|
|
1259
|
+
* },
|
|
1260
|
+
* mutable: true,
|
|
1261
|
+
* autoSync: false
|
|
1262
|
+
* });
|
|
1263
|
+
* ```
|
|
1264
|
+
*
|
|
1265
|
+
* @public
|
|
1266
|
+
*/
|
|
1267
|
+
public static createFromLocalStorage<TCT extends string = string>(
|
|
1268
|
+
params: ILocalStorageTreeParams<TCT>
|
|
1269
|
+
): Result<FileTree.FileTree<TCT>> {
|
|
1270
|
+
const accessorsResult = LocalStorageTreeAccessors.fromStorage<TCT>(params);
|
|
1271
|
+
/* c8 ignore next 3 - coverage intermittently missed in full suite */
|
|
1272
|
+
if (accessorsResult.isFailure()) {
|
|
1273
|
+
return fail(accessorsResult.message);
|
|
1274
|
+
}
|
|
1275
|
+
|
|
1276
|
+
return FileTree.FileTree.create<TCT>(accessorsResult.value);
|
|
1277
|
+
}
|
|
1278
|
+
|
|
1009
1279
|
/**
|
|
1010
1280
|
* Create FileTree from various file sources using TreeInitializer array.
|
|
1011
1281
|
* @param initializers - Array of TreeInitializer objects specifying file sources
|
|
@@ -1330,7 +1600,7 @@ export class FileApiTreeAccessors<TCT extends string = string> {
|
|
|
1330
1600
|
<div class='footer quiet pad2 space-top1 center small'>
|
|
1331
1601
|
Code coverage generated by
|
|
1332
1602
|
<a href="https://istanbul.js.org/" target="_blank" rel="noopener noreferrer">istanbul</a>
|
|
1333
|
-
at
|
|
1603
|
+
at 2026-03-09T21:03:54.408Z
|
|
1334
1604
|
</div>
|
|
1335
1605
|
<script src="../prettify.js"></script>
|
|
1336
1606
|
<script>
|