UNPKG

@hapiness/core

Version:

Project to have a HapiJS (https://hapijs.com/) based framework to create easier NodeJS back-end with some awesome features

26 lines (25 loc) 747 B
import { Observable } from 'rxjs'; import { Type } from './decorators'; export declare class HookManager { private static logger; /** * Check if a token has a hook implemented * * @param {string} hook * @param {Type} token * @returns boolean */ static hasLifecycleHook<T>(hook: string, token: Type<T>): boolean; /** * Trigger the hook if * it is implemented * * @param {string} hook * @param {Type} token * @param {T} instance * @param {any[]} args * @param {boolean} throwErr * @returns Observable */ static triggerHook<T>(hook: string, token: Type<any>, instance: T, args?: any[], throwErr?: boolean): Observable<any>; }