mirror of
https://github.com/gosticks/DefinitelyTyped.git
synced 2026-10-03 14:27:04 +00:00
modify tsconfig and tslint.json
This commit is contained in:
@@ -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
@@ -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;
|
||||
|
||||
@@ -7,7 +7,7 @@
|
||||
"noImplicitAny": true,
|
||||
"noImplicitThis": true,
|
||||
"strictFunctionTypes": true,
|
||||
"strictNullChecks": false,
|
||||
"strictNullChecks": true,
|
||||
"baseUrl": "../",
|
||||
"typeRoots": [
|
||||
"../"
|
||||
|
||||
@@ -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" }
|
||||
|
||||
Reference in New Issue
Block a user