6 Star 16 Fork 5

散漫的水元素 / aspects-js

加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
克隆/下载
aspects.d.ts 1.04 KB
一键复制 编辑 原始数据 按行查看 历史
wangmiao 提交于 2020-05-13 14:29 . 1.0.2 pre
declare namespace Aspects {
type Class = { new(...args: any[]): any; };
export class Context {
readonly type: Class;
readonly fun: Function;
readonly args: any[];
}
export class Pointcut {
constructor(pointcut: string | ((context: Context) => boolean));
matches(context: Context): boolean;
}
export interface Aspect {
readonly pointcut: Pointcut | string | ((context: Context) => boolean);
readonly order: number;
after(joinPoint: JoinPoint, result: any, error: Error): void;
afterReturn(joinPoint: JoinPoint, result: any): any;
afterThrow(joinPoint: JoinPoint, error: Error): void;
before(joinPoint: JoinPoint):void;
around(joinPoint: JoinPoint): any;
}
export class JoinPoint {
readonly type: Class;
readonly fun: Function;
readonly thisArg: any;
readonly target: any;
readonly args: any[];
proceed(...args: any[]): any;
}
}
export = Aspects;
export as namespace Aspects;
JavaScript
1
https://gitee.com/wm123450405/aspects-js.git
git@gitee.com:wm123450405/aspects-js.git
wm123450405
aspects-js
aspects-js
master

搜索帮助