kobp
Version:
Koa Boilerplate with MikroORM
16 lines (15 loc) • 603 B
TypeScript
import type { Middleware } from '../context';
import { KobpParsable } from './doc.helpers';
/**
* This will mutates the inputs
* `query` will mutates context.query
* `params` will mutates context.params
* `body` will mutates context.request.body
* `headers` will mutates context.request.headers
*/
export declare const withValidation: <Q extends Record<string, string>, P extends Record<string, string>, H extends Record<string, string>, B = any>(schemaSpec: {
query?: KobpParsable<Q>;
params?: KobpParsable<P>;
body?: KobpParsable<B>;
headers?: KobpParsable<H>;
}) => Middleware;