modify tsconfig and tslint.json

This commit is contained in:
simmons8616
2018-08-23 17:55:46 +08:00
parent 8415d3ef91
commit 461268efc5
4 changed files with 20 additions and 27 deletions
@@ -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'
};
+17 -14
View File
@@ -5,31 +5,34 @@
// TypeScript Version: 2.2
/// <reference types="node" />
/// <reference types="express" />
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;
+1 -1
View File
@@ -7,7 +7,7 @@
"noImplicitAny": true,
"noImplicitThis": true,
"strictFunctionTypes": true,
"strictNullChecks": false,
"strictNullChecks": true,
"baseUrl": "../",
"typeRoots": [
"../"
+1 -11
View File
@@ -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" }