import fsMod from 'node:fs'; import type { PluginContext } from 'rollup'; import type { RunnableDevEnvironment } from 'vite'; import * as z from 'zod/v4'; import type { AstroLogger } from '../core/logger/core.js'; import type { AstroSettings } from '../types/astro.js'; import type { AstroConfig } from '../types/public/config.js'; import type { ContentEntryType, DataEntryType } from '../types/public/content.js'; import { type CONTENT_FLAGS } from './consts.js'; import type { LoaderContext } from './loaders/types.js'; export declare const loaderReturnSchema: z.ZodUnion>, z.ZodRecord; }, z.core.$loose>>]>; declare const collectionConfigParser: z.ZodUnion>; schema: z.ZodOptional; loader: z.ZodOptional; }, z.core.$strip>, z.ZodObject<{ type: z.ZodOptional>; schema: z.ZodOptional; loader: z.ZodOptional; }, z.core.$strip>, z.ZodObject<{ type: z.ZodLiteral<"content_layer">; schema: z.ZodOptional; loader: z.ZodUnion, z.ZodObject<{ name: z.ZodString; load: z.ZodFunction], null>, z.ZodCustom>; schema: z.ZodOptional>>; createSchema: z.ZodOptional, z.ZodPromise>, z.ZodType>>; types: z.ZodString; }, z.core.$strip>>>>; }, z.core.$strip>]>; }, z.core.$strip>, z.ZodObject<{ type: z.ZodDefault>>; schema: z.ZodOptional; loader: z.ZodFunction; }, z.core.$strip>]>; declare const contentConfigParser: z.ZodObject<{ collections: z.ZodRecord>; schema: z.ZodOptional; loader: z.ZodOptional; }, z.core.$strip>, z.ZodObject<{ type: z.ZodOptional>; schema: z.ZodOptional; loader: z.ZodOptional; }, z.core.$strip>, z.ZodObject<{ type: z.ZodLiteral<"content_layer">; schema: z.ZodOptional; loader: z.ZodUnion, z.ZodObject<{ name: z.ZodString; load: z.ZodFunction], null>, z.ZodCustom>; schema: z.ZodOptional>>; createSchema: z.ZodOptional, z.ZodPromise>, z.ZodType>>; types: z.ZodString; }, z.core.$strip>>>>; }, z.core.$strip>]>; }, z.core.$strip>, z.ZodObject<{ type: z.ZodDefault>>; schema: z.ZodOptional; loader: z.ZodFunction; }, z.core.$strip>]>>; }, z.core.$strip>; export type CollectionConfig = z.infer; export type ContentConfig = z.infer & { digest?: string; }; type EntryInternal = { rawData: string | undefined; filePath: string; }; export declare function parseEntrySlug({ id, collection, generatedSlug, frontmatterSlug, }: { id: string; collection: string; generatedSlug: string; frontmatterSlug?: unknown; }): string; export declare function getEntryData = Record, TOutputData extends TInputData = TInputData>(entry: { id: string; collection: string; unvalidatedData: TInputData; _internal: EntryInternal; }, collectionConfig: CollectionConfig, shouldEmitFile: boolean, pluginContext?: PluginContext): Promise; export declare function getContentEntryExts(settings: Pick): string[]; export declare function getDataEntryExts(settings: Pick): string[]; export declare function getEntryConfigByExtMap(entryTypes: TEntryType[]): Map; export declare function getSymlinkedContentCollections({ contentDir, logger, fs, }: { contentDir: URL; logger: AstroLogger; fs: typeof fsMod; }): Promise>; export declare function reverseSymlink({ entry, symlinks, contentDir, }: { entry: string | URL; contentDir: string | URL; symlinks?: Map; }): string; export declare function getEntryCollectionName({ contentDir, entry, }: Pick & { entry: string | URL; }): string | undefined; export declare function getDataEntryId({ entry, contentDir, collection, }: Pick & { entry: URL; collection: string; }): string; export declare function getContentEntryIdAndSlug({ entry, contentDir, collection, }: Pick & { entry: URL; collection: string; }): { id: string; slug: string; }; export declare function getEntryType(entryPath: string, paths: Pick, contentFileExts: string[], dataFileExts: string[]): 'content' | 'data' | 'config' | 'ignored'; export declare function safeParseFrontmatter(source: string, id?: string): import("@astrojs/markdown-remark").ParseFrontmatterResult; /** * The content config is loaded separately from other `src/` files. * This global observable lets dependent plugins (like the content flag plugin) * subscribe to changes during dev server updates. */ export declare const globalContentConfigObserver: ContentObservable; export declare function hasContentFlag(viteId: string, flag: (typeof CONTENT_FLAGS)[number]): boolean; export declare function isDeferredModule(viteId: string): boolean; export declare function reloadContentConfigObserver({ observer, ...loadContentConfigOpts }: { fs: typeof fsMod; settings: AstroSettings; environment: RunnableDevEnvironment; observer?: ContentObservable; }): Promise; type ContentCtx = { status: 'init'; } | { status: 'loading'; } | { status: 'does-not-exist'; } | { status: 'loaded'; config: ContentConfig; } | { status: 'error'; error: Error; }; type Observable = { get: () => C; set: (ctx: C) => void; subscribe: (fn: (ctx: C) => void) => () => void; }; export type ContentObservable = Observable; export type ContentPaths = { root: URL; contentDir: URL; assetsDir: URL; typesTemplate: URL; virtualModTemplate: URL; config: { exists: boolean; url: URL; }; liveConfig: { exists: boolean; url: URL; }; }; export declare function getContentPaths({ srcDir, root }: Pick, fs?: typeof fsMod, legacyCollectionsBackwardsCompat?: boolean): ContentPaths; /** * Check for slug in content entry frontmatter and validate the type, * falling back to the `generatedSlug` if none is found. */ export declare function getEntrySlug({ id, collection, generatedSlug, contentEntryType, fileUrl, fs, }: { fs: typeof fsMod; id: string; collection: string; generatedSlug: string; fileUrl: URL; contentEntryType: Pick; }): Promise; /** * Unlike `path.posix.relative`, this function will accept a platform path and return a posix path. */ export declare function posixRelative(from: string, to: string): string; export declare function contentModuleToId(fileName: string): string; export declare function safeStringify(value: unknown): string; export {};