@decaf-ts/db-decorators
Version:
Agnostic database decorators and repository
39 lines (38 loc) • 1.81 kB
TypeScript
/**
* @summary Util method to change a method of an object prefixing it with another
* @param {any} obj The Base Object
* @param {Function} after The original method
* @param {Function} prefix The Prefix method. The output will be used as arguments in the original method
* @param {string} [afterName] When the after function anme cannot be extracted, pass it here
*
* @function prefixMethod
*
* @memberOf module:db-decorators
*/
export declare function prefixMethod(obj: any, after: (...args: any[]) => any, prefix: (...args: any[]) => any, afterName?: string): void;
/**
* @summary Util method to change a method of an object suffixing it with another
* @param {any} obj The Base Object
* @param {Function} before The original method
* @param {Function} suffix The Prefix method. The output will be used as arguments in the original method
* @param {string} [beforeName] When the after function anme cannot be extracted, pass it here
*
* @function suffixMethod
*
* @memberOf module:db-decorators.Repository
*/
export declare function suffixMethod(obj: any, before: (...args: any[]) => any, suffix: (...args: any[]) => any, beforeName?: string): void;
/**
* @summary Util method to wrap a method of an object with additional logic
*
* @param {any} obj The Base Object
* @param {Function} before the method to be prefixed
* @param {Function} method the method to be wrapped
* @param {Function} after The method to be suffixed
* @param {string} [methodName] When the after function anme cannot be extracted, pass it here
*
* @function wrapMethodWithContext
*
* @memberOf module:db-decorators
*/
export declare function wrapMethodWithContext(obj: any, before: (...args: any[]) => any, method: (...args: any[]) => any, after: (...args: any[]) => any, methodName?: string): void;