import { IRouter, RequestHandler as ExpressRequestHandler, ErrorRequestHandler } from 'express'; import { TypeInfo } from 'rtti'; import { HttpSchema, Method } from '../shared'; import { Paths } from '../util'; import { RequestHandler } from './create-request-handler'; /** Options for decorateExpressRouter. */ export interface DecorateExpressRouterOptions { /** Type schema describing the endpoints handled by the express server. */ schema: Schema; /** Express app or router. Default value is `express.Router()`. */ router?: App; /** TODO: doc... */ requestProps?: ReqProps; /** * Optional request handler to delegate to if a server-side validation error occurs. If this option is not * specified, the default behaviour is to respond with a 400 status code. */ onValidationError?: ErrorRequestHandler; } /** * Returns a decorated copy of the given express application or router, with strongly-typed `get`/`post` methods * and runtime validation checks on request/response bodies. The given app/router is not modified. */ export declare function decorateExpressRouter>(options: DecorateExpressRouterOptions): DecoratedExpressRouter; /** A strongly-typed express application/router. */ export declare type DecoratedExpressRouter = ExpressRequestHandler & Omit> & { [M in Method as Lowercase]:

>(path: P, ...handlers: Array | Array>) => void; };