import 'reflect-metadata'; import { Context, HttpResponse } from './http'; import { OpenApiDecorator } from './openapi'; import { ServiceManager } from './service-manager'; /** * Interface of a function that can be returned in a hook function. This function is then * executed after the controller method execution. * * @export */ export type HookPostFunction = (response: HttpResponse) => void | Promise; /** * Interface of a function from which a hook can be created. * * @export */ export type HookFunction = (ctx: C, services: ServiceManager) => void | HttpResponse | HookPostFunction | Promise; /** * Interface of a hook. It is actually the interface of a decorator. * * @export */ export type HookDecorator = (target: any, propertyKey?: string) => any; /** * Create a hook from one or several functions. * * @export * @param {HookFunction[]} hookFunction - The function from which the hook should be created. * @returns {HookDecorator} - The hook decorator. */ export declare function Hook(hookFunction: HookFunction, openApiDecorators?: OpenApiDecorator[], options?: { openapi?: boolean; }): HookDecorator; /** * Get the function from which the hook was made. * * @export * @param {HookDecorator} hook - The hook decorator. * @returns {HookFunction} The hook function. */ export declare function getHookFunction(hook: HookDecorator): HookFunction; /** * Get the functions from which the hook was made. * * @export * @param {HookDecorator} hook - The hook decorator. * @returns {HookFunction[]} The hook functions. */ export declare function getHookFunctions(hook: HookDecorator): HookFunction[]; /** * Group multiple hooks into a new one. * * @export * @param {...HookDecorator[]} hookDecorators - The hooks to merge. * @returns {HookDecorator} The new hook. */ export declare function MergeHooks(...hookDecorators: HookDecorator[]): HookDecorator;