import { CommandBusCallback } from './bus.js'; import Command, { CommandClass } from './command.js'; import '@hexadrop/either'; import '@hexadrop/error'; import '@hexadrop/types/class'; import '@hexadrop/types/primitives'; /** * This is an abstract class named CommandHandlers. * It provides a structure for handling commands in the application. * * @abstract */ declare abstract class CommandHandlers { /** * This is an abstract method named 'search'. * It is expected to be implemented by subclasses of CommandHandlers. * The method takes a command of type 'CommandType' or 'CommandClass' as an argument. * 'CommandType' is a generic parameter that extends 'Command'. * The method should return a 'CommandBusCallback'. * * @abstract * @param {CommandType | CommandClass} command - The command to be searched. * @returns {CommandBusCallback} - The callback function to be executed when the command is found. * @template CommandType - The type of the command. */ abstract search(command: CommandClass | CommandType): CommandBusCallback; } export { CommandHandlers as default };