@mnaoumov/obsidian-lib 10.11.0 → 11.0.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +26 -0
- package/components/all-windows-status-bar-item-component/package.json +6 -0
- package/components/shared-component-pool-component/package.json +6 -0
- package/components/worker-component/package.json +6 -0
- package/components/worker-pool-component/package.json +6 -0
- package/components/workspace-layout-state-component/package.json +6 -0
- package/dist/lib/cjs/__merged.cjs +477 -285
- package/dist/lib/cjs/__merged.d.cts +26 -10
- package/dist/lib/cjs/anchored-suggest.cjs +1 -1
- package/dist/lib/cjs/app.cjs +2 -2
- package/dist/lib/cjs/async-with-notice.cjs +4 -4
- package/dist/lib/cjs/attachment-path.cjs +9 -9
- package/dist/lib/cjs/attachment-path.d.cts +3 -3
- package/dist/lib/cjs/attachment-unit-folder.cjs +2 -2
- package/dist/lib/cjs/backlink-index.cjs +5 -5
- package/dist/lib/cjs/backlink.cjs +7 -7
- package/dist/lib/cjs/bases-view-registrar.cjs +1 -1
- package/dist/lib/cjs/broken-link-candidates.cjs +1 -1
- package/dist/lib/cjs/bug-report-diagnostics.cjs +222 -0
- package/dist/lib/cjs/bug-report-diagnostics.d.cts +186 -0
- package/dist/lib/cjs/bug-report.cjs +38 -12
- package/dist/lib/cjs/bug-report.d.cts +65 -0
- package/dist/lib/cjs/bulk-operation-progress.cjs +1 -1
- package/dist/lib/cjs/bulk-operation.cjs +2 -2
- package/dist/lib/cjs/callout.cjs +6 -6
- package/dist/lib/cjs/canvas.cjs +11 -9
- package/dist/lib/cjs/canvas.d.cts +13 -0
- package/dist/lib/cjs/case-insensitive-file-index.cjs +3 -3
- package/dist/lib/cjs/code-block-render-handoff.cjs +5 -5
- package/dist/lib/cjs/codemirror/editor-mode-extension.cjs +4 -4
- package/dist/lib/cjs/codemirror/incremental-parse-state-field.cjs +2 -2
- package/dist/lib/cjs/codemirror/index.cjs +7 -7
- package/dist/lib/cjs/codemirror/inline-token-widgets.cjs +5 -5
- package/dist/lib/cjs/codemirror/markdown-editor-views.cjs +2 -2
- package/dist/lib/cjs/codemirror/settings-facet.cjs +1 -1
- package/dist/lib/cjs/command-handlers/abstract-file-command-handler.cjs +17 -17
- package/dist/lib/cjs/command-handlers/abstract-file-command-handler.d.cts +13 -13
- package/dist/lib/cjs/command-handlers/command-handler-component.cjs +2 -2
- package/dist/lib/cjs/command-handlers/command-handler.cjs +2 -2
- package/dist/lib/cjs/command-handlers/editor-command-handler.cjs +10 -10
- package/dist/lib/cjs/command-handlers/editor-command-handler.d.cts +7 -7
- package/dist/lib/cjs/command-handlers/file-command-handler.cjs +3 -3
- package/dist/lib/cjs/command-handlers/folder-command-handler.cjs +3 -3
- package/dist/lib/cjs/command-handlers/global-command-handler.cjs +2 -2
- package/dist/lib/cjs/command-handlers/index.cjs +15 -15
- package/dist/lib/cjs/command-handlers/open-bug-report-command-handler.cjs +95 -4
- package/dist/lib/cjs/command-handlers/open-bug-report-command-handler.d.cts +34 -2
- package/dist/lib/cjs/command-handlers/open-demo-vault-command-handler.cjs +2 -2
- package/dist/lib/cjs/command-handlers/open-discussion-command-handler.cjs +2 -2
- package/dist/lib/cjs/command-handlers/open-feature-request-command-handler.cjs +2 -2
- package/dist/lib/cjs/command-handlers/open-git-hub-command-handler.cjs +1 -1
- package/dist/lib/cjs/command-handlers/open-settings-command-handler.cjs +2 -2
- package/dist/lib/cjs/command-handlers/undo-bulk-operation-command-handler.cjs +2 -2
- package/dist/lib/cjs/command-handlers/unlock-active-note-command-handler.cjs +1 -1
- package/dist/lib/cjs/community-plugins.cjs +3 -3
- package/dist/lib/cjs/components/abort-signal-component.cjs +2 -2
- package/dist/lib/cjs/components/all-windows-event-component.cjs +5 -5
- package/dist/lib/cjs/components/all-windows-status-bar-item-component.cjs +245 -0
- package/dist/lib/cjs/components/all-windows-status-bar-item-component.d.cts +146 -0
- package/dist/lib/cjs/components/async-error-handler-component.cjs +5 -5
- package/dist/lib/cjs/components/async-events-component.cjs +1 -1
- package/dist/lib/cjs/components/bulk-operation-commit-component.cjs +12 -12
- package/dist/lib/cjs/components/case-insensitive-file-index-component.cjs +2 -2
- package/dist/lib/cjs/components/component-ex.cjs +21 -11
- package/dist/lib/cjs/components/component-ex.d.cts +11 -0
- package/dist/lib/cjs/components/console-debug-component.cjs +2 -2
- package/dist/lib/cjs/components/core-plugin-toggle-component.cjs +2 -2
- package/dist/lib/cjs/components/disposable-component.cjs +2 -2
- package/dist/lib/cjs/components/embed-extensions-component.cjs +21 -4
- package/dist/lib/cjs/components/embed-extensions-component.d.cts +8 -0
- package/dist/lib/cjs/components/embeddable-markdown-editor-component.cjs +24 -10
- package/dist/lib/cjs/components/embeddable-markdown-editor-component.d.cts +9 -0
- package/dist/lib/cjs/components/file-explorer-root-menu-component.cjs +7 -7
- package/dist/lib/cjs/components/generate-markdown-link-default-params-component.cjs +2 -2
- package/dist/lib/cjs/components/incremental-file-index-component.cjs +4 -4
- package/dist/lib/cjs/components/index.cjs +54 -39
- package/dist/lib/cjs/components/index.d.cts +5 -0
- package/dist/lib/cjs/components/layout-ready-component.cjs +3 -3
- package/dist/lib/cjs/components/menu-event-registrar-component.cjs +2 -2
- package/dist/lib/cjs/components/monkey-around-component.cjs +3 -3
- package/dist/lib/cjs/components/notebook-navigator-menu-event-registrar-component.cjs +5 -5
- package/dist/lib/cjs/components/plugin-context-component.cjs +5 -5
- package/dist/lib/cjs/components/plugin-gate-component.cjs +69 -36
- package/dist/lib/cjs/components/plugin-gate-component.d.cts +36 -13
- package/dist/lib/cjs/components/plugin-notice-component.cjs +39 -33
- package/dist/lib/cjs/components/plugin-notice-component.d.cts +4 -3
- package/dist/lib/cjs/components/plugin-settings-component.cjs +119 -18
- package/dist/lib/cjs/components/plugin-settings-component.d.cts +35 -5
- package/dist/lib/cjs/components/plugin-settings-tab-component.cjs +2 -2
- package/dist/lib/cjs/components/plugin-suggestion-component.cjs +8 -8
- package/dist/lib/cjs/components/pointer-position-component.cjs +2 -2
- package/dist/lib/cjs/components/reconfigurable-editor-extension-component.cjs +3 -3
- package/dist/lib/cjs/components/registry-component.cjs +2 -2
- package/dist/lib/cjs/components/release-notes-component.cjs +6 -6
- package/dist/lib/cjs/components/rename-delete-handler-component.cjs +25 -25
- package/dist/lib/cjs/components/rmdir-guard-component.cjs +2 -2
- package/dist/lib/cjs/components/settings-facet-component.cjs +1 -1
- package/dist/lib/cjs/components/settings-migration-component.cjs +5 -5
- package/dist/lib/cjs/components/shared-component-pool-component.cjs +368 -0
- package/dist/lib/cjs/components/shared-component-pool-component.d.cts +129 -0
- package/dist/lib/cjs/components/style-sheet-component.cjs +3 -3
- package/dist/lib/cjs/components/syntax-highlighting-component.cjs +3 -3
- package/dist/lib/cjs/components/templates-language-component.cjs +1 -1
- package/dist/lib/cjs/components/worker-component.cjs +363 -0
- package/dist/lib/cjs/components/worker-component.d.cts +156 -0
- package/dist/lib/cjs/components/worker-pool-component.cjs +185 -0
- package/dist/lib/cjs/components/worker-pool-component.d.cts +102 -0
- package/dist/lib/cjs/components/workspace-layout-state-component.cjs +495 -0
- package/dist/lib/cjs/components/workspace-layout-state-component.d.cts +239 -0
- package/dist/lib/cjs/constructors/get-dom-events-handlers-constructor.cjs +5 -5
- package/dist/lib/cjs/constructors/index.cjs +1 -1
- package/dist/lib/cjs/css-class.cjs +5 -1
- package/dist/lib/cjs/css-class.d.cts +16 -0
- package/dist/lib/cjs/data-handler.cjs +264 -6
- package/dist/lib/cjs/data-handler.d.cts +219 -2
- package/dist/lib/cjs/data-stores/data-store-locations.cjs +82 -24
- package/dist/lib/cjs/data-stores/data-store-locations.d.cts +15 -0
- package/dist/lib/cjs/data-stores/data-store-replica.cjs +33 -5
- package/dist/lib/cjs/data-stores/data-store-seeds.cjs +6 -6
- package/dist/lib/cjs/data-stores/data-store-seeds.d.cts +2 -2
- package/dist/lib/cjs/data-stores/data-store-transport.cjs +81 -8
- package/dist/lib/cjs/data-stores/data-store-transport.d.cts +30 -1
- package/dist/lib/cjs/data-stores/index.cjs +6 -6
- package/dist/lib/cjs/data-stores/local-data-store.cjs +74 -10
- package/dist/lib/cjs/data-stores/local-data-store.d.cts +58 -1
- package/dist/lib/cjs/data-stores/shared-data-store.cjs +76 -19
- package/dist/lib/cjs/data-stores/shared-data-store.d.cts +18 -1
- package/dist/lib/cjs/dataview-link.cjs +2 -2
- package/dist/lib/cjs/dataview.cjs +27 -7
- package/dist/lib/cjs/dataview.d.cts +14 -0
- package/dist/lib/cjs/debug.cjs +3 -3
- package/dist/lib/cjs/demo-vault-helper.cjs +34 -6
- package/dist/lib/cjs/demo-vault-helper.d.cts +6 -2
- package/dist/lib/cjs/desktop-bulk-operation-git.cjs +10 -10
- package/dist/lib/cjs/desktop-demo-vault-opener.cjs +13 -13
- package/dist/lib/cjs/desktop-git-runner.cjs +4 -14
- package/dist/lib/cjs/desktop-git-runner.d.cts +8 -2
- package/dist/lib/cjs/desktop-operating-system.cjs +1 -1
- package/dist/lib/cjs/desktop-request-url-stream.cjs +8 -14
- package/dist/lib/cjs/desktop-trusted-input.cjs +2 -2
- package/dist/lib/cjs/disposable.cjs +150 -0
- package/dist/lib/cjs/disposable.d.cts +39 -0
- package/dist/lib/cjs/editor-extension-registrar.cjs +1 -1
- package/dist/lib/cjs/editor-suggest-registrar.cjs +2 -2
- package/dist/lib/cjs/editor-suggest.cjs +1 -1
- package/dist/lib/cjs/editor.cjs +6 -6
- package/dist/lib/cjs/events.cjs +2 -2
- package/dist/lib/cjs/extensions-registrar.cjs +1 -1
- package/dist/lib/cjs/feature-request.cjs +1 -1
- package/dist/lib/cjs/file-change.cjs +10 -10
- package/dist/lib/cjs/file-explorer.cjs +2 -2
- package/dist/lib/cjs/file-manager.cjs +5 -5
- package/dist/lib/cjs/file-system.cjs +10 -10
- package/dist/lib/cjs/folder-note.cjs +4 -4
- package/dist/lib/cjs/frontmatter-formatting.cjs +7 -6
- package/dist/lib/cjs/frontmatter-link-cache-with-offsets.cjs +1 -1
- package/dist/lib/cjs/frontmatter.cjs +5 -5
- package/dist/lib/cjs/generated-during-build.cjs +2 -2
- package/dist/lib/cjs/git-rename-history.cjs +1 -1
- package/dist/lib/cjs/git-rename-history.d.cts +2 -2
- package/dist/lib/cjs/hotkey.cjs +1 -1
- package/dist/lib/cjs/hover-link-source-registrar.cjs +1 -1
- package/dist/lib/cjs/html-element.cjs +2 -2
- package/dist/lib/cjs/i18n/custom-type-options.cjs +1 -1
- package/dist/lib/cjs/i18n/default-translations.cjs +1 -1
- package/dist/lib/cjs/i18n/i18n.cjs +7 -7
- package/dist/lib/cjs/i18n/index.cjs +4 -4
- package/dist/lib/cjs/i18n/locales/en.cjs +27 -1
- package/dist/lib/cjs/i18n/locales/en.d.cts +26 -0
- package/dist/lib/cjs/i18n/locales/index.cjs +2 -2
- package/dist/lib/cjs/i18n/locales/translations-map.cjs +1 -1
- package/dist/lib/cjs/i18n/locales/translations-map.d.cts +26 -0
- package/dist/lib/cjs/index.cjs +147 -126
- package/dist/lib/cjs/index.d.cts +7 -0
- package/dist/lib/cjs/inline-token-renderer.cjs +2 -2
- package/dist/lib/cjs/is-in-obsidian.cjs +1 -1
- package/dist/lib/cjs/library-styles.cjs +3 -3
- package/dist/lib/cjs/link-and-tag-input-suggest.cjs +2 -2
- package/dist/lib/cjs/link.cjs +76 -56
- package/dist/lib/cjs/link.d.cts +20 -14
- package/dist/lib/cjs/logger.cjs +4 -4
- package/dist/lib/cjs/loop.cjs +10 -16
- package/dist/lib/cjs/markdown-code-block-processor-registrar.cjs +17 -2
- package/dist/lib/cjs/markdown-code-block-processor-registrar.d.cts +7 -0
- package/dist/lib/cjs/markdown-code-block-processor.cjs +13 -13
- package/dist/lib/cjs/markdown-post-processor-registrar.cjs +2 -2
- package/dist/lib/cjs/markdown-view.cjs +191 -3
- package/dist/lib/cjs/markdown-view.d.cts +48 -1
- package/dist/lib/cjs/markdown.cjs +12 -12
- package/dist/lib/cjs/metadata-cache.cjs +23 -23
- package/dist/lib/cjs/metadata-cache.d.cts +5 -4
- package/dist/lib/cjs/misplaced-attachment.cjs +297 -0
- package/dist/lib/cjs/misplaced-attachment.d.cts +228 -0
- package/dist/lib/cjs/mobile-app-info.cjs +1 -1
- package/dist/lib/cjs/modals/alert.cjs +4 -4
- package/dist/lib/cjs/modals/code-block-builder.cjs +7 -7
- package/dist/lib/cjs/modals/confirm.cjs +4 -4
- package/dist/lib/cjs/modals/copy-text-manually.cjs +181 -0
- package/dist/lib/cjs/modals/copy-text-manually.d.cts +38 -0
- package/dist/lib/cjs/modals/index.cjs +17 -11
- package/dist/lib/cjs/modals/index.d.cts +2 -0
- package/dist/lib/cjs/modals/minimizable-modal.cjs +6 -6
- package/dist/lib/cjs/modals/modal-command-builder.cjs +3 -3
- package/dist/lib/cjs/modals/modal.cjs +3 -3
- package/dist/lib/cjs/modals/prompt.cjs +10 -10
- package/dist/lib/cjs/modals/prompt.d.cts +1 -1
- package/dist/lib/cjs/modals/review-bug-report-diagnostics.cjs +202 -0
- package/dist/lib/cjs/modals/review-bug-report-diagnostics.d.cts +30 -0
- package/dist/lib/cjs/modals/select-item.cjs +6 -6
- package/dist/lib/cjs/modals/select-option.cjs +3 -3
- package/dist/lib/cjs/modals/suggest-modal-command-builder.cjs +1 -1
- package/dist/lib/cjs/note-priority.cjs +2 -2
- package/dist/lib/cjs/notebook-navigator.cjs +12 -2
- package/dist/lib/cjs/notebook-navigator.d.cts +6 -0
- package/dist/lib/cjs/obsidian-lib-state.cjs +1 -1
- package/dist/lib/cjs/obsidian-protocol-handler-registrar.cjs +1 -1
- package/dist/lib/cjs/obsidian-settings.cjs +1 -1
- package/dist/lib/cjs/obsidian-word-characters.cjs +1 -1
- package/dist/lib/cjs/parse-link.cjs +14 -14
- package/dist/lib/cjs/path-compatibility.cjs +368 -0
- package/dist/lib/cjs/path-compatibility.d.cts +263 -0
- package/dist/lib/cjs/path-settings.cjs +3 -3
- package/dist/lib/cjs/pdf.cjs +2 -2
- package/dist/lib/cjs/plugin/index.cjs +18 -12
- package/dist/lib/cjs/plugin/index.d.cts +2 -0
- package/dist/lib/cjs/plugin/plugin-api.cjs +21 -12
- package/dist/lib/cjs/plugin/plugin-api.d.cts +5 -1
- package/dist/lib/cjs/plugin/plugin-async-cleanup.cjs +6 -3
- package/dist/lib/cjs/plugin/plugin-async-cleanup.d.cts +5 -0
- package/dist/lib/cjs/plugin/plugin-context.cjs +10 -9
- package/dist/lib/cjs/plugin/plugin-event-source.cjs +1 -1
- package/dist/lib/cjs/plugin/plugin-event-source.d.cts +4 -4
- package/dist/lib/cjs/plugin/plugin-install-state.cjs +49 -4
- package/dist/lib/cjs/plugin/plugin-install-state.d.cts +30 -0
- package/dist/lib/cjs/plugin/plugin-instance.cjs +450 -0
- package/dist/lib/cjs/plugin/plugin-instance.d.cts +258 -0
- package/dist/lib/cjs/plugin/plugin-lifecycle-events.cjs +1 -1
- package/dist/lib/cjs/plugin/plugin-lifecycle-events.d.cts +6 -4
- package/dist/lib/cjs/plugin/plugin-settings-tab.cjs +15 -15
- package/dist/lib/cjs/plugin/plugin.cjs +133 -34
- package/dist/lib/cjs/plugin/plugin.d.cts +35 -5
- package/dist/lib/cjs/plugin/settings-migration-api.cjs +1 -1
- package/dist/lib/cjs/plugin/third-party-plugin.cjs +231 -0
- package/dist/lib/cjs/plugin/third-party-plugin.d.cts +244 -0
- package/dist/lib/cjs/plugin-cli-handler-registrar.cjs +2 -2
- package/dist/lib/cjs/popovers/field-popover.cjs +4 -4
- package/dist/lib/cjs/popovers/index.cjs +3 -3
- package/dist/lib/cjs/popovers/popover-anchor.cjs +1 -1
- package/dist/lib/cjs/popovers/popover.cjs +5 -5
- package/dist/lib/cjs/queue.cjs +8 -8
- package/dist/lib/cjs/react/app-context.cjs +3 -3
- package/dist/lib/cjs/react/index.cjs +1 -1
- package/dist/lib/cjs/reference-definition.cjs +1 -1
- package/dist/lib/cjs/reference.cjs +3 -3
- package/dist/lib/cjs/release-asset.cjs +5 -5
- package/dist/lib/cjs/rendered-markdown.cjs +4 -4
- package/dist/lib/cjs/request-url.cjs +4 -4
- package/dist/lib/cjs/resource-lock.cjs +46 -42
- package/dist/lib/cjs/resource-lock.d.cts +8 -7
- package/dist/lib/cjs/resource-url.cjs +3 -3
- package/dist/lib/cjs/ribbon-icon-registrar.cjs +1 -1
- package/dist/lib/cjs/setting-components/checkbox-component.cjs +3 -3
- package/dist/lib/cjs/setting-components/code-highlighter-component.cjs +7 -7
- package/dist/lib/cjs/setting-components/date-component.cjs +4 -4
- package/dist/lib/cjs/setting-components/date-time-component.cjs +4 -4
- package/dist/lib/cjs/setting-components/email-component.cjs +2 -2
- package/dist/lib/cjs/setting-components/file-component.cjs +2 -2
- package/dist/lib/cjs/setting-components/folder-list-component.cjs +3 -3
- package/dist/lib/cjs/setting-components/hotkey-component.cjs +5 -5
- package/dist/lib/cjs/setting-components/index.cjs +30 -30
- package/dist/lib/cjs/setting-components/list-component.cjs +5 -5
- package/dist/lib/cjs/setting-components/month-component.cjs +4 -4
- package/dist/lib/cjs/setting-components/multiple-dropdown-component.cjs +3 -3
- package/dist/lib/cjs/setting-components/multiple-email-component.cjs +2 -2
- package/dist/lib/cjs/setting-components/multiple-file-component.cjs +3 -3
- package/dist/lib/cjs/setting-components/multiple-text-component.cjs +9 -6
- package/dist/lib/cjs/setting-components/multiple-text-component.d.cts +4 -1
- package/dist/lib/cjs/setting-components/number-component.cjs +2 -2
- package/dist/lib/cjs/setting-components/password-component.cjs +2 -2
- package/dist/lib/cjs/setting-components/setting-component-wrapper.cjs +3 -3
- package/dist/lib/cjs/setting-components/tag-list-component.cjs +4 -4
- package/dist/lib/cjs/setting-components/telephone-component.cjs +2 -2
- package/dist/lib/cjs/setting-components/text-based-component.cjs +1 -1
- package/dist/lib/cjs/setting-components/time-component.cjs +3 -3
- package/dist/lib/cjs/setting-components/tri-state-checkbox-component.cjs +3 -3
- package/dist/lib/cjs/setting-components/typed-dropdown-component.cjs +3 -3
- package/dist/lib/cjs/setting-components/typed-multiple-dropdown-component.cjs +4 -4
- package/dist/lib/cjs/setting-components/typed-range-text-component.cjs +1 -1
- package/dist/lib/cjs/setting-components/typed-text-component.cjs +3 -3
- package/dist/lib/cjs/setting-components/url-component.cjs +2 -2
- package/dist/lib/cjs/setting-components/validator-component.cjs +4 -4
- package/dist/lib/cjs/setting-components/week-component.cjs +4 -4
- package/dist/lib/cjs/setting-ex.cjs +26 -26
- package/dist/lib/cjs/setting-group-ex.cjs +2 -2
- package/dist/lib/cjs/settings-recovery.cjs +217 -0
- package/dist/lib/cjs/settings-recovery.d.cts +178 -0
- package/dist/lib/cjs/settings-tabs.cjs +5 -5
- package/dist/lib/cjs/status-bar-item-registrar.cjs +1 -1
- package/dist/lib/cjs/templater.cjs +14 -4
- package/dist/lib/cjs/templater.d.cts +6 -0
- package/dist/lib/cjs/transformers/duration-transformer.cjs +2 -2
- package/dist/lib/cjs/transformers/index.cjs +1 -1
- package/dist/lib/cjs/trusted-input.cjs +1 -1
- package/dist/lib/cjs/validation.cjs +4 -4
- package/dist/lib/cjs/vault-delete.cjs +6 -6
- package/dist/lib/cjs/vault-transaction.cjs +5 -5
- package/dist/lib/cjs/vault.cjs +12 -12
- package/dist/lib/cjs/view-registrar.cjs +1 -1
- package/dist/lib/cjs/virtual-file.cjs +16 -14
- package/dist/lib/cjs/virtual-file.d.cts +2 -1
- package/dist/lib/cjs/wasm.cjs +119 -0
- package/dist/lib/cjs/wasm.d.cts +54 -0
- package/dist/lib/cjs/worker-protocol.cjs +209 -0
- package/dist/lib/cjs/worker-protocol.d.cts +282 -0
- package/dist/lib/cjs/workspace.cjs +1 -1
- package/dist/lib/esm/__merged.d.mts +26 -10
- package/dist/lib/esm/__merged.mjs +215 -5
- package/dist/lib/esm/app.mjs +2 -2
- package/dist/lib/esm/attachment-path.d.mts +3 -3
- package/dist/lib/esm/attachment-path.mjs +2 -2
- package/dist/lib/esm/backlink-index.mjs +2 -2
- package/dist/lib/esm/bug-report-diagnostics.d.mts +186 -0
- package/dist/lib/esm/bug-report-diagnostics.mjs +127 -0
- package/dist/lib/esm/bug-report.d.mts +65 -0
- package/dist/lib/esm/bug-report.mjs +33 -10
- package/dist/lib/esm/canvas.d.mts +13 -0
- package/dist/lib/esm/canvas.mjs +6 -5
- package/dist/lib/esm/command-handlers/abstract-file-command-handler.d.mts +13 -13
- package/dist/lib/esm/command-handlers/abstract-file-command-handler.mjs +14 -14
- package/dist/lib/esm/command-handlers/editor-command-handler.d.mts +7 -7
- package/dist/lib/esm/command-handlers/editor-command-handler.mjs +8 -8
- package/dist/lib/esm/command-handlers/open-bug-report-command-handler.d.mts +34 -2
- package/dist/lib/esm/command-handlers/open-bug-report-command-handler.mjs +99 -3
- package/dist/lib/esm/components/all-windows-status-bar-item-component.d.mts +146 -0
- package/dist/lib/esm/components/all-windows-status-bar-item-component.mjs +154 -0
- package/dist/lib/esm/components/component-ex.d.mts +11 -0
- package/dist/lib/esm/components/component-ex.mjs +19 -6
- package/dist/lib/esm/components/disposable-component.mjs +1 -1
- package/dist/lib/esm/components/embed-extensions-component.d.mts +8 -0
- package/dist/lib/esm/components/embed-extensions-component.mjs +20 -3
- package/dist/lib/esm/components/embeddable-markdown-editor-component.d.mts +9 -0
- package/dist/lib/esm/components/embeddable-markdown-editor-component.mjs +16 -2
- package/dist/lib/esm/components/index.d.mts +5 -0
- package/dist/lib/esm/components/index.mjs +12 -2
- package/dist/lib/esm/components/plugin-gate-component.d.mts +36 -13
- package/dist/lib/esm/components/plugin-gate-component.mjs +61 -26
- package/dist/lib/esm/components/plugin-notice-component.d.mts +4 -3
- package/dist/lib/esm/components/plugin-notice-component.mjs +30 -21
- package/dist/lib/esm/components/plugin-settings-component.d.mts +35 -5
- package/dist/lib/esm/components/plugin-settings-component.mjs +105 -4
- package/dist/lib/esm/components/rename-delete-handler-component.mjs +2 -2
- package/dist/lib/esm/components/shared-component-pool-component.d.mts +129 -0
- package/dist/lib/esm/components/shared-component-pool-component.mjs +280 -0
- package/dist/lib/esm/components/worker-component.d.mts +156 -0
- package/dist/lib/esm/components/worker-component.mjs +279 -0
- package/dist/lib/esm/components/worker-pool-component.d.mts +102 -0
- package/dist/lib/esm/components/worker-pool-component.mjs +95 -0
- package/dist/lib/esm/components/workspace-layout-state-component.d.mts +239 -0
- package/dist/lib/esm/components/workspace-layout-state-component.mjs +404 -0
- package/dist/lib/esm/css-class.d.mts +16 -0
- package/dist/lib/esm/css-class.mjs +5 -1
- package/dist/lib/esm/data-handler.d.mts +219 -2
- package/dist/lib/esm/data-handler.mjs +262 -5
- package/dist/lib/esm/data-stores/data-store-locations.d.mts +15 -0
- package/dist/lib/esm/data-stores/data-store-locations.mjs +80 -22
- package/dist/lib/esm/data-stores/data-store-replica.mjs +33 -5
- package/dist/lib/esm/data-stores/data-store-seeds.d.mts +2 -2
- package/dist/lib/esm/data-stores/data-store-seeds.mjs +4 -4
- package/dist/lib/esm/data-stores/data-store-transport.d.mts +30 -1
- package/dist/lib/esm/data-stores/data-store-transport.mjs +78 -5
- package/dist/lib/esm/data-stores/local-data-store.d.mts +58 -1
- package/dist/lib/esm/data-stores/local-data-store.mjs +71 -9
- package/dist/lib/esm/data-stores/shared-data-store.d.mts +18 -1
- package/dist/lib/esm/data-stores/shared-data-store.mjs +72 -15
- package/dist/lib/esm/dataview.d.mts +14 -0
- package/dist/lib/esm/dataview.mjs +19 -1
- package/dist/lib/esm/demo-vault-helper.d.mts +6 -2
- package/dist/lib/esm/demo-vault-helper.mjs +29 -1
- package/dist/lib/esm/desktop-demo-vault-opener.mjs +1 -1
- package/dist/lib/esm/desktop-git-runner.d.mts +8 -2
- package/dist/lib/esm/desktop-git-runner.mjs +3 -3
- package/dist/lib/esm/desktop-request-url-stream.mjs +4 -10
- package/dist/lib/esm/disposable.d.mts +39 -0
- package/dist/lib/esm/disposable.mjs +64 -0
- package/dist/lib/esm/file-system.mjs +2 -2
- package/dist/lib/esm/frontmatter-formatting.mjs +2 -1
- package/dist/lib/esm/generated-during-build.mjs +2 -2
- package/dist/lib/esm/git-rename-history.d.mts +2 -2
- package/dist/lib/esm/git-rename-history.mjs +1 -1
- package/dist/lib/esm/i18n/locales/en.d.mts +26 -0
- package/dist/lib/esm/i18n/locales/en.mjs +27 -1
- package/dist/lib/esm/i18n/locales/translations-map.d.mts +26 -0
- package/dist/lib/esm/index.d.mts +7 -0
- package/dist/lib/esm/index.mjs +15 -1
- package/dist/lib/esm/link.d.mts +20 -14
- package/dist/lib/esm/link.mjs +57 -38
- package/dist/lib/esm/loop.mjs +2 -8
- package/dist/lib/esm/markdown-code-block-processor-registrar.d.mts +7 -0
- package/dist/lib/esm/markdown-code-block-processor-registrar.mjs +16 -1
- package/dist/lib/esm/markdown-view.d.mts +48 -1
- package/dist/lib/esm/markdown-view.mjs +192 -2
- package/dist/lib/esm/metadata-cache.d.mts +5 -4
- package/dist/lib/esm/metadata-cache.mjs +6 -6
- package/dist/lib/esm/misplaced-attachment.d.mts +228 -0
- package/dist/lib/esm/misplaced-attachment.mjs +212 -0
- package/dist/lib/esm/modals/copy-text-manually.d.mts +38 -0
- package/dist/lib/esm/modals/copy-text-manually.mjs +99 -0
- package/dist/lib/esm/modals/index.d.mts +2 -0
- package/dist/lib/esm/modals/index.mjs +5 -1
- package/dist/lib/esm/modals/prompt.d.mts +1 -1
- package/dist/lib/esm/modals/prompt.mjs +1 -1
- package/dist/lib/esm/modals/review-bug-report-diagnostics.d.mts +30 -0
- package/dist/lib/esm/modals/review-bug-report-diagnostics.mjs +120 -0
- package/dist/lib/esm/notebook-navigator.d.mts +6 -0
- package/dist/lib/esm/notebook-navigator.mjs +11 -2
- package/dist/lib/esm/parse-link.mjs +4 -4
- package/dist/lib/esm/path-compatibility.d.mts +263 -0
- package/dist/lib/esm/path-compatibility.mjs +277 -0
- package/dist/lib/esm/plugin/index.d.mts +2 -0
- package/dist/lib/esm/plugin/index.mjs +6 -2
- package/dist/lib/esm/plugin/plugin-api.d.mts +5 -1
- package/dist/lib/esm/plugin/plugin-api.mjs +13 -4
- package/dist/lib/esm/plugin/plugin-async-cleanup.d.mts +5 -0
- package/dist/lib/esm/plugin/plugin-async-cleanup.mjs +3 -1
- package/dist/lib/esm/plugin/plugin-context.mjs +2 -1
- package/dist/lib/esm/plugin/plugin-event-source.d.mts +4 -4
- package/dist/lib/esm/plugin/plugin-event-source.mjs +1 -1
- package/dist/lib/esm/plugin/plugin-install-state.d.mts +30 -0
- package/dist/lib/esm/plugin/plugin-install-state.mjs +44 -1
- package/dist/lib/esm/plugin/plugin-instance.d.mts +258 -0
- package/dist/lib/esm/plugin/plugin-instance.mjs +367 -0
- package/dist/lib/esm/plugin/plugin-lifecycle-events.d.mts +6 -4
- package/dist/lib/esm/plugin/plugin-lifecycle-events.mjs +1 -1
- package/dist/lib/esm/plugin/plugin.d.mts +35 -5
- package/dist/lib/esm/plugin/plugin.mjs +118 -9
- package/dist/lib/esm/plugin/third-party-plugin.d.mts +244 -0
- package/dist/lib/esm/plugin/third-party-plugin.mjs +147 -0
- package/dist/lib/esm/release-asset.mjs +1 -1
- package/dist/lib/esm/resource-lock.d.mts +8 -7
- package/dist/lib/esm/resource-lock.mjs +31 -26
- package/dist/lib/esm/setting-components/multiple-text-component.d.mts +4 -1
- package/dist/lib/esm/setting-components/multiple-text-component.mjs +6 -3
- package/dist/lib/esm/settings-recovery.d.mts +178 -0
- package/dist/lib/esm/settings-recovery.mjs +125 -0
- package/dist/lib/esm/settings-tabs.mjs +2 -2
- package/dist/lib/esm/templater.d.mts +6 -0
- package/dist/lib/esm/templater.mjs +11 -2
- package/dist/lib/esm/vault.mjs +1 -1
- package/dist/lib/esm/virtual-file.d.mts +2 -1
- package/dist/lib/esm/virtual-file.mjs +7 -5
- package/dist/lib/esm/wasm.d.mts +54 -0
- package/dist/lib/esm/wasm.mjs +30 -0
- package/dist/lib/esm/worker-protocol.d.mts +282 -0
- package/dist/lib/esm/worker-protocol.mjs +113 -0
- package/dist/styles.css +16 -1
- package/modals/copy-text-manually/package.json +6 -0
- package/modals/review-bug-report-diagnostics/package.json +6 -0
- package/package.json +10 -8
- package/plugin/plugin-instance/package.json +6 -0
- package/plugin/third-party-plugin/package.json +6 -0
|
@@ -0,0 +1,185 @@
|
|
|
1
|
+
/*
|
|
2
|
+
THIS IS A GENERATED/BUNDLED FILE BY ESBUILD
|
|
3
|
+
if you want to view the source, please visit the github repository of this plugin
|
|
4
|
+
*/
|
|
5
|
+
(function patchObsidianRequire() {
|
|
6
|
+
const originalRequire = require;
|
|
7
|
+
if (!originalRequire || originalRequire.__isPatched) {
|
|
8
|
+
return;
|
|
9
|
+
}
|
|
10
|
+
require = Object.assign(
|
|
11
|
+
(id) => requirePatched(id),
|
|
12
|
+
originalRequire,
|
|
13
|
+
{
|
|
14
|
+
__isPatched: true
|
|
15
|
+
}
|
|
16
|
+
);
|
|
17
|
+
function extractDefault($module) {
|
|
18
|
+
return $module && $module.__esModule && "default" in $module ? $module.default : $module;
|
|
19
|
+
}
|
|
20
|
+
const OBSIDIAN_BUILT_IN_MODULE_NAMES = /* @__PURE__ */ new Set([
|
|
21
|
+
"@codemirror/autocomplete",
|
|
22
|
+
"@codemirror/collab",
|
|
23
|
+
"@codemirror/commands",
|
|
24
|
+
"@codemirror/language",
|
|
25
|
+
"@codemirror/lint",
|
|
26
|
+
"@codemirror/search",
|
|
27
|
+
"@codemirror/state",
|
|
28
|
+
"@codemirror/text",
|
|
29
|
+
"@codemirror/view",
|
|
30
|
+
"@lezer/common",
|
|
31
|
+
"@lezer/highlight",
|
|
32
|
+
"@lezer/lr",
|
|
33
|
+
"obsidian"
|
|
34
|
+
]);
|
|
35
|
+
const DEPRECATED_OBSIDIAN_BUILT_IN_MODULE_NAMES = /* @__PURE__ */ new Set([
|
|
36
|
+
"@codemirror/closebrackets",
|
|
37
|
+
"@codemirror/comment",
|
|
38
|
+
"@codemirror/fold",
|
|
39
|
+
"@codemirror/gutter",
|
|
40
|
+
"@codemirror/highlight",
|
|
41
|
+
"@codemirror/history",
|
|
42
|
+
"@codemirror/matchbrackets",
|
|
43
|
+
"@codemirror/panel",
|
|
44
|
+
"@codemirror/rangeset",
|
|
45
|
+
"@codemirror/rectangular-selection",
|
|
46
|
+
"@codemirror/stream-parser",
|
|
47
|
+
"@codemirror/tooltip"
|
|
48
|
+
]);
|
|
49
|
+
function requirePatched(id) {
|
|
50
|
+
if (OBSIDIAN_BUILT_IN_MODULE_NAMES.has(id) || DEPRECATED_OBSIDIAN_BUILT_IN_MODULE_NAMES.has(id)) {
|
|
51
|
+
return originalRequire?.(id);
|
|
52
|
+
}
|
|
53
|
+
const app = globalThis.app;
|
|
54
|
+
if (app?.isMobile) {
|
|
55
|
+
if (id === "process" || id === "node:process") {
|
|
56
|
+
console.debug(`The most likely you can safely ignore this error. Module not found: ${id}. Fake process object is returned instead.`);
|
|
57
|
+
return process;
|
|
58
|
+
}
|
|
59
|
+
} else {
|
|
60
|
+
const $module = originalRequire?.(id);
|
|
61
|
+
if ($module) {
|
|
62
|
+
return extractDefault($module);
|
|
63
|
+
}
|
|
64
|
+
}
|
|
65
|
+
console.debug(`The most likely you can safely ignore this error. Module not found: ${id}. Empty object is returned instead.`);
|
|
66
|
+
return {};
|
|
67
|
+
}
|
|
68
|
+
})();
|
|
69
|
+
|
|
70
|
+
"use strict";
|
|
71
|
+
var __defProp = Object.defineProperty;
|
|
72
|
+
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
73
|
+
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
74
|
+
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
75
|
+
var __export = (target, all) => {
|
|
76
|
+
for (var name in all)
|
|
77
|
+
__defProp(target, name, { get: all[name], enumerable: true });
|
|
78
|
+
};
|
|
79
|
+
var __copyProps = (to, from, except, desc) => {
|
|
80
|
+
if (from && typeof from === "object" || typeof from === "function") {
|
|
81
|
+
for (let key of __getOwnPropNames(from))
|
|
82
|
+
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
83
|
+
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
84
|
+
}
|
|
85
|
+
return to;
|
|
86
|
+
};
|
|
87
|
+
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
88
|
+
var worker_pool_component_exports = {};
|
|
89
|
+
__export(worker_pool_component_exports, {
|
|
90
|
+
MAX_DEFAULT_WORKER_POOL_SIZE: () => MAX_DEFAULT_WORKER_POOL_SIZE,
|
|
91
|
+
WorkerPoolComponent: () => WorkerPoolComponent,
|
|
92
|
+
getDefaultWorkerPoolSize: () => getDefaultWorkerPoolSize
|
|
93
|
+
});
|
|
94
|
+
module.exports = __toCommonJS(worker_pool_component_exports);
|
|
95
|
+
var import_component_ex = require("./component-ex.cjs");
|
|
96
|
+
var import_worker_component = require("./worker-component.cjs");
|
|
97
|
+
const MAX_DEFAULT_WORKER_POOL_SIZE = 4;
|
|
98
|
+
class WorkerPoolComponent extends import_component_ex.ComponentEx {
|
|
99
|
+
/**
|
|
100
|
+
* Creates the pool.
|
|
101
|
+
*
|
|
102
|
+
* @param params - The parameters.
|
|
103
|
+
*/
|
|
104
|
+
constructor(params) {
|
|
105
|
+
super();
|
|
106
|
+
this.params = params;
|
|
107
|
+
const size = params.size ?? getDefaultWorkerPoolSize();
|
|
108
|
+
if (!Number.isSafeInteger(size) || size < 1) {
|
|
109
|
+
throw new Error(`A worker pool needs a positive integer size, not ${String(size)}`);
|
|
110
|
+
}
|
|
111
|
+
for (let index = 0; index < size; index++) {
|
|
112
|
+
const workerParams = {
|
|
113
|
+
source: params.source,
|
|
114
|
+
...params.fallbackHandlers !== void 0 && { fallbackHandlers: params.fallbackHandlers },
|
|
115
|
+
...params.name !== void 0 && { name: `${params.name} ${String(index)}` }
|
|
116
|
+
};
|
|
117
|
+
this.workers.push(this.addChild(new import_worker_component.WorkerComponent(workerParams)));
|
|
118
|
+
}
|
|
119
|
+
}
|
|
120
|
+
params;
|
|
121
|
+
/**
|
|
122
|
+
* The number of workers.
|
|
123
|
+
*
|
|
124
|
+
* @returns The size.
|
|
125
|
+
*/
|
|
126
|
+
get size() {
|
|
127
|
+
return this.workers.length;
|
|
128
|
+
}
|
|
129
|
+
workers = [];
|
|
130
|
+
/**
|
|
131
|
+
* Calls a method on the least busy worker.
|
|
132
|
+
*
|
|
133
|
+
* @typeParam TMethod - The method.
|
|
134
|
+
* @param method - The method name.
|
|
135
|
+
* @param callArguments - The method's arguments.
|
|
136
|
+
* @param options - The call options.
|
|
137
|
+
* @returns The method's result.
|
|
138
|
+
*/
|
|
139
|
+
async call(method, callArguments, options) {
|
|
140
|
+
let leastBusy = this.getWorker(0);
|
|
141
|
+
for (const worker of this.workers) {
|
|
142
|
+
if (worker.pendingCallCount < leastBusy.pendingCallCount) {
|
|
143
|
+
leastBusy = worker;
|
|
144
|
+
}
|
|
145
|
+
}
|
|
146
|
+
return await leastBusy.call(method, callArguments, options);
|
|
147
|
+
}
|
|
148
|
+
/**
|
|
149
|
+
* Calls a method on every worker with the same arguments, for instance to configure them all.
|
|
150
|
+
*
|
|
151
|
+
* @typeParam TMethod - The method.
|
|
152
|
+
* @param method - The method name.
|
|
153
|
+
* @param callArguments - The method's arguments, cloned for each worker; nothing can be transferred to all of them.
|
|
154
|
+
* @param abortSignal - Cancels every call.
|
|
155
|
+
* @returns The results, in worker order.
|
|
156
|
+
*/
|
|
157
|
+
async callAll(method, callArguments, abortSignal) {
|
|
158
|
+
const options = abortSignal === void 0 ? {} : { abortSignal };
|
|
159
|
+
return await Promise.all(this.workers.map(async (worker) => await worker.call(method, callArguments, options)));
|
|
160
|
+
}
|
|
161
|
+
/**
|
|
162
|
+
* Gets one worker, for jobs that keep state in a particular worker.
|
|
163
|
+
*
|
|
164
|
+
* @param index - The worker index, from `0` to {@link WorkerPoolComponent.size} minus one.
|
|
165
|
+
* @returns The worker.
|
|
166
|
+
*/
|
|
167
|
+
getWorker(index) {
|
|
168
|
+
const worker = this.workers[index];
|
|
169
|
+
if (!worker) {
|
|
170
|
+
throw new Error(`The worker pool has no worker at index ${String(index)}`);
|
|
171
|
+
}
|
|
172
|
+
return worker;
|
|
173
|
+
}
|
|
174
|
+
}
|
|
175
|
+
function getDefaultWorkerPoolSize(hardwareConcurrency) {
|
|
176
|
+
const processorCount = hardwareConcurrency ?? window.navigator.hardwareConcurrency;
|
|
177
|
+
return Math.max(1, Math.min(MAX_DEFAULT_WORKER_POOL_SIZE, processorCount - 1));
|
|
178
|
+
}
|
|
179
|
+
// Annotate the CommonJS export names for ESM import in node:
|
|
180
|
+
0 && (module.exports = {
|
|
181
|
+
MAX_DEFAULT_WORKER_POOL_SIZE,
|
|
182
|
+
WorkerPoolComponent,
|
|
183
|
+
getDefaultWorkerPoolSize
|
|
184
|
+
});
|
|
185
|
+
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbIi4uLy4uLy4uLy4uL3NyYy9jb21wb25lbnRzL3dvcmtlci1wb29sLWNvbXBvbmVudC50cyJdLCJzb3VyY2VzQ29udGVudCI6WyIvKipcbiAqIEBmaWxlXG4gKlxuICogQSBjb21wb25lbnQgdGhhdCBvd25zIHNldmVyYWwgd29ya2VycyBidWlsdCBmcm9tIHRoZSBzYW1lIGJ1bmRsZWQgc291cmNlIGFuZCBzcHJlYWRzIGNhbGxzIG92ZXIgdGhlbS5cbiAqL1xuXG5pbXBvcnQgdHlwZSB7XG4gIFdvcmtlckFwaSxcbiAgV29ya2VyQXBpSGFuZGxlcnNcbn0gZnJvbSAnLi4vd29ya2VyLXByb3RvY29sLnRzJztcbmltcG9ydCB0eXBlIHtcbiAgV29ya2VyQ29tcG9uZW50Q2FsbE9wdGlvbnMsXG4gIFdvcmtlck1ldGhvZCxcbiAgV29ya2VyTWV0aG9kUmVzdWx0XG59IGZyb20gJy4vd29ya2VyLWNvbXBvbmVudC50cyc7XG5cbmltcG9ydCB7IENvbXBvbmVudEV4IH0gZnJvbSAnLi9jb21wb25lbnQtZXgudHMnO1xuaW1wb3J0IHsgV29ya2Vy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O0FBQUE7QUFBQSxFQVdBLE1BQWEsUUFDWCxRQUNBLGVBQ0EsYUFDOEM7QUFDOUMsVUFBTSxVQUFzQyxnQkFBZ0IsU0FBWSxDQUFDLElBQUksRUFBRSxZQUFZO0FBQzNGLFdBQU8sTUFBTSxRQUFRLElBQUksS0FBSyxRQUFRLElBQUksT0FBTyxXQUFXLE1BQU0sT0FBTyxLQUFLLFFBQVEsZUFBZSxPQUFPLENBQUMsQ0FBQztBQUFBLEVBQ2hIO0FBQUE7QUFBQTtBQUFBO0FBQUE7QUFBQTtBQUFBO0FBQUEsRUFRTyxVQUFVLE9BQXNDO0FBQ3JELFVBQU0sU0FBUyxLQUFLLFFBQVEsS0FBSztBQUNqQyxRQUFJLENBQUMsUUFBUTtBQUNYLFlBQU0sSUFBSSxNQUFNLDBDQUEwQyxPQUFPLEtBQUssQ0FBQyxFQUFFO0FBQUEsSUFDM0U7QUFDQSxXQUFPO0FBQUEsRUFDVDtBQUNGO0FBU08sU0FBUyx5QkFBeUIscUJBQXNDO0FBQzdFLFFBQU0saUJBQWlCLHVCQUF1QixPQUFPLFVBQVU7QUFDL0QsU0FBTyxLQUFLLElBQUksR0FBRyxLQUFLLElBQUksOEJBQThCLGlCQUFpQixDQUFDLENBQUM7QUFDL0U7IiwibmFtZXMiOltdfQ==
|
|
@@ -0,0 +1,102 @@
|
|
|
1
|
+
/// <reference path="../library-references.d.cts" />
|
|
2
|
+
/// <reference lib="dom" />
|
|
3
|
+
/**
|
|
4
|
+
* @file
|
|
5
|
+
*
|
|
6
|
+
* A component that owns several workers built from the same bundled source and spreads calls over them.
|
|
7
|
+
*/
|
|
8
|
+
import type { WorkerApi, WorkerApiHandlers } from '../worker-protocol.cjs';
|
|
9
|
+
import type { WorkerComponentCallOptions, WorkerMethod, WorkerMethodResult } from './worker-component.cjs';
|
|
10
|
+
import { ComponentEx } from './component-ex.cjs';
|
|
11
|
+
import { WorkerComponent } from './worker-component.cjs';
|
|
12
|
+
/**
|
|
13
|
+
* The most workers {@link getDefaultWorkerPoolSize} suggests, so a pool on a many-core desktop does not starve
|
|
14
|
+
* Obsidian's own renderer of memory.
|
|
15
|
+
*/
|
|
16
|
+
export declare const MAX_DEFAULT_WORKER_POOL_SIZE = 4;
|
|
17
|
+
/**
|
|
18
|
+
* Options of {@link WorkerPoolComponent.call}: the same as {@link WorkerComponent.call}'s.
|
|
19
|
+
*/
|
|
20
|
+
export type WorkerPoolComponentCallOptions = WorkerComponentCallOptions;
|
|
21
|
+
/**
|
|
22
|
+
* Parameters of {@link WorkerPoolComponent}.
|
|
23
|
+
*
|
|
24
|
+
* @typeParam TApi - The API every worker exposes.
|
|
25
|
+
*/
|
|
26
|
+
export interface WorkerPoolComponentConstructorParams<TApi extends WorkerApi<TApi>> {
|
|
27
|
+
/**
|
|
28
|
+
* The handlers to run on the main thread when no `Worker` can be created. See {@link WorkerComponent}.
|
|
29
|
+
*/
|
|
30
|
+
readonly fallbackHandlers?: WorkerApiHandlers<TApi>;
|
|
31
|
+
/**
|
|
32
|
+
* The workers' name prefix, shown by the developer tools; each worker gets `<name> <index>`.
|
|
33
|
+
*/
|
|
34
|
+
readonly name?: string;
|
|
35
|
+
/**
|
|
36
|
+
* The number of workers. Defaults to {@link getDefaultWorkerPoolSize}.
|
|
37
|
+
*/
|
|
38
|
+
readonly size?: number;
|
|
39
|
+
/**
|
|
40
|
+
* The bundled worker source.
|
|
41
|
+
*/
|
|
42
|
+
readonly source: string;
|
|
43
|
+
}
|
|
44
|
+
/**
|
|
45
|
+
* Owns a fixed number of {@link WorkerComponent} children and sends each call to the one with the fewest pending calls.
|
|
46
|
+
*
|
|
47
|
+
* Use it for CPU-bound jobs that split into independent calls. A job that keeps state in a worker (a loaded corpus, an
|
|
48
|
+
* instantiated module) addresses each worker by index through {@link WorkerPoolComponent.getWorker} instead.
|
|
49
|
+
*
|
|
50
|
+
* @typeParam TApi - The API every worker exposes.
|
|
51
|
+
*/
|
|
52
|
+
export declare class WorkerPoolComponent<TApi extends WorkerApi<TApi>> extends ComponentEx {
|
|
53
|
+
protected readonly params: WorkerPoolComponentConstructorParams<TApi>;
|
|
54
|
+
/**
|
|
55
|
+
* The number of workers.
|
|
56
|
+
*
|
|
57
|
+
* @returns The size.
|
|
58
|
+
*/
|
|
59
|
+
get size(): number;
|
|
60
|
+
private readonly workers;
|
|
61
|
+
/**
|
|
62
|
+
* Creates the pool.
|
|
63
|
+
*
|
|
64
|
+
* @param params - The parameters.
|
|
65
|
+
*/
|
|
66
|
+
constructor(params: WorkerPoolComponentConstructorParams<TApi>);
|
|
67
|
+
/**
|
|
68
|
+
* Calls a method on the least busy worker.
|
|
69
|
+
*
|
|
70
|
+
* @typeParam TMethod - The method.
|
|
71
|
+
* @param method - The method name.
|
|
72
|
+
* @param callArguments - The method's arguments.
|
|
73
|
+
* @param options - The call options.
|
|
74
|
+
* @returns The method's result.
|
|
75
|
+
*/
|
|
76
|
+
call<TMethod extends WorkerMethod<TApi>>(method: TMethod, callArguments: Parameters<TApi[TMethod]>, options?: WorkerPoolComponentCallOptions): Promise<WorkerMethodResult<TApi, TMethod>>;
|
|
77
|
+
/**
|
|
78
|
+
* Calls a method on every worker with the same arguments, for instance to configure them all.
|
|
79
|
+
*
|
|
80
|
+
* @typeParam TMethod - The method.
|
|
81
|
+
* @param method - The method name.
|
|
82
|
+
* @param callArguments - The method's arguments, cloned for each worker; nothing can be transferred to all of them.
|
|
83
|
+
* @param abortSignal - Cancels every call.
|
|
84
|
+
* @returns The results, in worker order.
|
|
85
|
+
*/
|
|
86
|
+
callAll<TMethod extends WorkerMethod<TApi>>(method: TMethod, callArguments: Parameters<TApi[TMethod]>, abortSignal?: AbortSignal): Promise<WorkerMethodResult<TApi, TMethod>[]>;
|
|
87
|
+
/**
|
|
88
|
+
* Gets one worker, for jobs that keep state in a particular worker.
|
|
89
|
+
*
|
|
90
|
+
* @param index - The worker index, from `0` to {@link WorkerPoolComponent.size} minus one.
|
|
91
|
+
* @returns The worker.
|
|
92
|
+
*/
|
|
93
|
+
getWorker(index: number): WorkerComponent<TApi>;
|
|
94
|
+
}
|
|
95
|
+
/**
|
|
96
|
+
* Suggests a pool size: one fewer than the logical processors, so the main thread keeps one, between `1` and
|
|
97
|
+
* {@link MAX_DEFAULT_WORKER_POOL_SIZE}.
|
|
98
|
+
*
|
|
99
|
+
* @param hardwareConcurrency - The number of logical processors. Defaults to `navigator.hardwareConcurrency`.
|
|
100
|
+
* @returns The suggested size.
|
|
101
|
+
*/
|
|
102
|
+
export declare function getDefaultWorkerPoolSize(hardwareConcurrency?: number): number;
|