diff --git a/types/microrouter/index.d.ts b/types/microrouter/index.d.ts index 6d65adc8a1..934affd630 100644 --- a/types/microrouter/index.d.ts +++ b/types/microrouter/index.d.ts @@ -8,12 +8,13 @@ import { IncomingMessage, ServerResponse, Server } from 'http'; import { RequestHandler } from 'micro'; - +export type ServerResponse = ServerResponse; +export type ServerRequest = IncomingMessage & { + params: { [key: string]: string }, + query: { [key: string]: string } +}; export type AugmentedRequestHandler = ( - req: IncomingMessage & { - params: {[key: string]: string}, - query: {[key: string]: string} - }, + req: ServerRequest, res: ServerResponse ) => any;