import { CommandBusCallback, CommandHandler } from './bus.js'; import Command, { CommandClass } from './command.js'; import CommandHandlers from './command-handlers.js'; import '@hexadrop/either'; import '@hexadrop/error'; import '@hexadrop/types/class'; import '@hexadrop/types/primitives'; /** * @class InMemoryCommandHandlers * @implements CommandHandlers * @description Class representing in-memory command handlers. */ declare class InMemoryCommandHandlers extends CommandHandlers { /** * @property {Map} commandHandlersMap - The map of command handlers. */ private readonly commandHandlersMap; /** * @constructor * @description Constructs an instance of InMemoryCommandHandlers. */ constructor(); /** * @static * @method merge * @description Combines multiple InMemoryCommandHandlers instances into one. * @param {...InMemoryCommandHandlers[]} handlers - The instances to combine. * @returns {InMemoryCommandHandlers} The combined InMemoryCommandHandlers instance. */ static merge(...handlers: InMemoryCommandHandlers[]): InMemoryCommandHandlers; /** * @method register * @description Method to register a command handler. * @param {CommandClass} command - The command class. * @param {CommandBusCallback | CommandHandler} handlerOrCallback - The command bus callback or command handler. * @template CommandType - The type of the command. */ register(command: CommandClass, handlerOrCallback: CommandBusCallback | CommandHandler): void; /** * @method search * @description Method to search for a command handler. * @param {CommandType | CommandClass} command - The command or command class to search for. * @returns {CommandBusCallback} - The command bus callback for the command. * @throws {InvalidCommandError} - Throws an error if the command is invalid. * @throws {CommandNotRegisteredError} - Throws an error if the command is not registered. * @template CommandType - The type of the command. */ search(command: CommandClass | CommandType): CommandBusCallback; /** * @method unregister * @description Method to unregister a command handler. * @param {CommandClass} command - The command class to unregister. * @template CommandType - The type of the command. */ unregister(command: CommandClass): void; } export { InMemoryCommandHandlers as default };