UNPKG

@nahkies/typescript-koa-runtime

Version:

Runtime package for code generated by @nahkies/openapi-code-generator using the typescript-koa template

8 lines (7 loc) 653 B
import type { z } from "zod"; import { type RequestInputType } from "./errors"; /** @deprecated: update and re-generate to import from @nahkies/typescript-koa-runtime/server directly */ export type { Params } from "./server"; export declare function parseRequestInput<Schema extends z.ZodTypeAny>(schema: Schema, input: unknown, type: RequestInputType): z.infer<Schema>; export declare function parseRequestInput(schema: undefined, input: unknown, type: RequestInputType): undefined; export declare function responseValidationFactory(possibleResponses: [string, z.ZodTypeAny][], defaultResponse?: z.ZodTypeAny): (status: number, value: unknown) => any;