import { z } from 'zod/v4'; import type { CommonRouteDefinitionMetadata, InferSchemaOutput, RoutePathResolver } from '../apiContracts.ts'; import type { Exactly } from '../typeUtils.ts'; import { ContractNoBody } from './constants.ts'; import { type ResponsesByStatusCode, type SseSchemaByEventName } from './contractResponse.ts'; export type RequestPathParamsSchema = z.ZodObject; export type RequestQuerySchema = z.ZodObject; export type RequestHeaderSchema = z.ZodObject; export type ResponseHeaderSchema = z.ZodObject; export type CommonApiContract = { pathResolver: RoutePathResolver; requestPathParamsSchema?: RequestPathParamsSchema; requestQuerySchema?: RequestQuerySchema; requestHeaderSchema?: RequestHeaderSchema; responseHeaderSchema?: ResponseHeaderSchema; responsesByStatusCode: ResponsesByStatusCode; metadata?: CommonRouteDefinitionMetadata; summary?: string; description?: string; tags?: readonly string[]; }; export type GetApiContract = CommonApiContract & { method: 'get'; requestBodySchema?: never; }; export type DeleteApiContract = CommonApiContract & { method: 'delete'; requestBodySchema?: never; }; export type PayloadApiContract = CommonApiContract & { method: 'post' | 'put' | 'patch'; requestBodySchema: typeof ContractNoBody | z.ZodType; }; export type ApiContract = GetApiContract | DeleteApiContract | PayloadApiContract; type TypedPathApiContract = Omit & { pathResolver: RoutePathResolver>; requestPathParamsSchema?: T; }; export declare const defineApiContract: >(contract: Exactly> & { requestPathParamsSchema?: PathParamsSchema; }) => Contract; export declare const mapApiContractToPath: (routeConfig: ApiContract) => string; export declare const describeApiContract: (routeConfig: ApiContract) => string; export declare const getSseSchemaByEventName: (routeConfig: ApiContract) => SseSchemaByEventName | null; export declare const hasAnySuccessSseResponse: (apiContract: ApiContract) => boolean; export declare const getSuccessResponseSchema: (routeConfig: ApiContract) => z.ZodType | null; export declare const getIsEmptyResponseExpected: (routeConfig: ApiContract) => boolean; export {};