@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,2 +1,8 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Slug generator matching github-slugger v2.0.0 behavior
|
|
3
|
+
* Used for anchor slugs (heading IDs) - this DOES lowercase
|
|
4
|
+
*
|
|
5
|
+
* Note: This is different from Quartz's sluggify() which preserves case
|
|
6
|
+
*/
|
|
1
7
|
export declare function slug(text: string): string;
|
|
2
8
|
export { slug as slugAnchor };
|
|
@@ -4,14 +4,22 @@ export interface FrontMatterData {
|
|
|
4
4
|
format: 'yaml' | 'toml' | 'json' | 'org';
|
|
5
5
|
}
|
|
6
6
|
export interface Shortcode {
|
|
7
|
+
/** Shortcode name */
|
|
7
8
|
name: string;
|
|
9
|
+
/** Parameters */
|
|
8
10
|
params: string[] | Record<string, any> | null;
|
|
11
|
+
/** Position in source */
|
|
9
12
|
pos: number;
|
|
13
|
+
/** Length in source */
|
|
10
14
|
length: number;
|
|
11
15
|
rawContent: string;
|
|
16
|
+
/** Placeholder for shortcode in content */
|
|
12
17
|
placeholder: string;
|
|
18
|
+
/** Whether it's inline */
|
|
13
19
|
inline: boolean;
|
|
20
|
+
/** Whether it's closed */
|
|
14
21
|
closed: boolean;
|
|
22
|
+
/** Inner content for paired shortcodes */
|
|
15
23
|
inner?: string | any[];
|
|
16
24
|
ordinal: number;
|
|
17
25
|
indentation?: string;
|
|
@@ -25,12 +33,23 @@ export interface ParsedContentResult {
|
|
|
25
33
|
wordCount: number;
|
|
26
34
|
readingTime: number;
|
|
27
35
|
}
|
|
36
|
+
/**
|
|
37
|
+
* Shortcode renderer function type for external use
|
|
38
|
+
*/
|
|
28
39
|
export type ShortcodeRendererFunc = (shortcode: Shortcode) => Promise<string> | string;
|
|
40
|
+
/**
|
|
41
|
+
* Simplified content result interface for external use
|
|
42
|
+
*/
|
|
29
43
|
export interface ContentResult {
|
|
44
|
+
/** Front matter data */
|
|
30
45
|
frontMatter?: Record<string, any>;
|
|
46
|
+
/** Final rendered HTML content */
|
|
31
47
|
renderedContent: string;
|
|
48
|
+
/** Content summary */
|
|
32
49
|
summary?: string;
|
|
50
|
+
/** Word count */
|
|
33
51
|
wordCount: number;
|
|
52
|
+
/** Reading time in minutes */
|
|
34
53
|
readingTime: number;
|
|
35
54
|
}
|
|
36
55
|
export interface RenderableDocument {
|
|
@@ -38,9 +57,15 @@ export interface RenderableDocument {
|
|
|
38
57
|
toc(): TocFragments;
|
|
39
58
|
render(options: ParseAndRenderOptions): Promise<ContentResult>;
|
|
40
59
|
}
|
|
60
|
+
/**
|
|
61
|
+
* Parse and render options
|
|
62
|
+
*/
|
|
41
63
|
export interface ParseAndRenderOptions {
|
|
64
|
+
/** Shortcode renderer function */
|
|
42
65
|
shortcodeRenderer?: ShortcodeRendererFunc;
|
|
66
|
+
/** Maximum summary length */
|
|
43
67
|
maxSummaryLength?: number;
|
|
68
|
+
/** Words per minute for reading time calculation */
|
|
44
69
|
wordsPerMinute?: number;
|
|
45
70
|
}
|
|
46
71
|
export interface Markdown extends Highlighter {
|
|
@@ -49,115 +74,228 @@ export interface Markdown extends Highlighter {
|
|
|
49
74
|
parseAndRenderContent(source: Uint8Array, options?: ParseAndRenderOptions): Promise<ContentResult>;
|
|
50
75
|
prepareRender(source: Uint8Array): Promise<RenderableDocument>;
|
|
51
76
|
}
|
|
77
|
+
/**
|
|
78
|
+
* Result represents the minimum returned from Convert.
|
|
79
|
+
*/
|
|
52
80
|
export interface Result extends RenderingResult, ParsingResult {
|
|
53
81
|
}
|
|
82
|
+
/**
|
|
83
|
+
* ParsingResult interface
|
|
84
|
+
*/
|
|
54
85
|
export interface ParsingResult {
|
|
55
86
|
headers(): Header[];
|
|
56
87
|
tableOfContents(): TocFragments;
|
|
57
88
|
}
|
|
89
|
+
/**
|
|
90
|
+
* RenderingResult interface
|
|
91
|
+
*/
|
|
58
92
|
export interface RenderingResult {
|
|
59
93
|
bytes(): Uint8Array;
|
|
60
94
|
}
|
|
95
|
+
/**
|
|
96
|
+
* Highlighter interface for code highlighting
|
|
97
|
+
*/
|
|
61
98
|
export interface Highlighter extends CodeBlockRenderer, IsDefaultCodeBlockRendererProvider {
|
|
62
99
|
highlight(code: string, lang: string, opts?: any): Promise<string>;
|
|
63
100
|
highlightCodeBlock(ctx: CodeblockContext, opts?: any): Promise<HighlightResult>;
|
|
64
101
|
}
|
|
102
|
+
/**
|
|
103
|
+
* HighlightResult interface
|
|
104
|
+
*/
|
|
65
105
|
export interface HighlightResult {
|
|
66
106
|
wrapped(): string;
|
|
67
107
|
inner(): string;
|
|
68
108
|
}
|
|
109
|
+
/**
|
|
110
|
+
* AttributesOptionsSliceProvider interface
|
|
111
|
+
*/
|
|
69
112
|
export interface AttributesOptionsSliceProvider {
|
|
70
113
|
attributesSlice(): Attribute[];
|
|
71
114
|
optionsSlice(): Attribute[];
|
|
72
115
|
}
|
|
116
|
+
/**
|
|
117
|
+
* Attribute interface
|
|
118
|
+
*/
|
|
73
119
|
export interface Attribute {
|
|
74
120
|
name(): string;
|
|
75
121
|
value(): any;
|
|
76
122
|
valueString(): string;
|
|
77
123
|
}
|
|
124
|
+
/**
|
|
125
|
+
* RenderContext holds contextual information about the content to render.
|
|
126
|
+
*/
|
|
78
127
|
export interface RenderContext {
|
|
128
|
+
/** Context for the current Page render */
|
|
79
129
|
ctx: any;
|
|
130
|
+
/** Content to render */
|
|
80
131
|
src: Uint8Array;
|
|
132
|
+
/** Whether to render TableOfContents */
|
|
81
133
|
renderTOC: boolean;
|
|
134
|
+
/** Provides hook renderers on demand */
|
|
82
135
|
getRenderer: GetRendererFunc;
|
|
83
136
|
}
|
|
137
|
+
/**
|
|
138
|
+
* DocumentContext holds contextual information about the document to convert.
|
|
139
|
+
*/
|
|
84
140
|
export interface DocumentContext {
|
|
141
|
+
/** May be null. Usually a page.Page */
|
|
85
142
|
document: any | null;
|
|
86
143
|
documentID: string;
|
|
87
144
|
documentName: string;
|
|
88
145
|
filename: string;
|
|
89
146
|
}
|
|
147
|
+
/**
|
|
148
|
+
* Renderer types enum
|
|
149
|
+
*/
|
|
90
150
|
export declare enum RendererType {
|
|
91
151
|
LinkRendererType = 1,
|
|
92
152
|
ImageRendererType = 2,
|
|
93
153
|
HeadingRendererType = 3,
|
|
94
154
|
CodeBlockRendererType = 4
|
|
95
155
|
}
|
|
156
|
+
/**
|
|
157
|
+
* GetRendererFunc type
|
|
158
|
+
*/
|
|
96
159
|
export type GetRendererFunc = (t: RendererType, id?: any) => any | null;
|
|
160
|
+
/**
|
|
161
|
+
* Default renderer function
|
|
162
|
+
*/
|
|
97
163
|
export declare const DefaultRendererFunc: GetRendererFunc;
|
|
164
|
+
/**
|
|
165
|
+
* ContextData interface
|
|
166
|
+
*/
|
|
98
167
|
export interface ContextData {
|
|
99
168
|
renderContext(): RenderContext;
|
|
100
169
|
documentContext(): DocumentContext;
|
|
101
170
|
}
|
|
171
|
+
/**
|
|
172
|
+
* TableOfContentsProvider interface
|
|
173
|
+
*/
|
|
102
174
|
export interface TableOfContentsProvider {
|
|
103
175
|
tableOfContents(): TocFragments;
|
|
104
176
|
}
|
|
177
|
+
/**
|
|
178
|
+
* TocFragments interface
|
|
179
|
+
*/
|
|
105
180
|
export interface TocFragments {
|
|
106
181
|
toHTML(startLevel: number, stopLevel: number, ordered: boolean): string;
|
|
107
182
|
}
|
|
183
|
+
/**
|
|
184
|
+
* LinkContext is the context passed to a link render hook.
|
|
185
|
+
*/
|
|
108
186
|
export interface LinkContext {
|
|
187
|
+
/** The Page being rendered */
|
|
109
188
|
page(): any;
|
|
189
|
+
/** The link URL */
|
|
110
190
|
destination(): string;
|
|
191
|
+
/** The link title attribute */
|
|
111
192
|
title(): string;
|
|
193
|
+
/** The rendered (HTML) text */
|
|
112
194
|
text(): RenderedString;
|
|
195
|
+
/** The plain variant of Text */
|
|
113
196
|
plainText(): string;
|
|
114
197
|
}
|
|
198
|
+
/**
|
|
199
|
+
* LinkRenderer interface
|
|
200
|
+
*/
|
|
115
201
|
export interface LinkRenderer {
|
|
116
202
|
renderLink(cctx: any, w: FlexiWriter, ctx: LinkContext): Promise<void>;
|
|
117
203
|
}
|
|
204
|
+
/**
|
|
205
|
+
* AttributesProvider interface
|
|
206
|
+
*/
|
|
118
207
|
export interface AttributesProvider {
|
|
208
|
+
/** Attributes passed in from Markdown (e.g. { attrName1=attrValue1 attrName2="attr Value 2" }) */
|
|
119
209
|
attributes(): Record<string, any>;
|
|
120
210
|
}
|
|
211
|
+
/**
|
|
212
|
+
* HeadingContext contains accessors to all attributes that a HeadingRenderer
|
|
213
|
+
* can use to render a heading.
|
|
214
|
+
*/
|
|
121
215
|
export interface HeadingContext extends AttributesProvider {
|
|
216
|
+
/** Page is the page containing the heading */
|
|
122
217
|
page(): any;
|
|
218
|
+
/** Level is the level of the header (i.e. 1 for top-level, 2 for sub-level, etc.) */
|
|
123
219
|
level(): number;
|
|
220
|
+
/** Anchor is the HTML id assigned to the heading */
|
|
124
221
|
anchor(): string;
|
|
222
|
+
/** Text is the rendered (HTML) heading text, excluding the heading marker */
|
|
125
223
|
text(): RenderedString;
|
|
224
|
+
/** PlainText is the unrendered version of Text */
|
|
126
225
|
plainText(): string;
|
|
127
226
|
}
|
|
227
|
+
/**
|
|
228
|
+
* HeadingRenderer describes a uniquely identifiable rendering hook.
|
|
229
|
+
*/
|
|
128
230
|
export interface HeadingRenderer {
|
|
231
|
+
/** RenderHeading writes the rendered content to w using the data in ctx */
|
|
129
232
|
renderHeading(cctx: any, w: FlexiWriter, ctx: HeadingContext): Promise<void>;
|
|
130
233
|
}
|
|
234
|
+
/**
|
|
235
|
+
* IsDefaultCodeBlockRendererProvider interface
|
|
236
|
+
*/
|
|
131
237
|
export interface IsDefaultCodeBlockRendererProvider {
|
|
132
238
|
isDefaultCodeBlockRenderer(): boolean;
|
|
133
239
|
}
|
|
240
|
+
/**
|
|
241
|
+
* ElementPositionResolver provides a way to resolve the start Position
|
|
242
|
+
* of a markdown element in the original source document.
|
|
243
|
+
* This may be both slow and approximate, so should only be
|
|
244
|
+
* used for error logging.
|
|
245
|
+
*/
|
|
134
246
|
export interface ElementPositionResolver {
|
|
135
247
|
resolvePosition(ctx: any): Position;
|
|
136
248
|
}
|
|
249
|
+
/**
|
|
250
|
+
* Position interface for text positioning
|
|
251
|
+
*/
|
|
137
252
|
export interface Position {
|
|
138
253
|
line: number;
|
|
139
254
|
column: number;
|
|
140
255
|
offset: number;
|
|
141
256
|
}
|
|
257
|
+
/**
|
|
258
|
+
* CodeblockContext is the context passed to a code block render hook.
|
|
259
|
+
*/
|
|
142
260
|
export interface CodeblockContext extends AttributesProvider, AttributesOptionsSliceProvider, Positioner {
|
|
261
|
+
/** Chroma highlighting processing options. This will only be filled if Type is a known Chroma Lexer */
|
|
143
262
|
options(): Record<string, any>;
|
|
263
|
+
/** The type of code block. This will be the programming language, e.g. bash, when doing code highlighting */
|
|
144
264
|
type(): string;
|
|
265
|
+
/** The text between the code fences */
|
|
145
266
|
inner(): string;
|
|
267
|
+
/** Zero-based ordinal for all code blocks in the current document */
|
|
146
268
|
ordinal(): number;
|
|
269
|
+
/** The owning Page */
|
|
147
270
|
page(): any;
|
|
148
271
|
}
|
|
272
|
+
/**
|
|
273
|
+
* Positioner interface
|
|
274
|
+
*/
|
|
149
275
|
export interface Positioner {
|
|
150
276
|
position(): Position;
|
|
151
277
|
}
|
|
278
|
+
/**
|
|
279
|
+
* CodeBlockRenderer interface
|
|
280
|
+
*/
|
|
152
281
|
export interface CodeBlockRenderer {
|
|
153
282
|
renderCodeblock(cctx: any, w: FlexiWriter, ctx: CodeblockContext): Promise<void>;
|
|
154
283
|
}
|
|
284
|
+
/**
|
|
285
|
+
* FlexiWriter interface - flexible writer for different output types
|
|
286
|
+
*/
|
|
155
287
|
export interface FlexiWriter {
|
|
156
288
|
write(data: Uint8Array): Promise<void>;
|
|
157
289
|
writeString(str: string): Promise<void>;
|
|
158
290
|
writeByte(b: number): Promise<void>;
|
|
159
291
|
}
|
|
292
|
+
/**
|
|
293
|
+
* RenderedString type - represents rendered HTML string
|
|
294
|
+
*/
|
|
160
295
|
export type RenderedString = string;
|
|
296
|
+
/**
|
|
297
|
+
* Header interface
|
|
298
|
+
*/
|
|
161
299
|
export interface Header {
|
|
162
300
|
name(): string;
|
|
163
301
|
level(): number;
|
|
@@ -165,25 +303,46 @@ export interface Header {
|
|
|
165
303
|
paragraphs(): Paragraph[];
|
|
166
304
|
listParagraphs(): Paragraph[];
|
|
167
305
|
}
|
|
306
|
+
/**
|
|
307
|
+
* Link interface
|
|
308
|
+
*/
|
|
168
309
|
export interface Link {
|
|
169
310
|
text(): string;
|
|
170
311
|
url(): string;
|
|
171
312
|
}
|
|
313
|
+
/**
|
|
314
|
+
* Paragraph interface
|
|
315
|
+
*/
|
|
172
316
|
export interface Paragraph {
|
|
173
317
|
text(): string;
|
|
174
318
|
}
|
|
319
|
+
/**
|
|
320
|
+
* Markdown renderer interface - allows for external markdown renderers
|
|
321
|
+
*/
|
|
175
322
|
export interface MarkdownRenderer {
|
|
176
323
|
render(source: string): Promise<string>;
|
|
177
324
|
parse(source: string): Promise<ParsingResult>;
|
|
178
325
|
}
|
|
326
|
+
/**
|
|
327
|
+
* Markdown configuration interface
|
|
328
|
+
*/
|
|
179
329
|
export interface MarkdownConfig {
|
|
180
330
|
renderer?: MarkdownRenderer;
|
|
181
331
|
extensions?: MarkdownExtension[];
|
|
182
332
|
options?: Record<string, any>;
|
|
183
333
|
}
|
|
334
|
+
/**
|
|
335
|
+
* Markdown extension interface
|
|
336
|
+
*/
|
|
184
337
|
export interface MarkdownExtension {
|
|
185
338
|
name: string;
|
|
186
339
|
extend(md: any): void;
|
|
187
340
|
}
|
|
341
|
+
/**
|
|
342
|
+
* Basic markdown rendering function type - for environments where we only have access to render functions
|
|
343
|
+
*/
|
|
188
344
|
export type BasicMarkdownRenderFunc = (source: string) => Promise<string> | string;
|
|
345
|
+
/**
|
|
346
|
+
* Basic markdown parsing function type - for environments where we only have access to parse functions
|
|
347
|
+
*/
|
|
189
348
|
export type BasicMarkdownParseFunc = (source: string) => Promise<any> | any;
|
|
@@ -1,9 +1,15 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Auto heading ID types
|
|
3
|
+
*/
|
|
1
4
|
export declare const AutoHeadingIDType: {
|
|
2
5
|
readonly GitHub: "github";
|
|
3
6
|
readonly GitHubAscii: "github-ascii";
|
|
4
7
|
readonly Blackfriday: "blackfriday";
|
|
5
8
|
};
|
|
6
9
|
export type AutoHeadingIDType = typeof AutoHeadingIDType[keyof typeof AutoHeadingIDType];
|
|
10
|
+
/**
|
|
11
|
+
* Typographer configuration
|
|
12
|
+
*/
|
|
7
13
|
export interface TypographerConfig {
|
|
8
14
|
disable: boolean;
|
|
9
15
|
leftSingleQuote: string;
|
|
@@ -17,20 +23,32 @@ export interface TypographerConfig {
|
|
|
17
23
|
rightAngleQuote: string;
|
|
18
24
|
apostrophe: string;
|
|
19
25
|
}
|
|
26
|
+
/**
|
|
27
|
+
* CJK configuration
|
|
28
|
+
*/
|
|
20
29
|
export interface CJKConfig {
|
|
21
30
|
enable: boolean;
|
|
22
31
|
eastAsianLineBreaks: boolean;
|
|
23
32
|
eastAsianLineBreaksStyle: string;
|
|
24
33
|
escapedSpace: boolean;
|
|
25
34
|
}
|
|
35
|
+
/**
|
|
36
|
+
* Delimiters configuration
|
|
37
|
+
*/
|
|
26
38
|
export interface DelimitersConfig {
|
|
27
39
|
inline: string[][];
|
|
28
40
|
block: string[][];
|
|
29
41
|
}
|
|
42
|
+
/**
|
|
43
|
+
* Passthrough configuration
|
|
44
|
+
*/
|
|
30
45
|
export interface PassthroughConfig {
|
|
31
46
|
enable: boolean;
|
|
32
47
|
delimiters: DelimitersConfig;
|
|
33
48
|
}
|
|
49
|
+
/**
|
|
50
|
+
* Highlight configuration
|
|
51
|
+
*/
|
|
34
52
|
export interface HighlightConfig {
|
|
35
53
|
style: string;
|
|
36
54
|
lineNos: boolean;
|
|
@@ -43,19 +61,31 @@ export interface HighlightConfig {
|
|
|
43
61
|
guessSyntax: boolean;
|
|
44
62
|
tabWidth: number;
|
|
45
63
|
}
|
|
64
|
+
/**
|
|
65
|
+
* Parser attribute configuration
|
|
66
|
+
*/
|
|
46
67
|
export interface ParserAttributeConfig {
|
|
47
68
|
title: boolean;
|
|
48
69
|
block: boolean;
|
|
49
70
|
}
|
|
71
|
+
/**
|
|
72
|
+
* Parser configuration
|
|
73
|
+
*/
|
|
50
74
|
export interface ParserConfig {
|
|
51
75
|
autoHeadingID: boolean;
|
|
52
76
|
autoHeadingIDType: AutoHeadingIDType;
|
|
53
77
|
wrapStandAloneImageWithinParagraph: boolean;
|
|
54
78
|
attribute: ParserAttributeConfig;
|
|
55
79
|
}
|
|
80
|
+
/**
|
|
81
|
+
* Renderer configuration
|
|
82
|
+
*/
|
|
56
83
|
export interface RendererConfig {
|
|
57
84
|
unsafe: boolean;
|
|
58
85
|
}
|
|
86
|
+
/**
|
|
87
|
+
* Extensions configuration
|
|
88
|
+
*/
|
|
59
89
|
export interface ExtensionsConfig {
|
|
60
90
|
typographer: TypographerConfig;
|
|
61
91
|
footnote: boolean;
|
|
@@ -69,16 +99,28 @@ export interface ExtensionsConfig {
|
|
|
69
99
|
passthrough: PassthroughConfig;
|
|
70
100
|
highlight: HighlightConfig;
|
|
71
101
|
}
|
|
102
|
+
/**
|
|
103
|
+
* Image render hook configuration
|
|
104
|
+
*/
|
|
72
105
|
export interface ImageRenderHookConfig {
|
|
73
106
|
enableDefault: boolean;
|
|
74
107
|
}
|
|
108
|
+
/**
|
|
109
|
+
* Link render hook configuration
|
|
110
|
+
*/
|
|
75
111
|
export interface LinkRenderHookConfig {
|
|
76
112
|
enableDefault: boolean;
|
|
77
113
|
}
|
|
114
|
+
/**
|
|
115
|
+
* Render hooks configuration
|
|
116
|
+
*/
|
|
78
117
|
export interface RenderHooksConfig {
|
|
79
118
|
image: ImageRenderHookConfig;
|
|
80
119
|
link: LinkRenderHookConfig;
|
|
81
120
|
}
|
|
121
|
+
/**
|
|
122
|
+
* Main Markdown configuration
|
|
123
|
+
*/
|
|
82
124
|
export interface DomainMarkdownConfig {
|
|
83
125
|
renderer: RendererConfig;
|
|
84
126
|
parser: ParserConfig;
|
|
@@ -86,5 +128,11 @@ export interface DomainMarkdownConfig {
|
|
|
86
128
|
duplicateResourceFiles: boolean;
|
|
87
129
|
renderHooks: RenderHooksConfig;
|
|
88
130
|
}
|
|
131
|
+
/**
|
|
132
|
+
* Default highlight configuration
|
|
133
|
+
*/
|
|
89
134
|
export declare const DefaultHighlightConfig: HighlightConfig;
|
|
135
|
+
/**
|
|
136
|
+
* Default markdown configuration
|
|
137
|
+
*/
|
|
90
138
|
export declare const DefaultMarkdownConfig: DomainMarkdownConfig;
|
|
@@ -1,13 +1,27 @@
|
|
|
1
1
|
import { Item } from '@pkg/md/parser/item';
|
|
2
2
|
import { MarkdownRenderer, Shortcode } from "@internal/domain/markdown";
|
|
3
3
|
import { MediaType } from '@pkg/media/type';
|
|
4
|
+
/**
|
|
5
|
+
* Content replacement item
|
|
6
|
+
*/
|
|
4
7
|
export interface ContentReplacement {
|
|
8
|
+
/** Replacement value */
|
|
5
9
|
val: Uint8Array;
|
|
10
|
+
/** Source item */
|
|
6
11
|
source: Item;
|
|
7
12
|
}
|
|
13
|
+
/**
|
|
14
|
+
* Content item type - can be Item, Shortcode, or ContentReplacement
|
|
15
|
+
*/
|
|
8
16
|
export type ContentItem = Item | Shortcode | ContentReplacement;
|
|
17
|
+
/**
|
|
18
|
+
* Summary divider constants
|
|
19
|
+
*/
|
|
9
20
|
export declare const INTERNAL_SUMMARY_DIVIDER_BASE = "HUGOMORE42";
|
|
10
21
|
export declare const INTERNAL_SUMMARY_DIVIDER_PRE: NodeJS.NonSharedUint8Array;
|
|
22
|
+
/**
|
|
23
|
+
* Content class - manages parsed content with shortcodes and replacements
|
|
24
|
+
*/
|
|
11
25
|
export declare class Content {
|
|
12
26
|
private hasSummaryDivider;
|
|
13
27
|
private summaryTruncated;
|
|
@@ -15,37 +29,115 @@ export declare class Content {
|
|
|
15
29
|
private items;
|
|
16
30
|
private renderer;
|
|
17
31
|
constructor(source: Uint8Array, renderer: MarkdownRenderer);
|
|
32
|
+
/**
|
|
33
|
+
* Check if content is empty
|
|
34
|
+
*/
|
|
18
35
|
isEmpty(): boolean;
|
|
36
|
+
/**
|
|
37
|
+
* Set summary divider flag
|
|
38
|
+
*/
|
|
19
39
|
setSummaryDivider(): void;
|
|
40
|
+
/**
|
|
41
|
+
* Check if content has summary divider
|
|
42
|
+
*/
|
|
20
43
|
getHasSummaryDivider(): boolean;
|
|
44
|
+
/**
|
|
45
|
+
* Set summary truncated flag
|
|
46
|
+
*/
|
|
21
47
|
setSummaryTruncated(): void;
|
|
48
|
+
/**
|
|
49
|
+
* Check if summary is truncated
|
|
50
|
+
*/
|
|
22
51
|
getTruncated(): boolean;
|
|
52
|
+
/**
|
|
53
|
+
* Add replacement item
|
|
54
|
+
*/
|
|
23
55
|
addReplacement(val: Uint8Array, source: Item): void;
|
|
56
|
+
/**
|
|
57
|
+
* Add shortcode
|
|
58
|
+
*/
|
|
24
59
|
addShortcode(shortcode: Shortcode): void;
|
|
60
|
+
/**
|
|
61
|
+
* Add parsed item
|
|
62
|
+
*/
|
|
25
63
|
addItem(item: Item): void;
|
|
64
|
+
/**
|
|
65
|
+
* Add multiple items
|
|
66
|
+
*/
|
|
26
67
|
addItems(...items: Item[]): void;
|
|
68
|
+
/**
|
|
69
|
+
* Get raw content as string
|
|
70
|
+
*/
|
|
27
71
|
rawContent(): string;
|
|
72
|
+
/**
|
|
73
|
+
* Get pure content (with replacements and shortcodes processed)
|
|
74
|
+
*/
|
|
28
75
|
pureContent(): string;
|
|
29
76
|
pureContentWithoutPlaceholder(): string;
|
|
77
|
+
/**
|
|
78
|
+
* Get content with shortcodes rendered
|
|
79
|
+
*/
|
|
30
80
|
renderedContent(shortcodeRenderer?: (shortcode: Shortcode) => string): string;
|
|
81
|
+
/**
|
|
82
|
+
* Get content with shortcodes rendered (async version)
|
|
83
|
+
*/
|
|
31
84
|
renderedContentAsync(shortcodeRenderer?: (shortcode: Shortcode) => Promise<string> | string): Promise<string>;
|
|
85
|
+
/**
|
|
86
|
+
* Get all items
|
|
87
|
+
*/
|
|
32
88
|
getItems(): ContentItem[];
|
|
89
|
+
/**
|
|
90
|
+
* Get shortcodes only
|
|
91
|
+
*/
|
|
33
92
|
getShortcodes(): Shortcode[];
|
|
93
|
+
/**
|
|
94
|
+
* Get regular items only
|
|
95
|
+
*/
|
|
34
96
|
getTextItems(): Item[];
|
|
97
|
+
/**
|
|
98
|
+
* Get content replacements only
|
|
99
|
+
*/
|
|
35
100
|
getReplacements(): ContentReplacement[];
|
|
101
|
+
/**
|
|
102
|
+
* Extract summary automatically when summary is empty
|
|
103
|
+
*/
|
|
36
104
|
extractSummary(input: Uint8Array, mediaType: MediaType): {
|
|
37
105
|
summary: string;
|
|
38
106
|
truncated: boolean;
|
|
39
107
|
};
|
|
108
|
+
/**
|
|
109
|
+
* Extract summary from HTML content
|
|
110
|
+
*/
|
|
40
111
|
private extractSummaryFromHTML;
|
|
112
|
+
/**
|
|
113
|
+
* Check if string contains CJK characters
|
|
114
|
+
*/
|
|
41
115
|
private containsCJK;
|
|
116
|
+
/**
|
|
117
|
+
* Check if a word is probably an HTML token
|
|
118
|
+
*/
|
|
42
119
|
private isProbablyHTMLToken;
|
|
120
|
+
/**
|
|
121
|
+
* Strip HTML tags from string
|
|
122
|
+
*/
|
|
43
123
|
private stripHTML;
|
|
124
|
+
/**
|
|
125
|
+
* Trim short HTML content (remove single p tags if they wrap the entire content)
|
|
126
|
+
*/
|
|
44
127
|
private trimShortHTML;
|
|
45
128
|
cleanDividerPlaceholders(htmlContent: string): string;
|
|
129
|
+
/**
|
|
130
|
+
* Get content summary (up to summary divider)
|
|
131
|
+
*/
|
|
46
132
|
getDividedSummary(htmlContent: string): string;
|
|
47
133
|
getRenderedSummary(htmlContent?: string, maxLength?: number): Promise<string>;
|
|
134
|
+
/**
|
|
135
|
+
* Get word count
|
|
136
|
+
*/
|
|
48
137
|
getWordCount(): number;
|
|
138
|
+
/**
|
|
139
|
+
* Get reading time estimate (words per minute)
|
|
140
|
+
*/
|
|
49
141
|
getReadingTime(wordsPerMinute?: number): number;
|
|
50
142
|
private isItem;
|
|
51
143
|
private isShortcode;
|
|
@@ -1,4 +1,7 @@
|
|
|
1
1
|
import { RenderContext, DocumentContext, ContextData, FlexiWriter } from '../type';
|
|
2
|
+
/**
|
|
3
|
+
* BufWriter implements FlexiWriter using a buffer
|
|
4
|
+
*/
|
|
2
5
|
export declare class BufWriter implements FlexiWriter {
|
|
3
6
|
private buffer;
|
|
4
7
|
private position;
|
|
@@ -12,6 +15,9 @@ export declare class BufWriter implements FlexiWriter {
|
|
|
12
15
|
truncate(size: number): void;
|
|
13
16
|
private ensureCapacity;
|
|
14
17
|
}
|
|
18
|
+
/**
|
|
19
|
+
* RenderContextDataHolder holds render and document context
|
|
20
|
+
*/
|
|
15
21
|
export declare class RenderContextDataHolder implements ContextData {
|
|
16
22
|
private rctx;
|
|
17
23
|
private dctx;
|
|
@@ -19,6 +25,9 @@ export declare class RenderContextDataHolder implements ContextData {
|
|
|
19
25
|
renderContext(): RenderContext;
|
|
20
26
|
documentContext(): DocumentContext;
|
|
21
27
|
}
|
|
28
|
+
/**
|
|
29
|
+
* Context combines BufWriter and ContextData
|
|
30
|
+
*/
|
|
22
31
|
export declare class Context implements FlexiWriter, ContextData {
|
|
23
32
|
private bufWriter;
|
|
24
33
|
private contextData;
|
|
@@ -1,5 +1,8 @@
|
|
|
1
1
|
import { Highlighter, HighlightResult, CodeblockContext, FlexiWriter } from '../type';
|
|
2
2
|
import { HighlightConfig } from './config';
|
|
3
|
+
/**
|
|
4
|
+
* HighlightResultImpl implements HighlightResult
|
|
5
|
+
*/
|
|
3
6
|
export declare class HighlightResultImpl implements HighlightResult {
|
|
4
7
|
private wrappedContent;
|
|
5
8
|
private innerContent;
|
|
@@ -7,6 +10,9 @@ export declare class HighlightResultImpl implements HighlightResult {
|
|
|
7
10
|
wrapped(): string;
|
|
8
11
|
inner(): string;
|
|
9
12
|
}
|
|
13
|
+
/**
|
|
14
|
+
* Default highlighter using highlight.js or prism.js
|
|
15
|
+
*/
|
|
10
16
|
export declare class DefaultHighlighter implements Highlighter {
|
|
11
17
|
private config;
|
|
12
18
|
constructor(config: HighlightConfig);
|
|
@@ -17,6 +23,9 @@ export declare class DefaultHighlighter implements Highlighter {
|
|
|
17
23
|
private escapeHTML;
|
|
18
24
|
private addLineNumbers;
|
|
19
25
|
}
|
|
26
|
+
/**
|
|
27
|
+
* External highlighter adapter - allows using external highlight libraries
|
|
28
|
+
*/
|
|
20
29
|
export declare class ExternalHighlighter implements Highlighter {
|
|
21
30
|
private highlightFn;
|
|
22
31
|
private config;
|
|
@@ -26,5 +35,11 @@ export declare class ExternalHighlighter implements Highlighter {
|
|
|
26
35
|
renderCodeblock(cctx: any, w: FlexiWriter, ctx: CodeblockContext): Promise<void>;
|
|
27
36
|
isDefaultCodeBlockRenderer(): boolean;
|
|
28
37
|
}
|
|
38
|
+
/**
|
|
39
|
+
* Factory function to create default highlighter
|
|
40
|
+
*/
|
|
29
41
|
export declare function createDefaultHighlighter(config?: Partial<HighlightConfig>): DefaultHighlighter;
|
|
42
|
+
/**
|
|
43
|
+
* Factory function to create external highlighter
|
|
44
|
+
*/
|
|
30
45
|
export declare function createExternalHighlighter(highlightFn: (code: string, lang: string) => Promise<string>, config?: Partial<HighlightConfig>): ExternalHighlighter;
|
|
@@ -1,7 +1,16 @@
|
|
|
1
1
|
import { Items } from "@pkg/md/parser/item";
|
|
2
2
|
import { Config } from "@pkg/md/parser/pagelexer";
|
|
3
|
+
/**
|
|
4
|
+
* Parse bytes into items
|
|
5
|
+
*/
|
|
3
6
|
export declare function parseBytes(input: Uint8Array, config?: Config): Items;
|
|
7
|
+
/**
|
|
8
|
+
* Create position from input and offset
|
|
9
|
+
*/
|
|
4
10
|
export declare function posFromInput(filename: string, input: string | Uint8Array, offset: number): Position;
|
|
11
|
+
/**
|
|
12
|
+
* Position interface
|
|
13
|
+
*/
|
|
5
14
|
export interface Position {
|
|
6
15
|
filename: string;
|
|
7
16
|
line: number;
|