import type { Infer, Pred } from 'runtyp'; import { type BuiltinRouteFailures, type DefineErrorsInput, type RouteFailuresFor } from './defineErrors'; import { emptyObjectInput } from './routeDefaults'; import { type RouteHandler, type RouteMeta, type RouteAuth, type RouteScope, type McpRouteConfig, type WiredRoute } from './types'; /** Route preds and meta — the fields on `route()` besides `handler`. */ export type RouteContractInput = { input?: Pred; output?: Pred; errors?: DefineErrorsInput; meta: RouteMeta; auth?: RouteAuth; scope?: RouteScope; mcp?: McpRouteConfig; }; type RouteBase = { meta: RouteMeta; auth?: RouteAuth; scope?: RouteScope; mcp?: McpRouteConfig; }; type InferPred = T extends Pred ? U : never; type InferredInput = [I] extends [undefined] ? Infer : InferPred; type InferredOutput = [O] extends [undefined] ? void : InferPred; /** Route with no domain errors — builtins only on the handler return type. */ export declare function route | undefined, O extends Pred | undefined, Ctx>(def: RouteBase & { input?: I; output?: O; errors?: undefined; handler: RouteHandler, InferredOutput, Ctx, BuiltinRouteFailures>; }): WiredRoute, InferredOutput, Ctx>; /** Route with domain errors declared on `errors:`. */ export declare function route | undefined, O extends Pred | undefined, Ctx, const E extends DefineErrorsInput>(def: RouteBase & { input?: I; output?: O; errors: E; handler: RouteHandler, InferredOutput, Ctx, RouteFailuresFor>; }): WiredRoute, InferredOutput, Ctx>; export {};