Move all packages to a types directory

This commit is contained in:
Andy Hanson
2017-03-24 14:27:52 -07:00
parent f9869dc191
commit 354cec620d
13846 changed files with 0 additions and 0 deletions
+17
View File
@@ -0,0 +1,17 @@
import * as express from 'express';
import * as errorhandler from 'errorhandler';
var app = express();
app.use(errorhandler());
app.use(errorhandler({ log: true }));
app.use(errorhandler({ log: (err, str, req, res) => {
const { message, name, stack } = err;
const messageIsStr = message === str;
const requestWasFresh = req && req.fresh;
const responseContentType = res && res.contentType
}}))
+31
View File
@@ -0,0 +1,31 @@
// Type definitions for errorhandler
// Project: https://github.com/expressjs/errorhandler
// Definitions by: Santi Albo <https://github.com/santialbo/>
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
import * as express from 'express';
declare function errorHandler(options?: errorHandler.Options): express.ErrorRequestHandler;
declare namespace errorHandler {
interface LoggingCallback {
(err: Error, str: string, req: express.Request, res: express.Response): void;
}
interface Options {
/**
* Defaults to true.
*
* Possible values:
* true : Log errors using console.error(str).
* false : Only send the error back in the response.
* A function : pass the error to a function for handling.
*/
log: boolean | LoggingCallback;
}
}
export = errorHandler;
+22
View File
@@ -0,0 +1,22 @@
{
"compilerOptions": {
"module": "commonjs",
"lib": [
"es6"
],
"noImplicitAny": true,
"noImplicitThis": true,
"strictNullChecks": false,
"baseUrl": "../",
"typeRoots": [
"../"
],
"types": [],
"noEmit": true,
"forceConsistentCasingInFileNames": true
},
"files": [
"index.d.ts",
"errorhandler-tests.ts"
]
}