import * as express from 'express'; export type JsonValue = string | number | boolean | JsonObject | null; interface JsonObject { [x: string]: JsonValue | undefined; } interface JsonArray extends Array { } export type JsonSerializableValue = string | number | boolean | Date | JsonSerializableObject | JsonSerializableArray | null; export interface JsonSerializableObject { [x: string]: JsonSerializableValue | undefined; } interface JsonSerializableArray extends Array { } type WithBody = C & { body: BodyType }; export type ResponseBody = JsonSerializableValue; export type Request = Omit & C; interface Handler { (req: Request, res: express.Response): Promise | R | void; } interface CanHandle extends express.RequestHandler { (req: C & express.Request, res: express.Response): void; } export interface Router extends CanHandle { use(fn: Handler): this; // Mount another router use(router: CanHandle): this; // Mount a normal express app use(expressApp: express.Router): this; use(path: string, fn: express.RequestHandler): this; param(name: string, handler: Handler): this; get(path: string, handler: Handler): this; put(path: string, handler: Handler,R>): this; post(path: string, handler: Handler,R>): this; delete(path: string, handler: Handler,R>): this; } export default function createRouter(): Router;