export type HookCallback = (...args: unknown[]) => unknown; export interface HookEntry { callback: HookCallback; orderIndex: number; runOnce: boolean; initialHook: boolean; skip: boolean; } /** * The class represents a collection that allows to manage hooks (add, remove). * * @class HooksBucket */ export declare class HooksBucket { #private; /** * Initializes the bucket and pre-creates empty hook collections for all currently registered hook names. */ constructor(); /** * Gets all hooks for the provided hook name. * * @param {string} hookName The name of the hook. * @returns {HookEntry[]} */ getHooks(hookName: string): HookEntry[]; /** * Adds a new hook to the collection. * * @param {string} hookName The name of the hook. * @param {Function} callback The callback function to add. * @param {{ orderIndex?: number, runOnce?: boolean, initialHook?: boolean }} options The options object. */ add(hookName: string, callback: HookCallback, options?: { orderIndex?: number; runOnce?: boolean; initialHook?: boolean; }): void; /** * Checks if there are any hooks for the provided hook name. * * @param {string} hookName The name of the hook. * @returns {boolean} */ has(hookName: string): boolean; /** * Removes a hook from the collection. If the hook was found and removed, * the method returns `true`, otherwise `false`. * * @param {string} hookName The name of the hook. * @param {*} callback The callback function to remove. * @returns {boolean} */ remove(hookName: string, callback: HookCallback): boolean; /** * Destroys the bucket. */ destroy(): void; }