lakutata
Version:
An IoC-based universal application framework.
22 lines (17 loc) • 1.08 kB
TypeScript
import '../vendor/TypeDef.2.js';
import { M as MethodDecorator } from '../vendor/TypeDef.10.js';
type BeforeFunction<ClassPrototype extends Object, Method extends (...args: any[]) => unknown> = (this: ClassPrototype, ...args: Parameters<Method>) => Promise<Parameters<Method> | void> | Parameters<Method> | void;
type AfterFunction<ClassPrototype extends Object, Method extends (...args: any[]) => unknown> = (this: ClassPrototype, result: Awaited<ReturnType<Method>>) => Promise<ReturnType<Method> | void> | ReturnType<Method> | void;
/**
* Method Decorator
* @param afterFunc
* @constructor
*/
declare function After<ClassPrototype extends Object, Method extends (...args: any[]) => unknown>(afterFunc: AfterFunction<ClassPrototype, Method>): MethodDecorator<ClassPrototype, Method>;
/**
* Method Decorator
* @param beforeFunc
* @constructor
*/
declare function Before<ClassPrototype extends Object, Method extends (...args: any[]) => unknown>(beforeFunc: BeforeFunction<ClassPrototype, Method>): MethodDecorator<ClassPrototype, Method>;
export { After, Before };