@adonisjs/ace
Version:
Commandline apps framework used by AdonisJs
15 lines (14 loc) • 452 B
TypeScript
/**
* Exposes the API to register and execute async hooks
*/
export declare class Hooks {
private hooks;
/**
* Register hook for a given action and lifecycle
*/
add(lifecycle: 'before' | 'after', action: string, handler: (...args: any[]) => void | Promise<void>): this;
/**
* Execute hooks for a given action and lifecycle
*/
execute(lifecycle: 'before' | 'after', action: string, data: any): Promise<void>;
}