@mdfriday/foundry 26.4.19 → 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 +341 -362
- package/dist/cjs/worker/worker-node.js +110 -132
- 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 +68 -1
- 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 +133 -1
- 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
|
@@ -3,12 +3,31 @@ export declare class BaseFs implements Fs {
|
|
|
3
3
|
private readonly fs;
|
|
4
4
|
private readonly roots;
|
|
5
5
|
constructor(fs: Fs, roots: string[]);
|
|
6
|
+
/**
|
|
7
|
+
* Convert relative path to absolute path using the first root
|
|
8
|
+
* In BaseFs context, all paths are relative to the BaseFs root, even if they start with "/"
|
|
9
|
+
*/
|
|
6
10
|
private toAbsolutePath;
|
|
7
11
|
private isSameRootedPath;
|
|
12
|
+
/**
|
|
13
|
+
* Stat returns file info with opener function
|
|
14
|
+
*/
|
|
8
15
|
stat(name: string): Promise<IFileInfo>;
|
|
16
|
+
/**
|
|
17
|
+
* Open opens a file or directory
|
|
18
|
+
*/
|
|
9
19
|
open(name: string): Promise<IFile>;
|
|
20
|
+
/**
|
|
21
|
+
* Private method to open a file internally
|
|
22
|
+
*/
|
|
10
23
|
private openInternal;
|
|
24
|
+
/**
|
|
25
|
+
* Get the matching root path for a given name
|
|
26
|
+
*/
|
|
11
27
|
private getRoot;
|
|
28
|
+
/**
|
|
29
|
+
* Private method to open a directory
|
|
30
|
+
*/
|
|
12
31
|
private openDir;
|
|
13
32
|
create(name: string): Promise<IFile>;
|
|
14
33
|
mkdir(name: string, perm: number): Promise<void>;
|
|
@@ -22,4 +41,8 @@ export declare class BaseFs implements Fs {
|
|
|
22
41
|
chown(name: string, uid: number, gid: number): Promise<void>;
|
|
23
42
|
chtimes(name: string, atime: Date, mtime: Date): Promise<void>;
|
|
24
43
|
}
|
|
44
|
+
/**
|
|
45
|
+
* Creates a new BaseFs instance
|
|
46
|
+
* TypeScript version of Go's NewBaseFs function
|
|
47
|
+
*/
|
|
25
48
|
export declare function newBaseFs(fs: Fs, roots: string[]): BaseFs;
|
|
@@ -2,6 +2,10 @@ import { FileMetaInfo, Fs as IFs, WalkCallback, WalkwayConfig } from '../type';
|
|
|
2
2
|
import { OriginFs } from './originfs';
|
|
3
3
|
import { OverlayFs } from './overlayfs';
|
|
4
4
|
import { Service } from "@internal/domain/fs";
|
|
5
|
+
/**
|
|
6
|
+
* Fs entity - main filesystem entity
|
|
7
|
+
* TypeScript version of Go's Fs struct
|
|
8
|
+
*/
|
|
5
9
|
export declare class Fs {
|
|
6
10
|
readonly originFs: OriginFs;
|
|
7
11
|
readonly prompts: OverlayFs;
|
|
@@ -14,7 +18,13 @@ export declare class Fs {
|
|
|
14
18
|
readonly work: IFs;
|
|
15
19
|
readonly service: Service;
|
|
16
20
|
constructor(originFs: OriginFs, prompts: OverlayFs, workflows: OverlayFs, content: OverlayFs[], layouts: OverlayFs, statics: OverlayFs, assets: OverlayFs, i18n: OverlayFs, work: IFs);
|
|
21
|
+
/**
|
|
22
|
+
* Get the OS filesystem
|
|
23
|
+
*/
|
|
17
24
|
os(): IFs;
|
|
25
|
+
/**
|
|
26
|
+
* Get the work filesystem
|
|
27
|
+
*/
|
|
18
28
|
workFs(): IFs;
|
|
19
29
|
workflowFs(): IFs;
|
|
20
30
|
promptFs(): IFs;
|
|
@@ -27,6 +37,9 @@ export declare class Fs {
|
|
|
27
37
|
newFileMetaInfo(filename: string): FileMetaInfo;
|
|
28
38
|
newFileMetaInfoWithContent(content: string): FileMetaInfo;
|
|
29
39
|
getFileMetaInfos(paths: string[]): Promise<Map<string, FileMetaInfo>>;
|
|
40
|
+
/**
|
|
41
|
+
* Create new base path filesystem
|
|
42
|
+
*/
|
|
30
43
|
newBasePathFs(source: IFs, path: string): IFs;
|
|
31
44
|
walkPrompts(start: string, cb: WalkCallback, conf: WalkwayConfig): Promise<void>;
|
|
32
45
|
walkWorkflows(start: string, cb: WalkCallback, conf: WalkwayConfig): Promise<void>;
|
|
@@ -4,7 +4,13 @@ export declare class OriginFs {
|
|
|
4
4
|
readonly origin: IFs;
|
|
5
5
|
readonly publishDir: IFs;
|
|
6
6
|
constructor(source: IFs, origin: IFs, publishDir: IFs);
|
|
7
|
+
/**
|
|
8
|
+
* Get the source filesystem
|
|
9
|
+
*/
|
|
7
10
|
getSource(): IFs;
|
|
11
|
+
/**
|
|
12
|
+
* Get the origin filesystem
|
|
13
|
+
*/
|
|
8
14
|
getOrigin(): IFs;
|
|
9
15
|
publish(): IFs;
|
|
10
16
|
}
|
|
@@ -1,4 +1,8 @@
|
|
|
1
1
|
import { File, FileInfo, DirsMerger, InfoFunc, OverlayDirOptions, Fs } from '../type';
|
|
2
|
+
/**
|
|
3
|
+
* OverlayDir entity - represents a merged directory from multiple filesystems
|
|
4
|
+
* TypeScript version of Go's Dir struct
|
|
5
|
+
*/
|
|
2
6
|
export declare class OverlayDir implements File {
|
|
3
7
|
private _name;
|
|
4
8
|
private fss;
|
|
@@ -10,14 +14,41 @@ export declare class OverlayDir implements File {
|
|
|
10
14
|
private fis;
|
|
11
15
|
private closed;
|
|
12
16
|
constructor(options?: OverlayDirOptions);
|
|
17
|
+
/**
|
|
18
|
+
* Get file name
|
|
19
|
+
*/
|
|
13
20
|
name(): string;
|
|
21
|
+
/**
|
|
22
|
+
* Check if directory is closed
|
|
23
|
+
*/
|
|
14
24
|
private isClosed;
|
|
25
|
+
/**
|
|
26
|
+
* Read directory entries
|
|
27
|
+
*/
|
|
15
28
|
readdir(count: number): Promise<FileInfo[]>;
|
|
29
|
+
/**
|
|
30
|
+
* Read directory names
|
|
31
|
+
*/
|
|
16
32
|
readdirnames(n: number): Promise<string[]>;
|
|
33
|
+
/**
|
|
34
|
+
* Load directory entries from all filesystems
|
|
35
|
+
*/
|
|
17
36
|
private loadDirectoryEntries;
|
|
37
|
+
/**
|
|
38
|
+
* Read directory entries from a specific filesystem or file
|
|
39
|
+
*/
|
|
18
40
|
private readFromFilesystem;
|
|
41
|
+
/**
|
|
42
|
+
* Get file statistics
|
|
43
|
+
*/
|
|
19
44
|
stat(): Promise<FileInfo>;
|
|
45
|
+
/**
|
|
46
|
+
* Close directory
|
|
47
|
+
*/
|
|
20
48
|
close(): Promise<void>;
|
|
49
|
+
/**
|
|
50
|
+
* Not supported operations for directories
|
|
51
|
+
*/
|
|
21
52
|
private notSupported;
|
|
22
53
|
read(buffer: Uint8Array): Promise<{
|
|
23
54
|
bytesRead: number;
|
|
@@ -42,7 +73,20 @@ export declare class OverlayDir implements File {
|
|
|
42
73
|
bytesWritten: number;
|
|
43
74
|
}>;
|
|
44
75
|
}
|
|
76
|
+
/**
|
|
77
|
+
* Get a directory from the pool
|
|
78
|
+
*/
|
|
45
79
|
export declare function getDir(): OverlayDir;
|
|
80
|
+
/**
|
|
81
|
+
* Release a directory back to the pool
|
|
82
|
+
*/
|
|
46
83
|
export declare function releaseDir(dir: OverlayDir): void;
|
|
84
|
+
/**
|
|
85
|
+
* Open a new merged directory
|
|
86
|
+
* TypeScript version of Go's OpenDir function
|
|
87
|
+
*/
|
|
47
88
|
export declare function openDir(name: string, merge: DirsMerger | null, info: InfoFunc | null, fss: Fs[]): Promise<OverlayDir>;
|
|
89
|
+
/**
|
|
90
|
+
* Create a new OverlayDir instance
|
|
91
|
+
*/
|
|
48
92
|
export declare function newOverlayDir(options?: OverlayDirOptions): OverlayDir;
|
|
@@ -1,33 +1,112 @@
|
|
|
1
1
|
import { Fs, File, FileInfo, OverlayFs as IOverlayFs, DirsMerger, OverlayFsOptions } from '../type';
|
|
2
2
|
import { OverlayOptions } from '@internal/domain/fs/vo/overlayoptions';
|
|
3
|
+
/**
|
|
4
|
+
* OverlayFs entity - main overlay filesystem implementation
|
|
5
|
+
* TypeScript version of Go's OverlayFs struct
|
|
6
|
+
*/
|
|
3
7
|
export declare class OverlayFs implements IOverlayFs {
|
|
4
8
|
private fss;
|
|
5
9
|
private mergeDirs;
|
|
6
10
|
private firstWritable;
|
|
7
11
|
constructor(options: OverlayOptions);
|
|
12
|
+
/**
|
|
13
|
+
* Get filesystem name
|
|
14
|
+
*/
|
|
8
15
|
name(): string;
|
|
16
|
+
/**
|
|
17
|
+
* Implementation of FilesystemIterator interface
|
|
18
|
+
*/
|
|
9
19
|
filesystem(i: number): Fs | null;
|
|
20
|
+
/**
|
|
21
|
+
* Get number of filesystems in overlay
|
|
22
|
+
*/
|
|
10
23
|
numFilesystems(): number;
|
|
24
|
+
/**
|
|
25
|
+
* Append filesystems to overlay (returns new instance)
|
|
26
|
+
*/
|
|
11
27
|
append(...fss: Fs[]): OverlayFs;
|
|
28
|
+
/**
|
|
29
|
+
* Set directory merger (returns new instance)
|
|
30
|
+
*/
|
|
12
31
|
withDirsMerger(merger: DirsMerger): OverlayFs;
|
|
32
|
+
/**
|
|
33
|
+
* Get writable filesystem (first filesystem if firstWritable is true)
|
|
34
|
+
*/
|
|
13
35
|
private writeFs;
|
|
36
|
+
/**
|
|
37
|
+
* Collect directories from all filesystems
|
|
38
|
+
*/
|
|
14
39
|
private collectDirs;
|
|
40
|
+
/**
|
|
41
|
+
* Recursively collect directories from filesystem hierarchy
|
|
42
|
+
*/
|
|
15
43
|
private collectDirsRecursive;
|
|
44
|
+
/**
|
|
45
|
+
* Stat file/directory across all filesystems
|
|
46
|
+
*/
|
|
16
47
|
private statInternal;
|
|
48
|
+
/**
|
|
49
|
+
* Recursive stat implementation
|
|
50
|
+
*/
|
|
17
51
|
private statRecursive;
|
|
52
|
+
/**
|
|
53
|
+
* Check if error is "not exist" error
|
|
54
|
+
*/
|
|
18
55
|
private isNotExistError;
|
|
56
|
+
/**
|
|
57
|
+
* Create a file (write operation)
|
|
58
|
+
*/
|
|
19
59
|
create(name: string): Promise<File>;
|
|
60
|
+
/**
|
|
61
|
+
* Create directory (write operation)
|
|
62
|
+
*/
|
|
20
63
|
mkdir(name: string, perm: number): Promise<void>;
|
|
64
|
+
/**
|
|
65
|
+
* Create directory tree (write operation)
|
|
66
|
+
*/
|
|
21
67
|
mkdirAll(path: string, perm: number): Promise<void>;
|
|
68
|
+
/**
|
|
69
|
+
* Open file for reading (searches all filesystems)
|
|
70
|
+
*/
|
|
22
71
|
open(name: string): Promise<File>;
|
|
72
|
+
/**
|
|
73
|
+
* Open file with flags (write operations use first filesystem)
|
|
74
|
+
*/
|
|
23
75
|
openFile(name: string, flag: number, perm: number): Promise<File>;
|
|
76
|
+
/**
|
|
77
|
+
* Remove file (write operation)
|
|
78
|
+
*/
|
|
24
79
|
remove(name: string): Promise<void>;
|
|
80
|
+
/**
|
|
81
|
+
* Remove directory tree (write operation)
|
|
82
|
+
*/
|
|
25
83
|
removeAll(path: string): Promise<void>;
|
|
84
|
+
/**
|
|
85
|
+
* Rename file (write operation)
|
|
86
|
+
*/
|
|
26
87
|
rename(oldname: string, newname: string): Promise<void>;
|
|
88
|
+
/**
|
|
89
|
+
* Get file info (searches all filesystems)
|
|
90
|
+
*/
|
|
27
91
|
stat(name: string): Promise<FileInfo>;
|
|
92
|
+
/**
|
|
93
|
+
* Change file mode (write operation)
|
|
94
|
+
*/
|
|
28
95
|
chmod(name: string, mode: number): Promise<void>;
|
|
96
|
+
/**
|
|
97
|
+
* Change file ownership (write operation)
|
|
98
|
+
*/
|
|
29
99
|
chown(name: string, uid: number, gid: number): Promise<void>;
|
|
100
|
+
/**
|
|
101
|
+
* Change file times (write operation)
|
|
102
|
+
*/
|
|
30
103
|
chtimes(name: string, atime: Date, mtime: Date): Promise<void>;
|
|
31
104
|
}
|
|
105
|
+
/**
|
|
106
|
+
* Factory function to create new OverlayFs
|
|
107
|
+
*/
|
|
32
108
|
export declare function newOverlayFs(options: OverlayOptions): OverlayFs;
|
|
109
|
+
/**
|
|
110
|
+
* Create OverlayFs from raw options
|
|
111
|
+
*/
|
|
33
112
|
export declare function createOverlayFs(opts: OverlayFsOptions): OverlayFs;
|
|
@@ -1,7 +1,22 @@
|
|
|
1
1
|
import { FileMetaInfo } from '../type';
|
|
2
|
+
/**
|
|
3
|
+
* Service class for filesystem entity operations
|
|
4
|
+
* TypeScript equivalent of Go's Service struct
|
|
5
|
+
*/
|
|
2
6
|
export declare class Service {
|
|
7
|
+
/**
|
|
8
|
+
* Creates a new FileMetaInfo with the given filename
|
|
9
|
+
* TypeScript equivalent of Go's NewFileMetaInfo method
|
|
10
|
+
*/
|
|
3
11
|
newFileMetaInfo(filename: string): FileMetaInfo;
|
|
12
|
+
/**
|
|
13
|
+
* Creates a new FileMetaInfo with the given content
|
|
14
|
+
* TypeScript equivalent of Go's NewFileMetaInfoWithContent method
|
|
15
|
+
*/
|
|
4
16
|
newFileMetaInfoWithContent(content: string): FileMetaInfo;
|
|
5
17
|
}
|
|
18
|
+
/**
|
|
19
|
+
* Creates a new Service instance
|
|
20
|
+
*/
|
|
6
21
|
export declare function newService(): Service;
|
|
7
22
|
export default Service;
|
|
@@ -36,20 +36,69 @@ export interface File {
|
|
|
36
36
|
}>;
|
|
37
37
|
}
|
|
38
38
|
export interface Fs {
|
|
39
|
+
/**
|
|
40
|
+
* Create creates a file in the filesystem, returning the file and an
|
|
41
|
+
* error, if any happens.
|
|
42
|
+
*/
|
|
39
43
|
create(name: string): Promise<File>;
|
|
44
|
+
/**
|
|
45
|
+
* Mkdir creates a directory in the filesystem, return an error if any
|
|
46
|
+
* happens.
|
|
47
|
+
*/
|
|
40
48
|
mkdir(name: string, perm: number): Promise<void>;
|
|
49
|
+
/**
|
|
50
|
+
* MkdirAll creates a directory path and all parents that does not exist
|
|
51
|
+
* yet.
|
|
52
|
+
*/
|
|
41
53
|
mkdirAll(path: string, perm: number): Promise<void>;
|
|
54
|
+
/**
|
|
55
|
+
* Open opens a file, returning it or an error, if any happens.
|
|
56
|
+
*/
|
|
42
57
|
open(name: string): Promise<File>;
|
|
58
|
+
/**
|
|
59
|
+
* OpenFile opens a file using the given flags and the given mode.
|
|
60
|
+
*/
|
|
43
61
|
openFile(name: string, flag: number, perm: number): Promise<File>;
|
|
62
|
+
/**
|
|
63
|
+
* Remove removes a file identified by name, returning an error, if any
|
|
64
|
+
* happens.
|
|
65
|
+
*/
|
|
44
66
|
remove(name: string): Promise<void>;
|
|
67
|
+
/**
|
|
68
|
+
* RemoveAll removes a directory path and any children it contains. It
|
|
69
|
+
* does not fail if the path does not exist (return null).
|
|
70
|
+
*/
|
|
45
71
|
removeAll(path: string): Promise<void>;
|
|
72
|
+
/**
|
|
73
|
+
* Rename renames a file.
|
|
74
|
+
*/
|
|
46
75
|
rename(oldname: string, newname: string): Promise<void>;
|
|
76
|
+
/**
|
|
77
|
+
* Stat returns a FileInfo describing the named file, or an error, if any
|
|
78
|
+
* happens.
|
|
79
|
+
*/
|
|
47
80
|
stat(name: string): Promise<FileInfo>;
|
|
81
|
+
/**
|
|
82
|
+
* The name of this FileSystem
|
|
83
|
+
*/
|
|
48
84
|
name(): string;
|
|
85
|
+
/**
|
|
86
|
+
* Chmod changes the mode of the named file to mode.
|
|
87
|
+
*/
|
|
49
88
|
chmod(name: string, mode: number): Promise<void>;
|
|
89
|
+
/**
|
|
90
|
+
* Chown changes the uid and gid of the named file.
|
|
91
|
+
*/
|
|
50
92
|
chown(name: string, uid: number, gid: number): Promise<void>;
|
|
93
|
+
/**
|
|
94
|
+
* Chtimes changes the access and modification times of the named file
|
|
95
|
+
*/
|
|
51
96
|
chtimes(name: string, atime: Date, mtime: Date): Promise<void>;
|
|
52
97
|
}
|
|
98
|
+
/**
|
|
99
|
+
* File system error constants
|
|
100
|
+
* Equivalent to Go's afero error variables
|
|
101
|
+
*/
|
|
53
102
|
export declare class FsError extends Error {
|
|
54
103
|
code?: string | undefined;
|
|
55
104
|
constructor(message: string, code?: string | undefined);
|
|
@@ -60,6 +109,9 @@ export declare const ErrTooLarge: FsError;
|
|
|
60
109
|
export declare const ErrFileNotFound: FsError;
|
|
61
110
|
export declare const ErrFileExists: FsError;
|
|
62
111
|
export declare const ErrDestinationExists: FsError;
|
|
112
|
+
/**
|
|
113
|
+
* File open flags (equivalent to Go's vo package flags)
|
|
114
|
+
*/
|
|
63
115
|
export declare enum OpenFlags {
|
|
64
116
|
O_RDONLY = 0,
|
|
65
117
|
O_WRONLY = 1,
|
|
@@ -77,13 +129,25 @@ export interface FileMetaInfo extends FileInfo {
|
|
|
77
129
|
root(): string;
|
|
78
130
|
open(): Promise<File>;
|
|
79
131
|
}
|
|
132
|
+
/**
|
|
133
|
+
* Walk function type - called for each file/directory during walk
|
|
134
|
+
*/
|
|
80
135
|
export type WalkFunc = (path: string, info: FileMetaInfo) => Promise<void | Error>;
|
|
136
|
+
/**
|
|
137
|
+
* Walk hook function type - called before/after processing directory contents
|
|
138
|
+
*/
|
|
81
139
|
export type WalkHook = (dir: FileMetaInfo, path: string, readdir: FileMetaInfo[]) => Promise<FileMetaInfo[]>;
|
|
140
|
+
/**
|
|
141
|
+
* WalkCallback structure containing hooks and walk function
|
|
142
|
+
*/
|
|
82
143
|
export interface WalkCallback {
|
|
83
144
|
hookPre?: WalkHook;
|
|
84
145
|
walkFn: WalkFunc;
|
|
85
146
|
hookPost?: WalkHook;
|
|
86
147
|
}
|
|
148
|
+
/**
|
|
149
|
+
* WalkwayConfig structure containing hooks and walk function
|
|
150
|
+
*/
|
|
87
151
|
export interface WalkwayConfig {
|
|
88
152
|
info?: FileMetaInfo;
|
|
89
153
|
dirEntries?: FileMetaInfo[];
|
|
@@ -91,24 +155,52 @@ export interface WalkwayConfig {
|
|
|
91
155
|
failOnNotExist?: boolean;
|
|
92
156
|
sortDirEntries?: boolean;
|
|
93
157
|
}
|
|
158
|
+
/**
|
|
159
|
+
* Walk-related errors
|
|
160
|
+
*/
|
|
94
161
|
export declare const ErrSkipDir: Error;
|
|
95
162
|
export declare const ErrWalkAlreadyWalked: FsError;
|
|
163
|
+
/**
|
|
164
|
+
* Filesystem iterator interface for iterating over wrapped filesystems
|
|
165
|
+
* TypeScript version of Go's FilesystemIterator
|
|
166
|
+
*/
|
|
96
167
|
export interface FilesystemIterator {
|
|
97
168
|
filesystem(i: number): Fs | null;
|
|
98
169
|
numFilesystems(): number;
|
|
99
170
|
}
|
|
171
|
+
/**
|
|
172
|
+
* Directory merger function type
|
|
173
|
+
* TypeScript version of Go's DirsMerger
|
|
174
|
+
*/
|
|
100
175
|
export type DirsMerger = (lofi: FileInfo[], bofi: FileInfo[]) => FileInfo[];
|
|
176
|
+
/**
|
|
177
|
+
* OverlayFs options configuration
|
|
178
|
+
* TypeScript version of Go's Options
|
|
179
|
+
*/
|
|
101
180
|
export interface OverlayFsOptions {
|
|
102
181
|
fss: Fs[];
|
|
103
182
|
firstWritable?: boolean;
|
|
104
183
|
dirsMerger?: DirsMerger;
|
|
105
184
|
}
|
|
185
|
+
/**
|
|
186
|
+
* OverlayFs interface extending base Fs functionality
|
|
187
|
+
* TypeScript version of Go's OverlayFs interface
|
|
188
|
+
*/
|
|
106
189
|
export interface OverlayFs extends Fs, FilesystemIterator {
|
|
107
190
|
append(...fss: Fs[]): OverlayFs;
|
|
108
191
|
withDirsMerger(merger: DirsMerger): OverlayFs;
|
|
109
192
|
}
|
|
193
|
+
/**
|
|
194
|
+
* Directory opener function type
|
|
195
|
+
*/
|
|
110
196
|
export type DirOpener = () => Promise<File>;
|
|
197
|
+
/**
|
|
198
|
+
* Info function type for directory stats
|
|
199
|
+
*/
|
|
111
200
|
export type InfoFunc = () => Promise<FileInfo>;
|
|
201
|
+
/**
|
|
202
|
+
* Overlay directory options
|
|
203
|
+
*/
|
|
112
204
|
export interface OverlayDirOptions {
|
|
113
205
|
name?: string;
|
|
114
206
|
fss?: Fs[];
|
|
@@ -116,6 +208,9 @@ export interface OverlayDirOptions {
|
|
|
116
208
|
info?: InfoFunc;
|
|
117
209
|
merge?: DirsMerger;
|
|
118
210
|
}
|
|
211
|
+
/**
|
|
212
|
+
* OverlayFs errors
|
|
213
|
+
*/
|
|
119
214
|
export declare class OverlayFsError extends FsError {
|
|
120
215
|
constructor(message: string, code?: string);
|
|
121
216
|
}
|
|
@@ -2,20 +2,61 @@ import { File as IFile, Fs } from '../type';
|
|
|
2
2
|
import { FileMeta } from './filemeta';
|
|
3
3
|
import { FileInfo } from './fileinfo';
|
|
4
4
|
import { File } from './file';
|
|
5
|
+
/**
|
|
6
|
+
* DirOpener function type for opening virtual directories
|
|
7
|
+
* TypeScript version of Go's DirOpener func
|
|
8
|
+
*/
|
|
5
9
|
export type DirOpener = () => Promise<FileInfo[]>;
|
|
10
|
+
/**
|
|
11
|
+
* Filter function type for filtering directory entries
|
|
12
|
+
*/
|
|
6
13
|
export type DirFilter = (entries: FileInfo[]) => Promise<FileInfo[]>;
|
|
14
|
+
/**
|
|
15
|
+
* DirFile represents a directory file with virtual directory support
|
|
16
|
+
* TypeScript version of Go's DirFile struct
|
|
17
|
+
*/
|
|
7
18
|
export declare class DirFile extends File {
|
|
8
19
|
private virtualOpener;
|
|
9
20
|
private filter;
|
|
10
21
|
constructor(file: File, virtualOpener?: DirOpener | null, filter?: DirFilter | null);
|
|
22
|
+
/**
|
|
23
|
+
* ReadDir reads directory entries, supporting both real and virtual directories
|
|
24
|
+
*/
|
|
11
25
|
readDir(count: number): Promise<FileInfo[]>;
|
|
26
|
+
/**
|
|
27
|
+
* Read virtual directory entries
|
|
28
|
+
*/
|
|
12
29
|
private readVirtualDir;
|
|
30
|
+
/**
|
|
31
|
+
* Set the filter function
|
|
32
|
+
*/
|
|
13
33
|
setFilter(filter: DirFilter): void;
|
|
34
|
+
/**
|
|
35
|
+
* Set the virtual opener function
|
|
36
|
+
*/
|
|
14
37
|
setVirtualOpener(opener: DirOpener): void;
|
|
38
|
+
/**
|
|
39
|
+
* Get the filter function
|
|
40
|
+
*/
|
|
15
41
|
getFilter(): DirFilter | null;
|
|
42
|
+
/**
|
|
43
|
+
* Get the virtual opener function
|
|
44
|
+
*/
|
|
16
45
|
getVirtualOpener(): DirOpener | null;
|
|
17
46
|
}
|
|
47
|
+
/**
|
|
48
|
+
* Creates a new DirFile with virtual opener
|
|
49
|
+
*/
|
|
18
50
|
export declare function newDirFileWithVirtualOpener(file: File, opener: DirOpener): DirFile;
|
|
51
|
+
/**
|
|
52
|
+
* Creates a new DirFile from file components
|
|
53
|
+
*/
|
|
19
54
|
export declare function newDirFile(file: IFile, meta: FileMeta, fs: Fs): DirFile;
|
|
55
|
+
/**
|
|
56
|
+
* Creates a new DirFile with filter
|
|
57
|
+
*/
|
|
20
58
|
export declare function newDirFileWithFilter(file: File, filter: DirFilter): DirFile;
|
|
59
|
+
/**
|
|
60
|
+
* Creates a new DirFile with both virtual opener and filter
|
|
61
|
+
*/
|
|
21
62
|
export declare function newDirFileWithOpenerAndFilter(file: File, opener: DirOpener, filter: DirFilter): DirFile;
|
|
@@ -1,16 +1,35 @@
|
|
|
1
1
|
import { File as IFile, Fs, FileInfo as IFileInfo } from '../type';
|
|
2
2
|
import { FileMeta } from './filemeta';
|
|
3
3
|
import { FileInfo } from './fileinfo';
|
|
4
|
+
/**
|
|
5
|
+
* File represents a file with metadata
|
|
6
|
+
* TypeScript version of Go's File struct
|
|
7
|
+
*/
|
|
4
8
|
export declare class File implements IFile {
|
|
5
9
|
private readonly file;
|
|
6
10
|
private readonly fileMeta;
|
|
7
11
|
private fs;
|
|
8
12
|
private readonly _isDir;
|
|
9
13
|
constructor(file: IFile | null, fileMeta: FileMeta, fs: Fs, isDir?: boolean);
|
|
14
|
+
/**
|
|
15
|
+
* Check if this is a no-op file (null file)
|
|
16
|
+
*/
|
|
10
17
|
isNop(): boolean;
|
|
18
|
+
/**
|
|
19
|
+
* Close the file
|
|
20
|
+
*/
|
|
11
21
|
close(): Promise<void>;
|
|
22
|
+
/**
|
|
23
|
+
* ReadDir reads directory entries
|
|
24
|
+
*/
|
|
12
25
|
readDir(count: number): Promise<FileInfo[]>;
|
|
26
|
+
/**
|
|
27
|
+
* Get the file metadata
|
|
28
|
+
*/
|
|
13
29
|
meta(): FileMeta;
|
|
30
|
+
/**
|
|
31
|
+
* Simple path join implementation
|
|
32
|
+
*/
|
|
14
33
|
private joinPath;
|
|
15
34
|
read(buffer: Uint8Array): Promise<{
|
|
16
35
|
bytesRead: number;
|
|
@@ -39,7 +58,16 @@ export declare class File implements IFile {
|
|
|
39
58
|
bytesWritten: number;
|
|
40
59
|
}>;
|
|
41
60
|
}
|
|
61
|
+
/**
|
|
62
|
+
* Creates a new File instance
|
|
63
|
+
*/
|
|
42
64
|
export declare function newFile(file: IFile, filename: string, fs: Fs): File;
|
|
65
|
+
/**
|
|
66
|
+
* Creates a new File with existing FileMeta
|
|
67
|
+
*/
|
|
43
68
|
export declare function newFileWithMeta(file: IFile, meta: FileMeta, fs: Fs): File;
|
|
44
69
|
export declare function newDirFileWithMeta(file: IFile, meta: FileMeta, fs: Fs): File;
|
|
70
|
+
/**
|
|
71
|
+
* Creates a new directory File
|
|
72
|
+
*/
|
|
45
73
|
export declare function newDirFile(file: IFile, filename: string, fs: Fs): File;
|
|
@@ -1,12 +1,29 @@
|
|
|
1
1
|
import { FileInfo as IFileInfo, FileMetaInfo, File } from '../type';
|
|
2
2
|
import { FileMeta } from './filemeta';
|
|
3
|
+
/**
|
|
4
|
+
* FileInfo represents file information with metadata
|
|
5
|
+
* TypeScript version of Go's FileInfo struct
|
|
6
|
+
* Implements FileMetaInfo interface
|
|
7
|
+
*/
|
|
3
8
|
export declare class FileInfo implements FileMetaInfo {
|
|
4
9
|
private readonly fileInfo;
|
|
5
10
|
private _fileMeta;
|
|
6
11
|
constructor(fileInfo: IFileInfo, fileMeta: FileMeta);
|
|
12
|
+
/**
|
|
13
|
+
* Meta returns the FileMeta
|
|
14
|
+
*/
|
|
7
15
|
meta(): FileMeta;
|
|
16
|
+
/**
|
|
17
|
+
* Type returns the file mode
|
|
18
|
+
*/
|
|
8
19
|
type(): number;
|
|
20
|
+
/**
|
|
21
|
+
* Info returns the underlying FileInfo
|
|
22
|
+
*/
|
|
9
23
|
info(): IFileInfo;
|
|
24
|
+
/**
|
|
25
|
+
* Set the FileMeta
|
|
26
|
+
*/
|
|
10
27
|
setMeta(meta: FileMeta): void;
|
|
11
28
|
name(): string;
|
|
12
29
|
size(): number;
|
|
@@ -20,5 +37,11 @@ export declare class FileInfo implements FileMetaInfo {
|
|
|
20
37
|
root(): string;
|
|
21
38
|
open(): Promise<File>;
|
|
22
39
|
}
|
|
40
|
+
/**
|
|
41
|
+
* Creates a new FileInfo instance
|
|
42
|
+
*/
|
|
23
43
|
export declare function newFileInfo(fi: IFileInfo, filename: string): FileInfo;
|
|
44
|
+
/**
|
|
45
|
+
* Creates a new FileInfo instance with FileMeta
|
|
46
|
+
*/
|
|
24
47
|
export declare function newFileInfoWithMeta(fi: IFileInfo, meta: FileMeta): FileInfo;
|
|
@@ -1,23 +1,68 @@
|
|
|
1
1
|
import { File } from '../type';
|
|
2
|
+
/**
|
|
3
|
+
* FileOpener function type for opening files
|
|
4
|
+
* TypeScript version of Go's FileOpener func
|
|
5
|
+
*/
|
|
2
6
|
export type FileOpener = () => Promise<File>;
|
|
7
|
+
/**
|
|
8
|
+
* MetaProvider interface for objects that can provide FileMeta
|
|
9
|
+
*/
|
|
3
10
|
export interface MetaProvider {
|
|
4
11
|
meta(): FileMeta;
|
|
5
12
|
}
|
|
13
|
+
/**
|
|
14
|
+
* FileMeta represents file metadata
|
|
15
|
+
* Simplified TypeScript version of Go's FileMeta struct
|
|
16
|
+
*/
|
|
6
17
|
export declare class FileMeta {
|
|
7
18
|
private filename;
|
|
8
19
|
private componentRoot;
|
|
9
20
|
private componentDir;
|
|
10
21
|
private openFunc;
|
|
11
22
|
constructor(filename?: string, openFunc?: FileOpener | null);
|
|
23
|
+
/**
|
|
24
|
+
* FileName returns the filename
|
|
25
|
+
*/
|
|
12
26
|
fileName(): string;
|
|
27
|
+
/**
|
|
28
|
+
* RelativeFilename returns the relative filename from root
|
|
29
|
+
*/
|
|
13
30
|
relativeFilename(): string;
|
|
31
|
+
/**
|
|
32
|
+
* Component returns the component directory
|
|
33
|
+
*/
|
|
14
34
|
component(): string;
|
|
35
|
+
/**
|
|
36
|
+
* Root returns the component root
|
|
37
|
+
*/
|
|
15
38
|
root(): string;
|
|
39
|
+
/**
|
|
40
|
+
* Open opens the file using the OpenFunc
|
|
41
|
+
*/
|
|
16
42
|
open(): Promise<File>;
|
|
43
|
+
/**
|
|
44
|
+
* Set the filename
|
|
45
|
+
*/
|
|
17
46
|
setFileName(filename: string): void;
|
|
47
|
+
/**
|
|
48
|
+
* Set the component root
|
|
49
|
+
*/
|
|
18
50
|
setComponentRoot(root: string): void;
|
|
51
|
+
/**
|
|
52
|
+
* Set the component directory
|
|
53
|
+
*/
|
|
19
54
|
setComponentDir(dir: string): void;
|
|
55
|
+
/**
|
|
56
|
+
* Set the open function
|
|
57
|
+
*/
|
|
20
58
|
setOpenFunc(openFunc: FileOpener): void;
|
|
59
|
+
/**
|
|
60
|
+
* Merge merges another FileMeta into this one
|
|
61
|
+
* Only copies non-empty values
|
|
62
|
+
*/
|
|
21
63
|
merge(from: FileMeta): void;
|
|
22
64
|
}
|
|
65
|
+
/**
|
|
66
|
+
* Creates a new FileMeta instance
|
|
67
|
+
*/
|
|
23
68
|
export declare function newFileMeta(filename?: string, openFunc?: FileOpener): FileMeta;
|