From 804d7addcc0a87eefa56bde192755286e4918263 Mon Sep 17 00:00:00 2001 From: Ilya Mochalov Date: Tue, 20 Oct 2015 07:48:13 +0500 Subject: [PATCH] finalhandler: definition of the module has been added --- finalhandler/finalhandler.d.ts | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) create mode 100644 finalhandler/finalhandler.d.ts diff --git a/finalhandler/finalhandler.d.ts b/finalhandler/finalhandler.d.ts new file mode 100644 index 000000000..37e931718 --- /dev/null +++ b/finalhandler/finalhandler.d.ts @@ -0,0 +1,20 @@ +// Type definitions for finalhandler +// Project: https://github.com/pillarjs/finalhandler +// Definitions by: Ilya Mochalov +// Definitions: https://github.com/borisyankov/DefinitelyTyped + +/// + +declare module "finalhandler" { + import {ServerRequest, ServerResponse} from "http"; + + export interface Options { + message?: boolean|((err: any, status: number) => string); + onerror?: (err: any, req: ServerRequest, res: ServerResponse) => void; + stacktrace?: boolean; + } + + function finalHandler(req: ServerRequest, res: ServerResponse, options?: Options): (err: any) => void; + + export default finalHandler; +}