/** * @author Leonid Vinikov * @description Responsible for manging/running/hooking commands. */ import { ObjectBase } from "../bases/object-base"; import type { TCommandCallbackType, ICommandArgsInterface, ILogger } from "../interfaces"; import type { ControllerBase } from "../bases/controller-base"; import type { CommandBase } from "../command-bases/command-base"; export declare class Commands extends ObjectBase { static readonly trace: string[]; private current; private currentArgs; private trace; private commands; private onBeforeHooks; private onBeforeUIHooks; private onAfterHooks; private onAfterOnceHooks; private onAfterUIHooks; private onAfterAffectHooks; private readonly logger; static getName(): string; private static runCallbacks; private static hookCommand; constructor(); run(command: string | CommandBase, args?: ICommandArgsInterface, options?: any): Promise; register(commands: { [key: string]: typeof CommandBase; }, controller: ControllerBase): { [key: string]: typeof CommandBase; }; getAll(): { [key: string]: typeof CommandBase; }; getByName(name: string): typeof CommandBase; getLogger(): ILogger; getCommandInstance(name: string, args?: ICommandArgsInterface, options?: {}): CommandBase; /** * Used to set hooks that effects only data and not UI. */ onBefore(hookCommand: string, callback: TCommandCallbackType): void; /** * Used to set hooks that effects only UI. */ onBeforeUI(hookCommand: string, callback: TCommandCallbackType): void; /** * Used to set hooks that effects only data and not UI. */ onAfter(hookCommand: string, callback: TCommandCallbackType): void; /** * Used to set hooks that effects only UI. */ onAfterUI(command: string, callback: TCommandCallbackType): void; /** * Used to set hooks that effects only data and not UI. */ onAfterOnce(command: string, callback: TCommandCallbackType): void; /** * Used to register a trigger that runs command after `hookCommand` run's. */ onAfterAffect(hookCommand: string, affectCommand: string): void; protected onBeforeRun(command: CommandBase, args?: ICommandArgsInterface, options?: {}): void; protected runInstance(command: CommandBase, args?: ICommandArgsInterface, options?: {}): Promise; protected onAfterRun(command: CommandBase, args: ICommandArgsInterface, options: {}, result: any): Promise; protected attachCurrent(command: CommandBase, args?: any): void; protected detachCurrent(command: CommandBase): void; }