@@ -73,8 +73,7 @@ export function addValidator(validator: Validator): (
7373 * 1. With a built-in or custom validator function (e.g., `@validate(range(1, 10))`)
7474 * 2. With a predicate function and custom error message (e.g., `@validate(val => val > 0, "must be positive")`)
7575 *
76- * @param validatorOrPredicate - A validator function OR a predicate function
77- * @param message - Error message (required only if using a predicate)
76+ * @param validator - A validator function
7877 * @returns A decorator function
7978 */
8079export function validate < T > (
@@ -83,13 +82,27 @@ export function validate<T>(
8382 _target : unknown ,
8483 context : DecoratorContext ,
8584) => void ;
85+ /**
86+ * Validate decorator for custom validation logic.
87+ *
88+ * @param predicate - Function that returns true if value is valid
89+ * @param message - Error message to show when validation fails
90+ * @returns A decorator function
91+ */
8692export function validate < T > (
8793 predicate : ( value : T ) => boolean ,
8894 message : string ,
8995) : (
9096 _target : unknown ,
9197 context : DecoratorContext ,
9298) => void ;
99+ /**
100+ * Validate decorator for custom validation logic.
101+ *
102+ * @param validatorOrPredicate - A validator function OR a predicate function
103+ * @param message - Error message (required only if using a predicate)
104+ * @returns A decorator function
105+ */
93106export function validate < T > (
94107 validatorOrPredicate : Validator | ( ( value : T ) => boolean ) ,
95108 message ?: string ,
@@ -121,10 +134,24 @@ export function command(
121134 target : T ,
122135 ctx : ClassDecoratorContext ,
123136) => T ;
137+ /**
138+ * Command decorator to mark a class as a CLI command or subcommand.
139+ *
140+ * @param target - The class constructor being decorated
141+ * @param ctx - The class decorator context
142+ * @returns The original or a modified class constructor
143+ */
124144export function command < T extends new ( ) => unknown > (
125145 target : T ,
126146 ctx : ClassDecoratorContext ,
127147) : T ;
148+ /**
149+ * Command decorator to mark a class as a CLI command or subcommand.
150+ *
151+ * @param optionsOrTarget - Either command options or the class constructor
152+ * @param _maybeCtx - Optional context (only present when used as a direct decorator)
153+ * @returns The decorator function or the decorated class
154+ */
128155export function command < T extends new ( ) => unknown > (
129156 optionsOrTarget ?: CommandOptions | T ,
130157 _maybeCtx ?: ClassDecoratorContext ,
0 commit comments