import * as React$2 from "react"; import { ComponentType, ReactNode } from "react"; import * as _$http from "http"; import { Plugin } from "vite"; import * as _$react_jsx_runtime0 from "react/jsx-runtime"; //#region src/shared/types.d.ts /** * Metadata representing a single documentation route. * This information is used to build the client-side router and the sidebar navigation. */ interface RouteMeta { /** The final URL path for the route (e.g., '/docs/guide/start') */ path: string; /** The absolute filesystem path to the source markdown/mdx file */ componentPath: string; /** The title of the page, usually extracted from frontmatter or the filename */ title: string; /** The relative path from the docs directory, used for edit links */ filePath: string; /** Optional description of the page (for SEO/meta tags) */ description?: string; /** Optional explicit position for ordering in the sidebar */ sidebarPosition?: number; /** The group (directory) this route belongs to */ group?: string; /** The display title for the route's group */ groupTitle?: string; /** Optional explicit position for ordering the group itself */ groupPosition?: number; /** Optional icon for the route's group */ groupIcon?: string; /** The sub-route group this route belongs to (from folders starting with _) */ subRouteGroup?: string; /** Extracted markdown headings for search indexing */ headings?: { level: number; text: string; id: string; }[]; /** The locale this route belongs to, if i18n is configured */ locale?: string; /** The version this route belongs to, if versioning is configured */ version?: string; /** Optional badge to display next to the sidebar item (e.g., 'New', 'Experimental') */ badge?: BadgeValue; /** Optional icon to display (Lucide icon name or raw SVG) */ icon?: string; /** The tab this route belongs to, if tabs are configured */ tab?: string; /** The collection this route belongs to (from [name] directories like [blog]) */ collection?: string; /** Tags for blog posts or other taxonomy */ tags?: string[]; /** Author identifier for blog posts */ author?: string; /** Draft flag — excluded from production builds */ draft?: boolean; /** Feature flags required for this page to be visible */ featureFlags?: string[]; /** Short excerpt/summary for list displays */ excerpt?: string; /** Cover image for blog posts */ coverImage?: string; /** The extracted plain-text content of the page for search indexing */ _content?: string; /** The raw markdown content of the page */ _rawContent?: string; /** Extracted SEO and Open Graph metadata from frontmatter */ seo?: Record; /** The publication date */ date?: string | Date; /** The last updated timestamp or date */ lastUpdated?: string | number | Date; /** Optional category for the page */ category?: string; /** Optional explicit order (alternative to sidebarPosition) */ order?: number; /** Optional explicit label for the sidebar */ sidebarLabel?: string; /** Whether the page is hidden from the sidebar */ sidebarHidden?: boolean; /** Raw extensible frontmatter data for custom components and formatters */ frontmatter?: Record; /** Optional recursive child routes for deep sidebar hierarchies */ subRoutes?: RouteMeta[]; /** Clean URL segments stripped of locale/version prefixes */ slugParts?: string[]; } /** * Represents a single social link in the configuration. */ interface BoltdocsSocialLink { icon: 'discord' | 'x' | 'github' | 'bluesky' | string; link: string; } /** * Theme-specific configuration options. */ interface BoltdocsThemeConfig { title?: string | Record; description?: string | Record; logo?: string | { dark: string; light: string; alt?: string; width?: number; height?: number; }; navbar?: Array<{ label: string | Record; href: BoltdocsRoutePathWithFallback; items?: Array<{ label: string | Record; href: BoltdocsRoutePathWithFallback; }>; }>; sidebar?: Record>; sidebarGroups?: Record; icon?: string; }>; socialLinks?: BoltdocsSocialLink[]; editLink?: string; communityHelp?: string; version?: string; githubRepo?: string; favicon?: string; tabs?: Array<{ id: string; text: string | Record; icon?: string; }>; codeTheme?: ShikiTheme | { light: ShikiTheme; dark: ShikiTheme; }; } /** * List of supported syntax highlighting themes. */ type ShikiTheme = 'github-dark' | 'github-light' | 'tokyo-night' | 'dracula' | 'nord' | 'one-dark-pro' | 'one-light'; /** * Configuration for the robots.txt file. */ type BoltdocsRobotsConfig = string | { rules?: Array<{ userAgent: string; allow?: string | string[]; disallow?: string | string[]; }>; sitemaps?: string[]; }; /** * Configuration for a specific locale. */ interface BoltdocsLocaleConfig { label?: string; direction?: 'ltr' | 'rtl'; htmlLang?: string; calendar?: string; } /** * Configuration for internationalization (i18n). */ interface BoltdocsI18nConfig { defaultLocale: string; locales: string[] | Record; localeConfigs?: Record; } /** * Configuration for a specific documentation version. */ interface BoltdocsVersionConfig { label: string; path: string; } /** * Configuration for content collections (e.g. blog posts, changelog) * declared in `boltdocs.config.ts`. Each entry maps a directory name * (e.g. `[blog]`) to its display + ordering settings. */ interface BoltdocsCollectionsConfig { /** * Map of collection id (matches the bracketed directory name) to * its display label. Falls back to the id when a label is missing. */ labels?: Record>; /** * Map of collection id to a numeric position used for sidebar ordering. * Collections with no explicit position are sorted last. */ positions?: Record; /** * Items-per-page for paginated collection routes (e.g. blog indexes). * Falls back to the framework default (10) when omitted. */ postsPerPage?: number; /** * Default collection ID used by collection routing when no collection * is explicitly referenced. Defaults to `'blog'`. */ defaultCollection?: string; /** * Date format string for rendering post dates in listing pages. * Defaults to `'MMMM dd, yyyy'`. */ dateFormat?: string; /** * Field used to sort posts within a collection. * Defaults to `'date'`. */ sortBy?: 'date' | 'title' | 'sidebarPosition'; } /** * Configuration for documentation versioning. */ interface BoltdocsVersionsConfig { defaultVersion: string; prefix?: string; versions: BoltdocsVersionConfig[]; } /** * Shared badge value type used in frontmatter, RouteMeta, and ComponentRoute. */ type BadgeValue = string | { text: string; expires?: string; }; /** * Context provided to plugin lifecycle hooks. */ interface PluginContext { readonly config: BoltdocsConfig; readonly logger: PluginLogger; readonly store: PluginStore; readonly meta: PluginMeta; readonly docsDir: string; readonly rootDir: string; readonly outDir: string; readonly routes: RouteMeta[]; /** Namespaced cache helpers bound to the core's cache machinery. */ readonly caches: PluginCachesAPI; /** Structured diagnostics channel; reports can be drained via `list()`. */ readonly diagnostics: PluginDiagnosticsAPI; /** Helpers for resolving paths inside the workspace safely. */ readonly paths: PluginPathsAPI; /** Declare virtual modules the core should expose to Vite. */ readonly virtualModules: PluginVirtualModulesAPI; /** Register and query transform middleware at runtime. */ readonly middleware: PluginMiddlewareAPI; /** * Hook into dev-server file watching and send custom HMR events * to connected clients. */ readonly hmr: PluginHmrAPI; /** * Register HTTP middleware and server lifecycle hooks without * writing a Vite plugin. */ readonly server: PluginServerAPI; } /** * Functional cache helpers exposed through `PluginContext.caches`. * * Plugin authors do not get a reference to the raw `TransformCache` / * `FileCache` instances — those stay encapsulated in core. The methods * returned here are bound to namespaced keys so two plugins cannot * collide. */ interface PluginCachesAPI { /** Sharded, hash-keyed cache. One namespace per plugin recommended. */ transform(namespace: string): PluginTransformCacheAPI; /** Routes cache wrapper around the parsed-doc cache. */ routes: PluginRoutesCacheAPI; /** In-memory LRU cache keyed by namespace + plugin-supplied key. */ memory(namespace: string, opts?: { max?: number; ttl?: number; }): PluginMemoryCacheAPI; } interface PluginTransformCacheAPI { /** Async read — first call may warm from disk if the entry was evicted. */ get(key: string): Promise; /** Synchronous write that batches a background disk flush. */ set(key: string, value: string): void; /** Force-flush background writes. Call before measuring disk state. */ flush(): Promise; } interface PluginRoutesCacheAPI { /** Read a parsed `RouteMeta` (and its private `_content` blob) by abs file path. */ get(filePath: string): RouteMeta | null; /** Write a parsed route entry. Caller assumptions match `docCache.set`. */ set(filePath: string, route: RouteMeta): void; /** Invalidate one route. Use when content changes. */ invalidate(filePath: string): void; /** Clear every cached route. Use when the directory layout changes. */ invalidateAll(): void; } interface PluginMemoryCacheAPI { get(key: string): V | undefined; set(key: string, value: V): void; has(key: string): boolean; } /** * Plugin diagnostics API. * * Plugins push structured records instead of spamming the logger; downstream * tools (dev-server overlay, CI reporters, IDE plugins) drain the queue via * `list()`. */ interface DiagnosticRecord { readonly id: number; readonly severity: 'info' | 'warn' | 'error'; readonly code: string; readonly message: string; readonly pluginName: string; readonly filePath?: string; readonly routePath?: string; readonly time: Date; } interface PluginDiagnosticsAPI { report(severity: DiagnosticRecord['severity'], code: string, message: string, where?: { filePath?: string; routePath?: string; }): void; list(): readonly DiagnosticRecord[]; clear(): void; } /** * Path-resolution helpers exposed through `PluginContext.paths`. * * Both `resolveDocs` and `resolveAsset` validate the resulting path against * the workspace boundary and reject any segment that resolves outside the * docs / project root directories. */ interface PluginPathsAPI { resolveDocs(...parts: string[]): string; resolveAsset(...parts: string[]): string; /** * Build a `file://` URL for an absolute path inside the workspace. * Useful for `new URL(import.meta.url)` replacements and image srcsets. */ safeFileURL(absFilePath: string): string; } /** * Plugin virtual-modules registration. * * Plugins call `add(id, loader)` to expose a `virtual:/` module * to Vite without having to author a full Vite plugin. The loader returns * the module source code as a string; the core wraps it in the right * `resolveId`/`load` plumbing at Vite build time. */ interface RegisteredVirtualModule { readonly id: string; readonly eager: boolean; readonly loader: () => string | Promise; } interface PluginVirtualModulesAPI { add(id: string, loader: () => string | Promise, opts?: { eager?: boolean; }): void; has(id: string): boolean; list(): readonly RegisteredVirtualModule[]; } /** * Logger interface for plugin logging. */ interface PluginLogger { info(message: string): void; warn(message: string): void; error(message: string | Error): void; debug(message: string): void; } /** * Key-value store interface for plugins. */ interface PluginStore { get(pluginName: string, key: string): T | undefined; set(pluginName: string, key: string, value: unknown): void; has(pluginName: string, key: string): boolean; } /** * Plugin metadata provided in the context. */ interface PluginMeta { name: string; version?: string; boltdocsVersion?: string; } /** * Chain control signal returned by transform hooks. Use with `__signal` in * the return value to influence the middleware chain: * * - `'skip'`: stop processing this hook for the current file (remaining * plugins in the chain still run). * - `'break'`: stop the entire chain immediately — no further plugin's * transform hooks run for this file. * * @example * ```ts * transformMdx: async (_ctx, { code }) => ({ * code: code.replace(/foo/g, 'bar'), * __signal: 'skip', // skip remaining plugins * }) * ``` */ type ChainSignal = 'skip' | 'break'; /** * Returned by a transform hook that wants to signal the chain. The `__signal` * field is optional — most hooks will just return `{ code: string }` and the * chain continues normally. When `__signal` is present, `runChain` reacts: * * - `'skip'` continues with the next plugin, but passes the **original params** * (the output of this hook is discarded). * - `'break'` stops the chain immediately. * * @template T The params shape (e.g. `{ code: string; filePath: string }`). */ type TransformResult = T & { __signal?: ChainSignal; }; /** * Enriched params passed to `transformSource` and `transformMdx`. The `code` * and `filePath` fields are always present. The optional `frontmatter` and * `route` fields are populated when available (they are `undefined` in the * early pipeline where frontmatter hasn't been parsed yet). */ interface TransformSourceParams { /** The raw or compiled code (source before MDX / JS after MDX). */ code: string; /** Absolute file path of the source document. */ filePath: string; /** Parsed frontmatter, if available. `undefined` in very early pipeline. */ frontmatter?: Record; } /** * Enriched params passed to `transformHtml`. The `html` and `path` fields * are always present. The optional `route` carries the generated `RouteMeta` * for richer context (locale, version, collection, etc.). */ interface TransformHtmlParams { /** The rendered HTML string for this page. */ html: string; /** The route path (e.g. `/docs/guides/start`). */ path: string; /** The route metadata for the page, if available. */ route?: RouteMeta; } /** * Plugin transform middleware. Each middleware runs in the transform * pipeline alongside lifecycle hooks. The `name` field is optional — * when omitted, the owning plugin's name is used as context. * Middleware runs in `enforce` order (pre → normal → post) and supports * `__signal: 'skip'` / `__signal: 'break'` for chain control. */ interface PluginTransformMiddleware { /** Optional name. Defaults to the owning plugin's name for diagnostics. */ name?: string; enforce?: 'pre' | 'post'; transformSource?: (ctx: PluginContext, params: TransformSourceParams) => TransformResult<{ code: string; }> | Promise>; transformMdx?: (ctx: PluginContext, params: TransformSourceParams) => TransformResult<{ code: string; }> | Promise>; transformHtml?: (ctx: PluginContext, params: TransformHtmlParams) => TransformResult<{ html: string; }> | Promise>; } /** * Plugin middleware registry API exposed through `PluginContext.middleware`. * Plugins can register named middleware entries from lifecycle hooks. */ interface PluginMiddlewareAPI { add(middleware: PluginTransformMiddleware): void; remove(name: string): void; has(name: string): boolean; list(): readonly PluginTransformMiddleware[]; } /** * HMR event types plugins can listen to. */ type PluginHmrEvent = 'add' | 'change' | 'unlink'; /** * Plugin HMR API — hook into file-watching events and send custom * HMR messages to connected clients. */ interface PluginHmrAPI { /** * Register a callback for file events scoped to the docs directory. * The callback receives the normalized file path and event type. */ onFileEvent(eventType: PluginHmrEvent, handler: (filePath: string) => void | Promise): void; /** Shorthand for `onFileEvent('add', handler)`. */ onFileAdd(handler: (filePath: string) => void | Promise): void; /** Shorthand for `onFileEvent('change', handler)`. */ onFileChange(handler: (filePath: string) => void | Promise): void; /** Shorthand for `onFileEvent('unlink', handler)`. */ onFileUnlink(handler: (filePath: string) => void | Promise): void; /** * Send a custom HMR event to all connected clients. * The client can listen with `import.meta.hot.on('boltdocs:plugin:', ...)`. */ send(event: string, data?: unknown): void; } /** * Plugin Server API — register HTTP middleware and lifecycle hooks * for the dev server and preview server, without writing a Vite plugin. */ interface PluginServerAPI { /** * Register a Connect-style middleware function. * Runs on both dev and preview servers. */ use(middleware: PluginServerMiddleware): void; /** * Register a middleware scoped to a specific path prefix. * Only requests starting with `path` trigger the handler. */ useAt(path: string, handler: PluginServerMiddleware): void; /** Called when the dev/preview server starts (once per process). */ onStart(callback: () => void | Promise): void; /** Called when the server shuts down (cleanup). */ onEnd(callback: () => void | Promise): void; } /** * Connect-style middleware signature. */ type PluginServerMiddleware = (req: _$http.IncomingMessage, res: _$http.ServerResponse, next: (err?: unknown) => void) => void | Promise; /** * Plugin lifecycle hooks with full type safety. */ interface PluginLifecycleHooks { beforeBuild?: (ctx: PluginContext) => Promise | void; afterBuild?: (ctx: PluginContext) => Promise | void; beforeDev?: (ctx: PluginContext) => Promise | void; afterDev?: (ctx: PluginContext) => Promise | void; buildEnd?: (ctx: PluginContext) => Promise | void; transformSource?: (ctx: PluginContext, params: TransformSourceParams) => TransformResult<{ code: string; }> | Promise>; transformMdx?: (ctx: PluginContext, params: TransformSourceParams) => TransformResult<{ code: string; }> | Promise>; transformHtml?: (ctx: PluginContext, params: TransformHtmlParams) => TransformResult<{ html: string; }> | Promise>; } /** * MDX processor configuration. * When `processor` is set to 'satteri', the Sätteri Rust-based compiler is used. */ interface BoltdocsMdxConfig { processor?: 'unified' | 'satteri'; } /** * Defines a Boltdocs plugin. * * Use the `createPlugin()` helper from the node API for full type safety and * access to lifecycle hooks. */ interface BoltdocsPlugin { name: string; enforce?: 'pre' | 'post'; version?: string; boltdocsVersion?: string; remarkPlugins?: unknown[]; rehypePlugins?: unknown[]; vitePlugins?: Plugin[]; components?: Record; /** Optional runtime metadata exposed to client via useConfig().plugins[].metadata */ metadata?: Record; /** Declarative transform middleware entries. */ middleware?: PluginTransformMiddleware[]; /** Lifecycle hooks with full type safety */ hooks?: PluginLifecycleHooks; } /** */ /** */ /** */ interface BoltdocsSecurityConfig { headers?: Record; enableCSP?: boolean; customHeaders?: Record; } interface BoltdocsVerificationConfig { google?: string; bing?: string; yandex?: string; pinterest?: string; facebook?: string; } /** * Configuration for SEO. */ interface BoltdocsSeoConfig { metatags?: Record; indexing?: 'all' | 'public'; thumbnails?: { background?: string; }; verification?: BoltdocsVerificationConfig; } /** * Configuration for Google Analytics 4 (GA4). */ interface BoltdocsGA4Config { measurementId: string; debug?: boolean; anonymizeIp?: boolean; sendPageView?: boolean; cookieFlags?: string; autoTrack?: { pageViews?: boolean; downloads?: boolean; externalLinks?: boolean; search?: boolean; }; } /** * Configuration for Google Tag Manager (GTM). */ interface BoltdocsGTMConfig { tagId: string; dataLayerName?: string; preview?: string; } /** * Configuration for Algolia DocSearch. */ interface BoltdocsAlgoliaConfig { appId: string; apiKey: string; indexName: string; } /** * Configuration for Giscus comments. */ interface BoltdocsGiscusConfig { repo: string; repoId: string; category?: string; categoryId?: string; mapping?: 'pathname' | 'url' | 'title' | 'og:title' | 'specific' | 'number'; strict?: '0' | '1' | boolean; reactionsEnabled?: '0' | '1' | boolean; emitMetadata?: '0' | '1' | boolean; inputPosition?: 'top' | 'bottom'; theme?: string; darkTheme?: string; lang?: string; loading?: 'lazy' | 'eager'; } /** * Configuration for custom feedback system using GitHub Discussions API. */ interface BoltdocsCustomFeedbackConfig { enabled: boolean; owner: string; repo: string; categorySlug?: string; endpoint?: string; } interface BoltdocsVercelConfig { analytics?: boolean; speedInsights?: boolean; } interface BoltdocsPostHogConfig { apiKey: string; host?: string; capturePageview?: boolean; capturePageleave?: boolean; sessionRecording?: boolean; autocapture?: boolean; } interface BoltdocsIntegrationsConfig { analytics?: { ga4?: BoltdocsGA4Config; vercel?: BoltdocsVercelConfig; gtm?: BoltdocsGTMConfig; posthog?: BoltdocsPostHogConfig; }; search?: { algolia?: BoltdocsAlgoliaConfig; }; feedback?: { giscus?: BoltdocsGiscusConfig; custom?: BoltdocsCustomFeedbackConfig; }; } /** * Configuration for drafts visibility control. */ interface BoltdocsDraftsConfig { /** If true, drafts are visible in all environments. Default: false */ visible?: boolean; /** Environments where drafts are visible (e.g. ['development', 'staging']). Default: [] */ environments?: string[]; } /** * The root configuration object for Boltdocs. */ interface BoltdocsConfig { siteUrl?: string; docsDir?: string; base?: string; theme?: BoltdocsThemeConfig; i18n?: BoltdocsI18nConfig; versions?: BoltdocsVersionsConfig; mdx?: BoltdocsMdxConfig; plugins?: BoltdocsPlugin[]; collections?: BoltdocsCollectionsConfig; robots?: BoltdocsRobotsConfig; security?: BoltdocsSecurityConfig; seo?: BoltdocsSeoConfig; integrations?: BoltdocsIntegrationsConfig; drafts?: BoltdocsDraftsConfig; featureFlags?: Record; directoryMeta?: Record; vite?: unknown; } /** * Global namespace for Boltdocs types that can be augmented by generated code. * This allows for strictly typed locales and versions based on the project configuration. */ declare global { namespace Boltdocs { interface Types {} /** * Marker interface augmented by generated code to provide strict route path typing. * When no types have been generated (e.g., before first dev server start), * keyof is never, and BoltdocsRoutePath falls back to string. */ interface RoutePaths {} } } type BoltdocsTypes = Boltdocs.Types; type BoltdocsRoutePath = keyof Boltdocs.RoutePaths; type BoltdocsRoutePathWithFallback = BoltdocsRoutePath extends never ? string : BoltdocsRoutePath; type BoltdocsLocale = Boltdocs.Types extends { Locale: infer L; } ? L : string; type BoltdocsVersion = Boltdocs.Types extends { Version: infer V; } ? V : string; type UnpackMdxComponents = T extends { default: infer D; } ? D : T; type TransformMdxComponents = { [K in keyof T as K extends `Frontmatter_${string}` ? never : K]: T[K] } & { Frontmatter: { [K in keyof T as K extends `Frontmatter_${infer Name}` ? Name : never]: T[K] }; }; type BoltdocsMdxComponents = Boltdocs.Types extends { MdxComponents: infer M; } ? TransformMdxComponents> : Omit>, 'Frontmatter'> & { Frontmatter: Record>; }; //#endregion //#region src/client/types.d.ts /** * Metadata provided by the server for a specific route. * Maps closely to the `RouteMeta` type in the Node environment. */ interface ComponentRoute { /** The final URL path */ path: string; /** The absolute filesystem path of the source file */ componentPath: string; /** The page title */ title: string; /** Explicit order in the sidebar */ sidebarPosition?: number; /** The relative path from the docs directory */ filePath: string; /** The group directory name */ group?: string; /** The display title of the group */ groupTitle?: string; /** Explicit order of the group in the sidebar */ groupPosition?: number; /** Extracted markdown headings for search indexing */ headings?: { level: number; text: string; id: string; }[]; /** The page summary or description */ description?: string; /** The locale this route belongs to, if i18n is configured */ locale?: string; /** The version this route belongs to, if versioning is configured */ version?: string; /** Optional icon to display (Lucide icon name or raw SVG) */ icon?: string; /** The tab this route belongs to, if tabs are configured */ tab?: string; /** Optional badge to display next to the sidebar item */ badge?: BadgeValue; /** Optional icon for the route's group */ groupIcon?: string; /** The sub-route group this route belongs to (from folders starting with _) */ subRouteGroup?: string; /** The nested sub-routes if this route acts as the parent of a subRouteGroup */ subRoutes?: ComponentRoute[]; /** Internal helper map for nesting routes during sidebar construction */ _subMap?: Map; /** The extracted plain-text content of the page for search indexing */ _content?: string; /** The raw markdown content of the page */ _rawContent?: string; /** The publication date */ date?: string | Date; /** The last updated timestamp or date */ lastUpdated?: string | number | Date; /** The collection this route belongs to (from [name] directories) */ collection?: string; /** Tags for blog posts */ tags?: string[]; /** Author identifier for blog posts */ author?: string | { name: string; avatar?: string; url?: string; image?: string; }; /** Draft flag */ draft?: boolean; /** Feature flags required for this page to be visible */ featureFlags?: string[]; /** Short excerpt for list displays */ excerpt?: string; /** Cover image for blog posts */ coverImage?: string; /** Optional explicit order (alternative to sidebarPosition) */ order?: number; /** Optional explicit label for the sidebar */ sidebarLabel?: string; /** Optional category for the page */ category?: string; /** Whether the page is hidden from the sidebar */ sidebarHidden?: boolean; /** * Optional nested child routes for sidebar hierarchies that mirror the * server-side `RouteMeta.subRoutes` shape. `sidebar.tsx` walks this * field to render the group → subRoutes → items tree. */ routes?: ComponentRoute[]; /** Raw extensible frontmatter data for custom components and formatters */ frontmatter?: Record; /** Clean URL segments stripped of locale/version prefixes */ slugParts?: string[]; /** SEO metadata for page headers */ seo?: Record; /** Flag to indicate if this is a fallback redirect route */ fallback?: boolean; } /** * Site configuration provided by the server. */ type SiteConfig = BoltdocsConfig; /** * Tab configuration for the documentation site. */ interface BoltdocsTab { id: string; /** Text to display (can be a string or a map of translations) */ text: string | Record; icon?: string; } /** * Props for the Sidebar component. */ interface SidebarProps { routes: ComponentRoute[]; config: BoltdocsConfig; } /** * Props for the OnThisPage (TOC) component. */ interface OnThisPageProps { headings?: { level: number; text: string; id: string; }[]; editLink?: string; communityHelp?: string; filePath?: string; } /** * Props for the Tabs component. */ interface TabsProps { tabs: BoltdocsTab[]; routes: ComponentRoute[]; } /** * Props for user-defined layout components (layout.tsx). */ interface LayoutProps { children: React$2.ReactNode; } /** * Unified type for navbar links. */ interface NavbarLink { label: string | Record; href: BoltdocsRoutePathWithFallback; active: boolean; to?: string; items?: NavbarLink[]; } /** * Shape of the data returned by a collection post route loader. * Consumed by `BlogPost` via `useLoaderData()`. */ interface CollectionPostLoaderData { /** Full route metadata for this post (title, date, author, tags, etc.) */ route: ComponentRoute; /** The name of the collection this post belongs to (e.g. 'blog') */ collection: string; /** Extracted page headings for the Table of Contents */ headings: { level: number; text: string; id: string; }[]; } /** * Shape of the data returned by a collection listing route loader. * Consumed by `BlogList` via `useLoaderData()`. */ interface CollectionListLoaderData { /** Paginated subset of posts to display on this page */ posts: Array<{ path: string; title: string; date?: string | Date; excerpt?: string; tags?: string[]; author?: string; coverImage?: string; filePath: string; }>; /** Total number of pages available */ totalPages: number; /** Current page index (1-based) */ currentPage: number; /** Collection name used to build pagination URLs (e.g. 'blog' → '/blog/page/2') */ collection: string; } //#endregion //#region src/client/components/primitives/types.d.ts type ComponentBase = { className?: string; children?: ReactNode; }; //#endregion //#region src/client/components/primitives/sidebar.d.ts /** * Desktop Sidebar Container */ declare function SidebarRoot({ children, className }: ComponentBase): _$react_jsx_runtime0.JSX.Element; /** * Mobile Sidebar Modal */ declare function SidebarMobile({ children, className }: ComponentBase): _$react_jsx_runtime0.JSX.Element; /** * Shared Header for Sidebar */ declare function SidebarHeader({ children, className }: ComponentBase): _$react_jsx_runtime0.JSX.Element; /** * Scrollable Content Wrapper */ declare function SidebarContent({ children, className }: ComponentBase): _$react_jsx_runtime0.JSX.Element; /** * Navigation Group */ declare function SidebarGroup({ title, icon: Icon, children, className, collapsible, collapsed, active }: { title?: string; icon?: React.ElementType; collapsible?: boolean; collapsed?: boolean; active?: boolean; } & ComponentBase): _$react_jsx_runtime0.JSX.Element; /** * Sidebar Link */ interface SidebarLinkProps extends ComponentBase { label: string; href: BoltdocsRoutePathWithFallback; active?: boolean; icon?: React.ElementType; badge?: ComponentRoute['badge']; } declare function SidebarLink({ label, href, active, icon: Icon, badge, className }: SidebarLinkProps): _$react_jsx_runtime0.JSX.Element; /** * Nested SubGroup */ declare function SidebarSubGroup({ label, href, active, icon: Icon, badge, isOpen, onToggle, children, className }: SidebarLinkProps & { isOpen: boolean; onToggle: () => void; children: ReactNode; }): _$react_jsx_runtime0.JSX.Element; /** * Automated single-route rendering primitive */ interface SidebarItemProps extends ComponentBase { route: ComponentRoute; activePath: string; activeRoute?: ComponentRoute; } declare function SidebarItem({ route, activePath, activeRoute, className }: SidebarItemProps): _$react_jsx_runtime0.JSX.Element; /** * High-level automated routes data rendering primitive */ interface SidebarItemsProps extends ComponentBase { routes: ComponentRoute[]; } declare function SidebarItems({ routes, className }: SidebarItemsProps): _$react_jsx_runtime0.JSX.Element; /** * Main Sidebar Export */ declare const Sidebar: typeof SidebarRoot & { Root: typeof SidebarRoot; Mobile: typeof SidebarMobile; Header: typeof SidebarHeader; Content: typeof SidebarContent; Group: typeof SidebarGroup; Link: typeof SidebarLink; SubGroup: typeof SidebarSubGroup; Item: typeof SidebarItem; Items: typeof SidebarItems; }; //#endregion export { BoltdocsRoutePathWithFallback as A, SiteConfig as C, BoltdocsLocale as D, BoltdocsIntegrationsConfig as E, BoltdocsTypes as M, BoltdocsVersion as N, BoltdocsMdxComponents as O, SidebarProps as S, BoltdocsConfig as T, CollectionPostLoaderData as _, SidebarItem as a, NavbarLink as b, SidebarItemsProps as c, SidebarMobile as d, SidebarRoot as f, CollectionListLoaderData as g, BoltdocsTab as h, SidebarHeader as i, BoltdocsSocialLink as j, BoltdocsRoutePath as k, SidebarLink as l, ComponentBase as m, SidebarContent as n, SidebarItemProps as o, SidebarSubGroup as p, SidebarGroup as r, SidebarItems as s, Sidebar as t, SidebarLinkProps as u, ComponentRoute as v, TabsProps as w, OnThisPageProps as x, LayoutProps as y };