/**
 * Build-time manifest generation for @rangojs/router
 *
 * Extracts the prefix tree and route manifest from UrlPatterns at build time.
 * This enables:
 * - Pre-computed prefix tree for fast short-circuit checks
 * - Complete route manifest for href() without runtime evaluation
 * - Support for nested includes
 */
import type { UrlPatterns } from "../urls.js";
/**
 * Node in the prefix tree
 */
export interface PrefixTreeNode {
    /** The static prefix for this node */
    staticPrefix: string;
    /** The full URL prefix (including parent prefixes) */
    fullPrefix: string;
    /** Name prefix for routes in this include */
    namePrefix?: string;
    /** Child nodes (nested includes) */
    children: Record<string, PrefixTreeNode>;
    /** Route names defined directly in this include (not in children) */
    routes: string[];
}
/**
 * Generated manifest containing prefix tree and route mappings
 */
export interface GeneratedManifest {
    /** Nested prefix tree for short-circuit optimization */
    prefixTree: Record<string, PrefixTreeNode>;
    /** Complete route name → pattern mapping for href() */
    routeManifest: Record<string, string>;
    /** Route name → trailing slash mode for trie redirect handling */
    routeTrailingSlash?: Record<string, string>;
    /** Route names using Prerender (for dev-mode Node.js delegation) */
    prerenderRoutes?: string[];
    /** Route names with passthrough: true (handler kept in bundle for live fallback) */
    passthroughRoutes?: string[];
    /** Route name → response type for non-RSC routes */
    responseTypeRoutes?: Record<string, string>;
    /** Route name -> search schema descriptor for typed URL helpers */
    routeSearchSchemas?: Record<string, Record<string, string>>;
    /** Generation timestamp */
    generatedAt: string;
}
/**
 * Generate manifest from UrlPatterns
 *
 * This runs all patterns (including lazy ones) at build time to extract:
 * - The complete prefix tree for short-circuit optimization
 * - The complete route manifest for href()
 *
 * @example
 * ```typescript
 * import { generateManifest } from "@rangojs/router/build";
 * import { urlpatterns } from "./urls";
 *
 * const manifest = generateManifest(urlpatterns);
 * // Write to file for runtime use
 * fs.writeFileSync(
 *   "src/generated/route-manifest.json",
 *   JSON.stringify(manifest, null, 2)
 * );
 * ```
 */
export declare function generateManifest<TEnv>(urlpatterns: UrlPatterns<TEnv, any>, mountIndex?: number): GeneratedManifest & {
    _routeAncestry: Record<string, string[]>;
    _prerenderDefs?: Record<string, any>;
};
/**
 * Generate TypeScript code for the manifest
 *
 * @example
 * ```typescript
 * const code = generateManifestCode(urlpatterns);
 * fs.writeFileSync("src/generated/route-manifest.ts", code);
 * ```
 */
export declare function generateManifestCode<TEnv>(urlpatterns: UrlPatterns<TEnv, any>): string;
//# sourceMappingURL=generate-manifest.d.ts.map