fix export finalhandle as function

This commit is contained in:
James Moey
2016-10-09 14:13:19 +11:00
parent e623c6b316
commit eb6ec6b5f7
2 changed files with 10 additions and 8 deletions
+1 -1
View File
@@ -1,7 +1,7 @@
/// <reference path="./finalhandler.d.ts" />
import {ServerRequest, ServerResponse} from "http";
import finalHandler from "finalhandler";
import * as finalHandler from "finalhandler";
let req: ServerRequest;
let res: ServerResponse;
+9 -7
View File
@@ -8,13 +8,15 @@
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?: finalHandler.Options): (err: any) => void;
namespace finalHandler {
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;
export = finalHandler;
}