Interface ContextCommandDefinition<TCommand, TResult>

Definition for registering a command with its handler within a context.

interface ContextCommandDefinition<
    TCommand extends Command = Command,
    TResult = unknown,
> {
    name: string;
    commandType: new (...args: unknown[]) => TCommand;
    handler: CommandHandler<TCommand, TResult>;
}

Type Parameters

  • TCommand extends Command = Command

    The command type

  • TResult = unknown

    The result type returned by the handler

Properties

name: string

Unique name for the command type.

commandType: new (...args: unknown[]) => TCommand

The command class constructor.

The handler instance for this command.