mirror of
https://github.com/zhigang1992/DefinitelyTyped.git
synced 2026-05-30 10:35:22 +08:00
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:
12
types/express-flash/express-flash-tests.ts
Normal file
12
types/express-flash/express-flash-tests.ts
Normal 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
11
types/express-flash/index.d.ts
vendored
Normal 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;
|
||||
23
types/express-flash/tsconfig.json
Normal file
23
types/express-flash/tsconfig.json
Normal 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"
|
||||
]
|
||||
}
|
||||
1
types/express-flash/tslint.json
Normal file
1
types/express-flash/tslint.json
Normal file
@@ -0,0 +1 @@
|
||||
{ "extends": "dtslint/dt.json" }
|
||||
Reference in New Issue
Block a user