import { stripSource } from "./graph-tools.js";
import type { CodeIndex, RouteFramework } from "../types.js";
import type { MiddlewareTraceResult } from "../utils/nextjs.js";
interface RouteHandler {
    symbol: ReturnType<typeof stripSource>;
    file: string;
    method?: string;
    framework: RouteFramework;
    router?: "app" | "pages";
}
interface DbCall {
    symbol_name: string;
    file: string;
    line: number;
    operation: string;
}
export interface RouteTraceResult {
    path: string;
    handlers: RouteHandler[];
    call_chain: Array<{
        name: string;
        file: string;
        kind: string;
        depth: number;
    }>;
    db_calls: DbCall[];
    middleware?: MiddlewareTraceResult;
    layout_chain?: string[];
    server_actions?: Array<{
        name: string;
        file: string;
        called_from?: string | undefined;
    }>;
}
/**
 * Match a URL path pattern against a route definition.
 * Handles :param, [param], [...param], [[...param]], <type:name> (Flask/Django),
 * {name} (FastAPI) as wildcards.
 */
export declare function matchPath(routePath: string, searchPath: string): boolean;
/**
 * Find NestJS route handlers via @Controller + @Get/@Post/etc. decorators.
 * Reads raw file content because tree-sitter symbol source may not include decorators.
 */
export declare function findNestJSHandlers(index: CodeIndex, searchPath: string): Promise<RouteHandler[]>;
/**
 * Render a RouteTraceResult as a Mermaid sequence diagram.
 * @internal exported for unit testing
 */
export declare function routeToMermaid(result: RouteTraceResult): string;
/**
 * Trace an HTTP route: find handler, trace callees, identify DB calls.
 */
export declare function traceRoute(repo: string, path: string, outputFormat?: "json" | "mermaid"): Promise<RouteTraceResult | {
    mermaid: string;
}>;
export {};
//# sourceMappingURL=route-tools.d.ts.map