Function command

  • Factory function to create a Command object with strong typing. This is used to define a command with its associated metadata, options, and handler logic.

    Type Parameters

    • TData = unknown

      Optional type for data specific to this command.

    • const TOptions extends OptionsConfig = OptionsConfig

      The OptionsConfig type that represents all options for the command.

    Parameters

    Returns {
        description: string;
        handler: CommandHandler<TData, TOptions>;
        isMiddleware: boolean;
        options: TOptions;
        requiresSubcommand: boolean;
    }

    A constructed Command object with strong types.