@fgv/ts-web-extras 5.0.2 → 5.1.0-1
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/chunked-rush-logs/ts-web-extras.build.chunks.jsonl +58 -25
- package/.rush/temp/chunked-rush-logs/ts-web-extras.test.chunks.jsonl +70 -0
- package/.rush/temp/operation/build/all.log +58 -25
- package/.rush/temp/operation/build/error.log +18 -0
- package/.rush/temp/operation/build/log-chunks.jsonl +58 -25
- package/.rush/temp/operation/build/state.json +1 -1
- package/.rush/temp/operation/test/all.log +70 -0
- package/.rush/temp/operation/test/error.log +16 -0
- package/.rush/temp/operation/test/log-chunks.jsonl +70 -0
- package/.rush/temp/operation/test/state.json +3 -0
- 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 +91 -0
- package/dist/packlets/file-tree/fileApiTreeAccessors.js.map +1 -1
- package/dist/packlets/file-tree/fileSystemAccessTreeAccessors.js +414 -0
- package/dist/packlets/file-tree/fileSystemAccessTreeAccessors.js.map +1 -0
- package/dist/packlets/file-tree/httpTreeAccessors.js +279 -0
- package/dist/packlets/file-tree/httpTreeAccessors.js.map +1 -0
- package/dist/packlets/file-tree/index.js +4 -0
- package/dist/packlets/file-tree/index.js.map +1 -1
- package/dist/packlets/file-tree/localStorageTreeAccessors.js +359 -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/fileApiTreeAccessors.test.js +51 -0
- package/dist/test/unit/fileApiTreeAccessors.test.js.map +1 -1
- 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 +622 -0
- package/dist/test/unit/fileSystemAccessTreeAccessors.test.js.map +1 -0
- package/dist/test/unit/httpTreeAccessors.test.js +1000 -0
- package/dist/test/unit/httpTreeAccessors.test.js.map +1 -0
- package/dist/test/unit/localStorageTreeAccessors.test.js +812 -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 +584 -1
- package/dist/tsdoc-metadata.json +1 -1
- package/docs/@fgv/namespaces/CryptoUtils/README.md +18 -0
- package/docs/@fgv/namespaces/CryptoUtils/classes/BrowserCryptoProvider.md +203 -0
- package/docs/@fgv/namespaces/CryptoUtils/classes/BrowserHashProvider.md +63 -0
- package/docs/@fgv/namespaces/CryptoUtils/functions/createBrowserCryptoProvider.md +18 -0
- package/docs/@fgv/namespaces/FileTreeHelpers/README.md +19 -0
- package/docs/@fgv/namespaces/FileTreeHelpers/functions/extractFileListMetadata.md +23 -0
- package/docs/@fgv/namespaces/FileTreeHelpers/functions/extractFileMetadata.md +23 -0
- package/docs/@fgv/namespaces/FileTreeHelpers/functions/fromDirectoryUpload.md +33 -0
- package/docs/@fgv/namespaces/FileTreeHelpers/functions/fromFileList.md +33 -0
- package/docs/@fgv/namespaces/FileTreeHelpers/functions/getOriginalFile.md +25 -0
- package/docs/@fgv/namespaces/FileTreeHelpers/variables/defaultFileApiTreeInitParams.md +11 -0
- package/docs/README.md +78 -0
- package/docs/classes/DirectoryHandleStore.md +116 -0
- package/docs/classes/FileApiTreeAccessors.md +286 -0
- package/docs/classes/FileSystemAccessTreeAccessors.md +557 -0
- package/docs/classes/HttpTreeAccessors.md +508 -0
- package/docs/classes/LocalStorageTreeAccessors.md +520 -0
- package/docs/functions/exportAsJson.md +23 -0
- package/docs/functions/exportUsingFileSystemAPI.md +26 -0
- package/docs/functions/extractDirectoryPath.md +23 -0
- package/docs/functions/isDirectoryHandle.md +23 -0
- package/docs/functions/isFileHandle.md +23 -0
- package/docs/functions/isFilePath.md +21 -0
- package/docs/functions/parseContextFilter.md +22 -0
- package/docs/functions/parseQualifierDefaults.md +22 -0
- package/docs/functions/parseResourceTypes.md +22 -0
- package/docs/functions/parseUrlParameters.md +15 -0
- package/docs/functions/safeShowDirectoryPicker.md +24 -0
- package/docs/functions/safeShowOpenFilePicker.md +24 -0
- package/docs/functions/safeShowSaveFilePicker.md +24 -0
- package/docs/functions/supportsFileSystemAccess.md +23 -0
- package/docs/interfaces/FilePickerAcceptType.md +16 -0
- package/docs/interfaces/FileSystemCreateWritableOptions.md +15 -0
- package/docs/interfaces/FileSystemDirectoryHandle.md +187 -0
- package/docs/interfaces/FileSystemFileHandle.md +106 -0
- package/docs/interfaces/FileSystemGetDirectoryOptions.md +15 -0
- package/docs/interfaces/FileSystemGetFileOptions.md +15 -0
- package/docs/interfaces/FileSystemHandle.md +69 -0
- package/docs/interfaces/FileSystemHandlePermissionDescriptor.md +15 -0
- package/docs/interfaces/FileSystemRemoveOptions.md +15 -0
- package/docs/interfaces/FileSystemWritableFileStream.md +127 -0
- package/docs/interfaces/IDirectoryHandleTreeInitializer.md +17 -0
- package/docs/interfaces/IFileHandleTreeInitializer.md +16 -0
- package/docs/interfaces/IFileListTreeInitializer.md +15 -0
- package/docs/interfaces/IFileMetadata.md +19 -0
- package/docs/interfaces/IFileSystemAccessTreeParams.md +30 -0
- package/docs/interfaces/IFsAccessApis.md +57 -0
- package/docs/interfaces/IHttpTreeParams.md +32 -0
- package/docs/interfaces/ILocalStorageTreeParams.md +30 -0
- package/docs/interfaces/IUrlConfigOptions.md +27 -0
- package/docs/interfaces/ShowDirectoryPickerOptions.md +17 -0
- package/docs/interfaces/ShowOpenFilePickerOptions.md +19 -0
- package/docs/interfaces/ShowSaveFilePickerOptions.md +19 -0
- package/docs/type-aliases/TreeInitializer.md +11 -0
- package/docs/type-aliases/WellKnownDirectory.md +11 -0
- package/docs/type-aliases/WindowWithFsAccess.md +11 -0
- package/docs/variables/DEFAULT_DIRECTORY_HANDLE_DB.md +11 -0
- package/docs/variables/DEFAULT_DIRECTORY_HANDLE_STORE.md +11 -0
- package/etc/ts-web-extras.api.md +124 -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 +66 -0
- package/lib/packlets/file-tree/fileApiTreeAccessors.d.ts.map +1 -1
- package/lib/packlets/file-tree/fileApiTreeAccessors.js +91 -0
- package/lib/packlets/file-tree/fileApiTreeAccessors.js.map +1 -1
- package/lib/packlets/file-tree/fileSystemAccessTreeAccessors.d.ts +152 -0
- package/lib/packlets/file-tree/fileSystemAccessTreeAccessors.d.ts.map +1 -0
- package/lib/packlets/file-tree/fileSystemAccessTreeAccessors.js +418 -0
- package/lib/packlets/file-tree/fileSystemAccessTreeAccessors.js.map +1 -0
- package/lib/packlets/file-tree/httpTreeAccessors.d.ts +88 -0
- package/lib/packlets/file-tree/httpTreeAccessors.d.ts.map +1 -0
- package/lib/packlets/file-tree/httpTreeAccessors.js +283 -0
- package/lib/packlets/file-tree/httpTreeAccessors.js.map +1 -0
- package/lib/packlets/file-tree/index.d.ts +4 -0
- package/lib/packlets/file-tree/index.d.ts.map +1 -1
- package/lib/packlets/file-tree/index.js +4 -0
- package/lib/packlets/file-tree/index.js.map +1 -1
- package/lib/packlets/file-tree/localStorageTreeAccessors.d.ts +141 -0
- package/lib/packlets/file-tree/localStorageTreeAccessors.d.ts.map +1 -0
- package/lib/packlets/file-tree/localStorageTreeAccessors.js +363 -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/fileApiTreeAccessors.test.js +51 -0
- package/lib/test/unit/fileApiTreeAccessors.test.js.map +1 -1
- 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 +624 -0
- package/lib/test/unit/fileSystemAccessTreeAccessors.test.js.map +1 -0
- package/lib/test/unit/httpTreeAccessors.test.d.ts +2 -0
- package/lib/test/unit/httpTreeAccessors.test.d.ts.map +1 -0
- package/lib/test/unit/httpTreeAccessors.test.js +1002 -0
- package/lib/test/unit/httpTreeAccessors.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 +814 -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 +41 -34
- package/rush-logs/ts-web-extras.build.cache.log +0 -1
- package/rush-logs/ts-web-extras.build.error.log +18 -0
- package/rush-logs/ts-web-extras.build.log +58 -25
- package/rush-logs/ts-web-extras.test.cache.log +1 -0
- package/rush-logs/ts-web-extras.test.error.log +16 -0
- package/rush-logs/ts-web-extras.test.log +70 -0
- 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 +108 -0
- package/src/packlets/file-tree/fileSystemAccessTreeAccessors.ts +519 -0
- package/src/packlets/file-tree/httpTreeAccessors.ts +381 -0
- package/src/packlets/file-tree/index.ts +4 -0
- package/src/packlets/file-tree/localStorageTreeAccessors.ts +430 -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/fileApiTreeAccessors.test.ts +69 -0
- package/src/test/unit/fileApiTypes.test.ts +36 -0
- package/src/test/unit/fileSystemAccessTreeAccessors.test.ts +885 -0
- package/src/test/unit/httpTreeAccessors.test.ts +1278 -0
- package/src/test/unit/localStorageTreeAccessors.test.ts +1014 -0
- package/src/test/utils/fileSystemAccessMocks.ts +353 -0
- package/temp/build/typescript/ts_8nwakTlr.json +1 -0
- package/temp/coverage/crypto/browserHashProvider.ts.html +1 -1
- package/temp/coverage/crypto/index.html +1 -1
- package/temp/coverage/crypto-utils/browserCryptoProvider.ts.html +1018 -0
- package/temp/coverage/crypto-utils/browserHashProvider.ts.html +304 -0
- package/temp/coverage/crypto-utils/index.html +131 -0
- package/temp/coverage/file-tree/directoryHandleStore.ts.html +493 -0
- package/temp/coverage/file-tree/fileApiTreeAccessors.ts.html +330 -6
- package/temp/coverage/file-tree/fileSystemAccessTreeAccessors.ts.html +1642 -0
- package/temp/coverage/file-tree/httpTreeAccessors.ts.html +1228 -0
- package/temp/coverage/file-tree/index.html +69 -9
- package/temp/coverage/file-tree/localStorageTreeAccessors.ts.html +1375 -0
- package/temp/coverage/helpers/fileTreeHelpers.ts.html +1 -1
- package/temp/coverage/helpers/index.html +1 -1
- package/temp/coverage/index.html +13 -13
- package/temp/coverage/lcov-report/crypto/browserHashProvider.ts.html +1 -1
- package/temp/coverage/lcov-report/crypto/index.html +1 -1
- package/temp/coverage/lcov-report/crypto-utils/browserCryptoProvider.ts.html +1018 -0
- package/temp/coverage/lcov-report/crypto-utils/browserHashProvider.ts.html +304 -0
- package/temp/coverage/lcov-report/crypto-utils/index.html +131 -0
- package/temp/coverage/lcov-report/file-tree/directoryHandleStore.ts.html +493 -0
- package/temp/coverage/lcov-report/file-tree/fileApiTreeAccessors.ts.html +330 -6
- package/temp/coverage/lcov-report/file-tree/fileSystemAccessTreeAccessors.ts.html +1642 -0
- package/temp/coverage/lcov-report/file-tree/httpTreeAccessors.ts.html +1228 -0
- package/temp/coverage/lcov-report/file-tree/index.html +69 -9
- package/temp/coverage/lcov-report/file-tree/localStorageTreeAccessors.ts.html +1375 -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 +13 -13
- 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 +2829 -428
- 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-b931e4e63102f86c5bd4949f7dced44f-9d713eb41149188b4e5c0ae3d86d0a57-2ad8e16b24e391b8cdbe50b55c137169 +0 -0
- package/temp/test/jest/perf-cache-b931e4e63102f86c5bd4949f7dced44f-da39a3ee5e6b4b0d3255bfef95601890 +1 -0
- package/temp/ts-web-extras.api.json +5282 -1472
- package/temp/ts-web-extras.api.md +124 -1
- package/dist/packlets/crypto/browserHashProvider.js.map +0 -1
- package/dist/packlets/crypto/index.js.map +0 -1
- package/docs/index.md +0 -34
- package/docs/ts-web-extras.browserhashprovider.hashparts.md +0 -88
- package/docs/ts-web-extras.browserhashprovider.hashstring.md +0 -72
- package/docs/ts-web-extras.browserhashprovider.md +0 -66
- package/docs/ts-web-extras.exportasjson.md +0 -70
- package/docs/ts-web-extras.exportusingfilesystemapi.md +0 -104
- package/docs/ts-web-extras.extractdirectorypath.md +0 -52
- package/docs/ts-web-extras.fileapitreeaccessors.create.md +0 -72
- package/docs/ts-web-extras.fileapitreeaccessors.extractfilemetadata.md +0 -54
- package/docs/ts-web-extras.fileapitreeaccessors.fromdirectoryupload.md +0 -72
- package/docs/ts-web-extras.fileapitreeaccessors.fromfilelist.md +0 -72
- package/docs/ts-web-extras.fileapitreeaccessors.getoriginalfile.md +0 -72
- package/docs/ts-web-extras.fileapitreeaccessors.md +0 -114
- package/docs/ts-web-extras.filepickeraccepttype.accept.md +0 -11
- package/docs/ts-web-extras.filepickeraccepttype.description.md +0 -11
- package/docs/ts-web-extras.filepickeraccepttype.md +0 -75
- package/docs/ts-web-extras.filesystemcreatewritableoptions_2.keepexistingdata.md +0 -11
- package/docs/ts-web-extras.filesystemcreatewritableoptions_2.md +0 -58
- package/docs/ts-web-extras.filesystemdirectoryhandle_2._symbol.asynciterator_.md +0 -15
- package/docs/ts-web-extras.filesystemdirectoryhandle_2.entries.md +0 -15
- package/docs/ts-web-extras.filesystemdirectoryhandle_2.getdirectoryhandle.md +0 -66
- package/docs/ts-web-extras.filesystemdirectoryhandle_2.getfilehandle.md +0 -66
- package/docs/ts-web-extras.filesystemdirectoryhandle_2.keys.md +0 -15
- package/docs/ts-web-extras.filesystemdirectoryhandle_2.kind.md +0 -11
- package/docs/ts-web-extras.filesystemdirectoryhandle_2.md +0 -146
- package/docs/ts-web-extras.filesystemdirectoryhandle_2.removeentry.md +0 -66
- package/docs/ts-web-extras.filesystemdirectoryhandle_2.resolve.md +0 -50
- package/docs/ts-web-extras.filesystemdirectoryhandle_2.values.md +0 -15
- package/docs/ts-web-extras.filesystemfilehandle_2.createwritable.md +0 -52
- package/docs/ts-web-extras.filesystemfilehandle_2.getfile.md +0 -15
- package/docs/ts-web-extras.filesystemfilehandle_2.kind.md +0 -11
- package/docs/ts-web-extras.filesystemfilehandle_2.md +0 -92
- package/docs/ts-web-extras.filesystemgetdirectoryoptions_2.create.md +0 -11
- package/docs/ts-web-extras.filesystemgetdirectoryoptions_2.md +0 -58
- package/docs/ts-web-extras.filesystemgetfileoptions_2.create.md +0 -11
- package/docs/ts-web-extras.filesystemgetfileoptions_2.md +0 -58
- package/docs/ts-web-extras.filesystemhandle_2.issameentry.md +0 -50
- package/docs/ts-web-extras.filesystemhandle_2.kind.md +0 -11
- package/docs/ts-web-extras.filesystemhandle_2.md +0 -119
- package/docs/ts-web-extras.filesystemhandle_2.name.md +0 -11
- package/docs/ts-web-extras.filesystemhandle_2.querypermission.md +0 -52
- package/docs/ts-web-extras.filesystemhandle_2.requestpermission.md +0 -52
- package/docs/ts-web-extras.filesystemhandlepermissiondescriptor.md +0 -58
- package/docs/ts-web-extras.filesystemhandlepermissiondescriptor.mode.md +0 -11
- package/docs/ts-web-extras.filesystemremoveoptions_2.md +0 -58
- package/docs/ts-web-extras.filesystemremoveoptions_2.recursive.md +0 -11
- package/docs/ts-web-extras.filesystemwritablefilestream_2.md +0 -57
- package/docs/ts-web-extras.filesystemwritablefilestream_2.seek.md +0 -50
- package/docs/ts-web-extras.filesystemwritablefilestream_2.truncate.md +0 -50
- package/docs/ts-web-extras.filesystemwritablefilestream_2.write.md +0 -50
- package/docs/ts-web-extras.filetreehelpers.defaultfileapitreeinitparams.md +0 -13
- package/docs/ts-web-extras.filetreehelpers.extractfilelistmetadata.md +0 -56
- package/docs/ts-web-extras.filetreehelpers.extractfilemetadata.md +0 -56
- package/docs/ts-web-extras.filetreehelpers.fromdirectoryupload.md +0 -76
- package/docs/ts-web-extras.filetreehelpers.fromfilelist.md +0 -76
- package/docs/ts-web-extras.filetreehelpers.getoriginalfile.md +0 -72
- package/docs/ts-web-extras.filetreehelpers.md +0 -102
- package/docs/ts-web-extras.idirectoryhandletreeinitializer.dirhandles.md +0 -11
- package/docs/ts-web-extras.idirectoryhandletreeinitializer.md +0 -100
- package/docs/ts-web-extras.idirectoryhandletreeinitializer.nonrecursive.md +0 -11
- package/docs/ts-web-extras.idirectoryhandletreeinitializer.prefix.md +0 -11
- package/docs/ts-web-extras.ifilehandletreeinitializer.filehandles.md +0 -11
- package/docs/ts-web-extras.ifilehandletreeinitializer.md +0 -79
- package/docs/ts-web-extras.ifilehandletreeinitializer.prefix.md +0 -11
- package/docs/ts-web-extras.ifilelisttreeinitializer.filelist.md +0 -11
- package/docs/ts-web-extras.ifilelisttreeinitializer.md +0 -58
- package/docs/ts-web-extras.ifilemetadata.lastmodified.md +0 -11
- package/docs/ts-web-extras.ifilemetadata.md +0 -124
- package/docs/ts-web-extras.ifilemetadata.name.md +0 -11
- package/docs/ts-web-extras.ifilemetadata.path.md +0 -11
- package/docs/ts-web-extras.ifilemetadata.size.md +0 -11
- package/docs/ts-web-extras.ifilemetadata.type.md +0 -11
- package/docs/ts-web-extras.ifsaccessapis.md +0 -56
- package/docs/ts-web-extras.ifsaccessapis.showdirectorypicker.md +0 -52
- package/docs/ts-web-extras.ifsaccessapis.showopenfilepicker.md +0 -52
- package/docs/ts-web-extras.ifsaccessapis.showsavefilepicker.md +0 -52
- package/docs/ts-web-extras.isdirectoryhandle.md +0 -56
- package/docs/ts-web-extras.isfilehandle.md +0 -56
- package/docs/ts-web-extras.isfilepath.md +0 -52
- package/docs/ts-web-extras.iurlconfigoptions.config.md +0 -13
- package/docs/ts-web-extras.iurlconfigoptions.configstartdir.md +0 -13
- package/docs/ts-web-extras.iurlconfigoptions.contextfilter.md +0 -13
- package/docs/ts-web-extras.iurlconfigoptions.input.md +0 -13
- package/docs/ts-web-extras.iurlconfigoptions.inputstartdir.md +0 -13
- package/docs/ts-web-extras.iurlconfigoptions.interactive.md +0 -13
- package/docs/ts-web-extras.iurlconfigoptions.loadzip.md +0 -13
- package/docs/ts-web-extras.iurlconfigoptions.maxdistance.md +0 -13
- package/docs/ts-web-extras.iurlconfigoptions.md +0 -286
- package/docs/ts-web-extras.iurlconfigoptions.qualifierdefaults.md +0 -13
- package/docs/ts-web-extras.iurlconfigoptions.reducequalifiers.md +0 -13
- package/docs/ts-web-extras.iurlconfigoptions.resourcetypes.md +0 -13
- package/docs/ts-web-extras.iurlconfigoptions.zipfile.md +0 -13
- package/docs/ts-web-extras.iurlconfigoptions.zippath.md +0 -13
- package/docs/ts-web-extras.md +0 -512
- package/docs/ts-web-extras.parsecontextfilter.md +0 -52
- package/docs/ts-web-extras.parsequalifierdefaults.md +0 -52
- package/docs/ts-web-extras.parseresourcetypes.md +0 -52
- package/docs/ts-web-extras.parseurlparameters.md +0 -17
- package/docs/ts-web-extras.safeshowdirectorypicker.md +0 -72
- package/docs/ts-web-extras.safeshowopenfilepicker.md +0 -72
- package/docs/ts-web-extras.safeshowsavefilepicker.md +0 -72
- package/docs/ts-web-extras.showdirectorypickeroptions.id.md +0 -11
- package/docs/ts-web-extras.showdirectorypickeroptions.md +0 -96
- package/docs/ts-web-extras.showdirectorypickeroptions.mode.md +0 -11
- package/docs/ts-web-extras.showdirectorypickeroptions.startin.md +0 -11
- package/docs/ts-web-extras.showopenfilepickeroptions.excludeacceptalloption.md +0 -11
- package/docs/ts-web-extras.showopenfilepickeroptions.id.md +0 -11
- package/docs/ts-web-extras.showopenfilepickeroptions.md +0 -134
- package/docs/ts-web-extras.showopenfilepickeroptions.multiple.md +0 -11
- package/docs/ts-web-extras.showopenfilepickeroptions.startin.md +0 -11
- package/docs/ts-web-extras.showopenfilepickeroptions.types.md +0 -11
- package/docs/ts-web-extras.showsavefilepickeroptions.excludeacceptalloption.md +0 -11
- package/docs/ts-web-extras.showsavefilepickeroptions.id.md +0 -11
- package/docs/ts-web-extras.showsavefilepickeroptions.md +0 -134
- package/docs/ts-web-extras.showsavefilepickeroptions.startin.md +0 -11
- package/docs/ts-web-extras.showsavefilepickeroptions.suggestedname.md +0 -11
- package/docs/ts-web-extras.showsavefilepickeroptions.types.md +0 -11
- package/docs/ts-web-extras.supportsfilesystemaccess.md +0 -56
- package/docs/ts-web-extras.treeinitializer.md +0 -15
- package/docs/ts-web-extras.wellknowndirectory.md +0 -13
- package/docs/ts-web-extras.windowwithfsaccess.md +0 -15
- 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/temp/test/jest/haste-map-7492f1b44480e0cdd1f220078fb3afd8-c8dd6c3430605adeb2f1cadf4f75e791-8c9336785555d572065b28c111982ba4 +0 -0
- package/temp/test/jest/perf-cache-7492f1b44480e0cdd1f220078fb3afd8-da39a3ee5e6b4b0d3255bfef95601890 +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 → jest-transform-cache-b931e4e63102f86c5bd4949f7dced44f-79ef2876fae7ca75eedb2aa53dc48338/b5/package_b5f57afc9ec2c011239b1608ee5bdfa5} +0 -0
|
@@ -0,0 +1,520 @@
|
|
|
1
|
+
[**@fgv/ts-web-extras**](../README.md)
|
|
2
|
+
|
|
3
|
+
***
|
|
4
|
+
|
|
5
|
+
[@fgv/ts-web-extras](../README.md) / LocalStorageTreeAccessors
|
|
6
|
+
|
|
7
|
+
# Class: LocalStorageTreeAccessors\<TCT\>
|
|
8
|
+
|
|
9
|
+
Browser localStorage-backed file tree accessors with persistence support.
|
|
10
|
+
|
|
11
|
+
Maps filesystem-like directory paths to localStorage keys, where each key stores
|
|
12
|
+
multiple collections as a JSON object. This provides a general-purpose implementation
|
|
13
|
+
for browser-based file tree persistence without requiring File System Access API.
|
|
14
|
+
|
|
15
|
+
Storage format per key: `{ "collection-id": "<raw file content>" }`
|
|
16
|
+
File paths map as: `/data/ingredients/collection-id.yaml` → stored in key for `/data/ingredients`
|
|
17
|
+
|
|
18
|
+
Legacy format (v1): `{ "collection-id": { ...parsedJsonObject } }` is auto-migrated on load.
|
|
19
|
+
|
|
20
|
+
## Extends
|
|
21
|
+
|
|
22
|
+
- [`InMemoryTreeAccessors`](https://github.com/ErikFortune/fgv/tree/main/libraries/ts-json-base/docs)\<`TCT`\>
|
|
23
|
+
|
|
24
|
+
## Type Parameters
|
|
25
|
+
|
|
26
|
+
| Type Parameter | Default type |
|
|
27
|
+
| ------ | ------ |
|
|
28
|
+
| `TCT` *extends* `string` | `string` |
|
|
29
|
+
|
|
30
|
+
## Implements
|
|
31
|
+
|
|
32
|
+
- [`IPersistentFileTreeAccessors`](https://github.com/ErikFortune/fgv/tree/main/libraries/ts-json-base/docs)\<`TCT`\>
|
|
33
|
+
|
|
34
|
+
## Methods
|
|
35
|
+
|
|
36
|
+
### createDirectory()
|
|
37
|
+
|
|
38
|
+
> **createDirectory**(`dirPath`): [`Result`](https://github.com/ErikFortune/fgv/tree/main/libraries/ts-utils/docs)\<`string`\>
|
|
39
|
+
|
|
40
|
+
FileTree.IMutableFileTreeAccessors.createDirectory
|
|
41
|
+
|
|
42
|
+
#### Parameters
|
|
43
|
+
|
|
44
|
+
| Parameter | Type |
|
|
45
|
+
| ------ | ------ |
|
|
46
|
+
| `dirPath` | `string` |
|
|
47
|
+
|
|
48
|
+
#### Returns
|
|
49
|
+
|
|
50
|
+
[`Result`](https://github.com/ErikFortune/fgv/tree/main/libraries/ts-utils/docs)\<`string`\>
|
|
51
|
+
|
|
52
|
+
#### Implementation of
|
|
53
|
+
|
|
54
|
+
`FileTree.IPersistentFileTreeAccessors.createDirectory`
|
|
55
|
+
|
|
56
|
+
#### Inherited from
|
|
57
|
+
|
|
58
|
+
`FileTree.InMemoryTreeAccessors.createDirectory`
|
|
59
|
+
|
|
60
|
+
***
|
|
61
|
+
|
|
62
|
+
### deleteDirectory()
|
|
63
|
+
|
|
64
|
+
> **deleteDirectory**(`path`): [`Result`](https://github.com/ErikFortune/fgv/tree/main/libraries/ts-utils/docs)\<`boolean`\>
|
|
65
|
+
|
|
66
|
+
FileTree.IMutableFileTreeAccessors.deleteDirectory
|
|
67
|
+
|
|
68
|
+
#### Parameters
|
|
69
|
+
|
|
70
|
+
| Parameter | Type |
|
|
71
|
+
| ------ | ------ |
|
|
72
|
+
| `path` | `string` |
|
|
73
|
+
|
|
74
|
+
#### Returns
|
|
75
|
+
|
|
76
|
+
[`Result`](https://github.com/ErikFortune/fgv/tree/main/libraries/ts-utils/docs)\<`boolean`\>
|
|
77
|
+
|
|
78
|
+
#### Implementation of
|
|
79
|
+
|
|
80
|
+
`FileTree.IPersistentFileTreeAccessors.deleteDirectory`
|
|
81
|
+
|
|
82
|
+
#### Inherited from
|
|
83
|
+
|
|
84
|
+
`FileTree.InMemoryTreeAccessors.deleteDirectory`
|
|
85
|
+
|
|
86
|
+
***
|
|
87
|
+
|
|
88
|
+
### deleteFile()
|
|
89
|
+
|
|
90
|
+
> **deleteFile**(`path`): [`Result`](https://github.com/ErikFortune/fgv/tree/main/libraries/ts-utils/docs)\<`boolean`\>
|
|
91
|
+
|
|
92
|
+
Delete a file and remove it from localStorage.
|
|
93
|
+
|
|
94
|
+
#### Parameters
|
|
95
|
+
|
|
96
|
+
| Parameter | Type | Description |
|
|
97
|
+
| ------ | ------ | ------ |
|
|
98
|
+
| `path` | `string` | File path to delete |
|
|
99
|
+
|
|
100
|
+
#### Returns
|
|
101
|
+
|
|
102
|
+
[`Result`](https://github.com/ErikFortune/fgv/tree/main/libraries/ts-utils/docs)\<`boolean`\>
|
|
103
|
+
|
|
104
|
+
Result with true if deleted, or error
|
|
105
|
+
|
|
106
|
+
#### Implementation of
|
|
107
|
+
|
|
108
|
+
`FileTree.IPersistentFileTreeAccessors.deleteFile`
|
|
109
|
+
|
|
110
|
+
#### Overrides
|
|
111
|
+
|
|
112
|
+
`FileTree.InMemoryTreeAccessors.deleteFile`
|
|
113
|
+
|
|
114
|
+
***
|
|
115
|
+
|
|
116
|
+
### fileIsMutable()
|
|
117
|
+
|
|
118
|
+
> **fileIsMutable**(`path`): [`DetailedResult`](https://github.com/ErikFortune/fgv/tree/main/libraries/ts-utils/docs)\<`boolean`, [`SaveDetail`](https://github.com/ErikFortune/fgv/tree/main/libraries/ts-json-base/docs)\>
|
|
119
|
+
|
|
120
|
+
Check if a file is mutable and return persistence detail.
|
|
121
|
+
|
|
122
|
+
#### Parameters
|
|
123
|
+
|
|
124
|
+
| Parameter | Type | Description |
|
|
125
|
+
| ------ | ------ | ------ |
|
|
126
|
+
| `path` | `string` | File path to check |
|
|
127
|
+
|
|
128
|
+
#### Returns
|
|
129
|
+
|
|
130
|
+
[`DetailedResult`](https://github.com/ErikFortune/fgv/tree/main/libraries/ts-utils/docs)\<`boolean`, [`SaveDetail`](https://github.com/ErikFortune/fgv/tree/main/libraries/ts-json-base/docs)\>
|
|
131
|
+
|
|
132
|
+
DetailedResult with mutability status and 'persistent' detail if mutable
|
|
133
|
+
|
|
134
|
+
#### Implementation of
|
|
135
|
+
|
|
136
|
+
`FileTree.IPersistentFileTreeAccessors.fileIsMutable`
|
|
137
|
+
|
|
138
|
+
#### Overrides
|
|
139
|
+
|
|
140
|
+
`FileTree.InMemoryTreeAccessors.fileIsMutable`
|
|
141
|
+
|
|
142
|
+
***
|
|
143
|
+
|
|
144
|
+
### getBaseName()
|
|
145
|
+
|
|
146
|
+
> **getBaseName**(`path`, `suffix?`): `string`
|
|
147
|
+
|
|
148
|
+
FileTree.IFileTreeAccessors.getBaseName
|
|
149
|
+
|
|
150
|
+
#### Parameters
|
|
151
|
+
|
|
152
|
+
| Parameter | Type |
|
|
153
|
+
| ------ | ------ |
|
|
154
|
+
| `path` | `string` |
|
|
155
|
+
| `suffix?` | `string` |
|
|
156
|
+
|
|
157
|
+
#### Returns
|
|
158
|
+
|
|
159
|
+
`string`
|
|
160
|
+
|
|
161
|
+
#### Implementation of
|
|
162
|
+
|
|
163
|
+
`FileTree.IPersistentFileTreeAccessors.getBaseName`
|
|
164
|
+
|
|
165
|
+
#### Inherited from
|
|
166
|
+
|
|
167
|
+
`FileTree.InMemoryTreeAccessors.getBaseName`
|
|
168
|
+
|
|
169
|
+
***
|
|
170
|
+
|
|
171
|
+
### getChildren()
|
|
172
|
+
|
|
173
|
+
> **getChildren**(`path`): [`Result`](https://github.com/ErikFortune/fgv/tree/main/libraries/ts-utils/docs)\<readonly [`FileTreeItem`](https://github.com/ErikFortune/fgv/tree/main/libraries/ts-json-base/docs)\<`TCT`\>[]\>
|
|
174
|
+
|
|
175
|
+
FileTree.IFileTreeAccessors.getChildren
|
|
176
|
+
|
|
177
|
+
#### Parameters
|
|
178
|
+
|
|
179
|
+
| Parameter | Type |
|
|
180
|
+
| ------ | ------ |
|
|
181
|
+
| `path` | `string` |
|
|
182
|
+
|
|
183
|
+
#### Returns
|
|
184
|
+
|
|
185
|
+
[`Result`](https://github.com/ErikFortune/fgv/tree/main/libraries/ts-utils/docs)\<readonly [`FileTreeItem`](https://github.com/ErikFortune/fgv/tree/main/libraries/ts-json-base/docs)\<`TCT`\>[]\>
|
|
186
|
+
|
|
187
|
+
#### Implementation of
|
|
188
|
+
|
|
189
|
+
`FileTree.IPersistentFileTreeAccessors.getChildren`
|
|
190
|
+
|
|
191
|
+
#### Inherited from
|
|
192
|
+
|
|
193
|
+
`FileTree.InMemoryTreeAccessors.getChildren`
|
|
194
|
+
|
|
195
|
+
***
|
|
196
|
+
|
|
197
|
+
### getDirtyPaths()
|
|
198
|
+
|
|
199
|
+
> **getDirtyPaths**(): `string`[]
|
|
200
|
+
|
|
201
|
+
Get list of file paths with unsaved changes.
|
|
202
|
+
|
|
203
|
+
#### Returns
|
|
204
|
+
|
|
205
|
+
`string`[]
|
|
206
|
+
|
|
207
|
+
Array of dirty file paths
|
|
208
|
+
|
|
209
|
+
#### Implementation of
|
|
210
|
+
|
|
211
|
+
`FileTree.IPersistentFileTreeAccessors.getDirtyPaths`
|
|
212
|
+
|
|
213
|
+
***
|
|
214
|
+
|
|
215
|
+
### getExtension()
|
|
216
|
+
|
|
217
|
+
> **getExtension**(`path`): `string`
|
|
218
|
+
|
|
219
|
+
FileTree.IFileTreeAccessors.getExtension
|
|
220
|
+
|
|
221
|
+
#### Parameters
|
|
222
|
+
|
|
223
|
+
| Parameter | Type |
|
|
224
|
+
| ------ | ------ |
|
|
225
|
+
| `path` | `string` |
|
|
226
|
+
|
|
227
|
+
#### Returns
|
|
228
|
+
|
|
229
|
+
`string`
|
|
230
|
+
|
|
231
|
+
#### Implementation of
|
|
232
|
+
|
|
233
|
+
`FileTree.IPersistentFileTreeAccessors.getExtension`
|
|
234
|
+
|
|
235
|
+
#### Inherited from
|
|
236
|
+
|
|
237
|
+
`FileTree.InMemoryTreeAccessors.getExtension`
|
|
238
|
+
|
|
239
|
+
***
|
|
240
|
+
|
|
241
|
+
### getFileContents()
|
|
242
|
+
|
|
243
|
+
> **getFileContents**(`path`): [`Result`](https://github.com/ErikFortune/fgv/tree/main/libraries/ts-utils/docs)\<`string`\>
|
|
244
|
+
|
|
245
|
+
FileTree.IFileTreeAccessors.getFileContents
|
|
246
|
+
|
|
247
|
+
#### Parameters
|
|
248
|
+
|
|
249
|
+
| Parameter | Type |
|
|
250
|
+
| ------ | ------ |
|
|
251
|
+
| `path` | `string` |
|
|
252
|
+
|
|
253
|
+
#### Returns
|
|
254
|
+
|
|
255
|
+
[`Result`](https://github.com/ErikFortune/fgv/tree/main/libraries/ts-utils/docs)\<`string`\>
|
|
256
|
+
|
|
257
|
+
#### Implementation of
|
|
258
|
+
|
|
259
|
+
`FileTree.IPersistentFileTreeAccessors.getFileContents`
|
|
260
|
+
|
|
261
|
+
#### Inherited from
|
|
262
|
+
|
|
263
|
+
`FileTree.InMemoryTreeAccessors.getFileContents`
|
|
264
|
+
|
|
265
|
+
***
|
|
266
|
+
|
|
267
|
+
### getFileContentType()
|
|
268
|
+
|
|
269
|
+
> **getFileContentType**(`path`, `provided?`): [`Result`](https://github.com/ErikFortune/fgv/tree/main/libraries/ts-utils/docs)\<`TCT` \| `undefined`\>
|
|
270
|
+
|
|
271
|
+
FileTree.IFileTreeAccessors.getFileContentType
|
|
272
|
+
|
|
273
|
+
#### Parameters
|
|
274
|
+
|
|
275
|
+
| Parameter | Type |
|
|
276
|
+
| ------ | ------ |
|
|
277
|
+
| `path` | `string` |
|
|
278
|
+
| `provided?` | `string` |
|
|
279
|
+
|
|
280
|
+
#### Returns
|
|
281
|
+
|
|
282
|
+
[`Result`](https://github.com/ErikFortune/fgv/tree/main/libraries/ts-utils/docs)\<`TCT` \| `undefined`\>
|
|
283
|
+
|
|
284
|
+
#### Implementation of
|
|
285
|
+
|
|
286
|
+
`FileTree.IPersistentFileTreeAccessors.getFileContentType`
|
|
287
|
+
|
|
288
|
+
#### Inherited from
|
|
289
|
+
|
|
290
|
+
`FileTree.InMemoryTreeAccessors.getFileContentType`
|
|
291
|
+
|
|
292
|
+
***
|
|
293
|
+
|
|
294
|
+
### getItem()
|
|
295
|
+
|
|
296
|
+
> **getItem**(`itemPath`): [`Result`](https://github.com/ErikFortune/fgv/tree/main/libraries/ts-utils/docs)\<[`FileTreeItem`](https://github.com/ErikFortune/fgv/tree/main/libraries/ts-json-base/docs)\<`TCT`\>\>
|
|
297
|
+
|
|
298
|
+
FileTree.IFileTreeAccessors.getItem
|
|
299
|
+
|
|
300
|
+
#### Parameters
|
|
301
|
+
|
|
302
|
+
| Parameter | Type |
|
|
303
|
+
| ------ | ------ |
|
|
304
|
+
| `itemPath` | `string` |
|
|
305
|
+
|
|
306
|
+
#### Returns
|
|
307
|
+
|
|
308
|
+
[`Result`](https://github.com/ErikFortune/fgv/tree/main/libraries/ts-utils/docs)\<[`FileTreeItem`](https://github.com/ErikFortune/fgv/tree/main/libraries/ts-json-base/docs)\<`TCT`\>\>
|
|
309
|
+
|
|
310
|
+
#### Implementation of
|
|
311
|
+
|
|
312
|
+
`FileTree.IPersistentFileTreeAccessors.getItem`
|
|
313
|
+
|
|
314
|
+
#### Inherited from
|
|
315
|
+
|
|
316
|
+
`FileTree.InMemoryTreeAccessors.getItem`
|
|
317
|
+
|
|
318
|
+
***
|
|
319
|
+
|
|
320
|
+
### isDirty()
|
|
321
|
+
|
|
322
|
+
> **isDirty**(): `boolean`
|
|
323
|
+
|
|
324
|
+
Check if there are unsaved changes.
|
|
325
|
+
|
|
326
|
+
#### Returns
|
|
327
|
+
|
|
328
|
+
`boolean`
|
|
329
|
+
|
|
330
|
+
True if there are dirty files
|
|
331
|
+
|
|
332
|
+
#### Implementation of
|
|
333
|
+
|
|
334
|
+
`FileTree.IPersistentFileTreeAccessors.isDirty`
|
|
335
|
+
|
|
336
|
+
***
|
|
337
|
+
|
|
338
|
+
### joinPaths()
|
|
339
|
+
|
|
340
|
+
> **joinPaths**(...`paths`): `string`
|
|
341
|
+
|
|
342
|
+
FileTree.IFileTreeAccessors.joinPaths
|
|
343
|
+
|
|
344
|
+
#### Parameters
|
|
345
|
+
|
|
346
|
+
| Parameter | Type |
|
|
347
|
+
| ------ | ------ |
|
|
348
|
+
| ...`paths` | `string`[] |
|
|
349
|
+
|
|
350
|
+
#### Returns
|
|
351
|
+
|
|
352
|
+
`string`
|
|
353
|
+
|
|
354
|
+
#### Implementation of
|
|
355
|
+
|
|
356
|
+
`FileTree.IPersistentFileTreeAccessors.joinPaths`
|
|
357
|
+
|
|
358
|
+
#### Inherited from
|
|
359
|
+
|
|
360
|
+
`FileTree.InMemoryTreeAccessors.joinPaths`
|
|
361
|
+
|
|
362
|
+
***
|
|
363
|
+
|
|
364
|
+
### resolveAbsolutePath()
|
|
365
|
+
|
|
366
|
+
> **resolveAbsolutePath**(...`paths`): `string`
|
|
367
|
+
|
|
368
|
+
FileTree.IFileTreeAccessors.resolveAbsolutePath
|
|
369
|
+
|
|
370
|
+
#### Parameters
|
|
371
|
+
|
|
372
|
+
| Parameter | Type |
|
|
373
|
+
| ------ | ------ |
|
|
374
|
+
| ...`paths` | `string`[] |
|
|
375
|
+
|
|
376
|
+
#### Returns
|
|
377
|
+
|
|
378
|
+
`string`
|
|
379
|
+
|
|
380
|
+
#### Implementation of
|
|
381
|
+
|
|
382
|
+
`FileTree.IPersistentFileTreeAccessors.resolveAbsolutePath`
|
|
383
|
+
|
|
384
|
+
#### Inherited from
|
|
385
|
+
|
|
386
|
+
`FileTree.InMemoryTreeAccessors.resolveAbsolutePath`
|
|
387
|
+
|
|
388
|
+
***
|
|
389
|
+
|
|
390
|
+
### saveFileContents()
|
|
391
|
+
|
|
392
|
+
> **saveFileContents**(`path`, `contents`): [`Result`](https://github.com/ErikFortune/fgv/tree/main/libraries/ts-utils/docs)\<`string`\>
|
|
393
|
+
|
|
394
|
+
Save file contents. Marks file as dirty and optionally auto-syncs.
|
|
395
|
+
|
|
396
|
+
#### Parameters
|
|
397
|
+
|
|
398
|
+
| Parameter | Type | Description |
|
|
399
|
+
| ------ | ------ | ------ |
|
|
400
|
+
| `path` | `string` | File path |
|
|
401
|
+
| `contents` | `string` | New file contents |
|
|
402
|
+
|
|
403
|
+
#### Returns
|
|
404
|
+
|
|
405
|
+
[`Result`](https://github.com/ErikFortune/fgv/tree/main/libraries/ts-utils/docs)\<`string`\>
|
|
406
|
+
|
|
407
|
+
Result with the saved contents or error
|
|
408
|
+
|
|
409
|
+
#### Implementation of
|
|
410
|
+
|
|
411
|
+
`FileTree.IPersistentFileTreeAccessors.saveFileContents`
|
|
412
|
+
|
|
413
|
+
#### Overrides
|
|
414
|
+
|
|
415
|
+
`FileTree.InMemoryTreeAccessors.saveFileContents`
|
|
416
|
+
|
|
417
|
+
***
|
|
418
|
+
|
|
419
|
+
### syncToDisk()
|
|
420
|
+
|
|
421
|
+
> **syncToDisk**(): `Promise`\<[`Result`](https://github.com/ErikFortune/fgv/tree/main/libraries/ts-utils/docs)\<`void`\>\>
|
|
422
|
+
|
|
423
|
+
Sync all dirty files to localStorage.
|
|
424
|
+
|
|
425
|
+
#### Returns
|
|
426
|
+
|
|
427
|
+
`Promise`\<[`Result`](https://github.com/ErikFortune/fgv/tree/main/libraries/ts-utils/docs)\<`void`\>\>
|
|
428
|
+
|
|
429
|
+
Result indicating success or failure
|
|
430
|
+
|
|
431
|
+
#### Implementation of
|
|
432
|
+
|
|
433
|
+
`FileTree.IPersistentFileTreeAccessors.syncToDisk`
|
|
434
|
+
|
|
435
|
+
***
|
|
436
|
+
|
|
437
|
+
### create()
|
|
438
|
+
|
|
439
|
+
#### Call Signature
|
|
440
|
+
|
|
441
|
+
> `static` **create**\<`TCT`\>(`files`, `prefix?`): [`Result`](https://github.com/ErikFortune/fgv/tree/main/libraries/ts-utils/docs)\<[`InMemoryTreeAccessors`](https://github.com/ErikFortune/fgv/tree/main/libraries/ts-json-base/docs)\<`TCT`\>\>
|
|
442
|
+
|
|
443
|
+
Creates a new [InMemoryTreeAccessors](https://github.com/ErikFortune/fgv/tree/main/libraries/ts-json-base/docs) instance with the supplied
|
|
444
|
+
in-memory files.
|
|
445
|
+
|
|
446
|
+
##### Type Parameters
|
|
447
|
+
|
|
448
|
+
| Type Parameter | Default type |
|
|
449
|
+
| ------ | ------ |
|
|
450
|
+
| `TCT` *extends* `string` | `string` |
|
|
451
|
+
|
|
452
|
+
##### Parameters
|
|
453
|
+
|
|
454
|
+
| Parameter | Type | Description |
|
|
455
|
+
| ------ | ------ | ------ |
|
|
456
|
+
| `files` | [`IInMemoryFile`](https://github.com/ErikFortune/fgv/tree/main/libraries/ts-json-base/docs)\<`TCT`\>[] | An array of [in-memory files](https://github.com/ErikFortune/fgv/tree/main/libraries/ts-json-base/docs) to include in the tree. |
|
|
457
|
+
| `prefix?` | `string` | Optional prefix for the tree. |
|
|
458
|
+
|
|
459
|
+
##### Returns
|
|
460
|
+
|
|
461
|
+
[`Result`](https://github.com/ErikFortune/fgv/tree/main/libraries/ts-utils/docs)\<[`InMemoryTreeAccessors`](https://github.com/ErikFortune/fgv/tree/main/libraries/ts-json-base/docs)\<`TCT`\>\>
|
|
462
|
+
|
|
463
|
+
##### Inherited from
|
|
464
|
+
|
|
465
|
+
`FileTree.InMemoryTreeAccessors.create`
|
|
466
|
+
|
|
467
|
+
#### Call Signature
|
|
468
|
+
|
|
469
|
+
> `static` **create**\<`TCT`\>(`files`, `params?`): [`Result`](https://github.com/ErikFortune/fgv/tree/main/libraries/ts-utils/docs)\<[`InMemoryTreeAccessors`](https://github.com/ErikFortune/fgv/tree/main/libraries/ts-json-base/docs)\<`TCT`\>\>
|
|
470
|
+
|
|
471
|
+
Creates a new [InMemoryTreeAccessors](https://github.com/ErikFortune/fgv/tree/main/libraries/ts-json-base/docs) instance with the supplied
|
|
472
|
+
in-memory files.
|
|
473
|
+
|
|
474
|
+
##### Type Parameters
|
|
475
|
+
|
|
476
|
+
| Type Parameter | Default type |
|
|
477
|
+
| ------ | ------ |
|
|
478
|
+
| `TCT` *extends* `string` | `string` |
|
|
479
|
+
|
|
480
|
+
##### Parameters
|
|
481
|
+
|
|
482
|
+
| Parameter | Type | Description |
|
|
483
|
+
| ------ | ------ | ------ |
|
|
484
|
+
| `files` | [`IInMemoryFile`](https://github.com/ErikFortune/fgv/tree/main/libraries/ts-json-base/docs)\<`TCT`\>[] | An array of [in-memory files](https://github.com/ErikFortune/fgv/tree/main/libraries/ts-json-base/docs) to include in the tree. |
|
|
485
|
+
| `params?` | [`IFileTreeInitParams`](https://github.com/ErikFortune/fgv/tree/main/libraries/ts-json-base/docs)\<`TCT`\> | Optional params for the tree. |
|
|
486
|
+
|
|
487
|
+
##### Returns
|
|
488
|
+
|
|
489
|
+
[`Result`](https://github.com/ErikFortune/fgv/tree/main/libraries/ts-utils/docs)\<[`InMemoryTreeAccessors`](https://github.com/ErikFortune/fgv/tree/main/libraries/ts-json-base/docs)\<`TCT`\>\>
|
|
490
|
+
|
|
491
|
+
##### Inherited from
|
|
492
|
+
|
|
493
|
+
`FileTree.InMemoryTreeAccessors.create`
|
|
494
|
+
|
|
495
|
+
***
|
|
496
|
+
|
|
497
|
+
### fromStorage()
|
|
498
|
+
|
|
499
|
+
> `static` **fromStorage**\<`TCT`\>(`params`): [`Result`](https://github.com/ErikFortune/fgv/tree/main/libraries/ts-utils/docs)\<`LocalStorageTreeAccessors`\<`TCT`\>\>
|
|
500
|
+
|
|
501
|
+
Create LocalStorageTreeAccessors from browser localStorage.
|
|
502
|
+
Loads all collections from the configured storage keys.
|
|
503
|
+
|
|
504
|
+
#### Type Parameters
|
|
505
|
+
|
|
506
|
+
| Type Parameter | Default type |
|
|
507
|
+
| ------ | ------ |
|
|
508
|
+
| `TCT` *extends* `string` | `string` |
|
|
509
|
+
|
|
510
|
+
#### Parameters
|
|
511
|
+
|
|
512
|
+
| Parameter | Type | Description |
|
|
513
|
+
| ------ | ------ | ------ |
|
|
514
|
+
| `params` | [`ILocalStorageTreeParams`](../interfaces/ILocalStorageTreeParams.md)\<`TCT`\> | Configuration including path-to-key mappings |
|
|
515
|
+
|
|
516
|
+
#### Returns
|
|
517
|
+
|
|
518
|
+
[`Result`](https://github.com/ErikFortune/fgv/tree/main/libraries/ts-utils/docs)\<`LocalStorageTreeAccessors`\<`TCT`\>\>
|
|
519
|
+
|
|
520
|
+
Result containing the accessors or an error
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
[**@fgv/ts-web-extras**](../README.md)
|
|
2
|
+
|
|
3
|
+
***
|
|
4
|
+
|
|
5
|
+
[@fgv/ts-web-extras](../README.md) / exportAsJson
|
|
6
|
+
|
|
7
|
+
# Function: exportAsJson()
|
|
8
|
+
|
|
9
|
+
> **exportAsJson**(`data`, `filename`): `void`
|
|
10
|
+
|
|
11
|
+
Export data as JSON file using legacy blob download method.
|
|
12
|
+
Creates a temporary download link and triggers file download.
|
|
13
|
+
|
|
14
|
+
## Parameters
|
|
15
|
+
|
|
16
|
+
| Parameter | Type | Description |
|
|
17
|
+
| ------ | ------ | ------ |
|
|
18
|
+
| `data` | `unknown` | Data to export as JSON |
|
|
19
|
+
| `filename` | `string` | Name for the downloaded file |
|
|
20
|
+
|
|
21
|
+
## Returns
|
|
22
|
+
|
|
23
|
+
`void`
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
[**@fgv/ts-web-extras**](../README.md)
|
|
2
|
+
|
|
3
|
+
***
|
|
4
|
+
|
|
5
|
+
[@fgv/ts-web-extras](../README.md) / exportUsingFileSystemAPI
|
|
6
|
+
|
|
7
|
+
# Function: exportUsingFileSystemAPI()
|
|
8
|
+
|
|
9
|
+
> **exportUsingFileSystemAPI**(`data`, `suggestedName`, `description`, `window`): `Promise`\<`boolean`\>
|
|
10
|
+
|
|
11
|
+
Export data using File System Access API with fallback to blob download.
|
|
12
|
+
|
|
13
|
+
## Parameters
|
|
14
|
+
|
|
15
|
+
| Parameter | Type | Default value | Description |
|
|
16
|
+
| ------ | ------ | ------ | ------ |
|
|
17
|
+
| `data` | `unknown` | `undefined` | Data to export as JSON |
|
|
18
|
+
| `suggestedName` | `string` | `undefined` | Suggested filename for the save dialog |
|
|
19
|
+
| `description` | `string` | `'JSON files'` | Description for file type filter (default: 'JSON files') |
|
|
20
|
+
| `window` | `Window` | `globalThis.window` | Window object for API access (default: globalThis.window) |
|
|
21
|
+
|
|
22
|
+
## Returns
|
|
23
|
+
|
|
24
|
+
`Promise`\<`boolean`\>
|
|
25
|
+
|
|
26
|
+
Promise resolving to true if saved via File System Access API, false if fallback used
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
[**@fgv/ts-web-extras**](../README.md)
|
|
2
|
+
|
|
3
|
+
***
|
|
4
|
+
|
|
5
|
+
[@fgv/ts-web-extras](../README.md) / extractDirectoryPath
|
|
6
|
+
|
|
7
|
+
# Function: extractDirectoryPath()
|
|
8
|
+
|
|
9
|
+
> **extractDirectoryPath**(`path`): `string`
|
|
10
|
+
|
|
11
|
+
Extracts the directory path from a file or directory path
|
|
12
|
+
If the path appears to be a directory (no extension), returns it as-is
|
|
13
|
+
If the path appears to be a file, returns the parent directory
|
|
14
|
+
|
|
15
|
+
## Parameters
|
|
16
|
+
|
|
17
|
+
| Parameter | Type |
|
|
18
|
+
| ------ | ------ |
|
|
19
|
+
| `path` | `string` |
|
|
20
|
+
|
|
21
|
+
## Returns
|
|
22
|
+
|
|
23
|
+
`string`
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
[**@fgv/ts-web-extras**](../README.md)
|
|
2
|
+
|
|
3
|
+
***
|
|
4
|
+
|
|
5
|
+
[@fgv/ts-web-extras](../README.md) / isDirectoryHandle
|
|
6
|
+
|
|
7
|
+
# Function: isDirectoryHandle()
|
|
8
|
+
|
|
9
|
+
> **isDirectoryHandle**(`handle`): `handle is FileSystemDirectoryHandle`
|
|
10
|
+
|
|
11
|
+
Type guard to check if a FileSystemHandle is a directory handle
|
|
12
|
+
|
|
13
|
+
## Parameters
|
|
14
|
+
|
|
15
|
+
| Parameter | Type | Description |
|
|
16
|
+
| ------ | ------ | ------ |
|
|
17
|
+
| `handle` | [`FileSystemHandle`](../interfaces/FileSystemHandle.md) | The handle to check |
|
|
18
|
+
|
|
19
|
+
## Returns
|
|
20
|
+
|
|
21
|
+
`handle is FileSystemDirectoryHandle`
|
|
22
|
+
|
|
23
|
+
True if the handle is a FileSystemDirectoryHandle
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
[**@fgv/ts-web-extras**](../README.md)
|
|
2
|
+
|
|
3
|
+
***
|
|
4
|
+
|
|
5
|
+
[@fgv/ts-web-extras](../README.md) / isFileHandle
|
|
6
|
+
|
|
7
|
+
# Function: isFileHandle()
|
|
8
|
+
|
|
9
|
+
> **isFileHandle**(`handle`): `handle is FileSystemFileHandle`
|
|
10
|
+
|
|
11
|
+
Type guard to check if a FileSystemHandle is a file handle
|
|
12
|
+
|
|
13
|
+
## Parameters
|
|
14
|
+
|
|
15
|
+
| Parameter | Type | Description |
|
|
16
|
+
| ------ | ------ | ------ |
|
|
17
|
+
| `handle` | [`FileSystemHandle`](../interfaces/FileSystemHandle.md) | The handle to check |
|
|
18
|
+
|
|
19
|
+
## Returns
|
|
20
|
+
|
|
21
|
+
`handle is FileSystemFileHandle`
|
|
22
|
+
|
|
23
|
+
True if the handle is a FileSystemFileHandle
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
[**@fgv/ts-web-extras**](../README.md)
|
|
2
|
+
|
|
3
|
+
***
|
|
4
|
+
|
|
5
|
+
[@fgv/ts-web-extras](../README.md) / isFilePath
|
|
6
|
+
|
|
7
|
+
# Function: isFilePath()
|
|
8
|
+
|
|
9
|
+
> **isFilePath**(`path`): `boolean`
|
|
10
|
+
|
|
11
|
+
Determines if a path appears to be a file (has extension) or directory
|
|
12
|
+
|
|
13
|
+
## Parameters
|
|
14
|
+
|
|
15
|
+
| Parameter | Type |
|
|
16
|
+
| ------ | ------ |
|
|
17
|
+
| `path` | `string` |
|
|
18
|
+
|
|
19
|
+
## Returns
|
|
20
|
+
|
|
21
|
+
`boolean`
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
[**@fgv/ts-web-extras**](../README.md)
|
|
2
|
+
|
|
3
|
+
***
|
|
4
|
+
|
|
5
|
+
[@fgv/ts-web-extras](../README.md) / parseContextFilter
|
|
6
|
+
|
|
7
|
+
# Function: parseContextFilter()
|
|
8
|
+
|
|
9
|
+
> **parseContextFilter**(`contextFilter`): `Record`\<`string`, `string`\>
|
|
10
|
+
|
|
11
|
+
Converts context filter token to context object
|
|
12
|
+
Example: "language=en-US|territory=US" -\> { language: "en-US", territory: "US" }
|
|
13
|
+
|
|
14
|
+
## Parameters
|
|
15
|
+
|
|
16
|
+
| Parameter | Type |
|
|
17
|
+
| ------ | ------ |
|
|
18
|
+
| `contextFilter` | `string` |
|
|
19
|
+
|
|
20
|
+
## Returns
|
|
21
|
+
|
|
22
|
+
`Record`\<`string`, `string`\>
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
[**@fgv/ts-web-extras**](../README.md)
|
|
2
|
+
|
|
3
|
+
***
|
|
4
|
+
|
|
5
|
+
[@fgv/ts-web-extras](../README.md) / parseQualifierDefaults
|
|
6
|
+
|
|
7
|
+
# Function: parseQualifierDefaults()
|
|
8
|
+
|
|
9
|
+
> **parseQualifierDefaults**(`qualifierDefaults`): `Record`\<`string`, `string`[]\>
|
|
10
|
+
|
|
11
|
+
Converts qualifier defaults token to structured format
|
|
12
|
+
Example: "language=en-US,en-CA|territory=US" -\> { language: ["en-US", "en-CA"], territory: ["US"] }
|
|
13
|
+
|
|
14
|
+
## Parameters
|
|
15
|
+
|
|
16
|
+
| Parameter | Type |
|
|
17
|
+
| ------ | ------ |
|
|
18
|
+
| `qualifierDefaults` | `string` |
|
|
19
|
+
|
|
20
|
+
## Returns
|
|
21
|
+
|
|
22
|
+
`Record`\<`string`, `string`[]\>
|