@lapis-notes/api 0.1.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/CHANGELOG.md +9 -0
- package/LICENSE.md +4 -0
- package/README.md +43 -0
- package/dist/__tests__/data-adapter-conformance.js +205 -0
- package/dist/__tests__/lapis-runtime-manifest.js +32 -0
- package/dist/__tests__/svelte-internal-client.d.ts +3 -0
- package/dist/agent-result-views.d.ts +52 -0
- package/dist/agent-result-views.js +89 -0
- package/dist/agent-skills.d.ts +99 -0
- package/dist/agent-skills.js +182 -0
- package/dist/agent-tools.d.ts +92 -0
- package/dist/agent-tools.js +139 -0
- package/dist/app-database-host.d.ts +4 -0
- package/dist/app-database-host.js +4 -0
- package/dist/app-shell-plugin-persistence.d.ts +15 -0
- package/dist/app-shell-plugin-persistence.js +34 -0
- package/dist/app-url.d.ts +54 -0
- package/dist/app-url.js +269 -0
- package/dist/application-compatibility.d.ts +31 -0
- package/dist/application-compatibility.js +64 -0
- package/dist/application-state.svelte.d.ts +14 -0
- package/dist/application-state.svelte.js +30 -0
- package/dist/assets/lapis-logo.svg +471 -0
- package/dist/bases.d.ts +281 -0
- package/dist/bases.js +475 -0
- package/dist/cache.svelte.d.ts +569 -0
- package/dist/cache.svelte.js +1433 -0
- package/dist/command.svelte.d.ts +337 -0
- package/dist/command.svelte.js +571 -0
- package/dist/compat.d.ts +29 -0
- package/dist/compat.js +30 -0
- package/dist/components/configuration/configuration.css +199 -0
- package/dist/components/configuration/date-setting.svelte +71 -0
- package/dist/components/configuration/date-setting.svelte.d.ts +8 -0
- package/dist/components/configuration/list-setting.svelte +128 -0
- package/dist/components/configuration/list-setting.svelte.d.ts +13 -0
- package/dist/components/configuration/object-array-row-grip.svelte +78 -0
- package/dist/components/configuration/object-array-row-grip.svelte.d.ts +9 -0
- package/dist/components/configuration/object-array-row.svelte +163 -0
- package/dist/components/configuration/object-array-row.svelte.d.ts +19 -0
- package/dist/components/configuration/object-array-setting.svelte +196 -0
- package/dist/components/configuration/object-array-setting.svelte.d.ts +15 -0
- package/dist/components/configuration/object-array-table-dnd.d.ts +8 -0
- package/dist/components/configuration/object-array-table-dnd.js +10 -0
- package/dist/components/configuration/object-array-utils.d.ts +11 -0
- package/dist/components/configuration/object-array-utils.js +103 -0
- package/dist/components/configuration/object-grid-setting.svelte +79 -0
- package/dist/components/configuration/object-grid-setting.svelte.d.ts +10 -0
- package/dist/components/configuration/object-map-row.svelte +147 -0
- package/dist/components/configuration/object-map-row.svelte.d.ts +15 -0
- package/dist/components/configuration/object-map-setting.svelte +137 -0
- package/dist/components/configuration/object-map-setting.svelte.d.ts +14 -0
- package/dist/components/configuration/object-map-types.d.ts +5 -0
- package/dist/components/configuration/object-map-types.js +1 -0
- package/dist/components/configuration/options-combobox-setting.svelte +129 -0
- package/dist/components/configuration/options-combobox-setting.svelte.d.ts +12 -0
- package/dist/components/copy-button/button.svelte +93 -0
- package/dist/components/copy-button/button.svelte.d.ts +13 -0
- package/dist/components/copy-button/index.d.ts +2 -0
- package/dist/components/copy-button/index.js +2 -0
- package/dist/components/editor/editor.css +565 -0
- package/dist/components/editor/editor.d.ts +33 -0
- package/dist/components/editor/editor.js +132 -0
- package/dist/components/editor/editor.svelte +176 -0
- package/dist/components/editor/editor.svelte.d.ts +15 -0
- package/dist/components/editor/embedded-editor-surface.d.ts +12 -0
- package/dist/components/editor/embedded-editor-surface.js +22 -0
- package/dist/components/editor/embedded-editor-surface.svelte +115 -0
- package/dist/components/editor/embedded-editor-surface.svelte.d.ts +17 -0
- package/dist/components/editor/extensions/autocomplete/index.d.ts +2 -0
- package/dist/components/editor/extensions/autocomplete/index.js +2 -0
- package/dist/components/editor/extensions/autocomplete/lapis-code-mirror-autocomplete.d.ts +16 -0
- package/dist/components/editor/extensions/autocomplete/lapis-code-mirror-autocomplete.js +34 -0
- package/dist/components/editor/extensions/autocomplete/vault-completion-sources.d.ts +27 -0
- package/dist/components/editor/extensions/autocomplete/vault-completion-sources.js +55 -0
- package/dist/components/editor/extensions/class-highlighter/index.d.ts +1 -0
- package/dist/components/editor/extensions/class-highlighter/index.js +47 -0
- package/dist/components/editor/extensions/fold-gutter/index.d.ts +8 -0
- package/dist/components/editor/extensions/fold-gutter/index.js +40 -0
- package/dist/components/editor/extensions/gutter-line-style-sync/index.d.ts +2 -0
- package/dist/components/editor/extensions/gutter-line-style-sync/index.js +118 -0
- package/dist/components/editor/extensions/lint/index.d.ts +4 -0
- package/dist/components/editor/extensions/lint/index.js +4 -0
- package/dist/components/editor/extensions/lint/lapis-code-mirror-lint.d.ts +26 -0
- package/dist/components/editor/extensions/lint/lapis-code-mirror-lint.js +101 -0
- package/dist/components/editor/extensions/lint/lapis-lint-diagnostic-helpers.d.ts +8 -0
- package/dist/components/editor/extensions/lint/lapis-lint-diagnostic-helpers.js +7 -0
- package/dist/components/editor/extensions/lint/lapis-lint-diagnostic.d.ts +20 -0
- package/dist/components/editor/extensions/lint/lapis-lint-diagnostic.js +47 -0
- package/dist/components/editor/extensions/lint/lapis-lint-hover-tooltip.d.ts +9 -0
- package/dist/components/editor/extensions/lint/lapis-lint-hover-tooltip.js +373 -0
- package/dist/components/editor/extensions/lint/lapis-lint-inline-widget.d.ts +31 -0
- package/dist/components/editor/extensions/lint/lapis-lint-inline-widget.js +191 -0
- package/dist/components/editor/extensions/lint/lapis-lint-tooltip.svelte +176 -0
- package/dist/components/editor/extensions/lint/lapis-lint-tooltip.svelte.d.ts +15 -0
- package/dist/components/editor/extensions/lint/lint-tooltip-actions.d.ts +11 -0
- package/dist/components/editor/extensions/lint/lint-tooltip-actions.js +21 -0
- package/dist/components/editor/extensions/lint/mount-lint-tooltip.d.ts +16 -0
- package/dist/components/editor/extensions/lint/mount-lint-tooltip.js +60 -0
- package/dist/components/editor/extensions/search/dom.d.ts +2 -0
- package/dist/components/editor/extensions/search/dom.js +6 -0
- package/dist/components/editor/extensions/search/index.d.ts +35 -0
- package/dist/components/editor/extensions/search/index.js +44 -0
- package/dist/components/editor/extensions/search/search.svelte +335 -0
- package/dist/components/editor/extensions/search/search.svelte.d.ts +8 -0
- package/dist/components/editor/index.d.ts +9 -0
- package/dist/components/editor/index.js +9 -0
- package/dist/components/editor/language-service/dom.d.ts +1 -0
- package/dist/components/editor/language-service/dom.js +6 -0
- package/dist/components/editor/language-service/index.d.ts +28 -0
- package/dist/components/editor/language-service/index.js +342 -0
- package/dist/components/empty-view/empty-view.css +39 -0
- package/dist/components/empty-view/empty-view.svelte +26 -0
- package/dist/components/empty-view/empty-view.svelte.d.ts +9 -0
- package/dist/components/empty-view/index.d.ts +2 -0
- package/dist/components/empty-view/index.js +2 -0
- package/dist/components/icon/icon-list.css +74 -0
- package/dist/components/icon/icon-list.svelte +213 -0
- package/dist/components/icon/icon-list.svelte.d.ts +11 -0
- package/dist/components/icon/icon.svelte +15 -0
- package/dist/components/icon/icon.svelte.d.ts +7 -0
- package/dist/components/icon/index.d.ts +3 -0
- package/dist/components/icon/index.js +3 -0
- package/dist/components/menu/context-menu.svelte +89 -0
- package/dist/components/menu/context-menu.svelte.d.ts +11 -0
- package/dist/components/menu/drawer-menu.svelte +83 -0
- package/dist/components/menu/drawer-menu.svelte.d.ts +8 -0
- package/dist/components/menu/dropdown-menu.svelte +89 -0
- package/dist/components/menu/dropdown-menu.svelte.d.ts +11 -0
- package/dist/components/menu/index.d.ts +6 -0
- package/dist/components/menu/index.js +6 -0
- package/dist/components/menu/menu.css +139 -0
- package/dist/components/menu/menu.svelte +37 -0
- package/dist/components/menu/menu.svelte.d.ts +11 -0
- package/dist/components/menu/mobile-menu-query.svelte.d.ts +3 -0
- package/dist/components/menu/mobile-menu-query.svelte.js +21 -0
- package/dist/components/menu/popover-menu.svelte +90 -0
- package/dist/components/menu/popover-menu.svelte.d.ts +10 -0
- package/dist/components/select/index.d.ts +2 -0
- package/dist/components/select/index.js +2 -0
- package/dist/components/select/select.svelte +72 -0
- package/dist/components/select/select.svelte.d.ts +25 -0
- package/dist/configuration-option-source-providers.d.ts +17 -0
- package/dist/configuration-option-source-providers.js +59 -0
- package/dist/configuration-option-source-registry.d.ts +59 -0
- package/dist/configuration-option-source-registry.js +123 -0
- package/dist/configuration.svelte.d.ts +258 -0
- package/dist/configuration.svelte.js +887 -0
- package/dist/context-keys.svelte.d.ts +42 -0
- package/dist/context-keys.svelte.js +278 -0
- package/dist/context.svelte.d.ts +247 -0
- package/dist/context.svelte.js +540 -0
- package/dist/daily-document-provider.d.ts +38 -0
- package/dist/daily-document-provider.js +176 -0
- package/dist/design-core-button-types.d.ts +7 -0
- package/dist/design-core-button-types.js +1 -0
- package/dist/diagnostics.d.ts +93 -0
- package/dist/diagnostics.js +84 -0
- package/dist/dialog-portal.d.ts +3 -0
- package/dist/dialog-portal.js +3 -0
- package/dist/docs-api.d.ts +44 -0
- package/dist/docs-api.js +29 -0
- package/dist/editor-view-registry.d.ts +35 -0
- package/dist/editor-view-registry.js +112 -0
- package/dist/editor.svelte.d.ts +126 -0
- package/dist/editor.svelte.js +454 -0
- package/dist/embed-registry.d.ts +15 -0
- package/dist/embed-registry.js +16 -0
- package/dist/enhance.d.ts +111 -0
- package/dist/enhance.js +309 -0
- package/dist/events.d.ts +28 -0
- package/dist/events.js +49 -0
- package/dist/file-manager.d.ts +90 -0
- package/dist/file-manager.js +289 -0
- package/dist/file-tools/app-tools.d.ts +3 -0
- package/dist/file-tools/app-tools.js +242 -0
- package/dist/file-tools/index.d.ts +3 -0
- package/dist/file-tools/index.js +3 -0
- package/dist/file-tools/paths.d.ts +14 -0
- package/dist/file-tools/paths.js +33 -0
- package/dist/file-tools/vault-operations.d.ts +3 -0
- package/dist/file-tools/vault-operations.js +60 -0
- package/dist/generated/plugin-host-modules.schema.generated.d.ts +371 -0
- package/dist/generated/plugin-host-modules.schema.generated.js +374 -0
- package/dist/glob.d.ts +15 -0
- package/dist/glob.js +68 -0
- package/dist/history.svelte.d.ts +24 -0
- package/dist/history.svelte.js +74 -0
- package/dist/hooks/createVirtualizer.svelte.d.ts +7 -0
- package/dist/hooks/createVirtualizer.svelte.js +70 -0
- package/dist/hooks/index.d.ts +5 -0
- package/dist/hooks/index.js +5 -0
- package/dist/hooks/is-mobile.svelte.d.ts +5 -0
- package/dist/hooks/is-mobile.svelte.js +23 -0
- package/dist/hooks/mountComponent.svelte.d.ts +7 -0
- package/dist/hooks/mountComponent.svelte.js +16 -0
- package/dist/hooks/use-text-highlight.d.ts +17 -0
- package/dist/hooks/use-text-highlight.js +82 -0
- package/dist/hooks/useBoundingRect.svelte.d.ts +11 -0
- package/dist/hooks/useBoundingRect.svelte.js +46 -0
- package/dist/icons/index.d.ts +57 -0
- package/dist/icons/index.js +288 -0
- package/dist/index.d.ts +87 -0
- package/dist/index.js +87 -0
- package/dist/language-service/index.d.ts +9 -0
- package/dist/language-service/index.js +7 -0
- package/dist/language-service/manager.d.ts +47 -0
- package/dist/language-service/manager.js +404 -0
- package/dist/language-service/types.d.ts +92 -0
- package/dist/language-service/types.js +1 -0
- package/dist/language-service/virtual-document.d.ts +11 -0
- package/dist/language-service/virtual-document.js +45 -0
- package/dist/language-service/worker-protocol.d.ts +63 -0
- package/dist/language-service/worker-protocol.js +1 -0
- package/dist/language-service/worker-provider.d.ts +9 -0
- package/dist/language-service/worker-provider.js +38 -0
- package/dist/lapis-extension.d.ts +244 -0
- package/dist/lapis-extension.js +591 -0
- package/dist/links.d.ts +34 -0
- package/dist/links.js +191 -0
- package/dist/loaders.d.ts +9 -0
- package/dist/loaders.js +59 -0
- package/dist/localization-manager.svelte.d.ts +56 -0
- package/dist/localization-manager.svelte.js +157 -0
- package/dist/logging.d.ts +172 -0
- package/dist/logging.js +352 -0
- package/dist/markdown-extension-registry.d.ts +31 -0
- package/dist/markdown-extension-registry.js +31 -0
- package/dist/markdown-file-surface-registry.d.ts +25 -0
- package/dist/markdown-file-surface-registry.js +23 -0
- package/dist/markdown.d.ts +205 -0
- package/dist/markdown.js +147 -0
- package/dist/menu-utils.d.ts +1 -0
- package/dist/menu-utils.js +47 -0
- package/dist/menu.svelte.d.ts +121 -0
- package/dist/menu.svelte.js +295 -0
- package/dist/metadata-value.d.ts +10 -0
- package/dist/metadata-value.js +173 -0
- package/dist/metadata.svelte.d.ts +106 -0
- package/dist/metadata.svelte.js +608 -0
- package/dist/notifications.d.ts +209 -0
- package/dist/notifications.js +338 -0
- package/dist/open-file.d.ts +23 -0
- package/dist/open-file.js +102 -0
- package/dist/platform.d.ts +86 -0
- package/dist/platform.js +86 -0
- package/dist/plugin-asset-server.d.ts +60 -0
- package/dist/plugin-asset-server.js +222 -0
- package/dist/plugin-assets.d.ts +4 -0
- package/dist/plugin-assets.js +3 -0
- package/dist/plugin-capability-facade.d.ts +104 -0
- package/dist/plugin-capability-facade.js +61 -0
- package/dist/plugin-dependency-resolver.d.ts +36 -0
- package/dist/plugin-dependency-resolver.js +54 -0
- package/dist/plugin-dependency-scanner.d.ts +9 -0
- package/dist/plugin-dependency-scanner.js +274 -0
- package/dist/plugin-distribution/canonical-json.d.ts +1 -0
- package/dist/plugin-distribution/canonical-json.js +40 -0
- package/dist/plugin-distribution/compatibility.d.ts +5 -0
- package/dist/plugin-distribution/compatibility.js +38 -0
- package/dist/plugin-distribution/errors.d.ts +11 -0
- package/dist/plugin-distribution/errors.js +13 -0
- package/dist/plugin-distribution/hashes.d.ts +2 -0
- package/dist/plugin-distribution/hashes.js +17 -0
- package/dist/plugin-distribution/index.d.ts +18 -0
- package/dist/plugin-distribution/index.js +18 -0
- package/dist/plugin-distribution/installed-plugin-state.d.ts +20 -0
- package/dist/plugin-distribution/installed-plugin-state.js +73 -0
- package/dist/plugin-distribution/installer.d.ts +89 -0
- package/dist/plugin-distribution/installer.js +395 -0
- package/dist/plugin-distribution/manager.d.ts +128 -0
- package/dist/plugin-distribution/manager.js +358 -0
- package/dist/plugin-distribution/path-safety.d.ts +2 -0
- package/dist/plugin-distribution/path-safety.js +20 -0
- package/dist/plugin-distribution/plugin-bundle-verifier.d.ts +28 -0
- package/dist/plugin-distribution/plugin-bundle-verifier.js +96 -0
- package/dist/plugin-distribution/plugin-bundle-worker.d.ts +34 -0
- package/dist/plugin-distribution/plugin-bundle-worker.js +99 -0
- package/dist/plugin-distribution/plugin-bundle.d.ts +16 -0
- package/dist/plugin-distribution/plugin-bundle.js +244 -0
- package/dist/plugin-distribution/plugin-bundle.worker.d.ts +1 -0
- package/dist/plugin-distribution/plugin-bundle.worker.js +38 -0
- package/dist/plugin-distribution/registry-cache.d.ts +26 -0
- package/dist/plugin-distribution/registry-cache.js +85 -0
- package/dist/plugin-distribution/registry-client.d.ts +36 -0
- package/dist/plugin-distribution/registry-client.js +115 -0
- package/dist/plugin-distribution/reserved-ids.d.ts +4 -0
- package/dist/plugin-distribution/reserved-ids.js +10 -0
- package/dist/plugin-distribution/runtime-validation.d.ts +14 -0
- package/dist/plugin-distribution/runtime-validation.js +388 -0
- package/dist/plugin-distribution/schemas.d.ts +4895 -0
- package/dist/plugin-distribution/schemas.js +299 -0
- package/dist/plugin-distribution/signing.d.ts +5 -0
- package/dist/plugin-distribution/signing.js +38 -0
- package/dist/plugin-distribution/types.d.ts +217 -0
- package/dist/plugin-distribution/types.js +1 -0
- package/dist/plugin-install-progress.d.ts +15 -0
- package/dist/plugin-install-progress.js +86 -0
- package/dist/plugin-manager.d.ts +306 -0
- package/dist/plugin-manager.js +2848 -0
- package/dist/plugin-runtime-entry.d.ts +19 -0
- package/dist/plugin-runtime-entry.js +135 -0
- package/dist/plugin.d.ts +350 -0
- package/dist/plugin.js +754 -0
- package/dist/popover.d.ts +20 -0
- package/dist/popover.js +32 -0
- package/dist/promise-worker.d.ts +22 -0
- package/dist/promise-worker.js +65 -0
- package/dist/prompt-confirm.d.ts +9 -0
- package/dist/prompt-confirm.js +33 -0
- package/dist/search-document-provider.d.ts +45 -0
- package/dist/search-document-provider.js +54 -0
- package/dist/search-query/index.d.ts +78 -0
- package/dist/search-query/index.js +426 -0
- package/dist/search-query/parser.d.ts +3 -0
- package/dist/search-query/parser.js +16 -0
- package/dist/search-query/parser.terms.js +26 -0
- package/dist/search-query/search-query.grammar +128 -0
- package/dist/search.d.ts +19 -0
- package/dist/search.js +104 -0
- package/dist/setting-section-layout.d.ts +19 -0
- package/dist/setting-section-layout.js +194 -0
- package/dist/settings.svelte.d.ts +474 -0
- package/dist/settings.svelte.js +1421 -0
- package/dist/source-text-file-view.d.ts +25 -0
- package/dist/source-text-file-view.js +78 -0
- package/dist/status-bar.svelte.d.ts +29 -0
- package/dist/status-bar.svelte.js +72 -0
- package/dist/storage/app-database.d.ts +860 -0
- package/dist/storage/app-database.js +2372 -0
- package/dist/storage/blob-store.d.ts +12 -0
- package/dist/storage/blob-store.js +1 -0
- package/dist/storage/browser-app-database-coordination.d.ts +35 -0
- package/dist/storage/browser-app-database-coordination.js +207 -0
- package/dist/storage/browser-coordinated-app-database.d.ts +109 -0
- package/dist/storage/browser-coordinated-app-database.js +704 -0
- package/dist/storage/browser.d.ts +153 -0
- package/dist/storage/browser.js +794 -0
- package/dist/storage/desktop-native.d.ts +184 -0
- package/dist/storage/desktop-native.js +415 -0
- package/dist/storage/fs.d.ts +188 -0
- package/dist/storage/fs.js +307 -0
- package/dist/storage/index-projection.d.ts +236 -0
- package/dist/storage/index-projection.js +402 -0
- package/dist/storage/index.d.ts +17 -0
- package/dist/storage/index.js +17 -0
- package/dist/storage/keyval.d.ts +94 -0
- package/dist/storage/keyval.js +199 -0
- package/dist/storage/memory-vault-adapter.d.ts +44 -0
- package/dist/storage/memory-vault-adapter.js +351 -0
- package/dist/storage/native-vault-bootstrap-kv.d.ts +22 -0
- package/dist/storage/native-vault-bootstrap-kv.js +96 -0
- package/dist/storage/path.d.ts +22 -0
- package/dist/storage/path.js +110 -0
- package/dist/storage/search-embedding-provider.d.ts +75 -0
- package/dist/storage/search-embedding-provider.js +446 -0
- package/dist/storage/search-embedding-worker.d.ts +1 -0
- package/dist/storage/search-embedding-worker.js +63 -0
- package/dist/storage/search-query-evaluator.d.ts +14 -0
- package/dist/storage/search-query-evaluator.js +678 -0
- package/dist/storage/task-projection.d.ts +152 -0
- package/dist/storage/task-projection.js +154 -0
- package/dist/storage/turso-app-database.d.ts +150 -0
- package/dist/storage/turso-app-database.js +2671 -0
- package/dist/storage/vault-session.d.ts +37 -0
- package/dist/storage/vault-session.js +196 -0
- package/dist/storage/vault-state.d.ts +74 -0
- package/dist/storage/vault-state.js +181 -0
- package/dist/storage/vault.svelte.d.ts +257 -0
- package/dist/storage/vault.svelte.js +661 -0
- package/dist/suggest.d.ts +193 -0
- package/dist/suggest.js +391 -0
- package/dist/tasks.d.ts +7 -0
- package/dist/tasks.js +18 -0
- package/dist/telemetry.d.ts +116 -0
- package/dist/telemetry.js +103 -0
- package/dist/utils.d.ts +55 -0
- package/dist/utils.js +314 -0
- package/dist/vault-api.d.ts +5 -0
- package/dist/vault-api.js +3 -0
- package/dist/vault-maintenance-commands.d.ts +5 -0
- package/dist/vault-maintenance-commands.js +32 -0
- package/dist/view.svelte.d.ts +215 -0
- package/dist/view.svelte.js +381 -0
- package/dist/vite-env.d.ts +2 -0
- package/dist/workspace-host-internal.d.ts +7 -0
- package/dist/workspace-host-internal.js +7 -0
- package/dist/workspace-host.d.ts +10 -0
- package/dist/workspace-host.js +14 -0
- package/dist/workspace-layout-commands.d.ts +3 -0
- package/dist/workspace-layout-commands.js +72 -0
- package/dist/workspace-layout-normalizer.d.ts +92 -0
- package/dist/workspace-layout-normalizer.js +301 -0
- package/dist/workspace-layouts.d.ts +7 -0
- package/dist/workspace-layouts.js +23 -0
- package/dist/workspace-trust.d.ts +32 -0
- package/dist/workspace-trust.js +72 -0
- package/dist/workspace.svelte.d.ts +796 -0
- package/dist/workspace.svelte.js +4380 -0
- package/package.json +240 -0
|
@@ -0,0 +1,188 @@
|
|
|
1
|
+
import { EventDispatcher } from "../events";
|
|
2
|
+
import type { Vault } from "./vault.svelte";
|
|
3
|
+
interface FileProperties {
|
|
4
|
+
/**
|
|
5
|
+
* Time of creation, represented as a unix timestamp, in milliseconds.
|
|
6
|
+
*
|
|
7
|
+
* @public
|
|
8
|
+
*/
|
|
9
|
+
ctime: number;
|
|
10
|
+
/**
|
|
11
|
+
* Time of last modification, represented as a unix timestamp, in
|
|
12
|
+
* milliseconds.
|
|
13
|
+
*
|
|
14
|
+
* @public
|
|
15
|
+
*/
|
|
16
|
+
mtime: number;
|
|
17
|
+
}
|
|
18
|
+
export interface FileStats extends FileProperties {
|
|
19
|
+
/**
|
|
20
|
+
* Size on disk, as bytes.
|
|
21
|
+
*
|
|
22
|
+
* @public
|
|
23
|
+
*/
|
|
24
|
+
size: number;
|
|
25
|
+
}
|
|
26
|
+
export type DataWriteOptions = Partial<FileProperties>;
|
|
27
|
+
export declare abstract class TAbstractFile {
|
|
28
|
+
parent: TFolder | null;
|
|
29
|
+
path: string;
|
|
30
|
+
vault: Vault;
|
|
31
|
+
constructor(path: string, parent?: TFolder | null, vault?: Vault);
|
|
32
|
+
get baseName(): string;
|
|
33
|
+
get extension(): string;
|
|
34
|
+
get name(): string;
|
|
35
|
+
get basename(): string;
|
|
36
|
+
abstract copy(props?: Partial<{
|
|
37
|
+
path: string;
|
|
38
|
+
stat: FileStats;
|
|
39
|
+
parent: TFolder;
|
|
40
|
+
children: TAbstractFile[];
|
|
41
|
+
}>): TAbstractFile;
|
|
42
|
+
toString(): string;
|
|
43
|
+
}
|
|
44
|
+
export declare class TFile extends TAbstractFile {
|
|
45
|
+
readonly stat: FileStats;
|
|
46
|
+
constructor(path: string, stat: FileStats, parent: TFolder | null, vault?: Vault);
|
|
47
|
+
copy(props?: Partial<{
|
|
48
|
+
path: string;
|
|
49
|
+
stat: FileStats;
|
|
50
|
+
parent: TFolder;
|
|
51
|
+
}>): TFile;
|
|
52
|
+
}
|
|
53
|
+
export declare class TFolder extends TAbstractFile {
|
|
54
|
+
readonly children: TAbstractFile[];
|
|
55
|
+
constructor(path: string, children?: TAbstractFile[], parent?: TFolder | null, vault?: Vault);
|
|
56
|
+
copy(props?: Partial<{
|
|
57
|
+
path: string;
|
|
58
|
+
children: TAbstractFile[];
|
|
59
|
+
}>): TFolder;
|
|
60
|
+
iterateAll(callback: (file: TAbstractFile) => void): void;
|
|
61
|
+
get files(): TFile[];
|
|
62
|
+
isRoot(): boolean;
|
|
63
|
+
}
|
|
64
|
+
export interface Stat extends FileStats {
|
|
65
|
+
type: "file" | "folder";
|
|
66
|
+
}
|
|
67
|
+
export interface ListedFiles {
|
|
68
|
+
/** @public */
|
|
69
|
+
files: string[];
|
|
70
|
+
/** @public */
|
|
71
|
+
folders: string[];
|
|
72
|
+
}
|
|
73
|
+
export type WatchOptions = {
|
|
74
|
+
recursive?: boolean;
|
|
75
|
+
interval?: number;
|
|
76
|
+
};
|
|
77
|
+
export interface ChangeEvent {
|
|
78
|
+
type: "create" | "modify" | "delete";
|
|
79
|
+
path: string;
|
|
80
|
+
}
|
|
81
|
+
export interface WatchErrorEvent {
|
|
82
|
+
type: "error";
|
|
83
|
+
path: string;
|
|
84
|
+
error: unknown;
|
|
85
|
+
}
|
|
86
|
+
export interface NativeWatchSubscription {
|
|
87
|
+
close(): void;
|
|
88
|
+
}
|
|
89
|
+
export interface NativeWatchAdapter {
|
|
90
|
+
watch(path: string | string[], options: WatchOptions, listener: (event: ChangeEvent | WatchErrorEvent) => void): NativeWatchSubscription | void;
|
|
91
|
+
}
|
|
92
|
+
export interface DataAdapter {
|
|
93
|
+
getName(): string;
|
|
94
|
+
exists(normalizedPath: string, sensitive?: boolean): Promise<boolean>;
|
|
95
|
+
stat(normalizedPath: string): Promise<Stat | null>;
|
|
96
|
+
read(normalizedPath: string): Promise<string>;
|
|
97
|
+
readBinary(normalizedPath: string): Promise<ArrayBuffer>;
|
|
98
|
+
write(normalizedPath: string, data: string, options?: DataWriteOptions): Promise<void>;
|
|
99
|
+
writeBinary(normalizedPath: string, data: ArrayBuffer, options?: DataWriteOptions): Promise<void>;
|
|
100
|
+
append(normalizedPath: string, data: string, options?: DataWriteOptions): Promise<void>;
|
|
101
|
+
appendBinary(normalizedPath: string, data: ArrayBuffer, options?: DataWriteOptions): Promise<void>;
|
|
102
|
+
/**
|
|
103
|
+
* Atomically read, modify, and save the contents of a plaintext file.
|
|
104
|
+
*
|
|
105
|
+
* @param normalizedPath - Path to file/folder, use {@link normalizePath} to
|
|
106
|
+
* normalize beforehand.
|
|
107
|
+
* @param fn - A callback function which returns the new content of the file
|
|
108
|
+
* synchronously.
|
|
109
|
+
* @param options - Write options.
|
|
110
|
+
* @returns String - the text value of the file that was written.
|
|
111
|
+
* @public
|
|
112
|
+
*/
|
|
113
|
+
process(normalizedPath: string, fn: (data: string) => string, options?: DataWriteOptions): Promise<string>;
|
|
114
|
+
list(normalizedPath: string): Promise<ListedFiles>;
|
|
115
|
+
mkdir(normalizedPath: string, options?: Partial<{
|
|
116
|
+
recursive: boolean;
|
|
117
|
+
mode: string;
|
|
118
|
+
}>): Promise<void>;
|
|
119
|
+
rmdir(normalizedPath: string, recursive: boolean): Promise<void>;
|
|
120
|
+
remove(normalizedPath: string): Promise<void>;
|
|
121
|
+
rename(normalizedPath: string, normalizedNewPath: string): Promise<void>;
|
|
122
|
+
copy(normalizedPath: string, normalizedNewPath: string): Promise<void>;
|
|
123
|
+
getResourcePath(normalizedPath: string): string;
|
|
124
|
+
trashSystem(normalizedPath: string): Promise<boolean>;
|
|
125
|
+
trashLocal(normalizedPath: string): Promise<void>;
|
|
126
|
+
}
|
|
127
|
+
export interface VaultAdapterCapabilities {
|
|
128
|
+
persistent: boolean;
|
|
129
|
+
userVisibleFiles: boolean;
|
|
130
|
+
requiresPermission: boolean;
|
|
131
|
+
nativeWatch: boolean;
|
|
132
|
+
resourceUrls: boolean;
|
|
133
|
+
systemTrash: boolean;
|
|
134
|
+
}
|
|
135
|
+
/**
|
|
136
|
+
* Preferred name for the canonical vault file adapter contract.
|
|
137
|
+
*
|
|
138
|
+
* `DataAdapter` remains exported for Obsidian API compatibility while the
|
|
139
|
+
* runtime migrates toward the cross-host vault session model.
|
|
140
|
+
*/
|
|
141
|
+
export interface VaultAdapter extends DataAdapter {
|
|
142
|
+
getCapabilities?(): Partial<VaultAdapterCapabilities>;
|
|
143
|
+
}
|
|
144
|
+
export interface VaultIdentityAdapter {
|
|
145
|
+
getVaultId(): string;
|
|
146
|
+
}
|
|
147
|
+
export interface AsyncResourceAdapter {
|
|
148
|
+
getResourceUrl(normalizedPath: string): Promise<string>;
|
|
149
|
+
revokeResourceUrl?(url: string): void;
|
|
150
|
+
}
|
|
151
|
+
export declare class DirectoryWatcher extends EventDispatcher<{
|
|
152
|
+
error: [{
|
|
153
|
+
error: unknown;
|
|
154
|
+
path: string;
|
|
155
|
+
}];
|
|
156
|
+
all: [event: ChangeEvent | WatchErrorEvent];
|
|
157
|
+
create: [path: string];
|
|
158
|
+
modify: [path: string];
|
|
159
|
+
delete: [path: string];
|
|
160
|
+
}> {
|
|
161
|
+
readonly adapter: DataAdapter;
|
|
162
|
+
readonly pollingInterval: number;
|
|
163
|
+
private watchers;
|
|
164
|
+
constructor(adapter: DataAdapter, pollingInterval?: number);
|
|
165
|
+
watch(path: string | string[], options?: WatchOptions): {
|
|
166
|
+
close: () => void;
|
|
167
|
+
} | undefined;
|
|
168
|
+
unwatch(path: string): void;
|
|
169
|
+
close(): void;
|
|
170
|
+
private takeSnapshot;
|
|
171
|
+
private toEventPath;
|
|
172
|
+
private checkForChanges;
|
|
173
|
+
private diffSnapshot;
|
|
174
|
+
}
|
|
175
|
+
export declare class FileCache {
|
|
176
|
+
private capacity;
|
|
177
|
+
private cache;
|
|
178
|
+
constructor(capacity: number);
|
|
179
|
+
get(key: string): string | undefined;
|
|
180
|
+
put(key: string, value: string): void;
|
|
181
|
+
invalidate(key: string): void;
|
|
182
|
+
rename(oldName: string, newName: string): void;
|
|
183
|
+
size(): number;
|
|
184
|
+
clear(): void;
|
|
185
|
+
has(key: string): boolean;
|
|
186
|
+
keys(): string[];
|
|
187
|
+
}
|
|
188
|
+
export {};
|
|
@@ -0,0 +1,307 @@
|
|
|
1
|
+
import { EventDispatcher } from "../events";
|
|
2
|
+
import { basename, joinPath, normalizePath } from "./path";
|
|
3
|
+
export class TAbstractFile {
|
|
4
|
+
parent;
|
|
5
|
+
path;
|
|
6
|
+
vault;
|
|
7
|
+
constructor(path, parent = null, vault) {
|
|
8
|
+
this.parent = parent;
|
|
9
|
+
this.path = path.replace(/\\/g, "/").replace(/\/$/, "");
|
|
10
|
+
if (vault) {
|
|
11
|
+
this.vault = vault;
|
|
12
|
+
}
|
|
13
|
+
else if (parent?.vault) {
|
|
14
|
+
this.vault = parent.vault;
|
|
15
|
+
}
|
|
16
|
+
}
|
|
17
|
+
get baseName() {
|
|
18
|
+
return basename(this.path);
|
|
19
|
+
}
|
|
20
|
+
get extension() {
|
|
21
|
+
const parts = this.baseName.split(".").filter((it) => it);
|
|
22
|
+
return parts.pop() ?? "";
|
|
23
|
+
}
|
|
24
|
+
get name() {
|
|
25
|
+
return this.baseName;
|
|
26
|
+
}
|
|
27
|
+
get basename() {
|
|
28
|
+
const parts = this.baseName.split(".").filter((it) => it);
|
|
29
|
+
parts.pop();
|
|
30
|
+
return parts.join(".");
|
|
31
|
+
}
|
|
32
|
+
toString() {
|
|
33
|
+
return this.path;
|
|
34
|
+
}
|
|
35
|
+
}
|
|
36
|
+
export class TFile extends TAbstractFile {
|
|
37
|
+
stat;
|
|
38
|
+
constructor(path, stat, parent, vault) {
|
|
39
|
+
super(path, parent, vault);
|
|
40
|
+
this.stat = stat;
|
|
41
|
+
}
|
|
42
|
+
copy(props = {}) {
|
|
43
|
+
return new TFile(props.path ?? this.path, props.stat ?? this.stat, props.parent ?? this.parent, props.parent?.vault ?? this.vault);
|
|
44
|
+
}
|
|
45
|
+
}
|
|
46
|
+
export class TFolder extends TAbstractFile {
|
|
47
|
+
children;
|
|
48
|
+
constructor(path, children = [], parent, vault) {
|
|
49
|
+
super(path, parent ?? null, vault);
|
|
50
|
+
this.children = children;
|
|
51
|
+
}
|
|
52
|
+
copy(props = {}) {
|
|
53
|
+
return new TFolder(props.path ?? this.path, props.children ?? this.children.map((it) => it.copy()), this.parent, this.vault);
|
|
54
|
+
}
|
|
55
|
+
iterateAll(callback) {
|
|
56
|
+
callback(this);
|
|
57
|
+
this.children.forEach((child) => {
|
|
58
|
+
if (child instanceof TFile) {
|
|
59
|
+
callback(child);
|
|
60
|
+
}
|
|
61
|
+
else if (child instanceof TFolder) {
|
|
62
|
+
child.iterateAll(callback);
|
|
63
|
+
}
|
|
64
|
+
});
|
|
65
|
+
}
|
|
66
|
+
get files() {
|
|
67
|
+
const values = [];
|
|
68
|
+
this.iterateAll((f) => {
|
|
69
|
+
if (f instanceof TFile) {
|
|
70
|
+
values.push(f);
|
|
71
|
+
}
|
|
72
|
+
});
|
|
73
|
+
return values;
|
|
74
|
+
}
|
|
75
|
+
isRoot() {
|
|
76
|
+
return this.parent === null;
|
|
77
|
+
}
|
|
78
|
+
}
|
|
79
|
+
function isNativeWatchAdapter(adapter) {
|
|
80
|
+
const vaultAdapter = adapter;
|
|
81
|
+
return (typeof vaultAdapter.watch === "function" &&
|
|
82
|
+
vaultAdapter.getCapabilities?.().nativeWatch === true);
|
|
83
|
+
}
|
|
84
|
+
export class DirectoryWatcher extends EventDispatcher {
|
|
85
|
+
adapter;
|
|
86
|
+
pollingInterval;
|
|
87
|
+
watchers = new Map();
|
|
88
|
+
constructor(adapter, pollingInterval = 5000) {
|
|
89
|
+
super();
|
|
90
|
+
this.adapter = adapter;
|
|
91
|
+
this.pollingInterval = pollingInterval;
|
|
92
|
+
}
|
|
93
|
+
watch(path, options = {}) {
|
|
94
|
+
if (Array.isArray(path)) {
|
|
95
|
+
path.forEach((p) => this.watch(p));
|
|
96
|
+
return;
|
|
97
|
+
}
|
|
98
|
+
path = normalizePath(path);
|
|
99
|
+
const watcherOptions = {
|
|
100
|
+
recursive: options.recursive || false,
|
|
101
|
+
interval: options.interval || this.pollingInterval,
|
|
102
|
+
lastSnapshot: null,
|
|
103
|
+
timeout: null,
|
|
104
|
+
nativeSubscription: null,
|
|
105
|
+
};
|
|
106
|
+
this.watchers.set(path, watcherOptions);
|
|
107
|
+
if (isNativeWatchAdapter(this.adapter)) {
|
|
108
|
+
watcherOptions.nativeSubscription =
|
|
109
|
+
this.adapter.watch(path, options, (event) => {
|
|
110
|
+
const normalizedEvent = event.type === "error"
|
|
111
|
+
? { ...event, path: this.toEventPath(event.path) }
|
|
112
|
+
: { ...event, path: this.toEventPath(event.path) };
|
|
113
|
+
this.dispatch("all", normalizedEvent);
|
|
114
|
+
if (normalizedEvent.type === "error") {
|
|
115
|
+
this.dispatch("error", {
|
|
116
|
+
error: normalizedEvent.error,
|
|
117
|
+
path: normalizedEvent.path,
|
|
118
|
+
});
|
|
119
|
+
return;
|
|
120
|
+
}
|
|
121
|
+
this.dispatch(normalizedEvent.type, normalizedEvent.path);
|
|
122
|
+
}) ?? null;
|
|
123
|
+
return {
|
|
124
|
+
close: () => this.unwatch(path),
|
|
125
|
+
};
|
|
126
|
+
}
|
|
127
|
+
this.takeSnapshot(path, watcherOptions.recursive).then((snapshot) => {
|
|
128
|
+
watcherOptions.lastSnapshot = snapshot;
|
|
129
|
+
watcherOptions.timeout = setInterval(() => {
|
|
130
|
+
this.checkForChanges(path, watcherOptions);
|
|
131
|
+
}, watcherOptions.interval);
|
|
132
|
+
});
|
|
133
|
+
return {
|
|
134
|
+
close: () => this.unwatch(path),
|
|
135
|
+
};
|
|
136
|
+
}
|
|
137
|
+
unwatch(path) {
|
|
138
|
+
path = normalizePath(path);
|
|
139
|
+
const watcher = this.watchers.get(path);
|
|
140
|
+
if (!watcher) {
|
|
141
|
+
return;
|
|
142
|
+
}
|
|
143
|
+
watcher.nativeSubscription?.close();
|
|
144
|
+
if (watcher.timeout) {
|
|
145
|
+
clearInterval(watcher.timeout);
|
|
146
|
+
}
|
|
147
|
+
this.watchers.delete(path);
|
|
148
|
+
}
|
|
149
|
+
close() {
|
|
150
|
+
for (const path of this.watchers.keys()) {
|
|
151
|
+
this.unwatch(path);
|
|
152
|
+
}
|
|
153
|
+
}
|
|
154
|
+
async takeSnapshot(path, recursive) {
|
|
155
|
+
path = normalizePath(path);
|
|
156
|
+
const snapshot = new Map();
|
|
157
|
+
try {
|
|
158
|
+
const stats = await this.adapter.stat(path);
|
|
159
|
+
if (!stats)
|
|
160
|
+
return snapshot;
|
|
161
|
+
snapshot.set(this.toEventPath(path), stats);
|
|
162
|
+
if (stats.type === "folder") {
|
|
163
|
+
const { files, folders } = await this.adapter.list(path);
|
|
164
|
+
for (const file of files) {
|
|
165
|
+
const entryPath = joinPath(path, file);
|
|
166
|
+
const entryStats = await this.adapter.stat(entryPath);
|
|
167
|
+
if (!entryStats)
|
|
168
|
+
continue;
|
|
169
|
+
snapshot.set(this.toEventPath(entryPath), entryStats);
|
|
170
|
+
}
|
|
171
|
+
if (!recursive)
|
|
172
|
+
return snapshot;
|
|
173
|
+
for (const folder of folders) {
|
|
174
|
+
const entryPath = joinPath(path, folder);
|
|
175
|
+
const subSnapshot = await this.takeSnapshot(entryPath, recursive);
|
|
176
|
+
for (const [subPath, subStats] of subSnapshot.entries()) {
|
|
177
|
+
snapshot.set(subPath, subStats);
|
|
178
|
+
}
|
|
179
|
+
}
|
|
180
|
+
}
|
|
181
|
+
}
|
|
182
|
+
catch (error) {
|
|
183
|
+
console.error("fs:watch", error);
|
|
184
|
+
this.trigger("error", { error, path });
|
|
185
|
+
this.trigger("all", { type: "error", path, error });
|
|
186
|
+
}
|
|
187
|
+
return snapshot;
|
|
188
|
+
}
|
|
189
|
+
toEventPath(path) {
|
|
190
|
+
path = normalizePath(path);
|
|
191
|
+
return path === "/" ? "/" : path.replace(/^\/+/, "");
|
|
192
|
+
}
|
|
193
|
+
async checkForChanges(path, watcherOptions) {
|
|
194
|
+
path = normalizePath(path);
|
|
195
|
+
try {
|
|
196
|
+
const newSnapshot = await this.takeSnapshot(path, watcherOptions.recursive);
|
|
197
|
+
if (watcherOptions.lastSnapshot) {
|
|
198
|
+
const changes = this.diffSnapshot(watcherOptions.lastSnapshot, newSnapshot);
|
|
199
|
+
for (const change of changes) {
|
|
200
|
+
this.dispatch(change.type, change.path);
|
|
201
|
+
this.dispatch("all", change);
|
|
202
|
+
}
|
|
203
|
+
}
|
|
204
|
+
watcherOptions.lastSnapshot = newSnapshot;
|
|
205
|
+
}
|
|
206
|
+
catch (err) {
|
|
207
|
+
const error = err;
|
|
208
|
+
if (error.code === "ENOENT") {
|
|
209
|
+
this.dispatch("delete", path);
|
|
210
|
+
this.dispatch("all", { type: "delete", path });
|
|
211
|
+
if (this.watchers.has(path)) {
|
|
212
|
+
this.unwatch(path);
|
|
213
|
+
}
|
|
214
|
+
}
|
|
215
|
+
else {
|
|
216
|
+
console.error("fs:watch", error);
|
|
217
|
+
this.dispatch("error", { error, path });
|
|
218
|
+
this.trigger("all", { type: "error", path, error });
|
|
219
|
+
}
|
|
220
|
+
}
|
|
221
|
+
}
|
|
222
|
+
diffSnapshot(oldSnapshot, newSnapshot) {
|
|
223
|
+
const changes = [];
|
|
224
|
+
for (const [path, stats] of newSnapshot) {
|
|
225
|
+
if (!oldSnapshot.has(path)) {
|
|
226
|
+
changes.push({ type: "create", path });
|
|
227
|
+
}
|
|
228
|
+
else {
|
|
229
|
+
const oldStats = oldSnapshot.get(path);
|
|
230
|
+
if (oldStats.mtime !== stats.mtime ||
|
|
231
|
+
oldStats.size !== stats.size ||
|
|
232
|
+
oldStats.type !== stats.type) {
|
|
233
|
+
changes.push({ type: "modify", path });
|
|
234
|
+
}
|
|
235
|
+
}
|
|
236
|
+
}
|
|
237
|
+
for (const path of oldSnapshot.keys()) {
|
|
238
|
+
if (!newSnapshot.has(path)) {
|
|
239
|
+
changes.push({ type: "delete", path });
|
|
240
|
+
}
|
|
241
|
+
}
|
|
242
|
+
return changes;
|
|
243
|
+
}
|
|
244
|
+
}
|
|
245
|
+
export class FileCache {
|
|
246
|
+
capacity;
|
|
247
|
+
cache;
|
|
248
|
+
constructor(capacity) {
|
|
249
|
+
if (capacity <= 0) {
|
|
250
|
+
throw new Error("Capacity must be greater than 0");
|
|
251
|
+
}
|
|
252
|
+
this.capacity = capacity;
|
|
253
|
+
this.cache = new Map();
|
|
254
|
+
}
|
|
255
|
+
get(key) {
|
|
256
|
+
key = normalizePath(key);
|
|
257
|
+
if (this.cache.has(key)) {
|
|
258
|
+
// Move to end (most recently used)
|
|
259
|
+
const value = this.cache.get(key);
|
|
260
|
+
this.cache.delete(key);
|
|
261
|
+
this.cache.set(key, value);
|
|
262
|
+
return value;
|
|
263
|
+
}
|
|
264
|
+
return undefined;
|
|
265
|
+
}
|
|
266
|
+
put(key, value) {
|
|
267
|
+
key = normalizePath(key);
|
|
268
|
+
if (this.cache.has(key)) {
|
|
269
|
+
// Update existing key - delete and re-add to move to end
|
|
270
|
+
this.cache.delete(key);
|
|
271
|
+
}
|
|
272
|
+
else if (this.cache.size >= this.capacity) {
|
|
273
|
+
// Remove least recently used (first item)
|
|
274
|
+
const firstKey = this.cache.keys().next().value;
|
|
275
|
+
this.cache.delete(firstKey);
|
|
276
|
+
}
|
|
277
|
+
this.cache.set(key, value);
|
|
278
|
+
}
|
|
279
|
+
invalidate(key) {
|
|
280
|
+
key = normalizePath(key);
|
|
281
|
+
this.keys()
|
|
282
|
+
.filter((path) => path.startsWith(`${key}/`) || path === key)
|
|
283
|
+
.forEach((key) => this.cache.delete(key));
|
|
284
|
+
}
|
|
285
|
+
rename(oldName, newName) {
|
|
286
|
+
oldName = normalizePath(oldName);
|
|
287
|
+
newName = normalizePath(newName);
|
|
288
|
+
if (this.cache.has(oldName)) {
|
|
289
|
+
const value = this.cache.get(oldName);
|
|
290
|
+
this.cache.delete(oldName);
|
|
291
|
+
this.cache.set(newName, value);
|
|
292
|
+
}
|
|
293
|
+
}
|
|
294
|
+
size() {
|
|
295
|
+
return this.cache.size;
|
|
296
|
+
}
|
|
297
|
+
clear() {
|
|
298
|
+
this.cache.clear();
|
|
299
|
+
}
|
|
300
|
+
has(key) {
|
|
301
|
+
return this.cache.has(key);
|
|
302
|
+
}
|
|
303
|
+
// Helper method to see current state (for debugging)
|
|
304
|
+
keys() {
|
|
305
|
+
return Array.from(this.cache.keys());
|
|
306
|
+
}
|
|
307
|
+
}
|