@vrtmrz/livesync-commonlib 0.1.0-rc.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/LICENSE +21 -0
- package/README.md +49 -0
- package/dist/API/DirectFileManipulator.d.ts +2 -0
- package/dist/API/DirectFileManipulator.js +4 -0
- package/dist/API/DirectFileManipulatorV2.d.ts +150 -0
- package/dist/API/DirectFileManipulatorV2.js +424 -0
- package/dist/API/processSetting.d.ts +41 -0
- package/dist/API/processSetting.js +140 -0
- package/dist/ContentSplitter/ContentSplitter.d.ts +28 -0
- package/dist/ContentSplitter/ContentSplitter.js +5 -0
- package/dist/ContentSplitter/ContentSplitterBase.d.ts +51 -0
- package/dist/ContentSplitter/ContentSplitterBase.js +83 -0
- package/dist/ContentSplitter/ContentSplitterRabinKarp.d.ts +9 -0
- package/dist/ContentSplitter/ContentSplitterRabinKarp.js +32 -0
- package/dist/ContentSplitter/ContentSplitterV1.d.ts +9 -0
- package/dist/ContentSplitter/ContentSplitterV1.js +34 -0
- package/dist/ContentSplitter/ContentSplitterV2.d.ts +9 -0
- package/dist/ContentSplitter/ContentSplitterV2.js +34 -0
- package/dist/ContentSplitter/ContentSplitters.d.ts +12 -0
- package/dist/ContentSplitter/ContentSplitters.js +29 -0
- package/dist/bureau/bureau.d.ts +7 -0
- package/dist/bureau/bureau.js +5 -0
- package/dist/common/ConnectionString.d.ts +30 -0
- package/dist/common/ConnectionString.js +179 -0
- package/dist/common/LSError.d.ts +48 -0
- package/dist/common/LSError.js +112 -0
- package/dist/common/configForDoc.d.ts +79 -0
- package/dist/common/configForDoc.js +312 -0
- package/dist/common/coreEnvFunctions.d.ts +21 -0
- package/dist/common/coreEnvFunctions.js +22 -0
- package/dist/common/coreEnvVars.d.ts +3 -0
- package/dist/common/coreEnvVars.js +6 -0
- package/dist/common/i18n.d.ts +18 -0
- package/dist/common/i18n.js +7193 -0
- package/dist/common/logger.d.ts +2 -0
- package/dist/common/logger.js +1 -0
- package/dist/common/messages/combinedMessages.dev.d.ts +7 -0
- package/dist/common/messages/combinedMessages.dev.js +44 -0
- package/dist/common/messages/combinedMessages.prod.d.ts +9264 -0
- package/dist/common/messages/combinedMessages.prod.js +9271 -0
- package/dist/common/messages/de.d.ts +297 -0
- package/dist/common/messages/de.js +7 -0
- package/dist/common/messages/def.d.ts +1119 -0
- package/dist/common/messages/def.js +7 -0
- package/dist/common/messages/es.d.ts +689 -0
- package/dist/common/messages/es.js +7 -0
- package/dist/common/messages/fr.d.ts +582 -0
- package/dist/common/messages/fr.js +7 -0
- package/dist/common/messages/he.d.ts +583 -0
- package/dist/common/messages/he.js +7 -0
- package/dist/common/messages/ja.d.ts +838 -0
- package/dist/common/messages/ja.js +7 -0
- package/dist/common/messages/ko.d.ts +800 -0
- package/dist/common/messages/ko.js +7 -0
- package/dist/common/messages/ru.d.ts +858 -0
- package/dist/common/messages/ru.js +7 -0
- package/dist/common/messages/zh-tw.d.ts +384 -0
- package/dist/common/messages/zh-tw.js +7 -0
- package/dist/common/messages/zh.d.ts +1093 -0
- package/dist/common/messages/zh.js +7 -0
- package/dist/common/messagesJson/de.json +295 -0
- package/dist/common/messagesJson/en.json +1117 -0
- package/dist/common/messagesJson/es.json +687 -0
- package/dist/common/messagesJson/fr.json +580 -0
- package/dist/common/messagesJson/he.json +581 -0
- package/dist/common/messagesJson/ja.json +836 -0
- package/dist/common/messagesJson/ko.json +798 -0
- package/dist/common/messagesJson/ru.json +856 -0
- package/dist/common/messagesJson/zh-tw.json +382 -0
- package/dist/common/messagesJson/zh.json +1091 -0
- package/dist/common/models/auth.type.d.ts +41 -0
- package/dist/common/models/auth.type.js +0 -0
- package/dist/common/models/db.const.d.ts +20 -0
- package/dist/common/models/db.const.js +28 -0
- package/dist/common/models/db.definition.d.ts +56 -0
- package/dist/common/models/db.definition.js +6 -0
- package/dist/common/models/db.type.d.ts +142 -0
- package/dist/common/models/db.type.js +0 -0
- package/dist/common/models/diff.definition.d.ts +16 -0
- package/dist/common/models/diff.definition.js +0 -0
- package/dist/common/models/fileaccess.const.d.ts +7 -0
- package/dist/common/models/fileaccess.const.js +16 -0
- package/dist/common/models/fileaccess.type.d.ts +72 -0
- package/dist/common/models/fileaccess.type.js +0 -0
- package/dist/common/models/redflag.const.d.ts +32 -0
- package/dist/common/models/redflag.const.js +27 -0
- package/dist/common/models/setting.const.d.ts +49 -0
- package/dist/common/models/setting.const.defaults.d.ts +3 -0
- package/dist/common/models/setting.const.defaults.js +185 -0
- package/dist/common/models/setting.const.js +68 -0
- package/dist/common/models/setting.const.preferred.d.ts +5 -0
- package/dist/common/models/setting.const.preferred.js +35 -0
- package/dist/common/models/setting.const.qr.d.ts +2 -0
- package/dist/common/models/setting.const.qr.js +174 -0
- package/dist/common/models/setting.type.d.ts +900 -0
- package/dist/common/models/setting.type.js +8 -0
- package/dist/common/models/shared.const.behabiour.d.ts +28 -0
- package/dist/common/models/shared.const.behabiour.js +36 -0
- package/dist/common/models/shared.const.d.ts +5 -0
- package/dist/common/models/shared.const.js +12 -0
- package/dist/common/models/shared.const.symbols.d.ts +9 -0
- package/dist/common/models/shared.const.symbols.js +20 -0
- package/dist/common/models/shared.definition.configNames.d.ts +36 -0
- package/dist/common/models/shared.definition.configNames.js +203 -0
- package/dist/common/models/shared.definition.d.ts +22 -0
- package/dist/common/models/shared.definition.js +24 -0
- package/dist/common/models/shared.type.util.d.ts +8 -0
- package/dist/common/models/shared.type.util.js +0 -0
- package/dist/common/models/sync.definition.d.ts +18 -0
- package/dist/common/models/sync.definition.js +20 -0
- package/dist/common/models/tweak.definition.d.ts +191 -0
- package/dist/common/models/tweak.definition.js +77 -0
- package/dist/common/rosetta.d.ts +42 -0
- package/dist/common/rosetta.js +57 -0
- package/dist/common/settingConstants.d.ts +216 -0
- package/dist/common/settingConstants.js +434 -0
- package/dist/common/typeUtils.d.ts +17 -0
- package/dist/common/typeUtils.js +51 -0
- package/dist/common/types.d.ts +107 -0
- package/dist/common/types.js +212 -0
- package/dist/common/utils.d.ts +129 -0
- package/dist/common/utils.doc.d.ts +11 -0
- package/dist/common/utils.doc.js +35 -0
- package/dist/common/utils.js +583 -0
- package/dist/common/utils.object.d.ts +2 -0
- package/dist/common/utils.object.js +14 -0
- package/dist/common/utils.patch.d.ts +8 -0
- package/dist/common/utils.patch.js +178 -0
- package/dist/common/utils.type.d.ts +1 -0
- package/dist/common/utils.type.js +0 -0
- package/dist/context.d.ts +8 -0
- package/dist/context.js +14 -0
- package/dist/databases/IndexedDBKeyValueDatabase.d.ts +26 -0
- package/dist/databases/IndexedDBKeyValueDatabase.js +130 -0
- package/dist/dataobject/StoredMap.d.ts +12 -0
- package/dist/dataobject/StoredMap.js +47 -0
- package/dist/dev/checks.d.ts +5 -0
- package/dist/dev/checks.js +38 -0
- package/dist/encryption/encryptHKDF.d.ts +3 -0
- package/dist/encryption/encryptHKDF.js +7 -0
- package/dist/encryption/stringEncryption.d.ts +27 -0
- package/dist/encryption/stringEncryption.js +59 -0
- package/dist/events/coreEvents.d.ts +54 -0
- package/dist/events/coreEvents.js +46 -0
- package/dist/hub/hub.d.ts +11 -0
- package/dist/hub/hub.js +7 -0
- package/dist/index.d.ts +1 -0
- package/dist/index.js +4 -0
- package/dist/interfaces/AsyncActivityRunner.d.ts +18 -0
- package/dist/interfaces/AsyncActivityRunner.js +7 -0
- package/dist/interfaces/Confirm.d.ts +17 -0
- package/dist/interfaces/Confirm.js +0 -0
- package/dist/interfaces/DatabaseFileAccess.d.ts +14 -0
- package/dist/interfaces/DatabaseFileAccess.js +0 -0
- package/dist/interfaces/DatabaseRebuilder.d.ts +13 -0
- package/dist/interfaces/DatabaseRebuilder.js +0 -0
- package/dist/interfaces/FileHandler.d.ts +13 -0
- package/dist/interfaces/FileHandler.js +0 -0
- package/dist/interfaces/KeyValueDatabase.d.ts +11 -0
- package/dist/interfaces/KeyValueDatabase.js +0 -0
- package/dist/interfaces/ServiceModule.d.ts +59 -0
- package/dist/interfaces/ServiceModule.js +19 -0
- package/dist/interfaces/StorageAccess.d.ts +44 -0
- package/dist/interfaces/StorageAccess.js +0 -0
- package/dist/interfaces/StorageEventManager.d.ts +16 -0
- package/dist/interfaces/StorageEventManager.js +5 -0
- package/dist/managers/ChangeManager.d.ts +61 -0
- package/dist/managers/ChangeManager.js +104 -0
- package/dist/managers/ChunkDeliveryCoordinator.d.ts +51 -0
- package/dist/managers/ChunkDeliveryCoordinator.js +136 -0
- package/dist/managers/ChunkFetcher.d.ts +44 -0
- package/dist/managers/ChunkFetcher.js +251 -0
- package/dist/managers/ChunkManager.d.ts +2 -0
- package/dist/managers/ChunkManager.js +4 -0
- package/dist/managers/ConflictManager.d.ts +37 -0
- package/dist/managers/ConflictManager.js +322 -0
- package/dist/managers/EntryManager/EntryManager.d.ts +37 -0
- package/dist/managers/EntryManager/EntryManager.js +73 -0
- package/dist/managers/EntryManager/EntryManagerImpls.d.ts +74 -0
- package/dist/managers/EntryManager/EntryManagerImpls.js +499 -0
- package/dist/managers/HashManager/HashManager.d.ts +60 -0
- package/dist/managers/HashManager/HashManager.js +97 -0
- package/dist/managers/HashManager/HashManagerCore.d.ts +114 -0
- package/dist/managers/HashManager/HashManagerCore.js +99 -0
- package/dist/managers/HashManager/PureJSHashManager.d.ts +77 -0
- package/dist/managers/HashManager/PureJSHashManager.js +84 -0
- package/dist/managers/HashManager/XXHashHashManager.d.ts +96 -0
- package/dist/managers/HashManager/XXHashHashManager.js +111 -0
- package/dist/managers/LayeredChunkManager/ArrivalWaitLayer.d.ts +30 -0
- package/dist/managers/LayeredChunkManager/ArrivalWaitLayer.js +115 -0
- package/dist/managers/LayeredChunkManager/CacheLayer.d.ts +59 -0
- package/dist/managers/LayeredChunkManager/CacheLayer.js +161 -0
- package/dist/managers/LayeredChunkManager/ChunkLayerInterfaces.d.ts +37 -0
- package/dist/managers/LayeredChunkManager/ChunkLayerInterfaces.js +0 -0
- package/dist/managers/LayeredChunkManager/DatabaseReadLayer.d.ts +14 -0
- package/dist/managers/LayeredChunkManager/DatabaseReadLayer.js +78 -0
- package/dist/managers/LayeredChunkManager/DatabaseWriteLayer.d.ts +11 -0
- package/dist/managers/LayeredChunkManager/DatabaseWriteLayer.js +43 -0
- package/dist/managers/LayeredChunkManager/HotPackLayer.d.ts +9 -0
- package/dist/managers/LayeredChunkManager/HotPackLayer.js +8 -0
- package/dist/managers/LayeredChunkManager/types.d.ts +39 -0
- package/dist/managers/LayeredChunkManager/types.js +0 -0
- package/dist/managers/LayeredChunkManager.d.ts +53 -0
- package/dist/managers/LayeredChunkManager.js +240 -0
- package/dist/managers/LiveSyncManagers.d.ts +48 -0
- package/dist/managers/LiveSyncManagers.js +136 -0
- package/dist/managers/StorageEventManager.d.ts +135 -0
- package/dist/managers/StorageEventManager.js +564 -0
- package/dist/managers/StorageProcessingManager.d.ts +14 -0
- package/dist/managers/StorageProcessingManager.js +48 -0
- package/dist/managers/adapters/IStorageEventConverterAdapter.d.ts +16 -0
- package/dist/managers/adapters/IStorageEventConverterAdapter.js +0 -0
- package/dist/managers/adapters/IStorageEventManagerAdapter.d.ts +18 -0
- package/dist/managers/adapters/IStorageEventManagerAdapter.js +0 -0
- package/dist/managers/adapters/IStorageEventPersistenceAdapter.d.ts +15 -0
- package/dist/managers/adapters/IStorageEventPersistenceAdapter.js +0 -0
- package/dist/managers/adapters/IStorageEventStatusAdapter.d.ts +13 -0
- package/dist/managers/adapters/IStorageEventStatusAdapter.js +0 -0
- package/dist/managers/adapters/IStorageEventTypeGuardAdapter.d.ts +16 -0
- package/dist/managers/adapters/IStorageEventTypeGuardAdapter.js +0 -0
- package/dist/managers/adapters/IStorageEventWatchAdapter.d.ts +21 -0
- package/dist/managers/adapters/IStorageEventWatchAdapter.js +0 -0
- package/dist/managers/adapters/index.d.ts +6 -0
- package/dist/managers/adapters/index.js +0 -0
- package/dist/mock_and_interop/stores.d.ts +21 -0
- package/dist/mock_and_interop/stores.js +15 -0
- package/dist/mock_and_interop/wrapper.d.ts +7 -0
- package/dist/mock_and_interop/wrapper.js +37 -0
- package/dist/mods.d.ts +1 -0
- package/dist/mods.js +18 -0
- package/dist/platform/browser/index.d.ts +1 -0
- package/dist/platform/browser/index.js +10 -0
- package/dist/platform/browser/storage.d.ts +35 -0
- package/dist/platform/browser/storage.js +139 -0
- package/dist/platform/node/index.d.ts +23 -0
- package/dist/platform/node/index.js +33 -0
- package/dist/platform/node/storage.d.ts +31 -0
- package/dist/platform/node/storage.js +104 -0
- package/dist/platform/storagePath.d.ts +7 -0
- package/dist/platform/storagePath.js +20 -0
- package/dist/pouchdb/LiveSyncDBFunctions.d.ts +14 -0
- package/dist/pouchdb/LiveSyncDBFunctions.js +129 -0
- package/dist/pouchdb/LiveSyncLocalDB.d.ts +196 -0
- package/dist/pouchdb/LiveSyncLocalDB.js +381 -0
- package/dist/pouchdb/PouchDBConstructor.d.ts +3 -0
- package/dist/pouchdb/PouchDBConstructor.js +0 -0
- package/dist/pouchdb/ReplicatorShim.d.ts +51 -0
- package/dist/pouchdb/ReplicatorShim.js +109 -0
- package/dist/pouchdb/StreamingFetch.d.ts +19 -0
- package/dist/pouchdb/StreamingFetch.js +263 -0
- package/dist/pouchdb/chunks.d.ts +38 -0
- package/dist/pouchdb/chunks.js +314 -0
- package/dist/pouchdb/compress.d.ts +11 -0
- package/dist/pouchdb/compress.js +99 -0
- package/dist/pouchdb/encryption.d.ts +20 -0
- package/dist/pouchdb/encryption.js +458 -0
- package/dist/pouchdb/negotiation.d.ts +9 -0
- package/dist/pouchdb/negotiation.js +109 -0
- package/dist/pouchdb/pouchdb-browser.d.ts +2 -0
- package/dist/pouchdb/pouchdb-browser.js +96 -0
- package/dist/pouchdb/pouchdb-http.d.ts +2 -0
- package/dist/pouchdb/pouchdb-http.js +94 -0
- package/dist/pouchdb/pouchdb-test.d.ts +2 -0
- package/dist/pouchdb/pouchdb-test.js +12 -0
- package/dist/pouchdb/utils_couchdb.d.ts +4 -0
- package/dist/pouchdb/utils_couchdb.js +38 -0
- package/dist/replication/LiveSyncAbstractReplicator.d.ts +69 -0
- package/dist/replication/LiveSyncAbstractReplicator.js +92 -0
- package/dist/replication/SyncParamsHandler.d.ts +35 -0
- package/dist/replication/SyncParamsHandler.js +118 -0
- package/dist/replication/couchdb/LiveSyncReplicator.d.ts +85 -0
- package/dist/replication/couchdb/LiveSyncReplicator.js +1132 -0
- package/dist/replication/httplib.d.ts +75 -0
- package/dist/replication/httplib.js +187 -0
- package/dist/replication/journal/JournalSyncCore.d.ts +70 -0
- package/dist/replication/journal/JournalSyncCore.js +737 -0
- package/dist/replication/journal/JournalSyncTypes.d.ts +9 -0
- package/dist/replication/journal/JournalSyncTypes.js +11 -0
- package/dist/replication/journal/LiveSyncJournalReplicator.d.ts +40 -0
- package/dist/replication/journal/LiveSyncJournalReplicator.js +294 -0
- package/dist/replication/journal/LiveSyncJournalReplicatorEnv.d.ts +3 -0
- package/dist/replication/journal/LiveSyncJournalReplicatorEnv.js +0 -0
- package/dist/replication/journal/objectstore/JournalStorageAdapter.d.ts +15 -0
- package/dist/replication/journal/objectstore/JournalStorageAdapter.js +0 -0
- package/dist/replication/journal/objectstore/MinioStorageAdapter.d.ts +21 -0
- package/dist/replication/journal/objectstore/MinioStorageAdapter.js +204 -0
- package/dist/replication/trystero/LiveSyncTrysteroReplicator.d.ts +90 -0
- package/dist/replication/trystero/LiveSyncTrysteroReplicator.js +380 -0
- package/dist/replication/trystero/P2PLogCollector.d.ts +8 -0
- package/dist/replication/trystero/P2PLogCollector.js +91 -0
- package/dist/replication/trystero/P2PReplicatorBase.d.ts +19 -0
- package/dist/replication/trystero/P2PReplicatorBase.js +0 -0
- package/dist/replication/trystero/P2PReplicatorCore.d.ts +12 -0
- package/dist/replication/trystero/P2PReplicatorCore.js +126 -0
- package/dist/replication/trystero/P2PReplicatorPaneCommon.d.ts +41 -0
- package/dist/replication/trystero/P2PReplicatorPaneCommon.js +20 -0
- package/dist/replication/trystero/ProxiedDB.d.ts +13 -0
- package/dist/replication/trystero/ProxiedDB.js +20 -0
- package/dist/replication/trystero/TrysteroReplicator.d.ts +152 -0
- package/dist/replication/trystero/TrysteroReplicator.js +683 -0
- package/dist/replication/trystero/TrysteroReplicatorP2PClient.d.ts +19 -0
- package/dist/replication/trystero/TrysteroReplicatorP2PClient.js +80 -0
- package/dist/replication/trystero/TrysteroReplicatorP2PConnection.d.ts +2 -0
- package/dist/replication/trystero/TrysteroReplicatorP2PConnection.js +4 -0
- package/dist/replication/trystero/TrysteroReplicatorP2PServer.d.ts +117 -0
- package/dist/replication/trystero/TrysteroReplicatorP2PServer.js +540 -0
- package/dist/replication/trystero/UseP2PReplicatorResult.d.ts +11 -0
- package/dist/replication/trystero/UseP2PReplicatorResult.js +0 -0
- package/dist/replication/trystero/addP2PEventHandlers.d.ts +35 -0
- package/dist/replication/trystero/addP2PEventHandlers.js +43 -0
- package/dist/replication/trystero/rpcCompat.d.ts +1 -0
- package/dist/replication/trystero/rpcCompat.js +9 -0
- package/dist/replication/trystero/types.d.ts +95 -0
- package/dist/replication/trystero/types.js +27 -0
- package/dist/replication/trystero/useP2PReplicatorCommands.d.ts +7 -0
- package/dist/replication/trystero/useP2PReplicatorCommands.js +25 -0
- package/dist/replication/trystero/useP2PReplicatorFeature.d.ts +17 -0
- package/dist/replication/trystero/useP2PReplicatorFeature.js +82 -0
- package/dist/rpc/RpcRoom.d.ts +24 -0
- package/dist/rpc/RpcRoom.js +300 -0
- package/dist/rpc/RpcSession.d.ts +9 -0
- package/dist/rpc/RpcSession.js +32 -0
- package/dist/rpc/chunking.d.ts +11 -0
- package/dist/rpc/chunking.js +58 -0
- package/dist/rpc/errors.d.ts +8 -0
- package/dist/rpc/errors.js +26 -0
- package/dist/rpc/index.d.ts +6 -0
- package/dist/rpc/index.js +12 -0
- package/dist/rpc/pouchdb/RpcPouchDBProxy.d.ts +75 -0
- package/dist/rpc/pouchdb/RpcPouchDBProxy.js +115 -0
- package/dist/rpc/pouchdb/RpcPouchDBServer.d.ts +16 -0
- package/dist/rpc/pouchdb/RpcPouchDBServer.js +55 -0
- package/dist/rpc/transports/DiagRTCPeerConnections.d.ts +24 -0
- package/dist/rpc/transports/DiagRTCPeerConnections.js +208 -0
- package/dist/rpc/transports/DiagRTCPeerConnections.types.d.ts +64 -0
- package/dist/rpc/transports/DiagRTCPeerConnections.types.js +12 -0
- package/dist/rpc/transports/DiagRTCPeerConnections.utils.d.ts +33 -0
- package/dist/rpc/transports/DiagRTCPeerConnections.utils.js +217 -0
- package/dist/rpc/transports/TrysteroTransport.d.ts +216 -0
- package/dist/rpc/transports/TrysteroTransport.js +134 -0
- package/dist/rpc/transports/trysteroUtils.d.ts +3 -0
- package/dist/rpc/transports/trysteroUtils.js +37 -0
- package/dist/rpc/types.d.ts +75 -0
- package/dist/rpc/types.js +6 -0
- package/dist/serviceFeatures/checkRemoteSize.d.ts +28 -0
- package/dist/serviceFeatures/checkRemoteSize.js +178 -0
- package/dist/serviceFeatures/offlineScanner.d.ts +128 -0
- package/dist/serviceFeatures/offlineScanner.js +553 -0
- package/dist/serviceFeatures/prepareDatabaseForUse.d.ts +20 -0
- package/dist/serviceFeatures/prepareDatabaseForUse.js +39 -0
- package/dist/serviceFeatures/remoteConfig.d.ts +46 -0
- package/dist/serviceFeatures/remoteConfig.js +247 -0
- package/dist/serviceFeatures/setupObsidian/qrCode.d.ts +4 -0
- package/dist/serviceFeatures/setupObsidian/qrCode.js +67 -0
- package/dist/serviceFeatures/setupObsidian/setupUri.d.ts +7 -0
- package/dist/serviceFeatures/setupObsidian/setupUri.js +70 -0
- package/dist/serviceFeatures/setupObsidian/types.d.ts +2 -0
- package/dist/serviceFeatures/setupObsidian/types.js +0 -0
- package/dist/serviceFeatures/targetFilter.d.ts +24 -0
- package/dist/serviceFeatures/targetFilter.js +178 -0
- package/dist/serviceModules/FileAccessBase.d.ts +93 -0
- package/dist/serviceModules/FileAccessBase.js +219 -0
- package/dist/serviceModules/Rebuilder.d.ts +92 -0
- package/dist/serviceModules/Rebuilder.js +449 -0
- package/dist/serviceModules/ServiceDatabaseFileAccessBase.d.ts +40 -0
- package/dist/serviceModules/ServiceDatabaseFileAccessBase.js +306 -0
- package/dist/serviceModules/ServiceFileAccessBase.d.ts +64 -0
- package/dist/serviceModules/ServiceFileAccessBase.js +312 -0
- package/dist/serviceModules/ServiceFileHandlerBase.d.ts +52 -0
- package/dist/serviceModules/ServiceFileHandlerBase.js +493 -0
- package/dist/serviceModules/ServiceModuleBase.d.ts +10 -0
- package/dist/serviceModules/ServiceModuleBase.js +13 -0
- package/dist/serviceModules/adapters/IConversionAdapter.d.ts +15 -0
- package/dist/serviceModules/adapters/IConversionAdapter.js +0 -0
- package/dist/serviceModules/adapters/IFileSystemAdapter.d.ts +47 -0
- package/dist/serviceModules/adapters/IFileSystemAdapter.js +0 -0
- package/dist/serviceModules/adapters/IPathAdapter.d.ts +15 -0
- package/dist/serviceModules/adapters/IPathAdapter.js +0 -0
- package/dist/serviceModules/adapters/IStorageAdapter.d.ts +56 -0
- package/dist/serviceModules/adapters/IStorageAdapter.js +0 -0
- package/dist/serviceModules/adapters/ITypeGuardAdapter.d.ts +14 -0
- package/dist/serviceModules/adapters/ITypeGuardAdapter.js +0 -0
- package/dist/serviceModules/adapters/IVaultAdapter.d.ts +51 -0
- package/dist/serviceModules/adapters/IVaultAdapter.js +0 -0
- package/dist/serviceModules/adapters/index.d.ts +6 -0
- package/dist/serviceModules/adapters/index.js +0 -0
- package/dist/services/BrowserServices.d.ts +36 -0
- package/dist/services/BrowserServices.js +123 -0
- package/dist/services/HeadlessServices.d.ts +14 -0
- package/dist/services/HeadlessServices.js +144 -0
- package/dist/services/InjectableServices.d.ts +1 -0
- package/dist/services/InjectableServices.js +4 -0
- package/dist/services/ServiceHub.d.ts +82 -0
- package/dist/services/ServiceHub.js +66 -0
- package/dist/services/base/APIService.d.ts +93 -0
- package/dist/services/base/APIService.js +44 -0
- package/dist/services/base/AppLifecycleService.d.ts +132 -0
- package/dist/services/base/AppLifecycleService.js +123 -0
- package/dist/services/base/ConfigService.d.ts +7 -0
- package/dist/services/base/ConfigService.js +6 -0
- package/dist/services/base/ConflictService.d.ts +54 -0
- package/dist/services/base/ConflictService.js +22 -0
- package/dist/services/base/ControlService.d.ts +54 -0
- package/dist/services/base/ControlService.js +103 -0
- package/dist/services/base/DatabaseEventService.d.ts +38 -0
- package/dist/services/base/DatabaseEventService.js +38 -0
- package/dist/services/base/DatabaseService.d.ts +40 -0
- package/dist/services/base/DatabaseService.js +79 -0
- package/dist/services/base/FileProcessingService.d.ts +25 -0
- package/dist/services/base/FileProcessingService.js +28 -0
- package/dist/services/base/IService.d.ts +284 -0
- package/dist/services/base/IService.js +1 -0
- package/dist/services/base/KeyValueDBService.d.ts +42 -0
- package/dist/services/base/KeyValueDBService.js +133 -0
- package/dist/services/base/MessageTranslator.d.ts +6 -0
- package/dist/services/base/MessageTranslator.js +4 -0
- package/dist/services/base/PathService.d.ts +38 -0
- package/dist/services/base/PathService.js +66 -0
- package/dist/services/base/RemoteService.d.ts +61 -0
- package/dist/services/base/RemoteService.js +212 -0
- package/dist/services/base/ReplicationService.d.ts +92 -0
- package/dist/services/base/ReplicationService.js +261 -0
- package/dist/services/base/ReplicatorService.d.ts +66 -0
- package/dist/services/base/ReplicatorService.js +164 -0
- package/dist/services/base/ServiceBase.d.ts +33 -0
- package/dist/services/base/ServiceBase.js +27 -0
- package/dist/services/base/SettingService.d.ts +112 -0
- package/dist/services/base/SettingService.js +543 -0
- package/dist/services/base/TestService.d.ts +28 -0
- package/dist/services/base/TestService.js +19 -0
- package/dist/services/base/TweakValueService.d.ts +40 -0
- package/dist/services/base/TweakValueService.js +6 -0
- package/dist/services/base/UnresolvedErrorManager.d.ts +15 -0
- package/dist/services/base/UnresolvedErrorManager.js +44 -0
- package/dist/services/base/VaultService.d.ts +69 -0
- package/dist/services/base/VaultService.js +70 -0
- package/dist/services/implements/base/SvelteDialog.d.ts +79 -0
- package/dist/services/implements/base/SvelteDialog.js +134 -0
- package/dist/services/implements/base/UIService.d.ts +24 -0
- package/dist/services/implements/base/UIService.js +37 -0
- package/dist/services/implements/browser/BrowserAPIService.d.ts +54 -0
- package/dist/services/implements/browser/BrowserAPIService.js +298 -0
- package/dist/services/implements/browser/BrowserDatabaseService.d.ts +7 -0
- package/dist/services/implements/browser/BrowserDatabaseService.js +10 -0
- package/dist/services/implements/browser/ConfigServiceBrowserCompat.d.ts +16 -0
- package/dist/services/implements/browser/ConfigServiceBrowserCompat.js +23 -0
- package/dist/services/implements/headless/HeadlessAPIService.d.ts +52 -0
- package/dist/services/implements/headless/HeadlessAPIService.js +127 -0
- package/dist/services/implements/headless/HeadlessDatabaseService.d.ts +7 -0
- package/dist/services/implements/headless/HeadlessDatabaseService.js +10 -0
- package/dist/services/implements/injectable/InjectableAPIService.d.ts +7 -0
- package/dist/services/implements/injectable/InjectableAPIService.js +18 -0
- package/dist/services/implements/injectable/InjectableAppLifecycleService.d.ts +11 -0
- package/dist/services/implements/injectable/InjectableAppLifecycleService.js +14 -0
- package/dist/services/implements/injectable/InjectableConflictService.d.ts +11 -0
- package/dist/services/implements/injectable/InjectableConflictService.js +14 -0
- package/dist/services/implements/injectable/InjectableDatabaseEventService.d.ts +4 -0
- package/dist/services/implements/injectable/InjectableDatabaseEventService.js +7 -0
- package/dist/services/implements/injectable/InjectableFileProcessingService.d.ts +4 -0
- package/dist/services/implements/injectable/InjectableFileProcessingService.js +6 -0
- package/dist/services/implements/injectable/InjectablePathService.d.ts +12 -0
- package/dist/services/implements/injectable/InjectablePathService.js +36 -0
- package/dist/services/implements/injectable/InjectableRemoteService.d.ts +4 -0
- package/dist/services/implements/injectable/InjectableRemoteService.js +7 -0
- package/dist/services/implements/injectable/InjectableReplicationService.d.ts +4 -0
- package/dist/services/implements/injectable/InjectableReplicationService.js +6 -0
- package/dist/services/implements/injectable/InjectableReplicatorService.d.ts +4 -0
- package/dist/services/implements/injectable/InjectableReplicatorService.js +7 -0
- package/dist/services/implements/injectable/InjectableServiceHub.d.ts +72 -0
- package/dist/services/implements/injectable/InjectableServiceHub.js +125 -0
- package/dist/services/implements/injectable/InjectableServices.d.ts +36 -0
- package/dist/services/implements/injectable/InjectableServices.js +1 -0
- package/dist/services/implements/injectable/InjectableSettingService.d.ts +11 -0
- package/dist/services/implements/injectable/InjectableSettingService.js +33 -0
- package/dist/services/implements/injectable/InjectableTestService.d.ts +5 -0
- package/dist/services/implements/injectable/InjectableTestService.js +8 -0
- package/dist/services/implements/injectable/InjectableTweakValueService.d.ts +15 -0
- package/dist/services/implements/injectable/InjectableTweakValueService.js +12 -0
- package/dist/services/implements/injectable/InjectableVaultService.d.ts +9 -0
- package/dist/services/implements/injectable/InjectableVaultService.js +20 -0
- package/dist/services/lib/HandlerUtils.d.ts +374 -0
- package/dist/services/lib/HandlerUtils.js +412 -0
- package/dist/services/lib/logUtils.d.ts +13 -0
- package/dist/services/lib/logUtils.js +28 -0
- package/dist/services/lib/remoteActivity.d.ts +13 -0
- package/dist/services/lib/remoteActivity.js +11 -0
- package/dist/string_and_binary/chunks.d.ts +10 -0
- package/dist/string_and_binary/chunks.js +561 -0
- package/dist/string_and_binary/convert.d.ts +8 -0
- package/dist/string_and_binary/convert.js +46 -0
- package/dist/string_and_binary/hash.d.ts +2 -0
- package/dist/string_and_binary/hash.js +1 -0
- package/dist/string_and_binary/path.d.ts +35 -0
- package/dist/string_and_binary/path.js +240 -0
- package/dist/worker/bg.common.d.ts +2 -0
- package/dist/worker/bg.common.js +6 -0
- package/dist/worker/bg.worker.d.ts +1 -0
- package/dist/worker/bg.worker.encryption.d.ts +7 -0
- package/dist/worker/bg.worker.encryption.js +30 -0
- package/dist/worker/bg.worker.js +14 -0
- package/dist/worker/bg.worker.splitting.d.ts +6 -0
- package/dist/worker/bg.worker.splitting.js +36 -0
- package/dist/worker/bgWorker.d.ts +25 -0
- package/dist/worker/bgWorker.direct.d.ts +40 -0
- package/dist/worker/bgWorker.direct.js +65 -0
- package/dist/worker/bgWorker.encryption.d.ts +22 -0
- package/dist/worker/bgWorker.encryption.js +40 -0
- package/dist/worker/bgWorker.js +348 -0
- package/dist/worker/bgWorker.splitting.d.ts +27 -0
- package/dist/worker/bgWorker.splitting.js +123 -0
- package/dist/worker/universalTypes.d.ts +63 -0
- package/dist/worker/universalTypes.js +4 -0
- package/docs/development.md +51 -0
- package/docs/platform-storage.md +60 -0
- package/docs/releasing.md +69 -0
- package/package.json +693 -0
|
@@ -0,0 +1,561 @@
|
|
|
1
|
+
function isTextBlob(blob) {
|
|
2
|
+
return blob.type === "text/plain";
|
|
3
|
+
}
|
|
4
|
+
import { LOG_LEVEL_VERBOSE, Logger } from "../common/logger.js";
|
|
5
|
+
import { arrayBufferToBase64Single, readString } from "./convert.js";
|
|
6
|
+
import { wrapByDefault } from "../common/utils.js";
|
|
7
|
+
import { compatGlobal } from "../common/coreEnvFunctions.js";
|
|
8
|
+
function* pickPiece(leftData, minimumChunkSize) {
|
|
9
|
+
let buffer = "";
|
|
10
|
+
L1: do {
|
|
11
|
+
const curLine = leftData.shift();
|
|
12
|
+
if (typeof curLine === "undefined") {
|
|
13
|
+
yield buffer;
|
|
14
|
+
break L1;
|
|
15
|
+
}
|
|
16
|
+
if (curLine.startsWith("```") || curLine.startsWith(" ```") || curLine.startsWith(" ```") || curLine.startsWith(" ```")) {
|
|
17
|
+
yield buffer;
|
|
18
|
+
buffer = curLine + (leftData.length != 0 ? "\n" : "");
|
|
19
|
+
L2: do {
|
|
20
|
+
const curPx = leftData.shift();
|
|
21
|
+
if (typeof curPx === "undefined") {
|
|
22
|
+
break L2;
|
|
23
|
+
}
|
|
24
|
+
buffer += curPx + (leftData.length != 0 ? "\n" : "");
|
|
25
|
+
} while (leftData.length > 0 && !(leftData[0].startsWith("```") || leftData[0].startsWith(" ```") || leftData[0].startsWith(" ```") || leftData[0].startsWith(" ```")));
|
|
26
|
+
const isLooksLikeBASE64 = buffer.endsWith("=");
|
|
27
|
+
const maybeUneditable = buffer.length > 2048;
|
|
28
|
+
const endOfCodeBlock = leftData.shift();
|
|
29
|
+
if (typeof endOfCodeBlock !== "undefined") {
|
|
30
|
+
buffer += endOfCodeBlock;
|
|
31
|
+
buffer += leftData.length != 0 ? "\n" : "";
|
|
32
|
+
}
|
|
33
|
+
if (!isLooksLikeBASE64 && !maybeUneditable) {
|
|
34
|
+
const splitExpr = /(.*?[;,:<])/g;
|
|
35
|
+
const sx = buffer.split(splitExpr).filter((e) => e != "");
|
|
36
|
+
for (const v of sx) {
|
|
37
|
+
yield v;
|
|
38
|
+
}
|
|
39
|
+
} else {
|
|
40
|
+
yield buffer;
|
|
41
|
+
}
|
|
42
|
+
buffer = "";
|
|
43
|
+
} else {
|
|
44
|
+
buffer += curLine + (leftData.length != 0 ? "\n" : "");
|
|
45
|
+
if (buffer.length >= minimumChunkSize || leftData.length == 0 || leftData[0] == "#" || buffer[0] == "#") {
|
|
46
|
+
yield buffer;
|
|
47
|
+
buffer = "";
|
|
48
|
+
}
|
|
49
|
+
}
|
|
50
|
+
} while (leftData.length > 0);
|
|
51
|
+
}
|
|
52
|
+
const charNewLine = "\n".charCodeAt(0);
|
|
53
|
+
const segmenter = "Segmenter" in Intl ? wrapByDefault(
|
|
54
|
+
// @ts-ignore We have checked Intl existence above.
|
|
55
|
+
// eslint-disable-next-line @typescript-eslint/no-unsafe-call, @typescript-eslint/no-unsafe-return
|
|
56
|
+
() => new Intl.Segmenter(compatGlobal.navigator.language, { granularity: "sentence" }),
|
|
57
|
+
(err) => {
|
|
58
|
+
Logger(`Failed to create Intl.Segmenter: ${err.message}`, LOG_LEVEL_VERBOSE);
|
|
59
|
+
return void 0;
|
|
60
|
+
}
|
|
61
|
+
) : void 0;
|
|
62
|
+
function* splitStringWithinLength(text, pieceSize) {
|
|
63
|
+
let leftData = text;
|
|
64
|
+
do {
|
|
65
|
+
const splitSize = pieceSize;
|
|
66
|
+
const piece = leftData.substring(0, splitSize);
|
|
67
|
+
leftData = leftData.substring(splitSize);
|
|
68
|
+
yield piece;
|
|
69
|
+
} while (leftData != "");
|
|
70
|
+
}
|
|
71
|
+
function* splitTextInSegment(text, pieceSize, minimumChunkSize) {
|
|
72
|
+
const segments = segmenter.segment(text);
|
|
73
|
+
let prev = "";
|
|
74
|
+
let buf = "";
|
|
75
|
+
for (const seg of segments) {
|
|
76
|
+
const buffer = seg.segment;
|
|
77
|
+
if (prev == buffer || buf.length < minimumChunkSize) {
|
|
78
|
+
buf += buffer;
|
|
79
|
+
prev = buffer;
|
|
80
|
+
} else {
|
|
81
|
+
prev = buffer;
|
|
82
|
+
if (buf.length > 0) {
|
|
83
|
+
yield* splitStringWithinLength(buf, pieceSize);
|
|
84
|
+
}
|
|
85
|
+
buf = buffer;
|
|
86
|
+
}
|
|
87
|
+
}
|
|
88
|
+
if (buf.length > 0) {
|
|
89
|
+
yield* splitStringWithinLength(buf, pieceSize);
|
|
90
|
+
}
|
|
91
|
+
}
|
|
92
|
+
function* splitInNewLine(texts) {
|
|
93
|
+
for (const text of texts) {
|
|
94
|
+
let start = -1;
|
|
95
|
+
let end = -1;
|
|
96
|
+
do {
|
|
97
|
+
end = text.indexOf("\n", start);
|
|
98
|
+
if (end == -1) {
|
|
99
|
+
yield text.substring(start);
|
|
100
|
+
break;
|
|
101
|
+
}
|
|
102
|
+
while (text[end] == "\n") {
|
|
103
|
+
end++;
|
|
104
|
+
}
|
|
105
|
+
yield text.substring(start, end);
|
|
106
|
+
start = end;
|
|
107
|
+
} while (end != -1);
|
|
108
|
+
}
|
|
109
|
+
return;
|
|
110
|
+
}
|
|
111
|
+
function splitPiecesTextV2(dataSrc, pieceSize, minimumChunkSize) {
|
|
112
|
+
const dataListAllArray = typeof dataSrc == "string" ? [dataSrc] : dataSrc;
|
|
113
|
+
const dataListAll = splitInNewLine(dataListAllArray);
|
|
114
|
+
let inCodeBlock = 0;
|
|
115
|
+
let flush = false;
|
|
116
|
+
let flushBefore = false;
|
|
117
|
+
return function* () {
|
|
118
|
+
const buf = [];
|
|
119
|
+
for (const line of dataListAll) {
|
|
120
|
+
if (line.startsWith("````")) {
|
|
121
|
+
if (inCodeBlock == 0) {
|
|
122
|
+
inCodeBlock = 4;
|
|
123
|
+
flushBefore = true;
|
|
124
|
+
} else if (inCodeBlock == 4) {
|
|
125
|
+
inCodeBlock = 0;
|
|
126
|
+
flush = true;
|
|
127
|
+
}
|
|
128
|
+
} else if (line.startsWith("```")) {
|
|
129
|
+
if (inCodeBlock == 0) {
|
|
130
|
+
inCodeBlock = 3;
|
|
131
|
+
flushBefore = true;
|
|
132
|
+
} else if (inCodeBlock == 3) {
|
|
133
|
+
inCodeBlock = 0;
|
|
134
|
+
flush = true;
|
|
135
|
+
}
|
|
136
|
+
}
|
|
137
|
+
if (flushBefore) {
|
|
138
|
+
if (buf.length > 0) {
|
|
139
|
+
yield* splitTextInSegment(buf.join(""), pieceSize, minimumChunkSize);
|
|
140
|
+
buf.length = 0;
|
|
141
|
+
}
|
|
142
|
+
flushBefore = false;
|
|
143
|
+
}
|
|
144
|
+
buf.push(line);
|
|
145
|
+
if (flush) {
|
|
146
|
+
if (buf.length > 0) {
|
|
147
|
+
yield* splitStringWithinLength(buf.join(""), pieceSize);
|
|
148
|
+
buf.length = 0;
|
|
149
|
+
}
|
|
150
|
+
flush = false;
|
|
151
|
+
}
|
|
152
|
+
}
|
|
153
|
+
if (buf.length > 0) {
|
|
154
|
+
if (inCodeBlock == 0) {
|
|
155
|
+
yield* splitTextInSegment(buf.join(""), pieceSize, minimumChunkSize);
|
|
156
|
+
} else {
|
|
157
|
+
yield* splitStringWithinLength(buf.join(""), pieceSize);
|
|
158
|
+
}
|
|
159
|
+
}
|
|
160
|
+
};
|
|
161
|
+
}
|
|
162
|
+
function binaryTextSplit(data, pieceSize, minimumChunkSize) {
|
|
163
|
+
return function* pieces() {
|
|
164
|
+
yield* splitStringWithinLength(data, pieceSize);
|
|
165
|
+
};
|
|
166
|
+
}
|
|
167
|
+
function splitPiecesText(dataSrc, pieceSize, plainSplit, minimumChunkSize, useSegmenter) {
|
|
168
|
+
if (!useSegmenter || !segmenter) {
|
|
169
|
+
return splitPiecesTextV1(dataSrc, pieceSize, plainSplit, minimumChunkSize);
|
|
170
|
+
}
|
|
171
|
+
if (!plainSplit) {
|
|
172
|
+
return binaryTextSplit(dataSrc, pieceSize, minimumChunkSize);
|
|
173
|
+
}
|
|
174
|
+
return splitPiecesTextV2(dataSrc, pieceSize, minimumChunkSize);
|
|
175
|
+
}
|
|
176
|
+
function splitPiecesTextV1(dataSrc, pieceSize, plainSplit, minimumChunkSize) {
|
|
177
|
+
const dataList = typeof dataSrc == "string" ? [dataSrc] : dataSrc;
|
|
178
|
+
return function* pieces() {
|
|
179
|
+
for (const data of dataList) {
|
|
180
|
+
if (plainSplit) {
|
|
181
|
+
const leftData = data.split("\n");
|
|
182
|
+
const f = pickPiece(leftData, minimumChunkSize);
|
|
183
|
+
for (const piece of f) {
|
|
184
|
+
let buffer = piece;
|
|
185
|
+
do {
|
|
186
|
+
let ps = pieceSize;
|
|
187
|
+
if (buffer.charCodeAt(ps - 1) != buffer.codePointAt(ps - 1)) {
|
|
188
|
+
ps++;
|
|
189
|
+
}
|
|
190
|
+
yield buffer.substring(0, ps);
|
|
191
|
+
buffer = buffer.substring(ps);
|
|
192
|
+
} while (buffer != "");
|
|
193
|
+
}
|
|
194
|
+
} else {
|
|
195
|
+
let leftData = data;
|
|
196
|
+
do {
|
|
197
|
+
const splitSize = pieceSize;
|
|
198
|
+
const piece = leftData.substring(0, splitSize);
|
|
199
|
+
leftData = leftData.substring(splitSize);
|
|
200
|
+
yield piece;
|
|
201
|
+
} while (leftData != "");
|
|
202
|
+
}
|
|
203
|
+
}
|
|
204
|
+
};
|
|
205
|
+
}
|
|
206
|
+
function* splitByDelimiterWithMinLength(sources, delimiter, minimumChunkLength = 25, splitThreshold) {
|
|
207
|
+
let buf = "";
|
|
208
|
+
let last = false;
|
|
209
|
+
const dl = delimiter.length;
|
|
210
|
+
for (const source of sources) {
|
|
211
|
+
const max = source.length;
|
|
212
|
+
if (splitThreshold && max > splitThreshold) {
|
|
213
|
+
yield buf + source;
|
|
214
|
+
last = false;
|
|
215
|
+
buf = "";
|
|
216
|
+
continue;
|
|
217
|
+
}
|
|
218
|
+
let i = -1;
|
|
219
|
+
let prev = 0;
|
|
220
|
+
L1: do {
|
|
221
|
+
i = source.indexOf(delimiter, prev);
|
|
222
|
+
if (i == -1) break L1;
|
|
223
|
+
buf += source.slice(prev, i) + delimiter;
|
|
224
|
+
if (buf.length > minimumChunkLength) {
|
|
225
|
+
yield buf;
|
|
226
|
+
buf = "";
|
|
227
|
+
last = false;
|
|
228
|
+
} else {
|
|
229
|
+
last = true;
|
|
230
|
+
}
|
|
231
|
+
prev = i + dl;
|
|
232
|
+
} while (i < max);
|
|
233
|
+
if (prev != i || prev == -1 && i == -1) {
|
|
234
|
+
buf += source.slice(prev);
|
|
235
|
+
last = true;
|
|
236
|
+
}
|
|
237
|
+
}
|
|
238
|
+
if (last) {
|
|
239
|
+
yield buf;
|
|
240
|
+
}
|
|
241
|
+
}
|
|
242
|
+
function* chunkStringGenerator(source, maxLength) {
|
|
243
|
+
const strLen = source.length;
|
|
244
|
+
if (strLen > maxLength) {
|
|
245
|
+
let from = 0;
|
|
246
|
+
do {
|
|
247
|
+
let end = from + maxLength;
|
|
248
|
+
if (end > strLen) {
|
|
249
|
+
yield source.substring(from);
|
|
250
|
+
break;
|
|
251
|
+
}
|
|
252
|
+
while (source.charCodeAt(end - 1) != source.codePointAt(end - 1)) {
|
|
253
|
+
end++;
|
|
254
|
+
}
|
|
255
|
+
yield source.substring(from, end);
|
|
256
|
+
from = end;
|
|
257
|
+
} while (from < strLen);
|
|
258
|
+
} else {
|
|
259
|
+
yield source;
|
|
260
|
+
}
|
|
261
|
+
}
|
|
262
|
+
function* chunkStringGeneratorFromGenerator(sources, maxLength) {
|
|
263
|
+
for (const source of sources) {
|
|
264
|
+
yield* chunkStringGenerator(source, maxLength);
|
|
265
|
+
}
|
|
266
|
+
}
|
|
267
|
+
function* stringGenerator(sources) {
|
|
268
|
+
for (const str of sources) {
|
|
269
|
+
yield str;
|
|
270
|
+
}
|
|
271
|
+
}
|
|
272
|
+
async function collectGenAll(strGen) {
|
|
273
|
+
const ret = [];
|
|
274
|
+
for await (const str of strGen) {
|
|
275
|
+
ret.push(str);
|
|
276
|
+
}
|
|
277
|
+
return ret;
|
|
278
|
+
}
|
|
279
|
+
async function concatGeneratedAll(strGen) {
|
|
280
|
+
return (await collectGenAll(strGen)).join("");
|
|
281
|
+
}
|
|
282
|
+
const MAX_ITEMS = 100;
|
|
283
|
+
async function splitPieces2V2(dataSrc, pieceSize, plainSplit, minimumChunkSize, filename, useSegmenter) {
|
|
284
|
+
if (dataSrc.size == 0) {
|
|
285
|
+
return function* noItems() {
|
|
286
|
+
return;
|
|
287
|
+
};
|
|
288
|
+
}
|
|
289
|
+
if (isTextBlob(dataSrc)) {
|
|
290
|
+
const text = await dataSrc.text();
|
|
291
|
+
if (!plainSplit) {
|
|
292
|
+
const gen2 = chunkStringGenerator(text, pieceSize);
|
|
293
|
+
return function* pieces() {
|
|
294
|
+
yield* gen2;
|
|
295
|
+
};
|
|
296
|
+
}
|
|
297
|
+
const textLen = text.length;
|
|
298
|
+
let xMinimumChunkSize = minimumChunkSize;
|
|
299
|
+
while (textLen / xMinimumChunkSize > MAX_ITEMS) {
|
|
300
|
+
xMinimumChunkSize += minimumChunkSize;
|
|
301
|
+
}
|
|
302
|
+
const org = stringGenerator([text]);
|
|
303
|
+
const gen1 = splitByDelimiterWithMinLength(org, "\n", xMinimumChunkSize);
|
|
304
|
+
const gen = chunkStringGeneratorFromGenerator(gen1, pieceSize);
|
|
305
|
+
return function* pieces() {
|
|
306
|
+
yield* gen;
|
|
307
|
+
};
|
|
308
|
+
}
|
|
309
|
+
let canBeSmall = false;
|
|
310
|
+
let delimiter = 0;
|
|
311
|
+
if (filename && filename.endsWith(".pdf")) {
|
|
312
|
+
delimiter = "/".charCodeAt(0);
|
|
313
|
+
} else if (filename && filename.endsWith(".json")) {
|
|
314
|
+
canBeSmall = true;
|
|
315
|
+
delimiter = ",".charCodeAt(0);
|
|
316
|
+
}
|
|
317
|
+
const clampMin = canBeSmall ? 100 : 1e5;
|
|
318
|
+
const clampMax = 1e8;
|
|
319
|
+
const clampedSize = Math.max(clampMin, Math.min(clampMax, dataSrc.size));
|
|
320
|
+
let step = 1;
|
|
321
|
+
let w = clampedSize;
|
|
322
|
+
while (w > 10) {
|
|
323
|
+
w /= 12.5;
|
|
324
|
+
step++;
|
|
325
|
+
}
|
|
326
|
+
minimumChunkSize = Math.floor(10 ** (step - 1));
|
|
327
|
+
return async function* piecesBlob() {
|
|
328
|
+
const size = dataSrc.size;
|
|
329
|
+
let i = 0;
|
|
330
|
+
const buf = new Uint8Array(await dataSrc.arrayBuffer());
|
|
331
|
+
do {
|
|
332
|
+
const findStart = i + minimumChunkSize;
|
|
333
|
+
const defaultSplitEnd = i + pieceSize;
|
|
334
|
+
let splitEnd;
|
|
335
|
+
let i1 = buf.indexOf(delimiter, findStart);
|
|
336
|
+
if (i1 == -1) {
|
|
337
|
+
i1 = buf.indexOf(charNewLine, findStart);
|
|
338
|
+
}
|
|
339
|
+
if (i1 == -1) {
|
|
340
|
+
splitEnd = defaultSplitEnd;
|
|
341
|
+
} else {
|
|
342
|
+
splitEnd = i1 < defaultSplitEnd ? i1 : defaultSplitEnd;
|
|
343
|
+
}
|
|
344
|
+
yield await arrayBufferToBase64Single(buf.slice(i, splitEnd));
|
|
345
|
+
i = splitEnd;
|
|
346
|
+
} while (i < size);
|
|
347
|
+
};
|
|
348
|
+
}
|
|
349
|
+
async function splitPieces2(dataSrc, pieceSize, plainSplit, minimumChunkSize, filename, useSegmenter) {
|
|
350
|
+
if (isTextBlob(dataSrc)) {
|
|
351
|
+
return splitPiecesText(await dataSrc.text(), pieceSize, plainSplit, minimumChunkSize, useSegmenter ?? false);
|
|
352
|
+
}
|
|
353
|
+
let delimiter = 0;
|
|
354
|
+
let canBeSmall = false;
|
|
355
|
+
if (filename && filename.endsWith(".pdf")) {
|
|
356
|
+
delimiter = "/".charCodeAt(0);
|
|
357
|
+
} else if (filename && filename.endsWith(".json")) {
|
|
358
|
+
canBeSmall = true;
|
|
359
|
+
delimiter = ",".charCodeAt(0);
|
|
360
|
+
}
|
|
361
|
+
const clampMin = canBeSmall ? 100 : 1e5;
|
|
362
|
+
const clampMax = 1e8;
|
|
363
|
+
const clampedSize = Math.max(clampMin, Math.min(clampMax, dataSrc.size));
|
|
364
|
+
let step = 1;
|
|
365
|
+
let w = clampedSize;
|
|
366
|
+
while (w > 10) {
|
|
367
|
+
w /= 12.5;
|
|
368
|
+
step++;
|
|
369
|
+
}
|
|
370
|
+
minimumChunkSize = Math.floor(10 ** (step - 1));
|
|
371
|
+
return async function* piecesBlob() {
|
|
372
|
+
const size = dataSrc.size;
|
|
373
|
+
let i = 0;
|
|
374
|
+
do {
|
|
375
|
+
let splitSize = pieceSize;
|
|
376
|
+
const currentData = new Uint8Array(await dataSrc.slice(i, i + pieceSize).arrayBuffer());
|
|
377
|
+
let nextIdx = currentData.indexOf(delimiter, minimumChunkSize);
|
|
378
|
+
splitSize = nextIdx == -1 ? pieceSize : Math.min(pieceSize, nextIdx);
|
|
379
|
+
if (nextIdx == -1) nextIdx = currentData.indexOf(charNewLine, minimumChunkSize);
|
|
380
|
+
const piece = currentData.slice(0, splitSize);
|
|
381
|
+
i += piece.length;
|
|
382
|
+
const b64 = await arrayBufferToBase64Single(piece);
|
|
383
|
+
yield b64;
|
|
384
|
+
} while (i < size);
|
|
385
|
+
};
|
|
386
|
+
}
|
|
387
|
+
async function splitPiecesRabinKarp(dataSrc, absoluteMaxPieceSize, doPlainSplit, minimumChunkSize, _filename, _useSegmenter) {
|
|
388
|
+
let plainSplit = doPlainSplit || isTextBlob(dataSrc);
|
|
389
|
+
const dataSize = dataSrc.size;
|
|
390
|
+
let chunkUnitPlain = 64;
|
|
391
|
+
const MAX_CHUNK_COUNT = 500;
|
|
392
|
+
if (plainSplit) {
|
|
393
|
+
const isDataSizeTooLargeForPlainSplit = dataSize >= 4 * 1024 * 1024;
|
|
394
|
+
if (isDataSizeTooLargeForPlainSplit) {
|
|
395
|
+
plainSplit = false;
|
|
396
|
+
} else {
|
|
397
|
+
let estimatedChunkCount;
|
|
398
|
+
do {
|
|
399
|
+
estimatedChunkCount = dataSize / (chunkUnitPlain * 4);
|
|
400
|
+
if (estimatedChunkCount > MAX_CHUNK_COUNT) {
|
|
401
|
+
chunkUnitPlain += 32;
|
|
402
|
+
}
|
|
403
|
+
} while (estimatedChunkCount > MAX_CHUNK_COUNT);
|
|
404
|
+
}
|
|
405
|
+
}
|
|
406
|
+
const chunkUnitBinary = 256 * 1024;
|
|
407
|
+
const fixedAvgChunkSize = plainSplit ? chunkUnitPlain * 4 : chunkUnitBinary * 4;
|
|
408
|
+
const fixedMaxChunkSize = plainSplit ? chunkUnitPlain * 16 : chunkUnitBinary * 16;
|
|
409
|
+
const fixedMinChunkSize = plainSplit ? chunkUnitPlain * 2 : chunkUnitBinary;
|
|
410
|
+
const rkAbsoluteMaxPieceSizeFloor = 30 * 1024;
|
|
411
|
+
const effectiveAbsoluteMaxPieceSize = Math.max(absoluteMaxPieceSize, rkAbsoluteMaxPieceSizeFloor);
|
|
412
|
+
const maxChunkSize = Math.min(fixedMaxChunkSize, effectiveAbsoluteMaxPieceSize);
|
|
413
|
+
const minChunkSize = Math.min(Math.max(fixedMinChunkSize, minimumChunkSize), maxChunkSize);
|
|
414
|
+
const avgChunkSize = Math.min(Math.max(fixedAvgChunkSize, minChunkSize), maxChunkSize);
|
|
415
|
+
const windowSize = 48;
|
|
416
|
+
const hashModulus = avgChunkSize;
|
|
417
|
+
const boundaryPattern = 1;
|
|
418
|
+
const PRIME = 31;
|
|
419
|
+
let P_pow_w = 1;
|
|
420
|
+
for (let i = 0; i < windowSize - 1; i++) {
|
|
421
|
+
P_pow_w = Math.imul(P_pow_w, PRIME);
|
|
422
|
+
}
|
|
423
|
+
const buffer = new Uint8Array(await dataSrc.arrayBuffer());
|
|
424
|
+
let pos = 0;
|
|
425
|
+
let hash = 0;
|
|
426
|
+
let start = 0;
|
|
427
|
+
const isText = isTextBlob(dataSrc);
|
|
428
|
+
const length = buffer.length;
|
|
429
|
+
return async function* piecesBlob() {
|
|
430
|
+
while (pos < length) {
|
|
431
|
+
const byte = buffer[pos];
|
|
432
|
+
if (pos >= start + windowSize) {
|
|
433
|
+
const oldByte = buffer[pos - windowSize];
|
|
434
|
+
const oldByteTerm = Math.imul(oldByte, P_pow_w);
|
|
435
|
+
hash = hash - oldByteTerm | 0;
|
|
436
|
+
hash = Math.imul(hash, PRIME);
|
|
437
|
+
hash = hash + byte | 0;
|
|
438
|
+
} else {
|
|
439
|
+
hash = Math.imul(hash, PRIME);
|
|
440
|
+
hash = hash + byte | 0;
|
|
441
|
+
}
|
|
442
|
+
const currentChunkSize = pos - start + 1;
|
|
443
|
+
let isBoundaryCandidate = false;
|
|
444
|
+
if (currentChunkSize >= minChunkSize) {
|
|
445
|
+
if ((hash >>> 0) % hashModulus === boundaryPattern) {
|
|
446
|
+
isBoundaryCandidate = true;
|
|
447
|
+
}
|
|
448
|
+
}
|
|
449
|
+
if (currentChunkSize >= maxChunkSize) {
|
|
450
|
+
isBoundaryCandidate = true;
|
|
451
|
+
}
|
|
452
|
+
if (isBoundaryCandidate) {
|
|
453
|
+
let isSafeBoundary = true;
|
|
454
|
+
if (isText) {
|
|
455
|
+
if (pos + 1 < length && (buffer[pos + 1] & 192) === 128) {
|
|
456
|
+
isSafeBoundary = false;
|
|
457
|
+
}
|
|
458
|
+
}
|
|
459
|
+
if (isSafeBoundary) {
|
|
460
|
+
if (isText) {
|
|
461
|
+
yield Promise.resolve(readString(buffer.subarray(start, pos + 1)));
|
|
462
|
+
} else {
|
|
463
|
+
yield await arrayBufferToBase64Single(buffer.subarray(start, pos + 1));
|
|
464
|
+
}
|
|
465
|
+
start = pos + 1;
|
|
466
|
+
}
|
|
467
|
+
}
|
|
468
|
+
pos++;
|
|
469
|
+
}
|
|
470
|
+
if (start < length) {
|
|
471
|
+
if (isText) {
|
|
472
|
+
yield Promise.resolve(readString(buffer.subarray(start, length)));
|
|
473
|
+
} else {
|
|
474
|
+
yield await arrayBufferToBase64Single(buffer.subarray(start, length));
|
|
475
|
+
}
|
|
476
|
+
}
|
|
477
|
+
};
|
|
478
|
+
}
|
|
479
|
+
async function splitPiecesRabinKarpOld(dataSrc, absoluteMaxPieceSize, doPlainSplit, minimumChunkSize, _filename, _useSegmenter) {
|
|
480
|
+
const plainSplit = doPlainSplit || isTextBlob(dataSrc);
|
|
481
|
+
const minPieceSize = plainSplit ? 128 : 1024 * 4;
|
|
482
|
+
const splitPieceCount = plainSplit ? 20 : 12;
|
|
483
|
+
const avgChunkSize = Math.max(minPieceSize, Math.floor(dataSrc.size / splitPieceCount));
|
|
484
|
+
const maxChunkSize = Math.min(absoluteMaxPieceSize, avgChunkSize * 5);
|
|
485
|
+
const minChunkSize = Math.min(Math.max(Math.floor(avgChunkSize / 4), minimumChunkSize), maxChunkSize);
|
|
486
|
+
const windowSize = 48;
|
|
487
|
+
const hashModulus = avgChunkSize;
|
|
488
|
+
const boundaryPattern = 1;
|
|
489
|
+
const PRIME = 31;
|
|
490
|
+
let P_pow_w = 1;
|
|
491
|
+
for (let i = 0; i < windowSize - 1; i++) {
|
|
492
|
+
P_pow_w = Math.imul(P_pow_w, PRIME);
|
|
493
|
+
}
|
|
494
|
+
const buffer = new Uint8Array(await dataSrc.arrayBuffer());
|
|
495
|
+
let pos = 0;
|
|
496
|
+
let hash = 0;
|
|
497
|
+
let start = 0;
|
|
498
|
+
const isText = isTextBlob(dataSrc);
|
|
499
|
+
const length = buffer.length;
|
|
500
|
+
return async function* piecesBlob() {
|
|
501
|
+
while (pos < length) {
|
|
502
|
+
const byte = buffer[pos];
|
|
503
|
+
if (pos >= start + windowSize) {
|
|
504
|
+
const oldByte = buffer[pos - windowSize];
|
|
505
|
+
const oldByteTerm = Math.imul(oldByte, P_pow_w);
|
|
506
|
+
hash = hash - oldByteTerm | 0;
|
|
507
|
+
hash = Math.imul(hash, PRIME);
|
|
508
|
+
hash = hash + byte | 0;
|
|
509
|
+
} else {
|
|
510
|
+
hash = Math.imul(hash, PRIME);
|
|
511
|
+
hash = hash + byte | 0;
|
|
512
|
+
}
|
|
513
|
+
const currentChunkSize = pos - start + 1;
|
|
514
|
+
let isBoundaryCandidate = false;
|
|
515
|
+
if (currentChunkSize >= minChunkSize) {
|
|
516
|
+
if ((hash >>> 0) % hashModulus === boundaryPattern) {
|
|
517
|
+
isBoundaryCandidate = true;
|
|
518
|
+
}
|
|
519
|
+
}
|
|
520
|
+
if (currentChunkSize >= maxChunkSize) {
|
|
521
|
+
isBoundaryCandidate = true;
|
|
522
|
+
}
|
|
523
|
+
if (isBoundaryCandidate) {
|
|
524
|
+
let isSafeBoundary = true;
|
|
525
|
+
if (isText) {
|
|
526
|
+
if (pos + 1 < length && (buffer[pos + 1] & 192) === 128) {
|
|
527
|
+
isSafeBoundary = false;
|
|
528
|
+
}
|
|
529
|
+
}
|
|
530
|
+
if (isSafeBoundary) {
|
|
531
|
+
if (isText) {
|
|
532
|
+
yield Promise.resolve(readString(buffer.subarray(start, pos + 1)));
|
|
533
|
+
} else {
|
|
534
|
+
yield await arrayBufferToBase64Single(buffer.subarray(start, pos + 1));
|
|
535
|
+
}
|
|
536
|
+
start = pos + 1;
|
|
537
|
+
}
|
|
538
|
+
}
|
|
539
|
+
pos++;
|
|
540
|
+
}
|
|
541
|
+
if (start < length) {
|
|
542
|
+
if (isText) {
|
|
543
|
+
yield Promise.resolve(readString(buffer.subarray(start, length)));
|
|
544
|
+
} else {
|
|
545
|
+
yield await arrayBufferToBase64Single(buffer.subarray(start, length));
|
|
546
|
+
}
|
|
547
|
+
}
|
|
548
|
+
};
|
|
549
|
+
}
|
|
550
|
+
export {
|
|
551
|
+
binaryTextSplit,
|
|
552
|
+
collectGenAll,
|
|
553
|
+
concatGeneratedAll,
|
|
554
|
+
splitPieces2,
|
|
555
|
+
splitPieces2V2,
|
|
556
|
+
splitPiecesRabinKarp,
|
|
557
|
+
splitPiecesRabinKarpOld,
|
|
558
|
+
splitPiecesText,
|
|
559
|
+
splitPiecesTextV1,
|
|
560
|
+
splitPiecesTextV2
|
|
561
|
+
};
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import { arrayBufferToBase64, base64ToArrayBuffer, base64ToArrayBufferInternalBrowser, readString, writeString, tryConvertBase64ToArrayBuffer } from "octagonal-wheels/binary";
|
|
2
|
+
export { arrayBufferToBase64, base64ToArrayBuffer, base64ToArrayBufferInternalBrowser, readString, writeString, tryConvertBase64ToArrayBuffer, };
|
|
3
|
+
export declare function arrayBufferToBase64Single(buffer: Uint8Array<ArrayBuffer> | ArrayBuffer): Promise<string>;
|
|
4
|
+
export { uint8ArrayToHexString, hexStringToUint8Array } from "octagonal-wheels/binary/hex";
|
|
5
|
+
export { encodeBinaryEach, decodeToArrayBuffer } from "octagonal-wheels/binary/encodedUTF16";
|
|
6
|
+
export { decodeBinary, encodeBinary } from "octagonal-wheels/binary";
|
|
7
|
+
export { escapeStringToHTML } from "octagonal-wheels/string";
|
|
8
|
+
export declare function versionNumberString2Number(version: string): number;
|
|
@@ -0,0 +1,46 @@
|
|
|
1
|
+
import {
|
|
2
|
+
arrayBufferToBase64,
|
|
3
|
+
base64ToArrayBuffer,
|
|
4
|
+
base64ToArrayBufferInternalBrowser,
|
|
5
|
+
arrayBufferToBase64Single as arrayBufferToBase64SingleInternal,
|
|
6
|
+
readString,
|
|
7
|
+
writeString,
|
|
8
|
+
tryConvertBase64ToArrayBuffer
|
|
9
|
+
} from "octagonal-wheels/binary";
|
|
10
|
+
import { compatGlobal } from "../common/coreEnvFunctions.js";
|
|
11
|
+
async function arrayBufferToBase64Single(buffer) {
|
|
12
|
+
try {
|
|
13
|
+
return await arrayBufferToBase64SingleInternal(buffer);
|
|
14
|
+
} catch (ex) {
|
|
15
|
+
const maybeBuffer = compatGlobal?.Buffer;
|
|
16
|
+
if (typeof maybeBuffer?.from === "function") {
|
|
17
|
+
const view = buffer instanceof Uint8Array ? buffer : new Uint8Array(buffer);
|
|
18
|
+
return maybeBuffer.from(view.buffer, view.byteOffset, view.byteLength).toString("base64");
|
|
19
|
+
}
|
|
20
|
+
throw ex;
|
|
21
|
+
}
|
|
22
|
+
}
|
|
23
|
+
import { uint8ArrayToHexString, hexStringToUint8Array } from "octagonal-wheels/binary/hex";
|
|
24
|
+
import { encodeBinaryEach, decodeToArrayBuffer } from "octagonal-wheels/binary/encodedUTF16";
|
|
25
|
+
import { decodeBinary, encodeBinary } from "octagonal-wheels/binary";
|
|
26
|
+
import { escapeStringToHTML } from "octagonal-wheels/string";
|
|
27
|
+
function versionNumberString2Number(version) {
|
|
28
|
+
return version.split(".").reverse().map((e, i) => (Number(e) || 0) * 1e3 ** i).reduce((prev, current) => prev + current, 0);
|
|
29
|
+
}
|
|
30
|
+
export {
|
|
31
|
+
arrayBufferToBase64,
|
|
32
|
+
arrayBufferToBase64Single,
|
|
33
|
+
base64ToArrayBuffer,
|
|
34
|
+
base64ToArrayBufferInternalBrowser,
|
|
35
|
+
decodeBinary,
|
|
36
|
+
decodeToArrayBuffer,
|
|
37
|
+
encodeBinary,
|
|
38
|
+
encodeBinaryEach,
|
|
39
|
+
escapeStringToHTML,
|
|
40
|
+
hexStringToUint8Array,
|
|
41
|
+
readString,
|
|
42
|
+
tryConvertBase64ToArrayBuffer,
|
|
43
|
+
uint8ArrayToHexString,
|
|
44
|
+
versionNumberString2Number,
|
|
45
|
+
writeString
|
|
46
|
+
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from "octagonal-wheels/hash/xxhash.js";
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
import { type AnyEntry, type DocumentID, type EntryHasPath, type FilePath, type FilePathWithPrefix } from "../common/types.js";
|
|
2
|
+
export declare function isValidFilenameInWidows(filename: string): boolean;
|
|
3
|
+
export declare function isValidFilenameInDarwin(filename: string): boolean;
|
|
4
|
+
export declare function isValidFilenameInLinux(filename: string): boolean;
|
|
5
|
+
export declare function isValidFilenameInAndroid(filename: string): boolean;
|
|
6
|
+
export declare function isFilePath(path: FilePath | FilePathWithPrefix): path is FilePath;
|
|
7
|
+
export declare function stripAllPrefixes(prefixedPath: FilePathWithPrefix): FilePath;
|
|
8
|
+
export declare function addPrefix(path: FilePath | FilePathWithPrefix, prefix: string): FilePathWithPrefix;
|
|
9
|
+
export declare function expandFilePathPrefix(path: FilePathWithPrefix | FilePath): [string, FilePathWithPrefix];
|
|
10
|
+
export declare function expandDocumentIDPrefix(id: DocumentID): [string, FilePathWithPrefix];
|
|
11
|
+
export declare function path2id_base(filenameSrc: FilePathWithPrefix | FilePath, obfuscatePassphrase: string | false, caseInsensitive: boolean): Promise<DocumentID>;
|
|
12
|
+
export declare function id2path_base(id: DocumentID, entry?: EntryHasPath): FilePathWithPrefix;
|
|
13
|
+
export declare function getPath(entry: AnyEntry): FilePathWithPrefix;
|
|
14
|
+
export declare function getPathWithoutPrefix(entry: AnyEntry): FilePath;
|
|
15
|
+
export declare function stripPrefix(prefixedPath: FilePathWithPrefix): FilePath;
|
|
16
|
+
export declare function shouldBeIgnored(filename: string): boolean;
|
|
17
|
+
export declare function isPlainText(filename: string): boolean;
|
|
18
|
+
export declare function shouldSplitAsPlainText(filename: string): boolean;
|
|
19
|
+
/**
|
|
20
|
+
* returns whether the given path is accepted (not ignored) by the `.gitignore`.
|
|
21
|
+
* @param path path of the file which is relative from `.gitignore` file
|
|
22
|
+
* @param ignore lines of `.gitignore`
|
|
23
|
+
* @returns true when accepted.
|
|
24
|
+
* false when not accepted.
|
|
25
|
+
* undefined when the path is not mentioned in the `.gitignore` file.
|
|
26
|
+
*/
|
|
27
|
+
export declare function isAccepted(path: string, ignore: string[]): boolean | undefined;
|
|
28
|
+
/**
|
|
29
|
+
* Checks whether the path is accepted by all ignored files.
|
|
30
|
+
* @param path path of target file
|
|
31
|
+
* @param ignoreFiles list of ignore files. i.e. [".gitignore", ".dockerignore"]
|
|
32
|
+
* @param getList function to retrieve the file.
|
|
33
|
+
* @returns true when accepted. false when should be ignored.
|
|
34
|
+
*/
|
|
35
|
+
export declare function isAcceptedAll(path: string, ignoreFiles: string[], getList: (path: string) => Promise<string[] | false>): Promise<boolean>;
|