Add basic express-flash definition

express-flash just implements connenct-flash so there is no need to
define anything beside the single RequestHandler function that it
exports.
This commit is contained in:
Ian Mobley
2018-04-03 13:42:25 -07:00
parent 52d2ffdc87
commit 2eaf80dd72
4 changed files with 47 additions and 0 deletions

View File

@@ -0,0 +1,12 @@
import express = require('express');
import flash = require('express-flash');
const app = express();
app.use(flash());
app.use((req) => {
req.flash();
req.flash('message');
req.flash('event', 'message');
});

11
types/express-flash/index.d.ts vendored Normal file
View File

@@ -0,0 +1,11 @@
// Type definitions for express-flash 0.0
// Project: https://github.com/RGBboy/express-flash
// Definitions by: Ian Mobley <https://github.com/iMobs>
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
// TypeScript Version: 2.2
/// <reference types="connect-flash" />
import express = require('express');
declare function flash(): express.RequestHandler;
export = flash;

View File

@@ -0,0 +1,23 @@
{
"compilerOptions": {
"module": "commonjs",
"lib": [
"es6"
],
"noImplicitAny": true,
"noImplicitThis": true,
"strictNullChecks": true,
"strictFunctionTypes": true,
"baseUrl": "../",
"typeRoots": [
"../"
],
"types": [],
"noEmit": true,
"forceConsistentCasingInFileNames": true
},
"files": [
"index.d.ts",
"express-flash-tests.ts"
]
}

View File

@@ -0,0 +1 @@
{ "extends": "dtslint/dt.json" }