2.0.2 • Published 2 years ago
@dawnjs/types v2.0.2
@dawnjs/types
安装依赖
$ npm install --save-dev @dawnjs/types
使用方式
// 中间件的 TS 入口文件
// src/index.ts
import * as Dawn from "@dawnjs/types";
interface IOptions {
name?: string;
age?: number;
}
const handler: Dawn.Handler<IOptions> = opts => {
return async (next, ctx) => {
ctx.console.log(`My name is ${opts.name}`);
ctx.console.log(ctx.utils.isFunction(ctx.load));
await next();
};
};
export default handler;
2.0.2
2 years ago
1.8.6
3 years ago
2.0.1
3 years ago
1.8.5
4 years ago
1.8.5-alpha.9
4 years ago
1.8.5-alpha.8
4 years ago
1.8.5-alpha.7
4 years ago
1.8.5-alpha.6
4 years ago
1.8.5-alpha.5
4 years ago
1.8.5-alpha.4
4 years ago
1.8.5-alpha.3
4 years ago
1.8.5-alpha.2
4 years ago
1.8.5-alpha.0
4 years ago