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.

    The function is generic and can be used to define a command with custom types, but it's recommended to allow TypeScript to infer the types based on the options passed to the function.

    Type Parameters

    Parameters

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

    A constructed Command object with strong types.