diff --git a/types/express-wechat-access/express-wechat-access-tests.ts b/types/express-wechat-access/express-wechat-access-tests.ts
index 659c5b3639..60cc5d9d88 100644
--- a/types/express-wechat-access/express-wechat-access-tests.ts
+++ b/types/express-wechat-access/express-wechat-access-tests.ts
@@ -3,7 +3,7 @@ import * as weAccessMiddleware from 'express-wechat-access';
const app: express.Application = express();
-const options: weAccessMiddleware.IWeAccessMidOption = {
+const options: weAccessMiddleware.WeAccessMidOption = {
appId: 'xxxxx',
appSecret: 'xxxxx'
};
diff --git a/types/express-wechat-access/index.d.ts b/types/express-wechat-access/index.d.ts
index f871d1733e..fb0d58701d 100644
--- a/types/express-wechat-access/index.d.ts
+++ b/types/express-wechat-access/index.d.ts
@@ -5,31 +5,34 @@
// TypeScript Version: 2.2
///
-///
import { Response, NextFunction } from 'express';
import * as http from 'http';
import { EventEmitter } from 'events';
-interface IMidOption {
- accessTokenUrl?: string;
- ticketUrl?: string;
- appId: string;
- appSecret: string;
- https?: boolean;
-}
-
-type IMiddleware = (req: any, res: Response | http.ServerResponse, next: NextFunction) => any;
+type WeMiddleware = (req: any, res: Response | http.ServerResponse, next: NextFunction) => any;
declare function weAccessMiddleware(
- options: IMidOption,
+ options: {
+ accessTokenUrl?: string;
+ ticketUrl?: string;
+ appId: string;
+ appSecret: string;
+ https?: boolean;
+ },
errorHandler?: (e: any) => any
-): IMiddleware;
+): WeMiddleware;
declare namespace weAccessMiddleware {
- interface IWeAccessMidOption extends IMidOption {}
+ interface WeAccessMidOption {
+ accessTokenUrl?: string;
+ ticketUrl?: string;
+ appId: string;
+ appSecret: string;
+ https?: boolean;
+ }
- interface IWeAccessMiddleware extends IMiddleware, EventEmitter, Function {}
+ interface WeAccessMiddleware extends WeMiddleware, EventEmitter, Function {}
}
export = weAccessMiddleware;
diff --git a/types/express-wechat-access/tsconfig.json b/types/express-wechat-access/tsconfig.json
index 9924528f6b..e24d740f2c 100644
--- a/types/express-wechat-access/tsconfig.json
+++ b/types/express-wechat-access/tsconfig.json
@@ -7,7 +7,7 @@
"noImplicitAny": true,
"noImplicitThis": true,
"strictFunctionTypes": true,
- "strictNullChecks": false,
+ "strictNullChecks": true,
"baseUrl": "../",
"typeRoots": [
"../"
diff --git a/types/express-wechat-access/tslint.json b/types/express-wechat-access/tslint.json
index 886d87b3b7..3db14f85ea 100644
--- a/types/express-wechat-access/tslint.json
+++ b/types/express-wechat-access/tslint.json
@@ -1,11 +1 @@
-{
- "extends": "dtslint/dt.json",
- "rules": {
- "interface-name": false,
- "no-empty-interface": false,
- "no-namespace": false,
- "no-reference-import": false,
- "no-var-keyword": false,
- "strict-export-declare-modifiers": false
- }
-}
+{ "extends": "dtslint/dt.json" }