import * as _btst_stack_plugins_client from '@btst/stack/plugins/client';
import * as React from 'react';
import * as _btst_yar from '@btst/yar';
import { QueryClient } from '@tanstack/react-query';
import { a as SitemapEntry, b as ClientStackContext } from '../../../shared/stack.7n9Y_u7N.js';
import '@btst/db';
import 'better-call';

/**
 * Represents a documented route parameter
 */
interface RouteParameter {
    name: string;
    type: string;
    required: boolean;
    description?: string;
    schema?: Record<string, any>;
}
/**
 * Sitemap entry with plugin source
 */
interface PluginSitemapEntry extends SitemapEntry {
    pluginKey: string;
}
/**
 * Represents a documented route
 */
interface DocumentedRoute {
    /** Route key from the plugin */
    key: string;
    /** The route path pattern (e.g., "/users/:id") */
    path: string;
    /** Path parameters extracted from the path */
    pathParams: RouteParameter[];
    /** Query parameters from the route's query schema */
    queryParams: RouteParameter[];
    /** Route metadata */
    meta?: {
        title?: string;
        description?: string;
        tags?: string[];
        [key: string]: any;
    };
}
/**
 * Represents a plugin's documented routes
 */
interface DocumentedPlugin {
    /** Plugin key */
    key: string;
    /** Plugin name */
    name: string;
    /** Routes from this plugin */
    routes: DocumentedRoute[];
    /** Sitemap entries from this plugin */
    sitemapEntries: PluginSitemapEntry[];
}
/**
 * The complete route documentation schema
 */
interface RouteDocsSchema {
    /** All documented plugins */
    plugins: DocumentedPlugin[];
    /** Generation timestamp */
    generatedAt: string;
    /** All sitemap entries aggregated */
    allSitemapEntries: PluginSitemapEntry[];
}

/**
 * Query key for route docs schema
 */
declare const ROUTE_DOCS_QUERY_KEY: readonly ["route-docs", "schema"];
/**
 * Get the stored client stack context
 * Used by the docs page component to generate schema on client-side navigation
 */
declare function getStoredContext(): ClientStackContext | null;
/**
 * Generate the route docs schema from the stored context
 * This can be called from both server and client
 */
declare function generateSchema(): Promise<RouteDocsSchema>;
/**
 * Configuration for Route Docs client plugin
 */
interface RouteDocsClientConfig {
    /** React Query client for SSR prefetching */
    queryClient: QueryClient;
    /** Title for the documentation page */
    title?: string;
    /** Description for the documentation page */
    description?: string;
    /** Site base path for constructing URLs (e.g., "/pages") */
    siteBasePath: string;
}
/**
 * Route Docs client plugin
 * Provides a route that displays documentation for all client routes
 */
declare const routeDocsClientPlugin: (config: RouteDocsClientConfig) => _btst_stack_plugins_client.ClientPlugin<Record<string, never>, {
    docs: {
        (inputCtx_0?: _btst_yar.InputContext<"/route-docs", _btst_yar.RouteOptions> | undefined): {
            PageComponent?: React.ComponentType<unknown> | undefined;
            LoadingComponent?: React.ComponentType<unknown> | undefined;
            ErrorComponent?: React.ComponentType<unknown> | undefined;
            loader?: (() => Promise<void>) | undefined;
            meta?: (() => ({
                title: string;
                name?: undefined;
                content?: undefined;
            } | {
                name: string;
                content: string;
                title?: undefined;
            })[]) | undefined;
            extra?: (() => any) | undefined;
        };
        options: _btst_yar.RouteOptions | undefined;
        path: "/route-docs";
        meta: _btst_yar.RouteMeta | undefined;
    };
}>;

export { ROUTE_DOCS_QUERY_KEY, generateSchema, getStoredContext, routeDocsClientPlugin };
export type { RouteDocsClientConfig };
