@@ -398,9 +398,25 @@ expectType<string>(helper.wrap('a b c', 50, 3));
398
398
399
399
expectType < string > ( helper . formatHelp ( helperCommand , helper ) ) ;
400
400
401
- // Option methods
402
-
401
+ // Option properties
403
402
const baseOption = new commander . Option ( '-f,--foo' , 'foo description' ) ;
403
+ expectType < string > ( baseOption . flags ) ;
404
+ expectType < string > ( baseOption . description ) ;
405
+ expectType < boolean > ( baseOption . required ) ;
406
+ expectType < boolean > ( baseOption . optional ) ;
407
+ expectType < boolean > ( baseOption . variadic ) ;
408
+ expectType < boolean > ( baseOption . mandatory ) ;
409
+ expectType < string | undefined > ( baseOption . short ) ;
410
+ expectType < string | undefined > ( baseOption . long ) ;
411
+ expectType < boolean > ( baseOption . negate ) ;
412
+ expectType < any > ( baseOption . defaultValue ) ;
413
+ expectType < string | undefined > ( baseOption . defaultValueDescription ) ;
414
+ expectType < unknown > ( baseOption . presetArg ) ;
415
+ expectType < string | undefined > ( baseOption . envVar ) ;
416
+ expectType < boolean > ( baseOption . hidden ) ;
417
+ expectType < string [ ] | undefined > ( baseOption . argChoices ) ;
418
+
419
+ // Option methods
404
420
405
421
// default
406
422
expectType < commander . Option > ( baseOption . default ( 3 ) ) ;
@@ -454,6 +470,9 @@ const baseArgument = new commander.Argument('<foo');
454
470
expectType < string > ( baseArgument . description ) ;
455
471
expectType < boolean > ( baseArgument . required ) ;
456
472
expectType < boolean > ( baseArgument . variadic ) ;
473
+ expectType < any > ( baseArgument . defaultValue ) ;
474
+ expectType < string | undefined > ( baseArgument . defaultValueDescription ) ;
475
+ expectType < string [ ] | undefined > ( baseArgument . argChoices ) ;
457
476
458
477
// Argument methods
459
478
0 commit comments