import type { LibSQLDatabase } from "drizzle-orm/libsql"; import { z } from "zod"; import * as schema from "../../db/schema.js"; import type { AppRouteWithFileName, AppRoutesTreeResponse } from "./types.js"; export declare const schemaProbedRoutes: z.ZodObject<{ openApiSpec: z.ZodOptional>; routes: z.ZodArray>; }, "strip", z.ZodTypeAny, { path: string; method: string; handler: string; handlerType: string; openApiSpec?: string | null | undefined; }, { path: string; method: string; handler: string; handlerType: string; openApiSpec?: string | null | undefined; }>, "many">; }, "strip", z.ZodTypeAny, { routes: { path: string; method: string; handler: string; handlerType: string; openApiSpec?: string | null | undefined; }[]; openApiSpec?: unknown; }, { routes: { path: string; method: string; handler: string; handlerType: string; openApiSpec?: string | null | undefined; }[]; openApiSpec?: unknown; }>; /** * Re-registers all app routes in a database transaction * * This is used to update the app routes when the client library reports new routes * * The logic is: * - Unregister all routes (including middleware), by setting currentlyRegistered to false * - Delete all old middleware, since we don't want stale middleware in the database * - Insert all new routes and middleware * - Update all routes that changed * * A route is considered "changed" if there's already a record in the database with * the same path and method, with `handlerType === "route"` and `routeOrigin === "discovered"`, * but the handler or other information is different */ export declare function reregisterRoutes(db: LibSQLDatabase, { routes }: z.infer): Promise; /** * Builds a route tree structure for a file tree browser in the UI. * * This function processes an array of route entries and organizes them into a tree * structure based on their file paths. Routes without a `fileName` are added to an * "unmatched" list. The resulting tree is optimized to consolidate nodes with a single * child into a single path segment. */ export declare function buildRouteTree(entries: Array): AppRoutesTreeResponse;