import { x as DocsMarkdownConfig } from "./docs-config--EmV3783.mjs"; import { SiteValidateOptions } from "@pagesmith/site"; //#region src/config/types.d.ts type FooterLink = { label: string; path: string; }; type FooterLinkGroup = { header?: string; links: FooterLink[]; }; type FooterLinks = FooterLink[] | FooterLinkGroup[]; type Maintainer = { name: string; link?: string; }; type CopyrightConfig = { projectName?: string; startYear?: number; endYear?: number | null; }; type ResolvedCopyright = { projectName: string; startYear: number; endYear?: number; }; type DocsLogLevel = "silent" | "error" | "warn" | "info" | "verbose"; /** * Port value accepted in `server.devPort` and `server.previewPort`. Either an * explicit port number or the literal `"auto"`, which makes the dev/preview * server scan upward from 4000 for the first available port at startup. */ type DocsServerPort = number | "auto"; type DocsUserConfig = { preset?: string; presets?: string[]; name?: string; title?: string; description?: string; origin?: string; language?: string; contentDir?: string; outDir?: string; publicDir?: string; /** Base path for deployment under a subdirectory (e.g. '/docs'). Overridden by BASE_URL env var. */ basePath?: string; /** Override the header logo link destination (defaults to basePath). */ homeLink?: string; /** Use trailing slashes in generated links (default: false). */ trailingSlash?: boolean; /** Maintainer credit shown in the default footer sign-off. Falls back to package.json author when omitted. */ maintainer?: Maintainer; /** Footer links can be a flat link row or grouped columns with optional headers. */ footerLinks?: FooterLinks; /** Override the footer sign-off text shown beneath theme controls. */ footerText?: string; /** Footer copyright line shown before the Pagesmith attribution. */ copyright?: CopyrightConfig; sidebar?: { /** Enable collapsible sidebar section groups (default: true) */collapsible?: boolean; }; search?: { enabled?: boolean; /** Show images in search results (default: false) */ showImages?: boolean; /** Show sub-results/sections within pages (default: true) */ showSubResults?: boolean; /** Extra CLI flags passed to the pagefind binary */ pagefindFlags?: string[]; }; theme?: { lightColor?: string; darkColor?: string; layouts?: Record; /** Path to default social sharing image, relative to publicDir or an absolute URL */ socialImage?: string; /** Default color scheme: 'auto' follows OS, 'light' or 'dark' forces a scheme. Default: 'auto'. */ defaultColorScheme?: "auto" | "light" | "dark"; /** Default theme variant. Default: 'paper'. */ defaultTheme?: "paper" | "high-contrast"; /** Default text size variant. Default: 'base'. */ defaultTextSize?: "small" | "base" | "large"; }; analytics?: { googleAnalytics?: string; }; /** Path to favicon file relative to project root. Defaults to 'public/favicon.svg'. Set to false to disable. */ favicon?: string | false; /** SVG string or path for the header logo icon. Defaults to the first letter of the site name. Set to false to disable. */ icon?: string | false; /** Show "Edit this page" link on each page. Auto-detected from git remote when omitted. Set to false to disable. */ editLink?: { /** GitHub/GitLab repo URL (e.g. 'https://github.com/user/repo') */repo: string; /** Branch name (default: 'main') */ branch?: string; /** Label for the link (default: 'Edit this page') */ label?: string; } | false; /** Show git-based "last updated" timestamp on pages (default: true) */ lastUpdated?: boolean; /** Generate sitemap.xml during build (default: true when origin is set). Set false to disable. */ sitemap?: boolean; markdown?: DocsMarkdownConfig; home?: { configFile?: string; }; /** Optional multi-package navigation labels. Maps section slug to display label. */ packages?: Record; /** * Map output paths to source files/folders that should be copied to the build output. * Keys are output directory paths (e.g. "/" for root, "/api" for api/). * Values are arrays of file or folder names resolved relative to the project root. * Folders are copied recursively. */ assets?: Record; /** Server settings shared by `pagesmith-docs dev` and `pagesmith-docs preview`. */ server?: { /** Interface to bind the dev and preview servers to. Default: `'127.0.0.1'`. */host?: string; /** Port for the dev server. Pass a number or `'auto'` to scan upward from 4000 for the first available port. Default: `3000`. */ devPort?: DocsServerPort; /** Port for the preview server. Pass a number or `'auto'` to scan upward from 4000 for the first available port. Default: `4000`. */ previewPort?: DocsServerPort; /** When true and the resolved port is a number, fail if it is in use instead of scanning for the next available port. Ignored when the port is `'auto'`. Default: `false`. */ strictPort?: boolean; /** Log level for the dev/preview servers. Default: `'info'`. */ logLevel?: DocsLogLevel; }; }; type ResolvedDocsConfig = { rootDir: string; contentDir: string; outDir: string; publicDir: string; basePath: string; homeLink?: string; trailingSlash: boolean; maintainer?: Maintainer; name: string; title: string; description: string; origin: string; language: string; footerLinks: FooterLinks; footerText?: string; copyright?: ResolvedCopyright; sidebar: { collapsible: boolean; }; search: { enabled: boolean; showImages: boolean; showSubResults: boolean; pagefindFlags: string[]; }; theme?: { lightColor?: string; darkColor?: string; layouts?: Record; defaultColorScheme?: string; defaultTheme?: string; defaultTextSize?: string; }; analytics?: { googleAnalytics?: string; }; /** Resolved path to default social sharing image, or undefined if not set. */ socialImage?: string; /** Resolved absolute path to favicon file, or false if disabled. */ favicon: string | false; /** SVG string for the header logo icon, or false if disabled. */ icon: string | false; /** Resolved absolute path to apple-touch-icon, or false if not found. */ appleTouchIcon: string | false; /** Resolved absolute path to ICO fallback (when primary favicon is SVG), or false. */ faviconFallback: string | false; editLink?: { repo: string; branch: string; label: string; /** Pre-computed edit URL pattern (includes host-specific path structure). */ editPattern: string; }; lastUpdated: boolean; sitemap: boolean; markdown?: DocsMarkdownConfig; homeConfigFile?: string; packages?: Record; /** Resolved asset mappings: output path -> array of resolved absolute source paths. */ assets: Map; /** * Resolved server settings. `devPort` / `previewPort` may still be the * literal `'auto'` until the server actually binds (auto resolution happens * in `startDev` / `preview`). */ server: { host: string; devPort: DocsServerPort; previewPort: DocsServerPort; strictPort: boolean; logLevel: DocsLogLevel; }; /** @internal Raw user config — used by validateConfig to distinguish explicit values from fallbacks. */ _userConfig?: DocsUserConfig; /** * @internal True when no `pagesmith.config.*` file exists on disk and the * resolver is operating in zero-config mode. validateConfig uses this to * suppress `name`/`title`/`description`/`origin` "missing field" warnings, * since the user has not opted into a config file at all. */ _zeroConfig?: boolean; }; type DocsBuildOptions = { configPath?: string; /** Override output directory from CLI (takes precedence over config). */ outDir?: string; /** Override base path from CLI (takes precedence over config and BASE_URL env). */ basePath?: string; }; type DocsDevOptions = DocsBuildOptions & { /** Override the resolved port. Use `'auto'` to scan upward from 4000 for the first available port. */port?: DocsServerPort; open?: boolean; /** Logging level for the dev/preview server. Defaults to the value resolved from `server.logLevel` (which itself defaults to `'info'`). */ logLevel?: DocsLogLevel; }; type ConfigValidationIssue = { field: string; message: string; severity: "error" | "warn"; }; //#endregion //#region src/config/resolve.d.ts declare function defineDocsConfig(config: T): T; /** * Identity helper for `pagesmith.config.ts` files. Equivalent to * `defineDocsConfig`; provided as the canonical name users expect from other * Pagesmith packages. */ declare const defineConfig: typeof defineDocsConfig; /** * Synchronous loader. Reads `pagesmith.config.json5` (or any explicit path * with a JSON5/JSON extension). Throws when handed a `.ts/.mts/.js/.mjs` path * because TypeScript/JS configs require asynchronous loading via `jiti` / * dynamic `import()`. CLI commands always go through `loadDocsConfigAsync`, * which handles every supported extension. */ declare function loadDocsConfig(configPath?: string): DocsUserConfig; /** * Async loader for any supported config file extension * (`.ts`, `.mts`, `.js`, `.mjs`, `.json5`, `.json`). * * Used by every CLI command (init/dev/build/preview/validate/mcp) so users can * author their docs config in TypeScript and still get the same resolved shape. */ declare function loadDocsConfigAsync(configPath?: string): Promise; declare function resolveDocsConfig(configPath?: string, overrides?: { outDir?: string; basePath?: string; }): ResolvedDocsConfig; /** * Async equivalent of `resolveDocsConfig` that supports every config file * extension (`.ts`, `.mts`, `.js`, `.mjs`, `.json5`, `.json`). CLI commands * always use this so authors can pick whichever config format they prefer. */ declare function resolveDocsConfigAsync(configPath?: string, overrides?: { outDir?: string; basePath?: string; }): Promise; //#endregion //#region src/config/shared.d.ts /** Prefix a path with a base path, avoiding double slashes. */ declare function withBase(basePath: string, path: string): string; //#endregion //#region src/config/validate.d.ts /** * Validate a resolved docs config. Returns issues found. * Checks required fields, verifies referenced directories and asset files exist. */ declare function validateConfig(config: ResolvedDocsConfig): ConfigValidationIssue[]; /** * Log validation issues to console. Returns true if there are any errors (severity: 'error'). */ declare function reportConfigIssues(issues: ConfigValidationIssue[]): boolean; //#endregion //#region src/build.d.ts declare function build(options?: DocsBuildOptions): Promise; //#endregion //#region src/server.d.ts declare function startDev(options?: DocsDevOptions): Promise; declare function preview(options?: DocsDevOptions): Promise; //#endregion //#region src/preset.d.ts interface DocsPreset { build(options?: DocsBuildOptions): Promise; dev(options?: DocsDevOptions): Promise; preview(options?: DocsDevOptions): Promise; validate(options?: SiteValidateOptions): Promise; } declare function docsPreset(): DocsPreset; //#endregion export { ResolvedDocsConfig as S, DocsDevOptions as _, build as a, Maintainer as b, withBase as c, loadDocsConfig as d, loadDocsConfigAsync as f, DocsBuildOptions as g, ConfigValidationIssue as h, startDev as i, defineConfig as l, resolveDocsConfigAsync as m, docsPreset as n, reportConfigIssues as o, resolveDocsConfig as p, preview as r, validateConfig as s, DocsPreset as t, defineDocsConfig as u, DocsUserConfig as v, ResolvedCopyright as x, FooterLinks as y }; //# sourceMappingURL=preset-cCbbz8-R.d.mts.map