import type { CogitaLogger } from '@cogita/shared'; import type { CogitaPlugin } from '@cogita/shared'; import type { CogitaPluginConfig } from '@cogita/shared'; import type { ContentPost } from '@cogita/shared'; import type { ContentPostSEO } from '@cogita/shared'; /** * 读取并解析单个文件的 Frontmatter 信息,并结合文件系统信息进行丰富。 * @param filePath 文件的绝对路径。 * @param postsDir 文章的根目录路径,用于计算路由。 * @param routePrefix 路由前缀,例如 'blog'。 * @returns 结构化的 Frontmatter 对象,如果发生错误或文件类型不支持则返回 null。 */ export declare function getFrontmatterFromFile(filePath: string, postsDir: string, routePrefix?: string, logger?: CogitaLogger): PostFrontmatter | null; /** * 插件的配置选项接口。 */ export declare interface PluginOptions { /** * 存放文章的目录的绝对路径。 */ postsDir: string; /** * 生成路由时使用的前缀,默认为 'posts'。 */ routePrefix?: string; } export declare function pluginPostsFrontmatter(config: CogitaPluginConfig): CogitaPlugin; /** 定义文章 Frontmatter 的数据结构。 */ export declare interface PostFrontmatter extends Omit { /** 文章级 SEO 覆盖字段。 */ seo?: PostSEO; } /** 文章 frontmatter 中的 SEO 覆盖字段。 */ export declare interface PostSEO extends ContentPostSEO { } export { }