@mdfriday/foundry 26.4.20 → 26.5.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/cjs/index.js +1 -1
- package/dist/cjs/obsidian/mobile.js +1 -1
- package/dist/cjs/worker/pool-manager.js +2 -2
- package/dist/cjs/worker/worker-node.js +2 -2
- package/dist/esm/index.js +1 -1
- package/dist/esm/obsidian/mobile.js +1 -1
- package/dist/types/internal/application/batch-task-queue.d.ts +17 -0
- package/dist/types/internal/application/container.d.ts +66 -0
- package/dist/types/internal/application/identity.d.ts +173 -0
- package/dist/types/internal/application/incremental-build-coordinator.d.ts +28 -0
- package/dist/types/internal/application/incremental-ssg.d.ts +4 -0
- package/dist/types/internal/application/index.d.ts +5 -4
- package/dist/types/internal/application/publish.d.ts +37 -0
- package/dist/types/internal/application/ssg-parallel.d.ts +6 -0
- package/dist/types/internal/application/ssg.d.ts +15 -0
- package/dist/types/internal/application/wiki-service-config.d.ts +65 -0
- package/dist/types/internal/application/wiki-service.d.ts +199 -0
- package/dist/types/internal/application/worker/pool-manager.d.ts +43 -0
- package/dist/types/internal/application/worker/worker-browser.d.ts +6 -0
- package/dist/types/internal/application/worker/worker-main.d.ts +12 -0
- package/dist/types/internal/application/worker/worker-state.d.ts +23 -0
- package/dist/types/internal/application/workspace.d.ts +98 -0
- package/dist/types/internal/domain/config/entity/config.d.ts +40 -0
- package/dist/types/internal/domain/config/entity/language.d.ts +51 -0
- package/dist/types/internal/domain/config/entity/markdown.d.ts +36 -0
- package/dist/types/internal/domain/config/entity/module.d.ts +36 -0
- package/dist/types/internal/domain/config/entity/root.d.ts +39 -0
- package/dist/types/internal/domain/config/entity/service.d.ts +36 -0
- package/dist/types/internal/domain/config/entity/social.d.ts +43 -0
- package/dist/types/internal/domain/config/entity/taxonomy.d.ts +39 -0
- package/dist/types/internal/domain/config/factory/config.d.ts +3 -0
- package/dist/types/internal/domain/config/factory/loader.d.ts +24 -0
- package/dist/types/internal/domain/config/factory/provider.d.ts +10 -0
- package/dist/types/internal/domain/config/factory/sourcedescriptor.d.ts +12 -0
- package/dist/types/internal/domain/config/type.d.ts +56 -0
- package/dist/types/internal/domain/config/vo/language.d.ts +6 -0
- package/dist/types/internal/domain/config/vo/markdown.d.ts +13 -0
- package/dist/types/internal/domain/config/vo/module.d.ts +9 -0
- package/dist/types/internal/domain/config/vo/root.d.ts +6 -0
- package/dist/types/internal/domain/config/vo/service.d.ts +6 -0
- package/dist/types/internal/domain/config/vo/social.d.ts +16 -0
- package/dist/types/internal/domain/config/vo/taxonomy.d.ts +12 -0
- package/dist/types/internal/domain/content/entity/content.d.ts +36 -0
- package/dist/types/internal/domain/content/entity/page.d.ts +23 -0
- package/dist/types/internal/domain/content/entity/pagebuilder.d.ts +83 -0
- package/dist/types/internal/domain/content/entity/pagecollector.d.ts +3 -0
- package/dist/types/internal/domain/content/entity/pagecontent.d.ts +14 -0
- package/dist/types/internal/domain/content/entity/pagemap.d.ts +69 -0
- package/dist/types/internal/domain/content/entity/pagesource.d.ts +52 -0
- package/dist/types/internal/domain/content/entity/pagetrees.d.ts +12 -0
- package/dist/types/internal/domain/content/entity/paginator.d.ts +19 -0
- package/dist/types/internal/domain/content/entity/section.d.ts +15 -0
- package/dist/types/internal/domain/content/entity/shortcode.d.ts +39 -0
- package/dist/types/internal/domain/content/entity/standalone.d.ts +9 -0
- package/dist/types/internal/domain/content/entity/taxonomy.d.ts +15 -0
- package/dist/types/internal/domain/content/entity/term.d.ts +6 -0
- package/dist/types/internal/domain/content/entity/translator.d.ts +22 -0
- package/dist/types/internal/domain/content/type.d.ts +6 -0
- package/dist/types/internal/domain/content/vo/classifier.d.ts +24 -0
- package/dist/types/internal/domain/content/vo/frontmatter.d.ts +65 -0
- package/dist/types/internal/domain/content/vo/kind.d.ts +10 -0
- package/dist/types/internal/domain/fs/entity/basefs.d.ts +23 -0
- package/dist/types/internal/domain/fs/entity/fs.d.ts +13 -0
- package/dist/types/internal/domain/fs/entity/originfs.d.ts +6 -0
- package/dist/types/internal/domain/fs/entity/overlaydir.d.ts +44 -0
- package/dist/types/internal/domain/fs/entity/overlayfs.d.ts +79 -0
- package/dist/types/internal/domain/fs/entity/service.d.ts +15 -0
- package/dist/types/internal/domain/fs/factory/fs.d.ts +4 -0
- package/dist/types/internal/domain/fs/type.d.ts +95 -0
- package/dist/types/internal/domain/fs/vo/dir.d.ts +41 -0
- package/dist/types/internal/domain/fs/vo/file.d.ts +28 -0
- package/dist/types/internal/domain/fs/vo/fileinfo.d.ts +23 -0
- package/dist/types/internal/domain/fs/vo/filemeta.d.ts +45 -0
- package/dist/types/internal/domain/fs/vo/filesystemscollector.d.ts +17 -0
- package/dist/types/internal/domain/fs/vo/filevitural.d.ts +8 -0
- package/dist/types/internal/domain/fs/vo/osfs.d.ts +12 -0
- package/dist/types/internal/domain/fs/vo/overlay-factory.d.ts +4 -0
- package/dist/types/internal/domain/fs/vo/overlayfs-factory.d.ts +42 -0
- package/dist/types/internal/domain/fs/vo/overlayoptions.d.ts +44 -0
- package/dist/types/internal/domain/fs/vo/static-copier.d.ts +22 -0
- package/dist/types/internal/domain/fs/vo/walkway.d.ts +22 -0
- package/dist/types/internal/domain/identity/entity/user.d.ts +100 -0
- package/dist/types/internal/domain/identity/factory/user-factory.d.ts +183 -0
- package/dist/types/internal/domain/identity/repository/index.d.ts +30 -0
- package/dist/types/internal/domain/identity/type.d.ts +17 -0
- package/dist/types/internal/domain/identity/value-object/device.d.ts +26 -0
- package/dist/types/internal/domain/identity/value-object/email.d.ts +29 -0
- package/dist/types/internal/domain/identity/value-object/license.d.ts +91 -0
- package/dist/types/internal/domain/identity/value-object/server-config.d.ts +37 -0
- package/dist/types/internal/domain/identity/value-object/sync-config.d.ts +47 -0
- package/dist/types/internal/domain/identity/value-object/token.d.ts +35 -0
- package/dist/types/internal/domain/markdown/entity/markdown.d.ts +41 -0
- package/dist/types/internal/domain/markdown/factory/it/config.d.ts +60 -0
- package/dist/types/internal/domain/markdown/factory/it/index.d.ts +21 -1
- package/dist/types/internal/domain/markdown/factory/it/parserresult.d.ts +3 -0
- package/dist/types/internal/domain/markdown/factory/it/plugins/callout-plugin.d.ts +40 -0
- package/dist/types/internal/domain/markdown/factory/it/plugins/latex-plugin.d.ts +23 -0
- package/dist/types/internal/domain/markdown/factory/it/plugins/mermaid-plugin.d.ts +24 -0
- package/dist/types/internal/domain/markdown/factory/it/plugins/tag-plugin.d.ts +71 -0
- package/dist/types/internal/domain/markdown/factory/it/plugins/wikilink-plugin.d.ts +28 -0
- package/dist/types/internal/domain/markdown/factory/it/plugins/wikilink.d.ts +31 -0
- package/dist/types/internal/domain/markdown/factory/it/tableofcontents.d.ts +21 -0
- package/dist/types/internal/domain/markdown/factory/it/util/path.d.ts +11 -0
- package/dist/types/internal/domain/markdown/factory/it/util/slugger-fallback.d.ts +6 -0
- package/dist/types/internal/domain/markdown/type.d.ts +159 -0
- package/dist/types/internal/domain/markdown/vo/config.d.ts +48 -0
- package/dist/types/internal/domain/markdown/vo/content.d.ts +92 -0
- package/dist/types/internal/domain/markdown/vo/context.d.ts +9 -0
- package/dist/types/internal/domain/markdown/vo/highlight.d.ts +15 -0
- package/dist/types/internal/domain/markdown/vo/pageparser.d.ts +9 -0
- package/dist/types/internal/domain/markdown/vo/parseinfo.d.ts +36 -0
- package/dist/types/internal/domain/markdown/vo/parserresult.d.ts +6 -0
- package/dist/types/internal/domain/markdown/vo/shortcode.d.ts +31 -1
- package/dist/types/internal/domain/markdown/vo/tableofcontents.d.ts +21 -0
- package/dist/types/internal/domain/module/entity/lang.d.ts +12 -0
- package/dist/types/internal/domain/module/entity/module.d.ts +73 -0
- package/dist/types/internal/domain/module/factory/module.d.ts +6 -0
- package/dist/types/internal/domain/module/type.d.ts +58 -0
- package/dist/types/internal/domain/module/vo/cache.d.ts +48 -0
- package/dist/types/internal/domain/module/vo/httpclient.d.ts +14 -0
- package/dist/types/internal/domain/module/vo/module.d.ts +76 -0
- package/dist/types/internal/domain/module/vo/mount.d.ts +39 -0
- package/dist/types/internal/domain/module/vo/themes.d.ts +38 -0
- package/dist/types/internal/domain/module/vo/zipextractor.d.ts +31 -0
- package/dist/types/internal/domain/paths/entity/path.d.ts +28 -0
- package/dist/types/internal/domain/paths/factory/pathfactory.d.ts +82 -0
- package/dist/types/internal/domain/paths/type.d.ts +132 -0
- package/dist/types/internal/domain/paths/vo/pathcomponents.d.ts +94 -0
- package/dist/types/internal/domain/paths/vo/pathparser.d.ts +77 -0
- package/dist/types/internal/domain/publish/entity/publisher.d.ts +26 -0
- package/dist/types/internal/domain/publish/factory/publisher-factory.d.ts +17 -0
- package/dist/types/internal/domain/publish/repository/http-client.d.ts +21 -0
- package/dist/types/internal/domain/publish/repository/manifest-repository.d.ts +27 -0
- package/dist/types/internal/domain/publish/type.d.ts +49 -0
- package/dist/types/internal/domain/publish/value-object/ftp-publisher.d.ts +30 -0
- package/dist/types/internal/domain/publish/value-object/mdfriday-publisher.d.ts +57 -0
- package/dist/types/internal/domain/publish/value-object/netlify-publisher.d.ts +55 -0
- package/dist/types/internal/domain/publish/value-object/publish-config.d.ts +38 -0
- package/dist/types/internal/domain/publish/value-object/publish-manifest.d.ts +50 -0
- package/dist/types/internal/domain/resources/entity/http.d.ts +11 -0
- package/dist/types/internal/domain/resources/entity/integrity.d.ts +4 -0
- package/dist/types/internal/domain/resources/entity/minifier.d.ts +4 -0
- package/dist/types/internal/domain/resources/entity/publisher.d.ts +24 -0
- package/dist/types/internal/domain/resources/entity/resource.d.ts +4 -0
- package/dist/types/internal/domain/resources/entity/resources.d.ts +40 -0
- package/dist/types/internal/domain/resources/entity/template.d.ts +4 -0
- package/dist/types/internal/domain/resources/factory/resource.d.ts +4 -0
- package/dist/types/internal/domain/site/entity/language.d.ts +55 -0
- package/dist/types/internal/domain/site/entity/menu-builder.d.ts +50 -0
- package/dist/types/internal/domain/site/entity/navigation.d.ts +8 -0
- package/dist/types/internal/domain/site/entity/page.d.ts +88 -0
- package/dist/types/internal/domain/site/entity/pagegraph.d.ts +85 -0
- package/dist/types/internal/domain/site/entity/pager.d.ts +6 -0
- package/dist/types/internal/domain/site/entity/publisher.d.ts +26 -0
- package/dist/types/internal/domain/site/entity/ref.d.ts +27 -0
- package/dist/types/internal/domain/site/entity/site.d.ts +178 -0
- package/dist/types/internal/domain/site/factory/navigation-factory.d.ts +6 -0
- package/dist/types/internal/domain/site/factory/site.d.ts +4 -0
- package/dist/types/internal/domain/site/service/html-link-processor.d.ts +44 -0
- package/dist/types/internal/domain/site/type.d.ts +100 -0
- package/dist/types/internal/domain/site/valueobject/author.d.ts +16 -0
- package/dist/types/internal/domain/site/valueobject/baseurl.d.ts +39 -0
- package/dist/types/internal/domain/site/valueobject/menu.d.ts +49 -0
- package/dist/types/internal/domain/site/valueobject/organization.d.ts +37 -0
- package/dist/types/internal/domain/site/valueobject/path.d.ts +50 -0
- package/dist/types/internal/domain/site/valueobject/version.d.ts +14 -0
- package/dist/types/internal/domain/template/entity/executor.d.ts +22 -0
- package/dist/types/internal/domain/template/entity/lookup.d.ts +55 -0
- package/dist/types/internal/domain/template/entity/parser.d.ts +40 -0
- package/dist/types/internal/domain/template/entity/template.d.ts +87 -0
- package/dist/types/internal/domain/template/factory/template.d.ts +61 -0
- package/dist/types/internal/domain/template/type.d.ts +109 -0
- package/dist/types/internal/domain/template/vo/baseof.d.ts +47 -0
- package/dist/types/internal/domain/template/vo/info.d.ts +28 -0
- package/dist/types/internal/domain/template/vo/namespace.d.ts +91 -0
- package/dist/types/internal/domain/template/vo/registry.d.ts +160 -0
- package/dist/types/internal/domain/wiki/entity/concept.d.ts +31 -0
- package/dist/types/internal/domain/wiki/entity/connection.d.ts +29 -0
- package/dist/types/internal/domain/wiki/entity/conversation.d.ts +65 -0
- package/dist/types/internal/domain/wiki/entity/embedding-index.d.ts +60 -0
- package/dist/types/internal/domain/wiki/entity/entity.d.ts +32 -0
- package/dist/types/internal/domain/wiki/entity/knowledge-base.d.ts +292 -0
- package/dist/types/internal/domain/wiki/entity/operation-log.d.ts +82 -0
- package/dist/types/internal/domain/wiki/factory/wiki-factory.d.ts +41 -0
- package/dist/types/internal/domain/wiki/index.d.ts +22 -0
- package/dist/types/internal/domain/wiki/repository/conversation-repository.interface.d.ts +29 -0
- package/dist/types/internal/domain/wiki/repository/crypto-service.d.ts +16 -0
- package/dist/types/internal/domain/wiki/repository/embedding-provider.d.ts +12 -0
- package/dist/types/internal/domain/wiki/repository/file-system.d.ts +43 -0
- package/dist/types/internal/domain/wiki/repository/index.d.ts +14 -0
- package/dist/types/internal/domain/wiki/repository/kb-repository.interface.d.ts +30 -0
- package/dist/types/internal/domain/wiki/repository/llm-http-client.d.ts +40 -0
- package/dist/types/internal/domain/wiki/repository/llm-provider.d.ts +34 -0
- package/dist/types/internal/domain/wiki/repository/path-service.d.ts +32 -0
- package/dist/types/internal/domain/wiki/repository/wiki-page-repository.interface.d.ts +49 -0
- package/dist/types/internal/domain/wiki/value-object/connection-type.d.ts +24 -0
- package/dist/types/internal/domain/wiki/value-object/content-annotator.d.ts +61 -0
- package/dist/types/internal/domain/wiki/value-object/entity-id.d.ts +17 -0
- package/dist/types/internal/domain/wiki/value-object/entity-type.d.ts +24 -0
- package/dist/types/internal/domain/wiki/value-object/extraction-parser.d.ts +27 -0
- package/dist/types/internal/domain/wiki/value-object/extraction-result.d.ts +32 -0
- package/dist/types/internal/domain/wiki/value-object/retrieval.d.ts +228 -0
- package/dist/types/internal/domain/wiki/value-object/source-record.d.ts +17 -0
- package/dist/types/internal/domain/wiki/value-object/wiki-config.d.ts +40 -0
- package/dist/types/internal/domain/wiki/value-object/wiki-index-generator.d.ts +31 -0
- package/dist/types/internal/domain/wiki/value-object/wiki-page-renderer.d.ts +42 -0
- package/dist/types/internal/domain/workspace/entity/authentication.d.ts +29 -0
- package/dist/types/internal/domain/workspace/entity/project.d.ts +173 -0
- package/dist/types/internal/domain/workspace/entity/workspace.d.ts +85 -0
- package/dist/types/internal/domain/workspace/factory/workspace-factory.d.ts +107 -0
- package/dist/types/internal/domain/workspace/repository/file-system.d.ts +241 -0
- package/dist/types/internal/domain/workspace/repository/index.d.ts +6 -0
- package/dist/types/internal/domain/workspace/repository.d.ts +72 -0
- package/dist/types/internal/domain/workspace/type.d.ts +18 -0
- package/dist/types/internal/domain/workspace/value-object/folder-structure.d.ts +41 -0
- package/dist/types/internal/domain/workspace/value-object/project-metadata.d.ts +36 -0
- package/dist/types/internal/domain/workspace/value-object/workspace-metadata.d.ts +7 -0
- package/dist/types/internal/infrastructure/embedding/embedding-provider.interface.d.ts +33 -0
- package/dist/types/internal/infrastructure/embedding/index.d.ts +5 -0
- package/dist/types/internal/infrastructure/embedding/ollama-embedding-provider.d.ts +24 -0
- package/dist/types/internal/infrastructure/http/netlify-http-client.d.ts +20 -0
- package/dist/types/internal/infrastructure/http/node-http-client.d.ts +3 -0
- package/dist/types/internal/infrastructure/index.d.ts +8 -0
- package/dist/types/internal/infrastructure/llm/fetch-http-client.d.ts +24 -0
- package/dist/types/internal/infrastructure/llm/index.d.ts +6 -0
- package/dist/types/internal/infrastructure/llm/llm-config.d.ts +80 -0
- package/dist/types/internal/infrastructure/llm/lmstudio-provider.d.ts +55 -0
- package/dist/types/internal/infrastructure/llm/node-llm-http-client.d.ts +21 -0
- package/dist/types/internal/infrastructure/llm/ollama-provider.d.ts +17 -0
- package/dist/types/internal/infrastructure/llm/openai-compatible-provider.d.ts +70 -0
- package/dist/types/internal/infrastructure/llm/provider-factory.d.ts +36 -0
- package/dist/types/internal/infrastructure/llm/provider.d.ts +77 -0
- package/dist/types/internal/infrastructure/node/index.d.ts +11 -0
- package/dist/types/internal/infrastructure/node/node-conversation-repository.d.ts +21 -0
- package/dist/types/internal/infrastructure/node/node-crypto-service.d.ts +10 -0
- package/dist/types/internal/infrastructure/node/node-file-system.d.ts +29 -0
- package/dist/types/internal/infrastructure/node/node-kb-repository.d.ts +18 -0
- package/dist/types/internal/infrastructure/node/node-path-service.d.ts +14 -0
- package/dist/types/internal/infrastructure/node/node-wiki-page-repository.d.ts +25 -0
- package/dist/types/internal/infrastructure/persistence/node-file-system.d.ts +8 -0
- package/dist/types/internal/infrastructure/persistence/node-manifest-repository.d.ts +31 -0
- package/dist/types/internal/infrastructure/persistence/node-snapshot-repository.d.ts +28 -0
- package/dist/types/internal/infrastructure/persistence/node-workspace-repository.d.ts +9 -0
- package/dist/types/pkg/cahce/cache.d.ts +56 -0
- package/dist/types/pkg/lang/data.d.ts +21 -0
- package/dist/types/pkg/lang/index.d.ts +46 -0
- package/dist/types/pkg/lang/service.d.ts +49 -0
- package/dist/types/pkg/lang/types.d.ts +29 -0
- package/dist/types/pkg/log/http.d.ts +16 -0
- package/dist/types/pkg/log/manager.d.ts +57 -0
- package/dist/types/pkg/maps/scratch.d.ts +25 -0
- package/dist/types/pkg/md/parser/item.d.ts +3 -3
- package/dist/types/pkg/media/type.d.ts +19 -0
- package/dist/types/pkg/page-filter/index.d.ts +29 -0
- package/dist/types/pkg/paths/index.d.ts +9 -0
- package/dist/types/pkg/text/index.d.ts +4 -0
- package/dist/types/pkg/web/server/livereload-server.d.ts +7 -0
- package/dist/types/pkg/web/watcher/content-file-watcher.d.ts +3 -0
- package/package.json +21 -15
- package/dist/types/index.d.ts +0 -20
- package/dist/types/internal/interfaces/obsidian/adapters/identity-adapter.d.ts +0 -5
- package/dist/types/internal/interfaces/obsidian/adapters/index.d.ts +0 -2
- package/dist/types/internal/interfaces/obsidian/adapters/workspace-adapter.d.ts +0 -8
- package/dist/types/internal/interfaces/obsidian/desktop/adapters/identity-adapter.d.ts +0 -6
- package/dist/types/internal/interfaces/obsidian/desktop/adapters/index.d.ts +0 -2
- package/dist/types/internal/interfaces/obsidian/desktop/adapters/workspace-adapter.d.ts +0 -12
- package/dist/types/internal/interfaces/obsidian/desktop/container.d.ts +0 -7
- package/dist/types/internal/interfaces/obsidian/desktop/index.d.ts +0 -22
- package/dist/types/internal/interfaces/obsidian/index.d.ts +0 -7
- package/dist/types/internal/interfaces/obsidian/mobile/adapters/identity-adapter.d.ts +0 -9
- package/dist/types/internal/interfaces/obsidian/mobile/adapters/index.d.ts +0 -2
- package/dist/types/internal/interfaces/obsidian/mobile/adapters/workspace-adapter.d.ts +0 -13
- package/dist/types/internal/interfaces/obsidian/mobile/config-types.d.ts +0 -13
- package/dist/types/internal/interfaces/obsidian/mobile/container.d.ts +0 -6
- package/dist/types/internal/interfaces/obsidian/mobile/index.d.ts +0 -16
- package/dist/types/internal/interfaces/obsidian/mobile.d.ts +0 -2
- package/dist/types/internal/interfaces/obsidian/services/auth.service.d.ts +0 -11
- package/dist/types/internal/interfaces/obsidian/services/build.service.d.ts +0 -9
- package/dist/types/internal/interfaces/obsidian/services/config.service.d.ts +0 -31
- package/dist/types/internal/interfaces/obsidian/services/domain.service.d.ts +0 -15
- package/dist/types/internal/interfaces/obsidian/services/license.service.d.ts +0 -22
- package/dist/types/internal/interfaces/obsidian/services/project.service.d.ts +0 -17
- package/dist/types/internal/interfaces/obsidian/services/publish.service.d.ts +0 -11
- package/dist/types/internal/interfaces/obsidian/services/serve.service.d.ts +0 -18
- package/dist/types/internal/interfaces/obsidian/services/workspace.service.d.ts +0 -10
- package/dist/types/internal/interfaces/obsidian/types/auth.d.ts +0 -27
- package/dist/types/internal/interfaces/obsidian/types/build.d.ts +0 -23
- package/dist/types/internal/interfaces/obsidian/types/config.d.ts +0 -16
- package/dist/types/internal/interfaces/obsidian/types/domain.d.ts +0 -46
- package/dist/types/internal/interfaces/obsidian/types/index.d.ts +0 -9
- package/dist/types/internal/interfaces/obsidian/types/license.d.ts +0 -87
- package/dist/types/internal/interfaces/obsidian/types/project.d.ts +0 -56
- package/dist/types/internal/interfaces/obsidian/types/publish.d.ts +0 -33
- package/dist/types/internal/interfaces/obsidian/types/serve.d.ts +0 -46
- package/dist/types/internal/interfaces/obsidian/types/workspace.d.ts +0 -27
- package/dist/types/pkg/log/browser-manager.d.ts +0 -20
- package/dist/types/pkg/log/browser.d.ts +0 -25
- package/dist/types/pkg/media/buildin.d.ts +0 -3
|
@@ -1,3 +1,7 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Menu - A single menu item with hierarchical support
|
|
3
|
+
* Simplified structure focusing on essential properties
|
|
4
|
+
*/
|
|
1
5
|
export declare class Menu {
|
|
2
6
|
private readonly _title;
|
|
3
7
|
private readonly _url;
|
|
@@ -11,20 +15,50 @@ export declare class Menu {
|
|
|
11
15
|
weight?: number;
|
|
12
16
|
identifier?: string;
|
|
13
17
|
});
|
|
18
|
+
/**
|
|
19
|
+
* Get menu entry title
|
|
20
|
+
*/
|
|
14
21
|
title(): string;
|
|
15
22
|
get Title(): string;
|
|
23
|
+
/**
|
|
24
|
+
* Get menu entry URL
|
|
25
|
+
*/
|
|
16
26
|
url(): string;
|
|
17
27
|
get URL(): string;
|
|
28
|
+
/**
|
|
29
|
+
* Get child menu entries
|
|
30
|
+
*/
|
|
18
31
|
children(): Menu[];
|
|
19
32
|
get Children(): Menu[];
|
|
33
|
+
/**
|
|
34
|
+
* Get menu entry weight for sorting
|
|
35
|
+
*/
|
|
20
36
|
weight(): number;
|
|
37
|
+
/**
|
|
38
|
+
* Get menu entry identifier
|
|
39
|
+
*/
|
|
21
40
|
identifier(): string;
|
|
41
|
+
/**
|
|
42
|
+
* Check if this menu entry has children
|
|
43
|
+
*/
|
|
22
44
|
hasChildren(): boolean;
|
|
23
45
|
get HasChildren(): boolean;
|
|
46
|
+
/**
|
|
47
|
+
* Add a child menu entry
|
|
48
|
+
*/
|
|
24
49
|
addChild(child: Menu): Menu;
|
|
50
|
+
/**
|
|
51
|
+
* Convert to JSON representation
|
|
52
|
+
*/
|
|
25
53
|
toJSON(): any;
|
|
54
|
+
/**
|
|
55
|
+
* Create a new Menu with updated children
|
|
56
|
+
*/
|
|
26
57
|
withChildren(children: Menu[]): Menu;
|
|
27
58
|
}
|
|
59
|
+
/**
|
|
60
|
+
* Menus - Simplified menu structure with nav and footer
|
|
61
|
+
*/
|
|
28
62
|
export declare class Menus {
|
|
29
63
|
private readonly _nav;
|
|
30
64
|
private readonly _footer;
|
|
@@ -32,11 +66,26 @@ export declare class Menus {
|
|
|
32
66
|
nav?: Menu[];
|
|
33
67
|
footer?: Menu[];
|
|
34
68
|
});
|
|
69
|
+
/**
|
|
70
|
+
* Get navigation menu
|
|
71
|
+
*/
|
|
35
72
|
nav(): Menu[];
|
|
36
73
|
get Nav(): Menu[];
|
|
74
|
+
/**
|
|
75
|
+
* Get footer menu
|
|
76
|
+
*/
|
|
37
77
|
footer(): Menu[];
|
|
38
78
|
get Footer(): Menu[];
|
|
79
|
+
/**
|
|
80
|
+
* Sort menus by weight and then by title
|
|
81
|
+
*/
|
|
39
82
|
private sortMenus;
|
|
83
|
+
/**
|
|
84
|
+
* Convert to plain object for serialization
|
|
85
|
+
*/
|
|
40
86
|
toJSON(): Record<string, any[]>;
|
|
41
87
|
}
|
|
88
|
+
/**
|
|
89
|
+
* Create empty menus instance
|
|
90
|
+
*/
|
|
42
91
|
export declare function newEmptyMenus(): Menus;
|
|
@@ -10,19 +10,56 @@ export declare class Organization {
|
|
|
10
10
|
private readonly _vision;
|
|
11
11
|
private _homeOrganization;
|
|
12
12
|
constructor();
|
|
13
|
+
/**
|
|
14
|
+
* Get organization name
|
|
15
|
+
*/
|
|
13
16
|
name(): string;
|
|
17
|
+
/**
|
|
18
|
+
* Get organization description
|
|
19
|
+
*/
|
|
14
20
|
description(): string;
|
|
21
|
+
/**
|
|
22
|
+
* Get organization website
|
|
23
|
+
*/
|
|
15
24
|
website(): string;
|
|
25
|
+
/**
|
|
26
|
+
* Set the home organization from content
|
|
27
|
+
*/
|
|
16
28
|
organization(organization: ContentOrganization | undefined): Organization;
|
|
29
|
+
/**
|
|
30
|
+
* Get organization name with fallback to home organization
|
|
31
|
+
*/
|
|
17
32
|
get Name(): string;
|
|
33
|
+
/**
|
|
34
|
+
* Get organization description with fallback to home organization
|
|
35
|
+
*/
|
|
18
36
|
get Description(): string;
|
|
37
|
+
/**
|
|
38
|
+
* Get organization website with fallback to home organization
|
|
39
|
+
*/
|
|
19
40
|
get Website(): string;
|
|
41
|
+
/**
|
|
42
|
+
* Get organization vision from home organization
|
|
43
|
+
*/
|
|
20
44
|
get Vision(): string;
|
|
45
|
+
/**
|
|
46
|
+
* Get organization logo from home organization
|
|
47
|
+
*/
|
|
21
48
|
get Logo(): string;
|
|
49
|
+
/**
|
|
50
|
+
* Get organization contact from home organization
|
|
51
|
+
*/
|
|
22
52
|
get Address(): string;
|
|
23
53
|
get Email(): string;
|
|
54
|
+
/**
|
|
55
|
+
* Get organization social from home organization
|
|
56
|
+
*/
|
|
24
57
|
get Social(): import("@internal/domain/content").Social | undefined;
|
|
25
58
|
SocialById(id: string): string;
|
|
26
59
|
get Socials(): SocialLink[];
|
|
27
60
|
}
|
|
61
|
+
/**
|
|
62
|
+
* Factory function to create new Organization
|
|
63
|
+
* TypeScript equivalent of NewOrganization function from Go
|
|
64
|
+
*/
|
|
28
65
|
export declare function newOrganization(): Organization;
|
|
@@ -1,15 +1,65 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Path utilities for wikilink resolution (Domain Layer)
|
|
3
|
+
* Based on Quartz path.ts and links.ts transformLink function
|
|
4
|
+
* Source: quartz-src/quartz/util/path.ts lines 224-257
|
|
5
|
+
*
|
|
6
|
+
* This module provides the core link transformation logic used by PageGraph.
|
|
7
|
+
*/
|
|
1
8
|
export type LinkStrategy = 'absolute' | 'relative' | 'shortest';
|
|
9
|
+
/**
|
|
10
|
+
* Split anchor from path: "page#anchor" -> ["page", "#anchor"]
|
|
11
|
+
* From Quartz path.ts lines 176-183
|
|
12
|
+
*/
|
|
2
13
|
export declare function splitAnchor(link: string): [string, string];
|
|
14
|
+
/**
|
|
15
|
+
* Simplify slug: remove index suffix, strip slashes
|
|
16
|
+
* From Quartz path.ts lines 90-93
|
|
17
|
+
*/
|
|
3
18
|
export declare function simplifySlug(fp: string): string;
|
|
19
|
+
/**
|
|
20
|
+
* Slugify file path
|
|
21
|
+
* From Quartz path.ts lines 72-88
|
|
22
|
+
*/
|
|
4
23
|
export declare function slugifyFilePath(fp: string, excludeExt?: boolean): string;
|
|
24
|
+
/**
|
|
25
|
+
* Transform internal link
|
|
26
|
+
* From Quartz path.ts lines 95-109
|
|
27
|
+
*/
|
|
5
28
|
export declare function transformInternalLink(link: string): string;
|
|
29
|
+
/**
|
|
30
|
+
* Resolve /a/b/c to ../..
|
|
31
|
+
* From Quartz path.ts lines 156-169
|
|
32
|
+
*/
|
|
6
33
|
export declare function pathToRoot(slug: string): string;
|
|
34
|
+
/**
|
|
35
|
+
* Resolve relative path from current to target
|
|
36
|
+
* From Quartz path.ts lines 171-174
|
|
37
|
+
*/
|
|
7
38
|
export declare function resolveRelative(current: string, target: string): string;
|
|
39
|
+
/**
|
|
40
|
+
* Join path segments
|
|
41
|
+
* From Quartz path.ts lines 192-213
|
|
42
|
+
*/
|
|
8
43
|
export declare function joinSegments(...args: string[]): string;
|
|
9
44
|
export interface TransformOptions {
|
|
10
45
|
strategy: LinkStrategy;
|
|
11
46
|
allSlugs: string[];
|
|
12
47
|
}
|
|
48
|
+
/**
|
|
49
|
+
* Transform link based on strategy (CORE FUNCTION - directly from Quartz)
|
|
50
|
+
* Source: quartz-src/quartz/util/path.ts lines 229-257
|
|
51
|
+
*
|
|
52
|
+
* This is the main link resolution function that PageGraph uses.
|
|
53
|
+
* It implements three strategies:
|
|
54
|
+
* - 'shortest': Use just the filename if unique (e.g., "page" matches "notes/page")
|
|
55
|
+
* - 'absolute': Use full path from vault root (e.g., "notes/page")
|
|
56
|
+
* - 'relative': Use relative path from current page
|
|
57
|
+
*
|
|
58
|
+
* @param src - Source page slug (e.g., "posts/my-post")
|
|
59
|
+
* @param target - Target wikilink (e.g., "another-page" or "notes/another-page")
|
|
60
|
+
* @param opts - Resolution options (strategy + all site slugs)
|
|
61
|
+
* @returns Resolved relative URL
|
|
62
|
+
*/
|
|
13
63
|
export declare function transformLink(src: string, target: string, opts: TransformOptions): string;
|
|
14
64
|
export declare function isFolderPath(fplike: string): boolean;
|
|
15
65
|
export declare function endsWith(s: string, suffix: string): boolean;
|
|
@@ -1,7 +1,21 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Compiler - TypeScript equivalent of Go's Compiler valueobject
|
|
3
|
+
* Represents compiler version information
|
|
4
|
+
*/
|
|
1
5
|
export declare class Compiler {
|
|
2
6
|
private readonly ver;
|
|
3
7
|
constructor(version: string);
|
|
8
|
+
/**
|
|
9
|
+
* Get compiler version
|
|
10
|
+
*/
|
|
4
11
|
version(): string;
|
|
12
|
+
/**
|
|
13
|
+
* Get environment (simplified implementation)
|
|
14
|
+
*/
|
|
5
15
|
environment(): string;
|
|
6
16
|
}
|
|
17
|
+
/**
|
|
18
|
+
* Factory function to create new Compiler
|
|
19
|
+
* TypeScript equivalent of NewVersion function from Go
|
|
20
|
+
*/
|
|
7
21
|
export declare function newVersion(version: string): Compiler;
|
|
@@ -1,12 +1,28 @@
|
|
|
1
1
|
import { Template } from '@mdfriday/text-template';
|
|
2
2
|
import { TemplateExecutor, TemplateError } from '../type';
|
|
3
|
+
/**
|
|
4
|
+
* Executor entity for executing templates
|
|
5
|
+
* TypeScript version of Go's Executor struct
|
|
6
|
+
*/
|
|
3
7
|
export declare class Executor implements TemplateExecutor {
|
|
8
|
+
/**
|
|
9
|
+
* Execute template with data
|
|
10
|
+
*/
|
|
4
11
|
execute(tmpl: Template, data: any): Promise<string>;
|
|
12
|
+
/**
|
|
13
|
+
* Execute template with timeout
|
|
14
|
+
*/
|
|
5
15
|
executeWithTimeout(tmpl: Template, data: any, timeoutMs: number): Promise<string>;
|
|
16
|
+
/**
|
|
17
|
+
* Execute template safely with error handling
|
|
18
|
+
*/
|
|
6
19
|
executeSafely(tmpl: Template, data: any): Promise<{
|
|
7
20
|
result: string | null;
|
|
8
21
|
error: TemplateError | null;
|
|
9
22
|
}>;
|
|
23
|
+
/**
|
|
24
|
+
* Execute multiple templates in batch
|
|
25
|
+
*/
|
|
10
26
|
executeBatch(templates: Array<{
|
|
11
27
|
name: string;
|
|
12
28
|
template: Template;
|
|
@@ -16,10 +32,16 @@ export declare class Executor implements TemplateExecutor {
|
|
|
16
32
|
result: string | null;
|
|
17
33
|
error: TemplateError | null;
|
|
18
34
|
}>>;
|
|
35
|
+
/**
|
|
36
|
+
* Execute template with context and cancellation support
|
|
37
|
+
*/
|
|
19
38
|
executeWithContext(tmpl: Template, data: any, context: {
|
|
20
39
|
signal?: AbortSignal;
|
|
21
40
|
timeout?: number;
|
|
22
41
|
metadata?: Record<string, any>;
|
|
23
42
|
}): Promise<string>;
|
|
24
43
|
}
|
|
44
|
+
/**
|
|
45
|
+
* Create a new Executor instance
|
|
46
|
+
*/
|
|
25
47
|
export declare function newExecutor(): Executor;
|
|
@@ -1,29 +1,84 @@
|
|
|
1
1
|
import { Template } from '@mdfriday/text-template';
|
|
2
2
|
import { TemplateLookup, TemplateNamespace, TemplateInfo, TemplateLookupFunc, TemplateFuncMap, RegularTemplateNamespaceInterface, PartialTemplateNamespaceInterface, ShortcodeTemplateNamespaceInterface } from '../type';
|
|
3
3
|
import { BaseOf } from '../vo/baseof';
|
|
4
|
+
/**
|
|
5
|
+
* Lookup entity for finding templates and managing dependencies
|
|
6
|
+
* TypeScript version of Go's Lookup struct
|
|
7
|
+
*/
|
|
4
8
|
export declare class Lookup implements TemplateLookup {
|
|
5
9
|
private baseOf;
|
|
6
10
|
private funcsv;
|
|
7
11
|
constructor(baseOf?: BaseOf, funcMap?: TemplateFuncMap);
|
|
12
|
+
/**
|
|
13
|
+
* Find template with no dependencies (legacy method)
|
|
14
|
+
*/
|
|
8
15
|
findNoDependence(name: string, ns: TemplateNamespace): [Template | null, boolean, Error | null];
|
|
16
|
+
/**
|
|
17
|
+
* Find regular template with baseof dependency support
|
|
18
|
+
*/
|
|
9
19
|
findTemplate(name: string, templateNS: RegularTemplateNamespaceInterface): [Template | null, boolean, Error | null];
|
|
20
|
+
/**
|
|
21
|
+
* Find partial template (simple lookup, no dependencies)
|
|
22
|
+
*/
|
|
10
23
|
findPartial(name: string, partialNS: PartialTemplateNamespaceInterface): [Template | null, boolean, Error | null];
|
|
24
|
+
/**
|
|
25
|
+
* Find shortcode template (simplest lookup)
|
|
26
|
+
*/
|
|
11
27
|
findShortcode(name: string, shortcodeNS: ShortcodeTemplateNamespaceInterface): [Template | null, boolean, Error | null];
|
|
28
|
+
/**
|
|
29
|
+
* Find dependent template information
|
|
30
|
+
*/
|
|
12
31
|
findDependentInfo(name: string): [TemplateInfo | null, TemplateInfo | null, boolean];
|
|
32
|
+
/**
|
|
33
|
+
* Get function by name
|
|
34
|
+
*/
|
|
13
35
|
getFunc(name: string): any;
|
|
36
|
+
/**
|
|
37
|
+
* Set function
|
|
38
|
+
*/
|
|
14
39
|
setFunc(name: string, fn: any): void;
|
|
40
|
+
/**
|
|
41
|
+
* Set function map
|
|
42
|
+
*/
|
|
15
43
|
setFuncMap(funcMap: TemplateFuncMap): void;
|
|
44
|
+
/**
|
|
45
|
+
* Get function map
|
|
46
|
+
*/
|
|
16
47
|
getFuncMap(): TemplateFuncMap;
|
|
48
|
+
/**
|
|
49
|
+
* Create template lookup function for namespace
|
|
50
|
+
*/
|
|
17
51
|
newTemplateLookup(ns: TemplateNamespace): TemplateLookupFunc;
|
|
52
|
+
/**
|
|
53
|
+
* Get base template manager
|
|
54
|
+
*/
|
|
18
55
|
getBaseOf(): BaseOf;
|
|
56
|
+
/**
|
|
57
|
+
* Set base template manager
|
|
58
|
+
*/
|
|
19
59
|
setBaseOf(baseOf: BaseOf): void;
|
|
60
|
+
/**
|
|
61
|
+
* Check if template has dependencies
|
|
62
|
+
*/
|
|
20
63
|
hasDependencies(name: string): boolean;
|
|
64
|
+
/**
|
|
65
|
+
* Get all available functions
|
|
66
|
+
*/
|
|
21
67
|
getAllFunctions(): string[];
|
|
68
|
+
/**
|
|
69
|
+
* Clear all functions
|
|
70
|
+
*/
|
|
22
71
|
clearFunctions(): void;
|
|
72
|
+
/**
|
|
73
|
+
* Get lookup statistics
|
|
74
|
+
*/
|
|
23
75
|
getStats(): {
|
|
24
76
|
functionCount: number;
|
|
25
77
|
baseTemplateCount: number;
|
|
26
78
|
dependentTemplateCount: number;
|
|
27
79
|
};
|
|
28
80
|
}
|
|
81
|
+
/**
|
|
82
|
+
* Create a new Lookup instance
|
|
83
|
+
*/
|
|
29
84
|
export declare function newLookup(baseOf?: BaseOf, funcMap?: TemplateFuncMap): Lookup;
|
|
@@ -1,5 +1,9 @@
|
|
|
1
1
|
import { Template } from '@mdfriday/text-template';
|
|
2
2
|
import { TemplateParser, TemplateState, TemplateInfo, TemplateLookupFunc, TemplateFuncMap } from '../type';
|
|
3
|
+
/**
|
|
4
|
+
* Parser entity for parsing templates
|
|
5
|
+
* TypeScript version of Go's Parser struct
|
|
6
|
+
*/
|
|
3
7
|
export declare class Parser implements TemplateParser {
|
|
4
8
|
private prototypeText;
|
|
5
9
|
private prototypeTextClone?;
|
|
@@ -7,16 +11,52 @@ export declare class Parser implements TemplateParser {
|
|
|
7
11
|
private funcMap;
|
|
8
12
|
private parseOverlapCache;
|
|
9
13
|
constructor(funcMap?: TemplateFuncMap);
|
|
14
|
+
/**
|
|
15
|
+
* Mark parser as ready and create clone
|
|
16
|
+
*/
|
|
10
17
|
markReady(): Promise<void>;
|
|
18
|
+
/**
|
|
19
|
+
* Parse template info into template state
|
|
20
|
+
*/
|
|
11
21
|
parse(info: TemplateInfo): Promise<TemplateState>;
|
|
22
|
+
/**
|
|
23
|
+
* Parse template with lock (for thread safety)
|
|
24
|
+
*/
|
|
12
25
|
parseWithLock(name: string, tpl: string): Promise<Template>;
|
|
26
|
+
/**
|
|
27
|
+
* Parse template with overlay and base template
|
|
28
|
+
*/
|
|
13
29
|
parseOverlap(overlay: TemplateInfo, base: TemplateInfo, lookup: TemplateLookupFunc): Promise<[TemplateState | null, boolean, Error | null]>;
|
|
30
|
+
/**
|
|
31
|
+
* Apply base template to overlay
|
|
32
|
+
*/
|
|
14
33
|
private applyBaseTemplate;
|
|
34
|
+
/**
|
|
35
|
+
* Get template dependencies using syntax tree traversal (与Go版本一致的遍历方法)
|
|
36
|
+
*/
|
|
15
37
|
private getDependencies;
|
|
38
|
+
/**
|
|
39
|
+
* Set function map
|
|
40
|
+
*/
|
|
16
41
|
setFuncMap(funcMap: TemplateFuncMap): void;
|
|
42
|
+
/**
|
|
43
|
+
* Get function map
|
|
44
|
+
*/
|
|
17
45
|
getFuncMap(): TemplateFuncMap;
|
|
46
|
+
/**
|
|
47
|
+
* Parse multiple templates
|
|
48
|
+
*/
|
|
18
49
|
parseMultiple(templates: TemplateInfo[]): Promise<TemplateState[]>;
|
|
50
|
+
/**
|
|
51
|
+
* Clear the parse overlap cache
|
|
52
|
+
*/
|
|
19
53
|
clearCache(): void;
|
|
54
|
+
/**
|
|
55
|
+
* Get cache statistics
|
|
56
|
+
*/
|
|
20
57
|
getCacheStats(): import("@pkg/cahce/cache").CacheStats;
|
|
21
58
|
}
|
|
59
|
+
/**
|
|
60
|
+
* Create a new Parser instance
|
|
61
|
+
*/
|
|
22
62
|
export declare function newParser(funcMap?: TemplateFuncMap): Parser;
|
|
@@ -4,6 +4,10 @@ import { Executor } from './executor';
|
|
|
4
4
|
import { Parser } from './parser';
|
|
5
5
|
import { Lookup } from './lookup';
|
|
6
6
|
import { RegularTemplateNamespace, PartialTemplateNamespace, ShortcodeTemplateNamespace } from '../vo/namespace';
|
|
7
|
+
/**
|
|
8
|
+
* Template entity - main template engine with separated template management
|
|
9
|
+
* TypeScript version of Go's Template struct
|
|
10
|
+
*/
|
|
7
11
|
export declare class TemplateEngine implements ITemplateEngine {
|
|
8
12
|
private executor;
|
|
9
13
|
private lookup;
|
|
@@ -13,37 +17,120 @@ export declare class TemplateEngine implements ITemplateEngine {
|
|
|
13
17
|
private shortcodeNamespace;
|
|
14
18
|
private fs;
|
|
15
19
|
constructor(executor: Executor, lookup: Lookup, parser: Parser, templateNamespace: RegularTemplateNamespace, partialNamespace: PartialTemplateNamespace, shortcodeNamespace: ShortcodeTemplateNamespace, fs: TemplateFs);
|
|
20
|
+
/**
|
|
21
|
+
* Mark template engine as ready
|
|
22
|
+
*/
|
|
16
23
|
markReady(): Promise<void>;
|
|
24
|
+
/**
|
|
25
|
+
* Get regular template by name with baseof dependency support
|
|
26
|
+
*/
|
|
17
27
|
getTemplate(name: string): Promise<[Template | null, boolean, Error | null]>;
|
|
28
|
+
/**
|
|
29
|
+
* Get partial template by name (simple lookup)
|
|
30
|
+
*/
|
|
18
31
|
getPartial(name: string): Promise<[Template | null, boolean, Error | null]>;
|
|
32
|
+
/**
|
|
33
|
+
* Get shortcode template by name
|
|
34
|
+
*/
|
|
19
35
|
getShortcode(name: string): Promise<[Template | null, boolean, Error | null]>;
|
|
36
|
+
/**
|
|
37
|
+
* Get template by name (unified method that routes to appropriate namespace)
|
|
38
|
+
*/
|
|
20
39
|
get(name: string): Promise<[Template | null, boolean, Error | null]>;
|
|
40
|
+
/**
|
|
41
|
+
* Find first available template from a list of template names by priority
|
|
42
|
+
* Returns the first template found, its name, whether it was found, and any error
|
|
43
|
+
*/
|
|
21
44
|
findFirst(names: string[]): Promise<[Template | null, string | null, boolean, Error | null]>;
|
|
45
|
+
/**
|
|
46
|
+
* Check if a shortcode exists
|
|
47
|
+
* @param name - The shortcode name
|
|
48
|
+
* @returns true if the shortcode exists, false otherwise
|
|
49
|
+
*/
|
|
22
50
|
hasShortcode(name: string): boolean;
|
|
51
|
+
/**
|
|
52
|
+
* Get all available shortcode names
|
|
53
|
+
* @returns Array of shortcode names
|
|
54
|
+
*/
|
|
23
55
|
getShortcodeNames(): string[];
|
|
56
|
+
/**
|
|
57
|
+
* Get shortcode count
|
|
58
|
+
* @returns Number of loaded shortcodes
|
|
59
|
+
*/
|
|
24
60
|
getShortcodeCount(): number;
|
|
61
|
+
/**
|
|
62
|
+
* Load templates from file system (unified for all template types)
|
|
63
|
+
*/
|
|
25
64
|
loadTemplates(): Promise<void>;
|
|
65
|
+
/**
|
|
66
|
+
* Add template from file info (routes to appropriate namespace)
|
|
67
|
+
*/
|
|
26
68
|
private addTemplateFileInfo;
|
|
69
|
+
/**
|
|
70
|
+
* Add template to appropriate namespace based on type
|
|
71
|
+
*/
|
|
27
72
|
private addTemplate;
|
|
73
|
+
/**
|
|
74
|
+
* Execute template with data
|
|
75
|
+
*/
|
|
28
76
|
execute(templateName: string, data: any): Promise<string>;
|
|
29
77
|
executeRaw(templateName: string, rawContent: string, data: any): Promise<string>;
|
|
78
|
+
/**
|
|
79
|
+
* Execute shortcode template with data
|
|
80
|
+
*/
|
|
30
81
|
executeShortcode(shortcodeName: string, data: any): Promise<string>;
|
|
82
|
+
/**
|
|
83
|
+
* Execute template safely
|
|
84
|
+
*/
|
|
31
85
|
executeSafely(templateName: string, data: any): Promise<{
|
|
32
86
|
result: string | null;
|
|
33
87
|
error: TemplateError | null;
|
|
34
88
|
}>;
|
|
89
|
+
/**
|
|
90
|
+
* Execute shortcode safely
|
|
91
|
+
*/
|
|
35
92
|
executeShortcodeSafely(shortcodeName: string, data: any): Promise<{
|
|
36
93
|
result: string | null;
|
|
37
94
|
error: TemplateError | null;
|
|
38
95
|
}>;
|
|
96
|
+
/**
|
|
97
|
+
* Check if template exists
|
|
98
|
+
*/
|
|
39
99
|
hasTemplate(name: string): Promise<boolean>;
|
|
100
|
+
/**
|
|
101
|
+
* Get all template names
|
|
102
|
+
*/
|
|
40
103
|
getTemplateNames(): string[];
|
|
104
|
+
/**
|
|
105
|
+
* Get all partial template names
|
|
106
|
+
*/
|
|
41
107
|
getPartialTemplateNames(): string[];
|
|
108
|
+
/**
|
|
109
|
+
* Get all template names from all namespaces
|
|
110
|
+
*/
|
|
42
111
|
getAllTemplateNames(): string[];
|
|
112
|
+
/**
|
|
113
|
+
* Get partial namespace (for internal use by partial function)
|
|
114
|
+
*/
|
|
43
115
|
getPartialNamespace(): PartialTemplateNamespace;
|
|
116
|
+
/**
|
|
117
|
+
* Get shortcode namespace (for internal use)
|
|
118
|
+
*/
|
|
44
119
|
getShortcodeNamespace(): ShortcodeTemplateNamespace;
|
|
120
|
+
/**
|
|
121
|
+
* Get template namespace (for internal use)
|
|
122
|
+
*/
|
|
45
123
|
getTemplateNamespace(): RegularTemplateNamespace;
|
|
124
|
+
/**
|
|
125
|
+
* Clear all templates including shortcodes
|
|
126
|
+
*/
|
|
46
127
|
clear(): void;
|
|
128
|
+
/**
|
|
129
|
+
* Get template by pattern
|
|
130
|
+
*/
|
|
47
131
|
getTemplatesByPattern(pattern: RegExp): string[];
|
|
48
132
|
}
|
|
133
|
+
/**
|
|
134
|
+
* Create a new TemplateEngine instance
|
|
135
|
+
*/
|
|
49
136
|
export declare function newTemplateEngine(executor: Executor, lookup: Lookup, parser: Parser, templateNamespace: RegularTemplateNamespace, partialNamespace: PartialTemplateNamespace, shortcodeNamespace: ShortcodeTemplateNamespace, fs: TemplateFs): TemplateEngine;
|
|
@@ -1,11 +1,30 @@
|
|
|
1
1
|
import { TemplateFactory, TemplateFs, TemplateFactoryConfig, TemplateFuncMap, CustomizedFunctions } from '../type';
|
|
2
2
|
import { TemplateEngine } from '../entity/template';
|
|
3
3
|
import { RegularTemplateNamespace, PartialTemplateNamespace, ShortcodeTemplateNamespace } from '../vo/namespace';
|
|
4
|
+
/**
|
|
5
|
+
* Template factory implementation
|
|
6
|
+
* TypeScript version of Go's template factory
|
|
7
|
+
* Following Go's factory pattern with service injection
|
|
8
|
+
*/
|
|
4
9
|
export declare class Factory implements TemplateFactory {
|
|
10
|
+
/**
|
|
11
|
+
* Create template engine with file system (core functions only)
|
|
12
|
+
*/
|
|
5
13
|
create(fs: TemplateFs): Promise<TemplateEngine>;
|
|
14
|
+
/**
|
|
15
|
+
* Create template engine with configuration
|
|
16
|
+
*/
|
|
6
17
|
createWithConfig(fs: TemplateFs, config: TemplateFactoryConfig): Promise<TemplateEngine>;
|
|
18
|
+
/**
|
|
19
|
+
* Create template engine with services
|
|
20
|
+
* TypeScript equivalent of Go's New(fs, cfs) function
|
|
21
|
+
*/
|
|
7
22
|
createWithServices(fs: TemplateFs, services: CustomizedFunctions): Promise<TemplateEngine>;
|
|
8
23
|
}
|
|
24
|
+
/**
|
|
25
|
+
* Builder for constructing template engine with dependencies
|
|
26
|
+
* TypeScript equivalent of Go's builder pattern
|
|
27
|
+
*/
|
|
9
28
|
export declare class Builder {
|
|
10
29
|
private funcMap;
|
|
11
30
|
private services?;
|
|
@@ -16,16 +35,58 @@ export declare class Builder {
|
|
|
16
35
|
private lookup?;
|
|
17
36
|
private parser?;
|
|
18
37
|
private executor?;
|
|
38
|
+
/**
|
|
39
|
+
* Set file system
|
|
40
|
+
*/
|
|
19
41
|
withFs(fs: TemplateFs): Builder;
|
|
42
|
+
/**
|
|
43
|
+
* Set namespaces
|
|
44
|
+
*/
|
|
20
45
|
withNamespaces(templateNamespace: RegularTemplateNamespace, partialNamespace: PartialTemplateNamespace, shortcodeNamespace: ShortcodeTemplateNamespace): Builder;
|
|
46
|
+
/**
|
|
47
|
+
* Set function map directly
|
|
48
|
+
*/
|
|
21
49
|
withFuncMap(funcMap: TemplateFuncMap): Builder;
|
|
50
|
+
/**
|
|
51
|
+
* Set services (will generate function map from services)
|
|
52
|
+
* TypeScript equivalent of Go's withCfs()
|
|
53
|
+
*/
|
|
22
54
|
withServices(services: CustomizedFunctions): Builder;
|
|
55
|
+
/**
|
|
56
|
+
* Build lookup component
|
|
57
|
+
* TypeScript equivalent of Go's buildLookup()
|
|
58
|
+
*/
|
|
23
59
|
buildLookup(): Builder;
|
|
60
|
+
/**
|
|
61
|
+
* Build parser component
|
|
62
|
+
* TypeScript equivalent of Go's buildParser()
|
|
63
|
+
*/
|
|
24
64
|
buildParser(): Builder;
|
|
65
|
+
/**
|
|
66
|
+
* Build executor component
|
|
67
|
+
* TypeScript equivalent of Go's buildExecutor()
|
|
68
|
+
*/
|
|
25
69
|
buildExecutor(): Builder;
|
|
70
|
+
/**
|
|
71
|
+
* Build final template engine
|
|
72
|
+
* TypeScript equivalent of Go's build()
|
|
73
|
+
*/
|
|
26
74
|
build(): Promise<TemplateEngine>;
|
|
27
75
|
}
|
|
76
|
+
/**
|
|
77
|
+
* Create a new template factory
|
|
78
|
+
*/
|
|
28
79
|
export declare function newTemplateFactory(): Factory;
|
|
80
|
+
/**
|
|
81
|
+
* Create a new builder
|
|
82
|
+
*/
|
|
29
83
|
export declare function newBuilder(): Builder;
|
|
84
|
+
/**
|
|
85
|
+
* Convenience function to create template engine with defaults
|
|
86
|
+
*/
|
|
30
87
|
export declare function createTemplateEngine(fs: TemplateFs, funcMap?: TemplateFuncMap): Promise<TemplateEngine>;
|
|
88
|
+
/**
|
|
89
|
+
* Convenience function to create template engine with services
|
|
90
|
+
* TypeScript equivalent of Go's factory.New()
|
|
91
|
+
*/
|
|
31
92
|
export declare function createTemplateEngineWithServices(fs: TemplateFs, services: CustomizedFunctions): Promise<TemplateEngine>;
|