dino-core
Version:
A dependency injection framework for NodeJS applications
23 lines (22 loc) • 912 B
TypeScript
export type PropertyKey = string | number | symbol;
export declare abstract class AbstractInterceptor {
/**
* Intercept the execution executing logic before and/or after the method execution.
*
* @param {Injectable} obj the injectable object
* @param {String} prop the name of the method or property that is accessed via this proxy
* @returns {Function} a function accepting the incoming argument that is able to execute the required logic
* The firm for the returned function would be:
* ```javascript
* (...args) => {}
* ```
*/
intercept(_obj: any, _prop: PropertyKey): any;
/**
* Validate if the current interceptor is applicable
*
* @param {Any} obj the current object target of the proxy
* @param {String} prop the method or property name currently invoked
*/
isApplicable(_obj: any, _prop: PropertyKey): boolean;
}