@lupinum/ginko-content 0.1.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/LICENSE +21 -0
- package/README.md +90 -0
- package/compatibility.json +27 -0
- package/dist/cli.d.mts +1 -0
- package/dist/cli.mjs +690 -0
- package/dist/cms-contract/build +1 -0
- package/dist/cms-contract/build.d.ts +44 -0
- package/dist/cms-contract/build.js +513 -0
- package/dist/cms-contract/index +1 -0
- package/dist/cms-contract/index.d.ts +25 -0
- package/dist/cms-contract/index.js +37 -0
- package/dist/cms-contract/mdc +1 -0
- package/dist/cms-contract/mdc.d.ts +32 -0
- package/dist/cms-contract/mdc.js +52 -0
- package/dist/cms-contract/path +1 -0
- package/dist/cms-contract/path.d.ts +12 -0
- package/dist/cms-contract/path.js +18 -0
- package/dist/cms-contract/schema +1 -0
- package/dist/cms-contract/schema.d.ts +18 -0
- package/dist/cms-contract/schema.js +13 -0
- package/dist/cms-contract/types +1 -0
- package/dist/cms-contract/types.d.ts +177 -0
- package/dist/cms-contract/types.js +0 -0
- package/dist/cms-import/index +1 -0
- package/dist/cms-import/index.d.ts +21 -0
- package/dist/cms-import/index.js +57 -0
- package/dist/config.d.mts +3 -0
- package/dist/config.mjs +3 -0
- package/dist/core/cache +1 -0
- package/dist/core/cache-hints +1 -0
- package/dist/core/cache-hints.d.ts +3 -0
- package/dist/core/cache-hints.js +55 -0
- package/dist/core/cache.d.ts +29 -0
- package/dist/core/cache.js +0 -0
- package/dist/core/content/collection +1 -0
- package/dist/core/content/collection.d.ts +3 -0
- package/dist/core/content/collection.js +52 -0
- package/dist/core/content/graph +1 -0
- package/dist/core/content/graph.d.ts +147 -0
- package/dist/core/content/graph.js +189 -0
- package/dist/core/content/ignore +1 -0
- package/dist/core/content/ignore.d.ts +5 -0
- package/dist/core/content/ignore.js +10 -0
- package/dist/core/content/locale +1 -0
- package/dist/core/content/locale.d.ts +61 -0
- package/dist/core/content/locale.js +77 -0
- package/dist/core/content/path +1 -0
- package/dist/core/content/path.d.ts +36 -0
- package/dist/core/content/path.js +143 -0
- package/dist/core/content/slug +1 -0
- package/dist/core/content/slug.d.ts +4 -0
- package/dist/core/content/slug.js +41 -0
- package/dist/core/content/sources +1 -0
- package/dist/core/content/sources.d.ts +2 -0
- package/dist/core/content/sources.js +6 -0
- package/dist/core/errors +1 -0
- package/dist/core/errors.d.ts +15 -0
- package/dist/core/errors.js +10 -0
- package/dist/core/markdown/tree +1 -0
- package/dist/core/markdown/tree.d.ts +9 -0
- package/dist/core/markdown/tree.js +47 -0
- package/dist/core/query/builder +1 -0
- package/dist/core/query/builder.d.ts +18 -0
- package/dist/core/query/builder.js +186 -0
- package/dist/core/query/execute +1 -0
- package/dist/core/query/execute.d.ts +52 -0
- package/dist/core/query/execute.js +304 -0
- package/dist/core/query/filter +1 -0
- package/dist/core/query/filter.d.ts +42 -0
- package/dist/core/query/filter.js +118 -0
- package/dist/core/query/json +1 -0
- package/dist/core/query/json.d.ts +2 -0
- package/dist/core/query/json.js +20 -0
- package/dist/core/query/lower +1 -0
- package/dist/core/query/lower.d.ts +14 -0
- package/dist/core/query/lower.js +121 -0
- package/dist/core/query/operators +1 -0
- package/dist/core/query/operators.d.ts +23 -0
- package/dist/core/query/operators.js +126 -0
- package/dist/core/query/params +1 -0
- package/dist/core/query/params.d.ts +15 -0
- package/dist/core/query/params.js +83 -0
- package/dist/core/query/plan +1 -0
- package/dist/core/query/plan.d.ts +110 -0
- package/dist/core/query/plan.js +0 -0
- package/dist/core/references/resolve +1 -0
- package/dist/core/references/resolve.d.ts +31 -0
- package/dist/core/references/resolve.js +121 -0
- package/dist/core/references/schema +1 -0
- package/dist/core/references/schema.d.ts +8 -0
- package/dist/core/references/schema.js +70 -0
- package/dist/core/result +1 -0
- package/dist/core/result.d.ts +27 -0
- package/dist/core/result.js +2 -0
- package/dist/features/collections/resolve +1 -0
- package/dist/features/collections/resolve.d.ts +63 -0
- package/dist/features/collections/resolve.js +76 -0
- package/dist/features/localization/config +1 -0
- package/dist/features/localization/config.d.ts +18 -0
- package/dist/features/localization/config.js +25 -0
- package/dist/features/localization/links +1 -0
- package/dist/features/localization/links.d.ts +1 -0
- package/dist/features/localization/links.js +69 -0
- package/dist/features/localization/path +1 -0
- package/dist/features/localization/path.d.ts +32 -0
- package/dist/features/localization/path.js +80 -0
- package/dist/features/localization/results +1 -0
- package/dist/features/localization/results.d.ts +42 -0
- package/dist/features/localization/results.js +149 -0
- package/dist/features/localization/translated-slugs +1 -0
- package/dist/features/localization/translated-slugs.d.ts +11 -0
- package/dist/features/localization/translated-slugs.js +80 -0
- package/dist/features/navigation/build +1 -0
- package/dist/features/navigation/build.d.ts +28 -0
- package/dist/features/navigation/build.js +104 -0
- package/dist/features/navigation/canonical +1 -0
- package/dist/features/navigation/canonical.d.ts +33 -0
- package/dist/features/navigation/canonical.js +149 -0
- package/dist/features/navigation/query +1 -0
- package/dist/features/navigation/query.d.ts +19 -0
- package/dist/features/navigation/query.js +51 -0
- package/dist/features/navigation/resolve +1 -0
- package/dist/features/navigation/resolve.d.ts +20 -0
- package/dist/features/navigation/resolve.js +79 -0
- package/dist/features/navigation/tree +1 -0
- package/dist/features/navigation/tree.d.ts +6 -0
- package/dist/features/navigation/tree.js +32 -0
- package/dist/features/search/navigation +1 -0
- package/dist/features/search/navigation.d.ts +6 -0
- package/dist/features/search/navigation.js +21 -0
- package/dist/features/search/sections +1 -0
- package/dist/features/search/sections.d.ts +21 -0
- package/dist/features/search/sections.js +98 -0
- package/dist/features/sitemap/query +1 -0
- package/dist/features/sitemap/query.d.ts +68 -0
- package/dist/features/sitemap/query.js +171 -0
- package/dist/integrations/nitro/context +1 -0
- package/dist/integrations/nitro/context.d.ts +63 -0
- package/dist/integrations/nitro/context.js +28 -0
- package/dist/integrations/nitro/ingest +1 -0
- package/dist/integrations/nitro/ingest.d.ts +18 -0
- package/dist/integrations/nitro/ingest.js +120 -0
- package/dist/integrations/nitro/preview +1 -0
- package/dist/integrations/nitro/preview.d.ts +5 -0
- package/dist/integrations/nitro/preview.js +21 -0
- package/dist/integrations/nitro/runtime-config +1 -0
- package/dist/integrations/nitro/runtime-config.d.ts +1 -0
- package/dist/integrations/nitro/runtime-config.js +4 -0
- package/dist/integrations/nitro/storage +1 -0
- package/dist/integrations/nitro/storage.d.ts +9 -0
- package/dist/integrations/nitro/storage.js +113 -0
- package/dist/integrations/vue/content-components +1 -0
- package/dist/integrations/vue/content-components.d.ts +24 -0
- package/dist/integrations/vue/content-components.js +67 -0
- package/dist/integrations/vue/html-tags +1 -0
- package/dist/integrations/vue/html-tags.d.ts +2 -0
- package/dist/integrations/vue/html-tags.js +119 -0
- package/dist/integrations/vue/markdown-refs +1 -0
- package/dist/integrations/vue/markdown-refs.d.ts +1 -0
- package/dist/integrations/vue/markdown-refs.js +1 -0
- package/dist/module.d.mts +2044 -0
- package/dist/module.json +12 -0
- package/dist/module.mjs +1381 -0
- package/dist/parsers/csv +1 -0
- package/dist/parsers/csv.d.ts +2 -0
- package/dist/parsers/csv.js +38 -0
- package/dist/parsers/from-csv +1 -0
- package/dist/parsers/from-csv.d.ts +20 -0
- package/dist/parsers/from-csv.js +85 -0
- package/dist/parsers/index +1 -0
- package/dist/parsers/index.d.ts +10 -0
- package/dist/parsers/index.js +50 -0
- package/dist/parsers/json +1 -0
- package/dist/parsers/json.d.ts +2 -0
- package/dist/parsers/json.js +29 -0
- package/dist/parsers/markdown +1 -0
- package/dist/parsers/markdown-plugins +1 -0
- package/dist/parsers/markdown-plugins.d.ts +3 -0
- package/dist/parsers/markdown-plugins.js +58 -0
- package/dist/parsers/markdown.d.ts +2 -0
- package/dist/parsers/markdown.js +64 -0
- package/dist/parsers/path-meta +1 -0
- package/dist/parsers/path-meta.d.ts +4 -0
- package/dist/parsers/path-meta.js +37 -0
- package/dist/parsers/utils +1 -0
- package/dist/parsers/utils.d.ts +2 -0
- package/dist/parsers/utils.js +3 -0
- package/dist/parsers/yaml +1 -0
- package/dist/parsers/yaml.d.ts +2 -0
- package/dist/parsers/yaml.js +19 -0
- package/dist/public/client +1 -0
- package/dist/public/client.d.ts +19 -0
- package/dist/public/client.js +26 -0
- package/dist/public/provider +1 -0
- package/dist/public/provider-errors +1 -0
- package/dist/public/provider-errors.d.ts +4 -0
- package/dist/public/provider-errors.js +28 -0
- package/dist/public/provider.d.ts +74 -0
- package/dist/public/provider.js +6 -0
- package/dist/public/server +1 -0
- package/dist/public/server.d.ts +19 -0
- package/dist/public/server.js +28 -0
- package/dist/runtime/app/components/ContentRenderer.d.vue.ts +62 -0
- package/dist/runtime/app/components/ContentRenderer.vue +84 -0
- package/dist/runtime/app/components/ContentRenderer.vue.d.ts +62 -0
- package/dist/runtime/app/components/ContentRendererInline.d.vue.ts +50 -0
- package/dist/runtime/app/components/ContentRendererInline.vue +97 -0
- package/dist/runtime/app/components/ContentRendererInline.vue.d.ts +50 -0
- package/dist/runtime/app/components/Prose/ProseCode.d.vue.ts +61 -0
- package/dist/runtime/app/components/Prose/ProseCode.vue +32 -0
- package/dist/runtime/app/components/Prose/ProseCode.vue.d.ts +61 -0
- package/dist/runtime/app/components/Prose/ProseCodeInline.d.vue.ts +13 -0
- package/dist/runtime/app/components/Prose/ProseCodeInline.vue +3 -0
- package/dist/runtime/app/components/Prose/ProseCodeInline.vue.d.ts +13 -0
- package/dist/runtime/app/components/Prose/ProseImg.d.vue.ts +59 -0
- package/dist/runtime/app/components/Prose/ProseImg.vue +59 -0
- package/dist/runtime/app/components/Prose/ProseImg.vue.d.ts +59 -0
- package/dist/runtime/app/components/Prose/ProsePre.d.vue.ts +79 -0
- package/dist/runtime/app/components/Prose/ProsePre.vue +42 -0
- package/dist/runtime/app/components/Prose/ProsePre.vue.d.ts +79 -0
- package/dist/runtime/app/components/internal/ContentRendererMarkdown.d.vue.ts +68 -0
- package/dist/runtime/app/components/internal/ContentRendererMarkdown.vue +99 -0
- package/dist/runtime/app/components/internal/ContentRendererMarkdown.vue.d.ts +68 -0
- package/dist/runtime/app/components/internal/MarkdownRenderer +1 -0
- package/dist/runtime/app/components/internal/MarkdownRenderer.d.ts +90 -0
- package/dist/runtime/app/components/internal/MarkdownRenderer.js +191 -0
- package/dist/runtime/app/composables/async-data +1 -0
- package/dist/runtime/app/composables/async-data.d.ts +2 -0
- package/dist/runtime/app/composables/async-data.js +4 -0
- package/dist/runtime/app/composables/content-i18n +1 -0
- package/dist/runtime/app/composables/content-i18n.d.ts +5 -0
- package/dist/runtime/app/composables/content-i18n.js +1 -0
- package/dist/runtime/app/composables/head +1 -0
- package/dist/runtime/app/composables/head.d.ts +11 -0
- package/dist/runtime/app/composables/head.js +98 -0
- package/dist/runtime/app/composables/locale +1 -0
- package/dist/runtime/app/composables/locale-context +1 -0
- package/dist/runtime/app/composables/locale-context.d.ts +5 -0
- package/dist/runtime/app/composables/locale-context.js +8 -0
- package/dist/runtime/app/composables/locale.d.ts +8 -0
- package/dist/runtime/app/composables/locale.js +15 -0
- package/dist/runtime/app/composables/navigation +1 -0
- package/dist/runtime/app/composables/navigation.d.ts +3 -0
- package/dist/runtime/app/composables/navigation.js +7 -0
- package/dist/runtime/app/composables/preview +1 -0
- package/dist/runtime/app/composables/preview.d.ts +5 -0
- package/dist/runtime/app/composables/preview.js +52 -0
- package/dist/runtime/app/composables/query-api +1 -0
- package/dist/runtime/app/composables/query-api.d.ts +27 -0
- package/dist/runtime/app/composables/query-api.js +46 -0
- package/dist/runtime/app/composables/route +1 -0
- package/dist/runtime/app/composables/route.d.ts +11 -0
- package/dist/runtime/app/composables/route.js +150 -0
- package/dist/runtime/app/composables/runtime +1 -0
- package/dist/runtime/app/composables/runtime.d.ts +2 -0
- package/dist/runtime/app/composables/runtime.js +7 -0
- package/dist/runtime/app/composables/search +1 -0
- package/dist/runtime/app/composables/search.d.ts +58 -0
- package/dist/runtime/app/composables/search.js +321 -0
- package/dist/runtime/app/composables/site-data +1 -0
- package/dist/runtime/app/composables/site-data.d.ts +12 -0
- package/dist/runtime/app/composables/site-data.js +12 -0
- package/dist/runtime/app/composables/toc +1 -0
- package/dist/runtime/app/composables/toc.d.ts +10 -0
- package/dist/runtime/app/composables/toc.js +31 -0
- package/dist/runtime/app/composables/use-content +1 -0
- package/dist/runtime/app/composables/use-content.d.ts +188 -0
- package/dist/runtime/app/composables/use-content.js +307 -0
- package/dist/runtime/app/composables/useUnwrap +1 -0
- package/dist/runtime/app/composables/useUnwrap.d.ts +8 -0
- package/dist/runtime/app/composables/useUnwrap.js +35 -0
- package/dist/runtime/app/composables/utils +1 -0
- package/dist/runtime/app/composables/utils.d.ts +22 -0
- package/dist/runtime/app/composables/utils.js +76 -0
- package/dist/runtime/app/composables/web-socket +1 -0
- package/dist/runtime/app/composables/web-socket.d.ts +3 -0
- package/dist/runtime/app/composables/web-socket.js +65 -0
- package/dist/runtime/app/pages/content.d.vue.ts +3 -0
- package/dist/runtime/app/pages/content.vue +14 -0
- package/dist/runtime/app/pages/content.vue.d.ts +3 -0
- package/dist/runtime/app/plugins/markdown-components +1 -0
- package/dist/runtime/app/plugins/markdown-components.d.ts +2 -0
- package/dist/runtime/app/plugins/markdown-components.js +19 -0
- package/dist/runtime/app/plugins/ws +1 -0
- package/dist/runtime/app/plugins/ws.d.ts +2 -0
- package/dist/runtime/app/plugins/ws.js +7 -0
- package/dist/runtime/app.d.vue.ts +3 -0
- package/dist/runtime/app.vue +3 -0
- package/dist/runtime/app.vue.d.ts +3 -0
- package/dist/runtime/markdown/plugins +1 -0
- package/dist/runtime/markdown/plugins.d.ts +3 -0
- package/dist/runtime/markdown/plugins.js +39 -0
- package/dist/runtime/query/public-limits +1 -0
- package/dist/runtime/query/public-limits.d.ts +2 -0
- package/dist/runtime/query/public-limits.js +2 -0
- package/dist/runtime/query/resolve +1 -0
- package/dist/runtime/query/resolve.d.ts +5 -0
- package/dist/runtime/query/resolve.js +9 -0
- package/dist/runtime/query/routes +1 -0
- package/dist/runtime/query/routes.d.ts +33 -0
- package/dist/runtime/query/routes.js +21 -0
- package/dist/runtime/query/unified +1 -0
- package/dist/runtime/query/unified.d.ts +94 -0
- package/dist/runtime/query/unified.js +473 -0
- package/dist/runtime/server/api/cache +1 -0
- package/dist/runtime/server/api/cache.d.ts +8 -0
- package/dist/runtime/server/api/cache.js +26 -0
- package/dist/runtime/server/api/locales +1 -0
- package/dist/runtime/server/api/locales.d.ts +6 -0
- package/dist/runtime/server/api/locales.js +28 -0
- package/dist/runtime/server/api/navigation +1 -0
- package/dist/runtime/server/api/navigation.d.ts +2 -0
- package/dist/runtime/server/api/navigation.js +21 -0
- package/dist/runtime/server/api/query +1 -0
- package/dist/runtime/server/api/query.d.ts +2 -0
- package/dist/runtime/server/api/query.js +6 -0
- package/dist/runtime/server/api/revalidate +1 -0
- package/dist/runtime/server/api/revalidate.d.ts +6 -0
- package/dist/runtime/server/api/revalidate.js +156 -0
- package/dist/runtime/server/api/search +1 -0
- package/dist/runtime/server/api/search-index +1 -0
- package/dist/runtime/server/api/search-index.d.ts +2 -0
- package/dist/runtime/server/api/search-index.js +20 -0
- package/dist/runtime/server/api/search.d.ts +2 -0
- package/dist/runtime/server/api/search.js +40 -0
- package/dist/runtime/server/api/site-data +1 -0
- package/dist/runtime/server/api/site-data.d.ts +2 -0
- package/dist/runtime/server/api/site-data.js +22 -0
- package/dist/runtime/server/api/sitemap +1 -0
- package/dist/runtime/server/api/sitemap.d.ts +2 -0
- package/dist/runtime/server/api/sitemap.js +11 -0
- package/dist/runtime/server/cache-adapter +1 -0
- package/dist/runtime/server/cache-adapter.d.ts +2 -0
- package/dist/runtime/server/cache-adapter.js +11 -0
- package/dist/runtime/server/cache-adapters +1 -0
- package/dist/runtime/server/cache-adapters.d.ts +9 -0
- package/dist/runtime/server/cache-adapters.js +50 -0
- package/dist/runtime/server/cache-hints +1 -0
- package/dist/runtime/server/cache-hints.d.ts +5 -0
- package/dist/runtime/server/cache-hints.js +17 -0
- package/dist/runtime/server/collection-helpers +1 -0
- package/dist/runtime/server/collection-helpers.d.ts +13 -0
- package/dist/runtime/server/collection-helpers.js +99 -0
- package/dist/runtime/server/index +1 -0
- package/dist/runtime/server/index.d.ts +9 -0
- package/dist/runtime/server/index.js +15 -0
- package/dist/runtime/server/manifest +1 -0
- package/dist/runtime/server/manifest.d.ts +1 -0
- package/dist/runtime/server/manifest.js +1 -0
- package/dist/runtime/server/navigation +1 -0
- package/dist/runtime/server/navigation-query +1 -0
- package/dist/runtime/server/navigation-query.d.ts +4 -0
- package/dist/runtime/server/navigation-query.js +80 -0
- package/dist/runtime/server/navigation.d.ts +2 -0
- package/dist/runtime/server/navigation.js +9 -0
- package/dist/runtime/server/pagefind +1 -0
- package/dist/runtime/server/pagefind.d.ts +2 -0
- package/dist/runtime/server/pagefind.js +30 -0
- package/dist/runtime/server/plugins/cache +1 -0
- package/dist/runtime/server/plugins/cache.d.ts +2 -0
- package/dist/runtime/server/plugins/cache.js +17 -0
- package/dist/runtime/server/plugins/sitemap +1 -0
- package/dist/runtime/server/plugins/sitemap.d.ts +2 -0
- package/dist/runtime/server/plugins/sitemap.js +25 -0
- package/dist/runtime/server/preview +1 -0
- package/dist/runtime/server/preview.d.ts +1 -0
- package/dist/runtime/server/preview.js +1 -0
- package/dist/runtime/server/provider-query +1 -0
- package/dist/runtime/server/provider-query.d.ts +27 -0
- package/dist/runtime/server/provider-query.js +131 -0
- package/dist/runtime/server/provider-result +1 -0
- package/dist/runtime/server/provider-result.d.ts +10 -0
- package/dist/runtime/server/provider-result.js +30 -0
- package/dist/runtime/server/providers/filesystem +1 -0
- package/dist/runtime/server/providers/filesystem.d.ts +2 -0
- package/dist/runtime/server/providers/filesystem.js +47 -0
- package/dist/runtime/server/providers/index +1 -0
- package/dist/runtime/server/providers/index.d.ts +3 -0
- package/dist/runtime/server/providers/index.js +190 -0
- package/dist/runtime/server/query-api +1 -0
- package/dist/runtime/server/query-api.d.ts +28 -0
- package/dist/runtime/server/query-api.js +54 -0
- package/dist/runtime/server/query-executor +1 -0
- package/dist/runtime/server/query-executor.d.ts +4 -0
- package/dist/runtime/server/query-executor.js +121 -0
- package/dist/runtime/server/runtime-config +1 -0
- package/dist/runtime/server/runtime-config.d.ts +1 -0
- package/dist/runtime/server/runtime-config.js +1 -0
- package/dist/runtime/server/search +1 -0
- package/dist/runtime/server/search.d.ts +18 -0
- package/dist/runtime/server/search.js +134 -0
- package/dist/runtime/server/sitemap +1 -0
- package/dist/runtime/server/sitemap-provider +1 -0
- package/dist/runtime/server/sitemap-provider.d.ts +10 -0
- package/dist/runtime/server/sitemap-provider.js +11 -0
- package/dist/runtime/server/sitemap.d.ts +6 -0
- package/dist/runtime/server/sitemap.js +45 -0
- package/dist/runtime/server/storage +1 -0
- package/dist/runtime/server/storage-access +1 -0
- package/dist/runtime/server/storage-access.d.ts +1 -0
- package/dist/runtime/server/storage-access.js +9 -0
- package/dist/runtime/server/storage.d.ts +2 -0
- package/dist/runtime/server/storage.js +2 -0
- package/dist/runtime/server/validation +1 -0
- package/dist/runtime/server/validation.d.ts +1 -0
- package/dist/runtime/server/validation.js +6 -0
- package/dist/runtime/shared/search +1 -0
- package/dist/runtime/shared/search.d.ts +2 -0
- package/dist/runtime/shared/search.js +89 -0
- package/dist/runtime/transformers/component-resolver +1 -0
- package/dist/runtime/transformers/component-resolver.d.ts +10 -0
- package/dist/runtime/transformers/component-resolver.js +30 -0
- package/dist/runtime/transformers/csv/from-csv +1 -0
- package/dist/runtime/transformers/csv/from-csv.d.ts +1 -0
- package/dist/runtime/transformers/csv/from-csv.js +1 -0
- package/dist/runtime/transformers/csv/index +1 -0
- package/dist/runtime/transformers/csv/index.d.ts +1 -0
- package/dist/runtime/transformers/csv/index.js +1 -0
- package/dist/runtime/transformers/define +1 -0
- package/dist/runtime/transformers/define.d.ts +1 -0
- package/dist/runtime/transformers/define.js +1 -0
- package/dist/runtime/transformers/index +1 -0
- package/dist/runtime/transformers/index.d.ts +1 -0
- package/dist/runtime/transformers/index.js +1 -0
- package/dist/runtime/transformers/json +1 -0
- package/dist/runtime/transformers/json.d.ts +1 -0
- package/dist/runtime/transformers/json.js +1 -0
- package/dist/runtime/transformers/markdown +1 -0
- package/dist/runtime/transformers/markdown.d.ts +1 -0
- package/dist/runtime/transformers/markdown.js +1 -0
- package/dist/runtime/transformers/path-meta +1 -0
- package/dist/runtime/transformers/path-meta.d.ts +2 -0
- package/dist/runtime/transformers/path-meta.js +2 -0
- package/dist/runtime/transformers/utils +1 -0
- package/dist/runtime/transformers/utils.d.ts +1 -0
- package/dist/runtime/transformers/utils.js +1 -0
- package/dist/runtime/transformers/yaml +1 -0
- package/dist/runtime/transformers/yaml.d.ts +1 -0
- package/dist/runtime/transformers/yaml.js +1 -0
- package/dist/runtime/utils/content-components +1 -0
- package/dist/runtime/utils/content-components.d.ts +9 -0
- package/dist/runtime/utils/content-components.js +16 -0
- package/dist/runtime/utils/query +1 -0
- package/dist/runtime/utils/query.d.ts +5 -0
- package/dist/runtime/utils/query.js +18 -0
- package/dist/runtime/virtual/transformers.d.ts +4 -0
- package/dist/runtime/virtual.d.ts +7 -0
- package/dist/storage/cache +1 -0
- package/dist/storage/cache.d.ts +32 -0
- package/dist/storage/cache.js +42 -0
- package/dist/storage/content +1 -0
- package/dist/storage/content.d.ts +41 -0
- package/dist/storage/content.js +86 -0
- package/dist/storage/contents +1 -0
- package/dist/storage/contents.d.ts +5 -0
- package/dist/storage/contents.js +116 -0
- package/dist/storage/driver +1 -0
- package/dist/storage/driver.d.ts +28 -0
- package/dist/storage/driver.js +22 -0
- package/dist/storage/graph +1 -0
- package/dist/storage/graph.d.ts +3 -0
- package/dist/storage/graph.js +14 -0
- package/dist/storage/manifest +1 -0
- package/dist/storage/manifest.d.ts +18 -0
- package/dist/storage/manifest.js +68 -0
- package/dist/storage/references +1 -0
- package/dist/storage/references.d.ts +13 -0
- package/dist/storage/references.js +78 -0
- package/dist/storage/validation +1 -0
- package/dist/storage/validation.d.ts +46 -0
- package/dist/storage/validation.js +341 -0
- package/dist/testing/provider-contract +1 -0
- package/dist/testing/provider-contract.d.ts +31 -0
- package/dist/testing/provider-contract.js +237 -0
- package/dist/testing/provider-fixture +1 -0
- package/dist/testing/provider-fixture.d.ts +65 -0
- package/dist/testing/provider-fixture.js +606 -0
- package/dist/types/api +1 -0
- package/dist/types/api.d.ts +47 -0
- package/dist/types/api.js +1 -0
- package/dist/types/config +1 -0
- package/dist/types/config.d.ts +281 -0
- package/dist/types/config.js +28 -0
- package/dist/types/content +1 -0
- package/dist/types/content.d.ts +311 -0
- package/dist/types/content.js +1 -0
- package/dist/types/fields +1 -0
- package/dist/types/fields.d.ts +81 -0
- package/dist/types/fields.js +146 -0
- package/dist/types/index +1 -0
- package/dist/types/index.d.ts +6 -0
- package/dist/types/index.js +6 -0
- package/dist/types/module +1 -0
- package/dist/types/module.d.ts +428 -0
- package/dist/types/module.js +0 -0
- package/dist/types/picomatch.d.ts +8 -0
- package/dist/types/query +1 -0
- package/dist/types/query.d.ts +862 -0
- package/dist/types/query.js +1 -0
- package/dist/types/reference +1 -0
- package/dist/types/reference.d.ts +1 -0
- package/dist/types/reference.js +1 -0
- package/dist/types/runtime +1 -0
- package/dist/types/runtime.d.ts +45 -0
- package/dist/types/runtime.js +1 -0
- package/dist/types/search +1 -0
- package/dist/types/search.d.ts +64 -0
- package/dist/types/search.js +0 -0
- package/dist/types/virtual.d.ts +19 -0
- package/dist/types.d.mts +11 -0
- package/dist/web-types.json +466 -0
- package/package.json +135 -0
|
@@ -0,0 +1,862 @@
|
|
|
1
|
+
import type { ContentQueryResponse } from './api';
|
|
2
|
+
import type { ContentCollectionHandle } from './config';
|
|
3
|
+
import type { ContentNavigationItem, ParsedContent, ParsedContentInternalMeta, ParsedContentMeta, StrictParsedContentMeta } from './content';
|
|
4
|
+
/**
|
|
5
|
+
* Query
|
|
6
|
+
*/
|
|
7
|
+
export interface ContentQuerySortParams {
|
|
8
|
+
/**
|
|
9
|
+
* Locale specifier for sorting
|
|
10
|
+
* A string with a BCP 47 language tag
|
|
11
|
+
*
|
|
12
|
+
* @default undefined
|
|
13
|
+
*/
|
|
14
|
+
$locale?: string;
|
|
15
|
+
/**
|
|
16
|
+
* Whether numeric collation should be used, such that "1" < "2" < "10".
|
|
17
|
+
* Possible values are `true` and `false`;
|
|
18
|
+
*
|
|
19
|
+
* @default false
|
|
20
|
+
*/
|
|
21
|
+
$numeric?: boolean;
|
|
22
|
+
/**
|
|
23
|
+
* Whether upper case or lower case should sort first.
|
|
24
|
+
* Possible values are `"upper"`, `"lower"`, or `"false"`
|
|
25
|
+
*
|
|
26
|
+
* @default "depends on locale"
|
|
27
|
+
*/
|
|
28
|
+
$caseFirst?: 'upper' | 'lower' | 'false';
|
|
29
|
+
/**
|
|
30
|
+
* Which differences in the strings should lead to non-zero result values. Possible values are:
|
|
31
|
+
* - "base": Only strings that differ in base letters compare as unequal. Examples: a ≠ b, a = á, a = A.
|
|
32
|
+
* - "accent": Only strings that differ in base letters or accents and other diacritic marks compare as unequal. Examples: a ≠ b, a ≠ á, a = A.
|
|
33
|
+
* - "case": Only strings that differ in base letters or case compare as unequal. Examples: a ≠ b, a = á, a ≠ A.
|
|
34
|
+
* - "variant": Strings that differ in base letters, accents and other diacritic marks, or case compare as unequal. Other differences may also be taken into consideration. Examples: a ≠ b, a ≠ á, a ≠ A.
|
|
35
|
+
*
|
|
36
|
+
* @default "variant"
|
|
37
|
+
*/
|
|
38
|
+
$sensitivity?: 'base' | 'accent' | 'case' | 'variant';
|
|
39
|
+
}
|
|
40
|
+
export interface ContentQuerySortFields {
|
|
41
|
+
[field: string]: -1 | 1;
|
|
42
|
+
}
|
|
43
|
+
export type ContentQuerySortOptions = ContentQuerySortParams | ContentQuerySortFields;
|
|
44
|
+
/**
|
|
45
|
+
* @internal
|
|
46
|
+
*/
|
|
47
|
+
export interface ContentQueryBuilderWhere extends Partial<Record<keyof ParsedContentInternalMeta, string | number | boolean | RegExp | ContentQueryBuilderWhere>> {
|
|
48
|
+
/**
|
|
49
|
+
* Match only if all nested conditions are true.
|
|
50
|
+
**/
|
|
51
|
+
$and?: ContentQueryBuilderWhere[];
|
|
52
|
+
/**
|
|
53
|
+
* Match if any nested condition is true.
|
|
54
|
+
**/
|
|
55
|
+
$or?: ContentQueryBuilderWhere[];
|
|
56
|
+
/**
|
|
57
|
+
* Match when the nested condition is false.
|
|
58
|
+
**/
|
|
59
|
+
$not?: string | number | boolean | RegExp | ContentQueryBuilderWhere;
|
|
60
|
+
/**
|
|
61
|
+
* Match if item equals condition.
|
|
62
|
+
**/
|
|
63
|
+
$eq?: string | number | boolean | RegExp;
|
|
64
|
+
/**
|
|
65
|
+
* Match if item does not equal condition.
|
|
66
|
+
**/
|
|
67
|
+
$ne?: string | number | boolean | RegExp;
|
|
68
|
+
/**
|
|
69
|
+
* Check if item is greater than condition.
|
|
70
|
+
*/
|
|
71
|
+
$gt?: number | string;
|
|
72
|
+
/**
|
|
73
|
+
* Check if item is greater than or equal to condition.
|
|
74
|
+
*/
|
|
75
|
+
$gte?: number | string;
|
|
76
|
+
/**
|
|
77
|
+
* Check if item is less than condition.
|
|
78
|
+
*/
|
|
79
|
+
$lt?: number | string;
|
|
80
|
+
/**
|
|
81
|
+
* Check if item is less than or equal to condition.
|
|
82
|
+
*/
|
|
83
|
+
$lte?: number | string;
|
|
84
|
+
/**
|
|
85
|
+
* Provides regular expression capabilities for pattern matching strings.
|
|
86
|
+
*/
|
|
87
|
+
$regex?: RegExp | string;
|
|
88
|
+
/**
|
|
89
|
+
* Match when a string field starts with the given prefix.
|
|
90
|
+
*/
|
|
91
|
+
$prefix?: string;
|
|
92
|
+
/**
|
|
93
|
+
* Match if type of item equals condition.
|
|
94
|
+
*/
|
|
95
|
+
$type?: string;
|
|
96
|
+
/**
|
|
97
|
+
* Check key existence.
|
|
98
|
+
*/
|
|
99
|
+
$exists?: boolean;
|
|
100
|
+
/**
|
|
101
|
+
* Match if item contains every condition or every rule in the condition array.
|
|
102
|
+
**/
|
|
103
|
+
$contains?: Array<string | number | boolean> | string | number | boolean;
|
|
104
|
+
/**
|
|
105
|
+
* Match if item contains at least one rule from the condition array.
|
|
106
|
+
*/
|
|
107
|
+
$containsAny?: Array<string | number | boolean>;
|
|
108
|
+
/**
|
|
109
|
+
* Ignore case when checking string containment.
|
|
110
|
+
**/
|
|
111
|
+
$icontains?: string;
|
|
112
|
+
/**
|
|
113
|
+
* Match if item is in condition array.
|
|
114
|
+
**/
|
|
115
|
+
$in?: Array<string | number | boolean>;
|
|
116
|
+
[key: string]: string | number | boolean | RegExp | ContentQueryBuilderWhere | Array<string | number | boolean | ContentQueryBuilderWhere> | undefined;
|
|
117
|
+
}
|
|
118
|
+
/**
|
|
119
|
+
* @internal
|
|
120
|
+
*/
|
|
121
|
+
export interface ContentQueryBuilderParams {
|
|
122
|
+
collection?: string;
|
|
123
|
+
first?: boolean;
|
|
124
|
+
skip?: number;
|
|
125
|
+
limit?: number;
|
|
126
|
+
only?: string[];
|
|
127
|
+
without?: string[];
|
|
128
|
+
sort?: ContentQuerySortOptions[];
|
|
129
|
+
where?: ContentQueryBuilderWhere[] | ContentQueryBuilderWhere;
|
|
130
|
+
canonical?: boolean;
|
|
131
|
+
navigationFields?: string[];
|
|
132
|
+
resolveLocale?: {
|
|
133
|
+
locale?: string;
|
|
134
|
+
fallback?: string[] | boolean;
|
|
135
|
+
exact?: boolean;
|
|
136
|
+
};
|
|
137
|
+
[key: string]: unknown;
|
|
138
|
+
}
|
|
139
|
+
type QueryScalar = string | number | boolean | Date;
|
|
140
|
+
type InternalQueryKeys = Extract<keyof ParsedContentInternalMeta, `_${string}`>;
|
|
141
|
+
type CollectionQueryKey<T> = Extract<keyof T, string> | InternalQueryKeys;
|
|
142
|
+
type CollectionQueryField<T> = CollectionQueryKey<T>;
|
|
143
|
+
type CollectionQueryFieldValue<T, K extends CollectionQueryField<T>> = K extends keyof T ? NonNullable<T[K]> : K extends InternalQueryKeys ? NonNullable<ParsedContentInternalMeta[K]> : never;
|
|
144
|
+
type EqualityValue<T> = T extends QueryScalar ? T | RegExp : T;
|
|
145
|
+
type ComparableValue<T> = T extends string | number | Date ? T : never;
|
|
146
|
+
type MembershipValue<T> = T extends Array<infer U> ? Array<U> : T extends QueryScalar ? Array<T> : never;
|
|
147
|
+
type ContainsValue<T> = T extends string ? string : T extends Array<infer U> ? U | Array<U> : never;
|
|
148
|
+
type ContainsAnyValue<T> = T extends Array<infer U> ? Array<U> : never;
|
|
149
|
+
type RegexValue<T> = T extends string ? RegExp | string : never;
|
|
150
|
+
type IContainsValue<T> = T extends string ? string : never;
|
|
151
|
+
type TypeValue = 'string' | 'number' | 'boolean' | 'object' | 'undefined';
|
|
152
|
+
export type CollectionQueryOperator<T> = '=' | '!=' | 'EXISTS' | 'TYPE' | (ComparableValue<T> extends never ? never : '>' | '>=' | '<' | '<=') | (MembershipValue<T> extends never ? never : 'IN' | 'NOT IN') | (ContainsValue<T> extends never ? never : 'CONTAINS') | (ContainsAnyValue<T> extends never ? never : 'CONTAINS_ANY') | (RegexValue<T> extends never ? never : 'REGEX') | (IContainsValue<T> extends never ? never : 'ICONTAINS');
|
|
153
|
+
export type CollectionQueryValue<T, O extends CollectionQueryOperator<T>> = O extends '=' | '!=' ? EqualityValue<T> : O extends '>' | '>=' | '<' | '<=' ? ComparableValue<T> : O extends 'IN' | 'NOT IN' ? MembershipValue<T> : O extends 'CONTAINS' ? ContainsValue<T> : O extends 'CONTAINS_ANY' ? ContainsAnyValue<T> : O extends 'REGEX' ? RegexValue<T> : O extends 'ICONTAINS' ? IContainsValue<T> : O extends 'EXISTS' ? boolean | undefined : O extends 'TYPE' ? TypeValue : never;
|
|
154
|
+
export type QueryOrderDirection = 'ASC' | 'DESC';
|
|
155
|
+
export interface QueryOrderOptions {
|
|
156
|
+
/**
|
|
157
|
+
* BCP 47 locale passed to `Intl.Collator` for string ordering.
|
|
158
|
+
*/
|
|
159
|
+
locale?: string;
|
|
160
|
+
/**
|
|
161
|
+
* Enable numeric ordering so `"2"` sorts before `"10"`.
|
|
162
|
+
*/
|
|
163
|
+
numeric?: boolean;
|
|
164
|
+
/**
|
|
165
|
+
* Control whether upper- or lower-case letters sort first.
|
|
166
|
+
*/
|
|
167
|
+
caseFirst?: ContentQuerySortParams['$caseFirst'];
|
|
168
|
+
/**
|
|
169
|
+
* Collation sensitivity used by string comparison.
|
|
170
|
+
*/
|
|
171
|
+
sensitivity?: ContentQuerySortParams['$sensitivity'];
|
|
172
|
+
}
|
|
173
|
+
/**
|
|
174
|
+
* Builder passed to grouped `andWhere` / `orWhere` callbacks.
|
|
175
|
+
*/
|
|
176
|
+
export interface QueryGroupBuilder<T = ParsedContentMeta> {
|
|
177
|
+
where<K extends CollectionQueryField<T>, O extends CollectionQueryOperator<CollectionQueryFieldValue<T, K>>>(field: K, operator: O, value?: CollectionQueryValue<CollectionQueryFieldValue<T, K>, O>): QueryGroupBuilder<T>;
|
|
178
|
+
andWhere(groupFactory: QueryGroupFunction<T>): QueryGroupBuilder<T>;
|
|
179
|
+
orWhere(groupFactory: QueryGroupFunction<T>): QueryGroupBuilder<T>;
|
|
180
|
+
}
|
|
181
|
+
/**
|
|
182
|
+
* Factory used to build grouped nested conditions.
|
|
183
|
+
*/
|
|
184
|
+
export type QueryGroupFunction<T = ParsedContentMeta> = (group: QueryGroupBuilder<T>) => QueryGroupBuilder<T>;
|
|
185
|
+
/**
|
|
186
|
+
* Options for locale-aware navigation queries.
|
|
187
|
+
*/
|
|
188
|
+
export interface ContentCollectionNavigationOptions<TField extends string = string> {
|
|
189
|
+
/**
|
|
190
|
+
* Extra document fields to merge onto each returned navigation item.
|
|
191
|
+
*/
|
|
192
|
+
fields?: TField[];
|
|
193
|
+
/**
|
|
194
|
+
* Locale to resolve against for translated collections.
|
|
195
|
+
*/
|
|
196
|
+
locale?: string;
|
|
197
|
+
/**
|
|
198
|
+
* When `true`, keep canonical paths instead of locale-prefixed paths.
|
|
199
|
+
*/
|
|
200
|
+
canonical?: boolean;
|
|
201
|
+
}
|
|
202
|
+
/**
|
|
203
|
+
* Options for previous/next navigation helpers.
|
|
204
|
+
*/
|
|
205
|
+
export type ContentCollectionItemSurroundingsOptions<TField extends string = string> = ContentCollectionNavigationOptions<TField>;
|
|
206
|
+
/**
|
|
207
|
+
* Options for extracting searchable sections from collection pages.
|
|
208
|
+
*/
|
|
209
|
+
export interface ContentCollectionSearchSectionsOptions {
|
|
210
|
+
/**
|
|
211
|
+
* Tags ignored while flattening page content into search text.
|
|
212
|
+
*/
|
|
213
|
+
ignoredTags?: string[];
|
|
214
|
+
/**
|
|
215
|
+
* Extra top-level fields copied from each page onto every emitted section.
|
|
216
|
+
*/
|
|
217
|
+
extraFields?: string[];
|
|
218
|
+
/**
|
|
219
|
+
* Query predicate applied before extracting searchable sections.
|
|
220
|
+
*/
|
|
221
|
+
filterQuery?: ContentQueryBuilderWhere;
|
|
222
|
+
/**
|
|
223
|
+
* Lowest heading level that starts a new section.
|
|
224
|
+
*/
|
|
225
|
+
minHeading?: `h${1 | 2 | 3 | 4 | 5 | 6}`;
|
|
226
|
+
/**
|
|
227
|
+
* Highest heading level that starts a new section.
|
|
228
|
+
*/
|
|
229
|
+
maxHeading?: `h${1 | 2 | 3 | 4 | 5 | 6}`;
|
|
230
|
+
/**
|
|
231
|
+
* Locale to resolve against for translated collections.
|
|
232
|
+
*/
|
|
233
|
+
locale?: string;
|
|
234
|
+
/**
|
|
235
|
+
* When `true`, keep canonical paths instead of locale-prefixed paths.
|
|
236
|
+
*/
|
|
237
|
+
canonical?: boolean;
|
|
238
|
+
}
|
|
239
|
+
/**
|
|
240
|
+
* Options for locale-aware page resolution.
|
|
241
|
+
*/
|
|
242
|
+
export interface ContentCollectionPageOptions {
|
|
243
|
+
/**
|
|
244
|
+
* Preferred locale to resolve.
|
|
245
|
+
*/
|
|
246
|
+
locale?: string;
|
|
247
|
+
/**
|
|
248
|
+
* Enable or customize locale fallback resolution.
|
|
249
|
+
*
|
|
250
|
+
* Pass `true` to use configured fallbacks, or an explicit locale list to
|
|
251
|
+
* override the configured chain for this query.
|
|
252
|
+
*/
|
|
253
|
+
fallback?: string[] | boolean;
|
|
254
|
+
/**
|
|
255
|
+
* When `true`, keep canonical paths in the returned route metadata.
|
|
256
|
+
*/
|
|
257
|
+
canonical?: boolean;
|
|
258
|
+
}
|
|
259
|
+
/**
|
|
260
|
+
* Options for route metadata resolution without loading full page content.
|
|
261
|
+
*/
|
|
262
|
+
export interface ContentCollectionRouteMetaOptions {
|
|
263
|
+
/**
|
|
264
|
+
* Preferred locale to resolve.
|
|
265
|
+
*/
|
|
266
|
+
locale?: string;
|
|
267
|
+
/**
|
|
268
|
+
* Enable or customize locale fallback resolution.
|
|
269
|
+
*/
|
|
270
|
+
fallback?: string[] | boolean;
|
|
271
|
+
}
|
|
272
|
+
/**
|
|
273
|
+
* Options for resolving an authored reference value into a document.
|
|
274
|
+
*/
|
|
275
|
+
export interface ResolveContentReferenceOptions {
|
|
276
|
+
/**
|
|
277
|
+
* Preferred locale to resolve.
|
|
278
|
+
*/
|
|
279
|
+
locale?: string;
|
|
280
|
+
/**
|
|
281
|
+
* Enable or customize locale fallback resolution.
|
|
282
|
+
*/
|
|
283
|
+
fallback?: string[] | boolean;
|
|
284
|
+
/**
|
|
285
|
+
* When `true`, require an exact locale match and skip fallback lookup.
|
|
286
|
+
*/
|
|
287
|
+
exact?: boolean;
|
|
288
|
+
/**
|
|
289
|
+
* Restrict resolution to a single collection.
|
|
290
|
+
*/
|
|
291
|
+
collection?: string;
|
|
292
|
+
}
|
|
293
|
+
/**
|
|
294
|
+
* Locale variant entry returned by the internal locale-variant endpoint.
|
|
295
|
+
*/
|
|
296
|
+
export interface ContentLocaleEntry {
|
|
297
|
+
/**
|
|
298
|
+
* Stable locale-agnostic identity shared by every translated variant.
|
|
299
|
+
*/
|
|
300
|
+
canonicalKey: string;
|
|
301
|
+
/**
|
|
302
|
+
* Locale code for the matching variant.
|
|
303
|
+
*/
|
|
304
|
+
locale: string;
|
|
305
|
+
/**
|
|
306
|
+
* Resolved route path for the variant, when the variant is routable.
|
|
307
|
+
*/
|
|
308
|
+
path?: string;
|
|
309
|
+
}
|
|
310
|
+
/**
|
|
311
|
+
* Route metadata for a single locale variant of a page.
|
|
312
|
+
*/
|
|
313
|
+
export interface ContentLocaleRoute {
|
|
314
|
+
locale: string;
|
|
315
|
+
path: string;
|
|
316
|
+
canonicalPath: string;
|
|
317
|
+
}
|
|
318
|
+
/**
|
|
319
|
+
* One entry in the per-locale path map attached to a localized document.
|
|
320
|
+
*
|
|
321
|
+
* `translated` is `true` when a concrete variant exists in that locale, `false`
|
|
322
|
+
* when the resolver fell back to another locale's path. `fallback` names the
|
|
323
|
+
* locale that supplied the path when `translated` is false.
|
|
324
|
+
*/
|
|
325
|
+
export interface LocalePathEntry {
|
|
326
|
+
/**
|
|
327
|
+
* Locale-prefixed route path (the URL the user navigates to).
|
|
328
|
+
*/
|
|
329
|
+
path: string;
|
|
330
|
+
/**
|
|
331
|
+
* `true` when this locale has its own variant; `false` when the path was
|
|
332
|
+
* supplied by a fallback locale.
|
|
333
|
+
*/
|
|
334
|
+
translated: boolean;
|
|
335
|
+
/**
|
|
336
|
+
* Locale that backed this entry when `translated` is `false`.
|
|
337
|
+
*/
|
|
338
|
+
fallback?: string;
|
|
339
|
+
}
|
|
340
|
+
/**
|
|
341
|
+
* Public resolution metadata attached to localized content results.
|
|
342
|
+
*
|
|
343
|
+
* Internal `_requestedLocale`, `_resolvedLocale`, and `_fallback` fields remain
|
|
344
|
+
* storage/query implementation details. UI code should read this object.
|
|
345
|
+
*/
|
|
346
|
+
export interface ContentResolvedMeta {
|
|
347
|
+
/**
|
|
348
|
+
* Locale of the concrete content variant that backed this result.
|
|
349
|
+
*/
|
|
350
|
+
locale: string;
|
|
351
|
+
/**
|
|
352
|
+
* Locale requested by the caller, when locale resolution was part of the
|
|
353
|
+
* query.
|
|
354
|
+
*/
|
|
355
|
+
requestedLocale?: string;
|
|
356
|
+
/**
|
|
357
|
+
* `true` when the concrete content variant came from a different locale than
|
|
358
|
+
* the requested locale.
|
|
359
|
+
*/
|
|
360
|
+
fallback: boolean;
|
|
361
|
+
/**
|
|
362
|
+
* Locale that supplied the content when `fallback` is true.
|
|
363
|
+
*/
|
|
364
|
+
fallbackLocale?: string;
|
|
365
|
+
/**
|
|
366
|
+
* Public route path returned to the user.
|
|
367
|
+
*/
|
|
368
|
+
path: string;
|
|
369
|
+
/**
|
|
370
|
+
* Requested route path before locale fallback, when known.
|
|
371
|
+
*/
|
|
372
|
+
requestedPath?: string;
|
|
373
|
+
/**
|
|
374
|
+
* Requested public route before locale fallback, when known.
|
|
375
|
+
*/
|
|
376
|
+
requestedRoute?: string;
|
|
377
|
+
/**
|
|
378
|
+
* Requested authored ref before locale fallback, when known.
|
|
379
|
+
*/
|
|
380
|
+
requestedRef?: string;
|
|
381
|
+
/**
|
|
382
|
+
* Locales that have concrete variants for this content identity.
|
|
383
|
+
*/
|
|
384
|
+
availableLocales: string[];
|
|
385
|
+
}
|
|
386
|
+
/**
|
|
387
|
+
* Locale-aware routing metadata attached to route-backed page payloads.
|
|
388
|
+
*/
|
|
389
|
+
export interface ContentRouteMeta {
|
|
390
|
+
locale: string;
|
|
391
|
+
defaultLocale: string;
|
|
392
|
+
path: string;
|
|
393
|
+
canonicalPath: string;
|
|
394
|
+
variants: ContentLocaleRoute[];
|
|
395
|
+
/**
|
|
396
|
+
* Map of every configured locale to its localized path. Includes a
|
|
397
|
+
* `translated` flag and a `fallback` source when a locale has no variant.
|
|
398
|
+
*/
|
|
399
|
+
localePaths: Record<string, LocalePathEntry>;
|
|
400
|
+
/**
|
|
401
|
+
* Public explanation of the locale/path resolution used for this result.
|
|
402
|
+
*/
|
|
403
|
+
resolved: ContentResolvedMeta;
|
|
404
|
+
}
|
|
405
|
+
/**
|
|
406
|
+
* Full page payload returned by route-aware unified query helpers and internal route helpers.
|
|
407
|
+
*/
|
|
408
|
+
export type ContentPageResult<T = ParsedContentMeta> = T & ContentRouteMeta & {
|
|
409
|
+
/**
|
|
410
|
+
* Locale-agnostic path stem derived from the source file.
|
|
411
|
+
*/
|
|
412
|
+
stem: string;
|
|
413
|
+
/**
|
|
414
|
+
* Source file extension when it can be inferred.
|
|
415
|
+
*/
|
|
416
|
+
extension?: string;
|
|
417
|
+
};
|
|
418
|
+
/**
|
|
419
|
+
* Alternate locale entry used in sitemap output.
|
|
420
|
+
*/
|
|
421
|
+
export interface ContentSitemapAlternative {
|
|
422
|
+
hreflang: string;
|
|
423
|
+
href: string;
|
|
424
|
+
}
|
|
425
|
+
/**
|
|
426
|
+
* Sitemap image entry discovered from page content or metadata.
|
|
427
|
+
*/
|
|
428
|
+
export interface ContentSitemapImage {
|
|
429
|
+
loc: string;
|
|
430
|
+
}
|
|
431
|
+
/**
|
|
432
|
+
* Sitemap entry produced by `queryCollectionsSitemapEntries`.
|
|
433
|
+
*/
|
|
434
|
+
export interface ContentSitemapEntry {
|
|
435
|
+
loc: string;
|
|
436
|
+
_sitemap?: string;
|
|
437
|
+
alternatives?: ContentSitemapAlternative[];
|
|
438
|
+
images?: ContentSitemapImage[];
|
|
439
|
+
}
|
|
440
|
+
/**
|
|
441
|
+
* Searchable document section produced by the internal search-section builder.
|
|
442
|
+
*/
|
|
443
|
+
export interface ContentSearchSection {
|
|
444
|
+
/**
|
|
445
|
+
* Stable section id, usually the page path or path plus anchor hash.
|
|
446
|
+
*/
|
|
447
|
+
id: string;
|
|
448
|
+
/**
|
|
449
|
+
* Heading or page title for the section.
|
|
450
|
+
*/
|
|
451
|
+
title: string;
|
|
452
|
+
/**
|
|
453
|
+
* Ancestor heading trail leading to this section.
|
|
454
|
+
*/
|
|
455
|
+
titles: string[];
|
|
456
|
+
/**
|
|
457
|
+
* Heading depth that opened the section.
|
|
458
|
+
*/
|
|
459
|
+
level: number;
|
|
460
|
+
/**
|
|
461
|
+
* Flattened text content used by the search index.
|
|
462
|
+
*/
|
|
463
|
+
content: string;
|
|
464
|
+
[key: string]: unknown;
|
|
465
|
+
}
|
|
466
|
+
export interface ContentQueryBuilder<T = ParsedContentMeta> {
|
|
467
|
+
/**
|
|
468
|
+
* Filter results with an explicit field/operator/value clause.
|
|
469
|
+
*/
|
|
470
|
+
where<K extends CollectionQueryField<T>, O extends CollectionQueryOperator<CollectionQueryFieldValue<T, K>>>(field: K, operator: O, value?: CollectionQueryValue<CollectionQueryFieldValue<T, K>, O>): ContentQueryBuilder<T>;
|
|
471
|
+
/**
|
|
472
|
+
* Add a grouped AND clause.
|
|
473
|
+
*/
|
|
474
|
+
andWhere(groupFactory: QueryGroupFunction<T>): ContentQueryBuilder<T>;
|
|
475
|
+
/**
|
|
476
|
+
* Add a grouped OR clause.
|
|
477
|
+
*/
|
|
478
|
+
orWhere(groupFactory: QueryGroupFunction<T>): ContentQueryBuilder<T>;
|
|
479
|
+
/**
|
|
480
|
+
* Select a subset of fields.
|
|
481
|
+
*/
|
|
482
|
+
select<const K extends readonly Extract<keyof T, string>[]>(...fields: K): ContentQueryBuilder<Pick<T, K[number]>>;
|
|
483
|
+
/**
|
|
484
|
+
* Order the result set by a field.
|
|
485
|
+
*/
|
|
486
|
+
order<K extends CollectionQueryField<T>>(field: K, direction: QueryOrderDirection, options?: QueryOrderOptions): ContentQueryBuilder<T>;
|
|
487
|
+
/**
|
|
488
|
+
* Limit number of results.
|
|
489
|
+
*/
|
|
490
|
+
limit(count: number): ContentQueryBuilder<T>;
|
|
491
|
+
/**
|
|
492
|
+
* Skip number of results.
|
|
493
|
+
*/
|
|
494
|
+
skip(count: number): ContentQueryBuilder<T>;
|
|
495
|
+
/**
|
|
496
|
+
* Retrieve query builder params.
|
|
497
|
+
* @internal
|
|
498
|
+
*/
|
|
499
|
+
params: () => ContentQueryBuilderParams;
|
|
500
|
+
/**
|
|
501
|
+
* Filter contents based on locale.
|
|
502
|
+
*/
|
|
503
|
+
locale(locale: string, options?: {
|
|
504
|
+
fallback?: boolean | string[];
|
|
505
|
+
}): ContentQueryBuilder<T>;
|
|
506
|
+
/**
|
|
507
|
+
* Fetch list of contents.
|
|
508
|
+
*/
|
|
509
|
+
all(): Promise<Array<T>>;
|
|
510
|
+
/**
|
|
511
|
+
* Fetch the first matched content.
|
|
512
|
+
*/
|
|
513
|
+
first(): Promise<T | undefined>;
|
|
514
|
+
/**
|
|
515
|
+
* Count matched contents.
|
|
516
|
+
*/
|
|
517
|
+
count(): Promise<number>;
|
|
518
|
+
}
|
|
519
|
+
export interface CollectionQueryBuilder<T = ParsedContentMeta> extends ContentQueryBuilder<T> {
|
|
520
|
+
select<const K extends readonly Extract<keyof T, string>[]>(...fields: K): CollectionQueryBuilder<Pick<T, K[number]>>;
|
|
521
|
+
}
|
|
522
|
+
/**
|
|
523
|
+
* Minimal request shape consumed by the query transport.
|
|
524
|
+
*/
|
|
525
|
+
export interface ContentQueryRequest {
|
|
526
|
+
params(): ContentQueryBuilderParams;
|
|
527
|
+
}
|
|
528
|
+
/**
|
|
529
|
+
* Internal transport used by the immutable query builder.
|
|
530
|
+
*/
|
|
531
|
+
export type ContentQueryFetcher<T> = (query: ContentQueryRequest) => Promise<ContentQueryResponse<T>>;
|
|
532
|
+
export type QueryMatchOperator = (item: unknown, condition: unknown) => boolean;
|
|
533
|
+
export interface ContentCollectionMap {
|
|
534
|
+
}
|
|
535
|
+
export interface ContentCollectionI18nMap {
|
|
536
|
+
}
|
|
537
|
+
export type ContentCollectionName = keyof ContentCollectionMap & string;
|
|
538
|
+
export type ContentCollectionItem<K extends ContentCollectionName> = ContentCollectionMap[K];
|
|
539
|
+
/**
|
|
540
|
+
* ============================================================================
|
|
541
|
+
* Unified Query API — public surface (ADR-0016)
|
|
542
|
+
* ============================================================================
|
|
543
|
+
*
|
|
544
|
+
* The types below back the unified query API exposed via `one`, `many`,
|
|
545
|
+
* `resolveOne`, `variants`, `tree`, `neighbors` and their `useContent*`
|
|
546
|
+
* composable mirrors. The public vocabulary is deliberately split:
|
|
547
|
+
*
|
|
548
|
+
* - `by` identifies exactly one document by route path or authored ref.
|
|
549
|
+
* - `where` filters a result set by document fields.
|
|
550
|
+
* - `resolveOne` returns diagnostics; `one` is the ergonomic doc-only view.
|
|
551
|
+
*/
|
|
552
|
+
/**
|
|
553
|
+
* MongoDB-style operator object applied to a single field. Mirrors the subset
|
|
554
|
+
* of `ContentQueryBuilderWhere` operators that are safe for public use.
|
|
555
|
+
*
|
|
556
|
+
* @template TValue Concrete field value type (used to narrow operator operands).
|
|
557
|
+
*/
|
|
558
|
+
export interface QueryOperators<TValue = unknown> {
|
|
559
|
+
$eq?: TValue;
|
|
560
|
+
$ne?: TValue;
|
|
561
|
+
$gt?: TValue;
|
|
562
|
+
$gte?: TValue;
|
|
563
|
+
$lt?: TValue;
|
|
564
|
+
$lte?: TValue;
|
|
565
|
+
$in?: TValue[];
|
|
566
|
+
$nin?: TValue[];
|
|
567
|
+
$exists?: boolean;
|
|
568
|
+
$contains?: TValue | TValue[];
|
|
569
|
+
$containsAny?: TValue[];
|
|
570
|
+
$icontains?: string;
|
|
571
|
+
$type?: 'string' | 'number' | 'boolean' | 'object' | 'undefined';
|
|
572
|
+
$prefix?: TValue extends string ? string : never;
|
|
573
|
+
$not?: TValue | QueryOperators<TValue>;
|
|
574
|
+
}
|
|
575
|
+
/**
|
|
576
|
+
* Identify exactly one document. `path` is stored content `_path`, `route` is
|
|
577
|
+
* public app URL, and `ref` is authored stable identity. They are mutually
|
|
578
|
+
* exclusive at the type level.
|
|
579
|
+
*/
|
|
580
|
+
export type ContentSelector = {
|
|
581
|
+
path: string;
|
|
582
|
+
route?: never;
|
|
583
|
+
ref?: never;
|
|
584
|
+
} | {
|
|
585
|
+
route: string;
|
|
586
|
+
path?: never;
|
|
587
|
+
ref?: never;
|
|
588
|
+
} | {
|
|
589
|
+
ref: string;
|
|
590
|
+
path?: never;
|
|
591
|
+
route?: never;
|
|
592
|
+
};
|
|
593
|
+
type WhereValue<T> = T | QueryOperators<T>;
|
|
594
|
+
type PathWhere = string | QueryOperators<string>;
|
|
595
|
+
/**
|
|
596
|
+
* MongoDB-style filter object generic on the document shape. `where.path` is a
|
|
597
|
+
* documented route-path filter and compiles to the internal `_path` field.
|
|
598
|
+
*/
|
|
599
|
+
export type QueryWhere<T = ParsedContentMeta> = {
|
|
600
|
+
path?: PathWhere;
|
|
601
|
+
$and?: QueryWhere<T>[];
|
|
602
|
+
$or?: QueryWhere<T>[];
|
|
603
|
+
$not?: QueryWhere<T>;
|
|
604
|
+
} & {
|
|
605
|
+
[K in Exclude<keyof T, 'path'>]?: WhereValue<NonNullable<T[K]>>;
|
|
606
|
+
};
|
|
607
|
+
/**
|
|
608
|
+
* Sort spec: `asc` / `desc` are preferred; `1` / `-1` remain accepted because
|
|
609
|
+
* they map directly to the transport shape.
|
|
610
|
+
*/
|
|
611
|
+
export type SortDirection = 'asc' | 'desc' | 1 | -1;
|
|
612
|
+
export type SortSpec<T = ParsedContentMeta> = string extends keyof T ? {
|
|
613
|
+
[key: string]: SortDirection | undefined;
|
|
614
|
+
} : {
|
|
615
|
+
[K in keyof T]?: SortDirection;
|
|
616
|
+
};
|
|
617
|
+
/**
|
|
618
|
+
* Schema of a collection handle (recovered from its `__schema` phantom).
|
|
619
|
+
*
|
|
620
|
+
* Uses `StrictParsedContentMeta` (no `[key: string]: unknown` index signature)
|
|
621
|
+
* as the base so `keyof HandleSchema<H>` is a finite union of the user's
|
|
622
|
+
* declared schema fields plus the internal `_*` meta fields. This is what
|
|
623
|
+
* makes `QueryWhere<HandleSchema<H>>` reject typo'd field names at compile time.
|
|
624
|
+
*/
|
|
625
|
+
type HandleSchema<H> = H extends {
|
|
626
|
+
__schema: infer S;
|
|
627
|
+
} ? S extends {
|
|
628
|
+
_output: infer O;
|
|
629
|
+
} ? O & StrictParsedContentMeta : StrictParsedContentMeta : StrictParsedContentMeta;
|
|
630
|
+
type SelectFields<H> = H extends string ? ReadonlyArray<string> : ReadonlyArray<Extract<keyof HandleSchema<H>, string>>;
|
|
631
|
+
/**
|
|
632
|
+
* Runtime document shape inferred from a collection handle.
|
|
633
|
+
*/
|
|
634
|
+
export type DocumentFromHandle<H> = H extends {
|
|
635
|
+
__schema: {
|
|
636
|
+
_output: infer O;
|
|
637
|
+
};
|
|
638
|
+
} ? O & ParsedContent : ParsedContent;
|
|
639
|
+
/**
|
|
640
|
+
* Explicit reference population map. Keys are fields on the source document;
|
|
641
|
+
* values are target collection handles.
|
|
642
|
+
*/
|
|
643
|
+
export type PopulateSpec = Record<string, ContentCollectionHandle | string>;
|
|
644
|
+
export type PopulatedDocument<T, P> = P extends undefined ? T : P extends PopulateSpec ? string extends keyof P ? T : Omit<T, keyof P> & {
|
|
645
|
+
[K in keyof P & keyof T]: T[K] extends ReadonlyArray<unknown> ? Array<LocalizedDoc<DocumentFromHandle<P[K]>>> : LocalizedDoc<DocumentFromHandle<P[K]>> | null;
|
|
646
|
+
} : T;
|
|
647
|
+
export type PopulateFromOptions<O> = O extends {
|
|
648
|
+
populate?: infer P;
|
|
649
|
+
} ? P : undefined;
|
|
650
|
+
type PopulateOption<P extends PopulateSpec | undefined = undefined> = {
|
|
651
|
+
populate?: P;
|
|
652
|
+
};
|
|
653
|
+
/**
|
|
654
|
+
* Whether a collection handle declares i18n at the type level.
|
|
655
|
+
*/
|
|
656
|
+
type HandleIsI18n<H> = H extends {
|
|
657
|
+
__i18n: infer I;
|
|
658
|
+
} ? I extends true ? true : false : false;
|
|
659
|
+
/**
|
|
660
|
+
* Locale option made required when the handle is i18n.
|
|
661
|
+
*/
|
|
662
|
+
type LocaleOption<H, OptKey extends string = 'locale'> = HandleIsI18n<H> extends true ? {
|
|
663
|
+
[K in OptKey]: string;
|
|
664
|
+
} : {
|
|
665
|
+
[K in OptKey]?: string;
|
|
666
|
+
};
|
|
667
|
+
type SourceIsI18n<S> = S extends ReadonlyArray<infer I> ? true extends HandleIsI18n<I> ? true : false : HandleIsI18n<S>;
|
|
668
|
+
type BacklinksLocaleOption<Target, Source> = HandleIsI18n<Target> extends true ? {
|
|
669
|
+
locale: string;
|
|
670
|
+
} : SourceIsI18n<Source> extends true ? {
|
|
671
|
+
locale: string;
|
|
672
|
+
} : {
|
|
673
|
+
locale?: string;
|
|
674
|
+
};
|
|
675
|
+
export type LocaleFallback = false | true | 'default' | string | string[];
|
|
676
|
+
/**
|
|
677
|
+
* Document shape returned from `one`, `many` and `resolveOne`. Every doc carries the
|
|
678
|
+
* route metadata (`path`, `localePaths`, `locale`, ...) the route resolver
|
|
679
|
+
* already produces, so locale switching needs no extra round trip.
|
|
680
|
+
*/
|
|
681
|
+
export type LocalizedDoc<T = ParsedContentMeta> = T & ContentRouteMeta & {
|
|
682
|
+
/**
|
|
683
|
+
* Locale-agnostic path stem derived from the source file.
|
|
684
|
+
*/
|
|
685
|
+
stem?: string;
|
|
686
|
+
/**
|
|
687
|
+
* Source file extension when it can be inferred.
|
|
688
|
+
*/
|
|
689
|
+
extension?: string;
|
|
690
|
+
};
|
|
691
|
+
/**
|
|
692
|
+
* Explain how `resolveOne` interpreted the request and what it matched.
|
|
693
|
+
*/
|
|
694
|
+
export interface ResolutionEnvelope {
|
|
695
|
+
requested: {
|
|
696
|
+
collection: string;
|
|
697
|
+
by: ContentSelector;
|
|
698
|
+
locale?: string;
|
|
699
|
+
fallback?: LocaleFallback;
|
|
700
|
+
};
|
|
701
|
+
normalized: {
|
|
702
|
+
by: ContentSelector;
|
|
703
|
+
};
|
|
704
|
+
matched: {
|
|
705
|
+
found: boolean;
|
|
706
|
+
collection: string;
|
|
707
|
+
path?: string;
|
|
708
|
+
canonicalPath?: string;
|
|
709
|
+
ref?: string;
|
|
710
|
+
locale?: string;
|
|
711
|
+
};
|
|
712
|
+
fallback: {
|
|
713
|
+
used: boolean;
|
|
714
|
+
locale?: string;
|
|
715
|
+
};
|
|
716
|
+
}
|
|
717
|
+
/**
|
|
718
|
+
* Result returned by `resolveOne`.
|
|
719
|
+
*/
|
|
720
|
+
export interface ResolveOneResult<T = ParsedContentMeta> {
|
|
721
|
+
doc: LocalizedDoc<T> | null;
|
|
722
|
+
explain: ResolutionEnvelope;
|
|
723
|
+
}
|
|
724
|
+
/**
|
|
725
|
+
* Options accepted by `resolveOne(handle, options)` and `one(handle, options)`.
|
|
726
|
+
*/
|
|
727
|
+
export type ResolveOneOptions<H = unknown, P extends PopulateSpec | undefined = undefined> = {
|
|
728
|
+
by: ContentSelector;
|
|
729
|
+
fallback?: LocaleFallback;
|
|
730
|
+
select?: SelectFields<H>;
|
|
731
|
+
} & LocaleOption<H> & PopulateOption<P>;
|
|
732
|
+
export type OneOptions<H = unknown, P extends PopulateSpec | undefined = undefined> = ResolveOneOptions<H, P>;
|
|
733
|
+
/**
|
|
734
|
+
* Options accepted by `many(handle, options)`.
|
|
735
|
+
*/
|
|
736
|
+
export type ManyOptions<H = unknown, P extends PopulateSpec | undefined = undefined> = {
|
|
737
|
+
where?: QueryWhere<HandleSchema<H>>;
|
|
738
|
+
sort?: SortSpec<HandleSchema<H>>;
|
|
739
|
+
limit?: number;
|
|
740
|
+
skip?: number;
|
|
741
|
+
fallback?: LocaleFallback;
|
|
742
|
+
select?: SelectFields<H>;
|
|
743
|
+
} & LocaleOption<H> & PopulateOption<P>;
|
|
744
|
+
/**
|
|
745
|
+
* Options accepted by `paginate(handle, options)`.
|
|
746
|
+
*/
|
|
747
|
+
export type PaginationOptions<H = unknown, P extends PopulateSpec | undefined = undefined> = Omit<ManyOptions<H, P>, 'skip' | 'limit'> & {
|
|
748
|
+
/**
|
|
749
|
+
* One-based page number.
|
|
750
|
+
*
|
|
751
|
+
* @default 1
|
|
752
|
+
*/
|
|
753
|
+
page?: number;
|
|
754
|
+
/**
|
|
755
|
+
* Number of documents per page.
|
|
756
|
+
*
|
|
757
|
+
* @default 10
|
|
758
|
+
*/
|
|
759
|
+
limit?: number;
|
|
760
|
+
};
|
|
761
|
+
/**
|
|
762
|
+
* Result returned by `paginate()` and `useContentPagination()`.
|
|
763
|
+
*/
|
|
764
|
+
export interface PaginationResult<T = ParsedContentMeta> {
|
|
765
|
+
data: Array<LocalizedDoc<T>>;
|
|
766
|
+
page: number;
|
|
767
|
+
limit: number;
|
|
768
|
+
total: number;
|
|
769
|
+
pageCount: number;
|
|
770
|
+
hasNext: boolean;
|
|
771
|
+
hasPrev: boolean;
|
|
772
|
+
nextPage: number | null;
|
|
773
|
+
prevPage: number | null;
|
|
774
|
+
}
|
|
775
|
+
export type BacklinkSource = ContentCollectionHandle | string;
|
|
776
|
+
type SourceName<S> = S extends string ? S : S extends {
|
|
777
|
+
name: infer N;
|
|
778
|
+
} ? Extract<N, string> : string;
|
|
779
|
+
export type BacklinkFields<S = BacklinkSource | ReadonlyArray<BacklinkSource>> = ReadonlyArray<string> | Partial<Record<SourceName<S extends ReadonlyArray<infer I> ? I : S>, ReadonlyArray<string>>>;
|
|
780
|
+
type DocumentFromSource<S> = S extends ReadonlyArray<infer I> ? DocumentFromHandle<I> : DocumentFromHandle<S>;
|
|
781
|
+
/**
|
|
782
|
+
* Options accepted by `backlinks(targetHandle, options)`.
|
|
783
|
+
*/
|
|
784
|
+
export type BacklinksOptions<Target = unknown, Source extends BacklinkSource | ReadonlyArray<BacklinkSource> = BacklinkSource | ReadonlyArray<BacklinkSource>, P extends PopulateSpec | undefined = undefined> = {
|
|
785
|
+
/**
|
|
786
|
+
* Target document to find incoming references for.
|
|
787
|
+
*/
|
|
788
|
+
by: ContentSelector;
|
|
789
|
+
/**
|
|
790
|
+
* Source collection handle(s) to scan for references.
|
|
791
|
+
*/
|
|
792
|
+
from: Source;
|
|
793
|
+
/**
|
|
794
|
+
* Explicit reference fields on the source collection(s). When omitted,
|
|
795
|
+
* fields are inferred from source handles that use `reference()`.
|
|
796
|
+
*/
|
|
797
|
+
fields?: BacklinkFields<Source>;
|
|
798
|
+
sort?: SortSpec<DocumentFromSource<Source>>;
|
|
799
|
+
limit?: number;
|
|
800
|
+
skip?: number;
|
|
801
|
+
fallback?: LocaleFallback;
|
|
802
|
+
select?: Source extends string ? ReadonlyArray<string> : ReadonlyArray<Extract<keyof DocumentFromSource<Source>, string>>;
|
|
803
|
+
} & BacklinksLocaleOption<Target, Source> & PopulateOption<P>;
|
|
804
|
+
export type BacklinksResult<Source extends BacklinkSource | ReadonlyArray<BacklinkSource> = BacklinkSource | ReadonlyArray<BacklinkSource>, P extends PopulateSpec | undefined = undefined> = Array<LocalizedDoc<PopulatedDocument<DocumentFromSource<Source>, P>>>;
|
|
805
|
+
/**
|
|
806
|
+
* Options accepted by `variants(handle, options)`.
|
|
807
|
+
*/
|
|
808
|
+
export type VariantsOptions<H = unknown> = {
|
|
809
|
+
by: ContentSelector;
|
|
810
|
+
/**
|
|
811
|
+
* Restrict to a subset of locales. Defaults to all configured locales.
|
|
812
|
+
*/
|
|
813
|
+
locales?: string[];
|
|
814
|
+
} & LocaleOption<H>;
|
|
815
|
+
/**
|
|
816
|
+
* Variant entry returned by `variants()` and `useContentVariants()`.
|
|
817
|
+
*/
|
|
818
|
+
export interface ContentVariant<_T = ParsedContentMeta> {
|
|
819
|
+
locale: string;
|
|
820
|
+
path: string;
|
|
821
|
+
translated: boolean;
|
|
822
|
+
fallback?: string;
|
|
823
|
+
}
|
|
824
|
+
/**
|
|
825
|
+
* Options accepted by `tree(handle, options)`.
|
|
826
|
+
*/
|
|
827
|
+
export type TreeOptions<H = unknown, Fields extends ReadonlyArray<keyof HandleSchema<H> | string> | undefined = undefined> = {
|
|
828
|
+
where?: QueryWhere<HandleSchema<H>>;
|
|
829
|
+
sort?: SortSpec<HandleSchema<H>>;
|
|
830
|
+
fields?: Fields;
|
|
831
|
+
fallback?: LocaleFallback;
|
|
832
|
+
} & LocaleOption<H>;
|
|
833
|
+
/**
|
|
834
|
+
* Typed navigation item. Requested `fields` are preserved in the return type
|
|
835
|
+
* without keeping the old open index signature.
|
|
836
|
+
*/
|
|
837
|
+
export type ContentTreeItem<T = ParsedContentMeta, Fields extends ReadonlyArray<keyof T | string> | undefined = undefined> = {
|
|
838
|
+
title: string;
|
|
839
|
+
path: string;
|
|
840
|
+
_path?: string;
|
|
841
|
+
children?: Array<ContentTreeItem<T, Fields>>;
|
|
842
|
+
} & (Fields extends ReadonlyArray<infer K> ? Pick<T, Extract<K, keyof T>> : Record<never, never>);
|
|
843
|
+
export type { ContentNavigationItem };
|
|
844
|
+
/**
|
|
845
|
+
* Options accepted by `neighbors(handle, options)`.
|
|
846
|
+
*
|
|
847
|
+
* Identifying the anchor document lives in `filter`, same as every other
|
|
848
|
+
* verb. Only the reserved selectors `path` and `ref` are accepted.
|
|
849
|
+
*/
|
|
850
|
+
export type NeighborsOptions<H = unknown> = {
|
|
851
|
+
by: ContentSelector;
|
|
852
|
+
fallback?: LocaleFallback;
|
|
853
|
+
fields?: SelectFields<H>;
|
|
854
|
+
} & LocaleOption<H>;
|
|
855
|
+
/**
|
|
856
|
+
* Result of `neighbors()` and `useContentNeighbors()`.
|
|
857
|
+
*/
|
|
858
|
+
export interface NeighborsResult<T = ParsedContentMeta> {
|
|
859
|
+
prev: ContentTreeItem<T> | null;
|
|
860
|
+
next: ContentTreeItem<T> | null;
|
|
861
|
+
}
|
|
862
|
+
export {};
|