import { NuxtModule } from '@nuxt/schema'; import { RoutePolicy } from '@vigilkids/cms-client/routes'; /** CMS 资源路由策略 */ type CmsRoutePolicy = RoutePolicy; /** CMS Nuxt Module 配置 */ interface CmsNuxtModuleOptions { /** CMS API 基础 URL */ apiUrl: string; /** 产品编码 */ productCode: string; /** 默认语言 */ defaultLocale?: string; /** Webhook HMAC-SHA256 密钥(服务端专用) */ webhookSecret: string; /** 预览模式配置 */ preview?: { enabled?: boolean; path?: string; cookieName?: string; cookieMaxAge?: number; }; /** CMS 资源路由策略 */ routes?: CmsRoutePolicy; /** 站点运行时配置 */ site?: { url?: string; runtime?: boolean; cacheTtl?: number; }; /** 内容 API 集成 */ content?: { articleCollectionPath?: string; cmsProxyPath?: string; }; /** 分类预加载配置 */ categories?: { preload?: boolean; locales?: string[]; }; /** ISR 重验证配置 */ revalidate?: { enabled?: boolean; path?: string; }; /** 重定向中间件配置 */ redirects?: { enabled?: boolean; cacheTtl?: number; }; /** Sitemap 集成 */ sitemap?: { enabled?: boolean; locales?: string[]; sourcePath?: string; }; /** 语言代码映射 (前端 locale → CMS API locale) */ localeMap?: Record; /** URL 路径前缀映射 (CMS locale → URL prefix),默认语言无需配置 */ localePrefixes?: Record; } declare const module: NuxtModule; export { module as default }; export type { CmsNuxtModuleOptions };