import { Kapp } from '..'; /** * @interface IHookCallback Contains informations about a registered reorderable callback method for a hook. * @template TSystem The type of the app, service or custom class that executes this hook. */ export interface IHookCallback { /** * @property The order number of this callback. The lowest the value, the first it is called. */ order: number; /** * @property The method to call when this hook is executed. */ callback: (context: IHookContext) => void | Promise; } /** * @interface IHookContext Contains all informations about the context of the hook when it's used. * @template TSystem The type of the app, service or custom class that executes this hook. */ export interface IHookContext { /** * @property The application that contains the service which uses this hook. */ app: Kapp; /** * @property The instance of the app, service or custom class that executes this hook. */ system: TSystem; /** * @property Any data manipulated by the service that uses this hook. */ data: unknown; /** * @property The name of the hook. */ name: string; /** * @property The order number of the current hook callback. */ order: number; }