import { TRPC_ERROR_CODE_KEY } from '@trpc/server/rpc'; import type { CreateRootTypes, Procedure, ProcedureType, Router, RouterRecord, } from '@trpc/server/unstable-core-do-not-import'; import { IncomingMessage } from 'http'; import type { ZodObject } from 'zod/v4'; import type { $ZodIssue } from 'zod/v4/core'; export { type OpenAPIObject, type SecuritySchemeObject } from 'openapi3-ts/oas31'; export type OpenApiMethod = 'GET' | 'POST' | 'PATCH' | 'PUT' | 'DELETE'; type TRPCMeta = Record; export type OpenApiContentType = | 'application/json' | 'application/x-www-form-urlencoded' // eslint-disable-next-line @typescript-eslint/ban-types | (string & {}); export type OpenApiMeta = TMeta & { openapi?: { enabled?: boolean; method: OpenApiMethod; path: `/${string}`; operationId?: string; summary?: string; description?: string; protect?: boolean; tags?: string[]; contentTypes?: OpenApiContentType[]; deprecated?: boolean; requestHeaders?: ZodObject; responseHeaders?: ZodObject; successDescription?: string; errorResponses?: number[] | Record; }; }; export type OpenApiProcedure = Procedure< ProcedureType, { input: any; output: any; meta: TRPCMeta; } >; export type OpenApiProcedureRecord = Record; export type OpenApiRouter = Router< CreateRootTypes<{ ctx: any; meta: TRPCMeta; errorShape: any; transformer: any; }>, RouterRecord >; export type OpenApiSuccessResponse = D; export interface OpenApiErrorResponse { message: string; code: TRPC_ERROR_CODE_KEY; issues?: $ZodIssue[]; } export type OpenApiResponse = OpenApiSuccessResponse | OpenApiErrorResponse; export type NodeHTTPRequest = IncomingMessage & { body?: unknown; query?: unknown; };