import type { RouteDocsConfig, RouteOptions, VextResponseSchemaConfig, VextResponseSchemaDefinition } from "../types/app.js"; type Serializer = (value: unknown) => string; type DocumentedResponseConfig = NonNullable[string]; export interface RouteResponseSerializerContext { method: string; path: string; sourceFile: string; } export interface ResolvedRouteResponseContract { selector: string; runtime?: VextResponseSchemaConfig; docs?: DocumentedResponseConfig; } interface CompiledResponseEntry { selector: string; data: Serializer; wrapped: Serializer; } export interface CompiledRouteResponseSerializers { method: string; exact: ReadonlyMap; family: ReadonlyMap; default?: CompiledResponseEntry; } export interface ResponseSerializerDiagnostics { routeOptionsCompiled: number; serializerFunctionsCompiled: number; } /** * Compile a route's runtime response schemas before the adapter registration * plan is committed. Reusing the same RouteOptions object for the same HTTP * method is cache-only. The method is part of the cache identity because HEAD * deliberately skips body serializer compilation. */ export declare function prepareRouteResponseSerializers(options: RouteOptions, context: RouteResponseSerializerContext): CompiledRouteResponseSerializers | undefined; /** Retrieve a registration-time result without compiling on the request path. */ export declare function getPreparedRouteResponseSerializers(options: RouteOptions | undefined, method: string | undefined): CompiledRouteResponseSerializers | undefined; /** * Serialize the final post-hook wire value. Routes without a matching runtime * schema preserve the previous JSON.stringify byte behavior. */ export declare function stringifyRouteResponse(serializers: CompiledRouteResponseSerializers | undefined, status: number, value: unknown, wrapped: boolean): string; /** * Merge runtime schemas with docs-only metadata using normalized selectors. * This does not compile and is shared by OpenAPI/frontend projections. */ export declare function collectRouteResponseContracts(options: Pick): ResolvedRouteResponseContract[]; export declare function normalizeRuntimeResponseSelector(selector: string): string; export declare function toOpenApiResponseSelector(selector: string): string; /** * Resolve the runtime schema into the exact closed JSON Schema used by the * registration-time serializers. OpenAPI and frontend contracts consume this * projection so the wire serializer remains the single runtime truth source. */ export declare function resolveRouteResponseJsonSchema(definition: VextResponseSchemaDefinition): Record; export declare function getResponseSerializerDiagnostics(): ResponseSerializerDiagnostics; /** @internal test helper */ export declare function resetResponseSerializerStateForTesting(): void; export declare function normalizeDocumentedResponseSelector(selector: string): string; export {};