mirror of
https://github.com/zhigang1992/DefinitelyTyped.git
synced 2026-04-23 21:00:01 +08:00
Add definitions for api-error-handler (https://github.com/expressjs/api-error-handler)
This commit is contained in:
11
api-error-handler/api-error-handler-tests.ts
Normal file
11
api-error-handler/api-error-handler-tests.ts
Normal file
@@ -0,0 +1,11 @@
|
||||
/// <reference path="api-error-handler.d.ts" />
|
||||
|
||||
import errorHandler = require('api-error-handler');
|
||||
import express = require('express');
|
||||
|
||||
var api = express.Router();
|
||||
api.get('/users/:userid', function (req, res, next) {
|
||||
|
||||
});
|
||||
|
||||
api.use(errorHandler());
|
||||
14
api-error-handler/api-error-handler.d.ts
vendored
Normal file
14
api-error-handler/api-error-handler.d.ts
vendored
Normal file
@@ -0,0 +1,14 @@
|
||||
// Type definitions for api-error-handler v1.0.0
|
||||
// Project: https://github.com/expressjs/api-error-handler
|
||||
// Definitions by: Tanguy Krotoff <https://github.com/tkrotoff>
|
||||
// Definitions: https://github.com/borisyankov/DefinitelyTyped
|
||||
|
||||
/// <reference path="../express/express.d.ts" />
|
||||
|
||||
declare module 'api-error-handler' {
|
||||
import express = require('express');
|
||||
|
||||
function apiErrorHandler(options?: any): express.ErrorRequestHandler;
|
||||
|
||||
export = apiErrorHandler;
|
||||
}
|
||||
Reference in New Issue
Block a user