import type { ThemeConfig } from "@docubook/themes-colors"; import type { PluginEntry } from "./plugin"; export interface DocuRouteContext { title?: string; icon?: string; description?: string; } export interface DocuRoute { title: string; href: string; noLink?: boolean; items?: DocuRoute[]; context?: DocuRouteContext; } export interface DocuMeta { title: string; description: string; baseURL: string; favicon?: string; /** Default OG image path (e.g. /docs/assets/images/og.png). Used when page frontmatter has no image. */ ogImage?: string; } export interface SocialLink { name: string; url: string; } export interface DocuNavbar { logoText: string; logo?: { src?: string; alt?: string }; menu: { title: string; href: string }[]; } export interface DocuFooter { social: SocialLink[]; } export interface DocuSidebar { /** How context sections are displayed. * "dropdown" — context switcher dropdown (default) * "separator" — inline group headers in sidebar */ context?: "dropdown" | "separator"; } export interface RepoConfig { url: string; path: string; edit: boolean; } export interface HeroAction { text: string; link: string; theme?: "primary" | "secondary" | "ghost"; icon?: string; } export interface Hero { tagline?: string; headline: string; description?: string; actions?: HeroAction[]; } export interface HomeFeature { icon?: string; title: string; description: string; link?: string; } export interface HomeConfig { hero?: Hero; features?: HomeFeature[]; } export interface DocuConfig { meta: DocuMeta; home?: HomeConfig; navbar: DocuNavbar; footer: DocuFooter; repo: RepoConfig; sidebar?: DocuSidebar; routes: DocuRoute[]; themes?: { colors: ThemeConfig; }; /** List of DocuBook plugins to load. Empty by default — no-op when absent. */ plugins?: PluginEntry[]; } export interface AssetEntry { css: string; js?: string; } export interface AssetManifest { docs: AssetEntry; home: AssetEntry; notFound: AssetEntry; } export interface BuildCacheEntry { hash: string; mtime: number; builtAt: number; } /** Version stamp stored as `__meta__` — extends entry so the index signature stays valid. */ export interface BuildCacheMeta extends BuildCacheEntry { version: number; runtime: string; } export interface BuildCache { [path: string]: BuildCacheEntry | undefined; __meta__?: BuildCacheMeta; __assets__?: BuildCacheEntry; __bundle__?: BuildCacheEntry; } /** Narrow a cache slot to a real page/asset entry (guards `__meta__` shape). */ export function isCacheEntry(value: unknown): value is BuildCacheEntry { if (typeof value !== "object" || value === null) return false; const v = value as Record; return typeof v.hash === "string" && typeof v.mtime === "number" && typeof v.builtAt === "number"; } export interface CliArgs { force?: boolean; clean?: boolean; ssr?: boolean; } export interface ParsedDoc { compiledSource: string; frontmatter: Record; raw: string; scope?: Record; } export type { TocItem } from "@docubook/core";