import { flushCache } from "./cache.mjs"; import { i as handleVercelFeedback, n as handleWebFeedback, r as handleNetlifyFeedback, t as handleAwsFeedback } from "../index-1KsTDq4o.mjs"; import { a as BoltdocsThemeConfig, c as PluginLogger, d as PluginTransformMiddleware, f as RouteMeta, i as BoltdocsPlugin, l as PluginMeta, n as defineConfig, o as PluginContext, r as BoltdocsConfig, s as PluginLifecycleHooks, t as resolveConfig, u as PluginStore } from "../config-xtS0ZkMm.mjs"; import { z } from "zod"; import { InlineConfig, Plugin } from "vite"; export * from "@bdocs/unist-utils"; //#region src/node/plugin/types.d.ts /** * Configuration options specifically for the Boltdocs Vite plugin. */ interface BoltdocsPluginOptions { /** The root directory containing markdown files (default: 'docs') */ docsDir?: string; /** Enable turbo mode (Sätteri MDX compiler) */ turbo?: boolean; } //#endregion //#region src/node/plugin/entry.d.ts /** * Generates the raw source code for the virtual entry file (`\0virtual:boltdocs-entry`). * This code initializes the client-side React application. * * @param options - Plugin options containing potential custom overrides (like `homePage` or `customCss`) * @param config - The resolved Boltdocs configuration containing custom plugins and components * @returns A string of JavaScript code to be evaluated by the browser */ declare function generateEntryCode(options: BoltdocsPluginOptions, config?: BoltdocsConfig): string; //#endregion //#region src/node/routes/index.d.ts /** * Invalidates the global route metadata and clears local state. */ declare function invalidateRouteCache(): void; /** * Generates the entire route map for the documentation site. * * Automatically handles versioning and i18n routing, including fallback * generation for missing translations. * * @param docsDir - The root documentation directory * @param config - The Boltdocs configuration * @param basePath - The base URL path for the routes (default: '/docs') * @returns A promise resolving to an array of RouteMeta objects */ declare function generateRoutes(docsDir: string, config?: BoltdocsConfig, basePath?: string, forceScan?: boolean, turbo?: boolean): Promise; //#endregion //#region src/node/plugins/plugin-types.d.ts interface SecureBoltdocsPlugin { name: string; enforce?: 'pre' | 'post'; version?: string; boltdocsVersion?: string; remarkPlugins?: unknown[]; rehypePlugins?: unknown[]; vitePlugins?: Plugin[]; components?: Record; metadata?: Record; middleware?: PluginTransformMiddleware[]; hooks?: PluginLifecycleHooks; } //#endregion //#region src/node/plugins/plugin-errors.d.ts declare class PluginError extends Error { readonly pluginName: string; name: string; constructor(pluginName: string, message: string, options?: ErrorOptions); } declare class PluginValidationError extends PluginError { constructor(pluginName: string, message: string); } declare class PluginCompatibilityError extends PluginError { constructor(pluginName: string, message: string); } declare class PluginHookError extends PluginError { readonly hookName: string; constructor(pluginName: string, hookName: string, originalError: Error); } //#endregion //#region src/node/plugins/plugin-store.d.ts /** * Implementation of the shared plugin store. * Uses a namespaced approach to prevent key collisions between plugins. */ declare class BoltdocsPluginStore implements PluginStore { private data; /** * Internal helper to create a namespaced key. */ private getNamespaceKey; /** * Retrieves a value from the store. Returns a deep clone to prevent mutations (side-effects). */ get(pluginName: string, key: string): T | undefined; /** * Stores a value in the store. Key is automatically namespaced. */ set(pluginName: string, key: string, value: unknown): void; /** * Checks for the existence of a key in the store. */ has(pluginName: string, key: string): boolean; } //#endregion //#region src/node/plugins/plugin-validator.d.ts declare function validatePlugins(plugins: any[], boltdocsVersion: string): SecureBoltdocsPlugin[]; //#endregion //#region src/node/plugins/plugin-lifecycle.d.ts declare class PluginLifecycleManager { private plugins; private config; private store; private docsDir; private rootDir; private routes; private outDir; constructor(plugins: SecureBoltdocsPlugin[], config: BoltdocsConfig, docsDir?: string, rootDir?: string, routes?: RouteMeta[], outDir?: string); runHook(hookName: keyof PluginLifecycleHooks, ...args: unknown[]): Promise; runChain>(hookName: keyof PluginLifecycleHooks, initialParams: TParams): Promise; /** * Run registered transform middleware in `enforce` order over a chain of * params. Middleware registered via `ctx.middleware.add()` from lifecycle * hooks or declared statically via `BoltdocsPlugin.middleware` are all * collected. Execution respects `__signal: 'skip'` and `__signal: 'break'`. */ runMiddlewareChain>(hookName: 'transformSource' | 'transformMdx' | 'transformHtml', initialParams: TParams): Promise; private getSortedPlugins; private createStep; private createContext; private createGenericContext; private createLogger; } //#endregion //#region src/node/plugins/index.d.ts declare function createPlugin(plugin: SecureBoltdocsPlugin): SecureBoltdocsPlugin; //#endregion //#region src/node/feedback/handler.d.ts interface FeedbackHandlerOptions { owner?: string; repo?: string; categorySlug?: string; token?: string; appId?: string; privateKey?: string; installationId?: string; } declare function handleFeedback(payload: unknown, env?: Record, options?: FeedbackHandlerOptions): Promise<{ success: boolean; }>; //#endregion //#region src/node/utils.d.ts /** * Normalizes a file path by replacing Windows backslashes with forward slashes. * Ensures consistent path handling across different operating systems. * * @param p - The file path to normalize * @returns The normalized path using forward slashes */ declare function normalizePath(p: string): string; /** * Sanitizes a filename or path component by removing dangerous characters. * Prevents multiple dots to avoid path traversal tricks. * * @param name - The name to sanitize * @returns The sanitized name */ declare function sanitizeFilename(name: string): string; declare namespace index_d_exports { export { BoltdocsConfig, BoltdocsPlugin, BoltdocsPluginOptions, BoltdocsPluginStore, BoltdocsThemeConfig, PluginCompatibilityError, PluginContext, PluginError, PluginHookError, PluginLifecycleHooks, PluginLifecycleManager, PluginLogger, PluginMeta, PluginStore, PluginValidationError, RouteMeta, SecureBoltdocsPlugin, createPlugin, createViteConfig, boltdocs as default, defineConfig, flushCache, generateEntryCode, generateRoutes, handleAwsFeedback, handleFeedback, handleNetlifyFeedback, handleVercelFeedback, handleWebFeedback, invalidateRouteCache, normalizePath, resolveConfig, sanitizeFilename, validatePlugins }; } declare function boltdocs(options?: BoltdocsPluginOptions): Promise; /** * Generates the complete Vite configuration for a Boltdocs project. * This is used by the Boltdocs CLI to run Vite without a user-defined vite.config.ts. */ declare function createViteConfig(root: string, mode?: 'development' | 'production', preResolvedConfig?: BoltdocsConfig, turbo?: boolean): Promise; //#endregion export { type BoltdocsConfig, type BoltdocsPlugin, type BoltdocsPluginOptions, BoltdocsPluginStore, type BoltdocsThemeConfig, PluginCompatibilityError, type PluginContext, PluginError, PluginHookError, type PluginLifecycleHooks, PluginLifecycleManager, type PluginLogger, type PluginMeta, type PluginStore, PluginValidationError, type RouteMeta, SecureBoltdocsPlugin, createPlugin, createViteConfig, boltdocs as default, defineConfig, flushCache, generateEntryCode, generateRoutes, handleAwsFeedback, handleFeedback, handleNetlifyFeedback, handleVercelFeedback, handleWebFeedback, invalidateRouteCache, normalizePath, resolveConfig, sanitizeFilename, validatePlugins };