Option
Defined in: packages/input/src/input.ts:100
An option.
Type Parameters
Section titled “Type Parameters”TKind extends Kind
TRequired
Section titled “TRequired”TRequired extends boolean = true
TList extends boolean = false
Constructors
Section titled “Constructors”Constructor
Section titled “Constructor”new Option<
TKind,TRequired,TList>(kind,names):Option<TKind,TRequired,TList>
Defined in: packages/input/src/input.ts:139
Creates a new option.
Parameters
Section titled “Parameters”TKind
The type of this option.
string[]
The names of this option.
Returns
Section titled “Returns”Option<TKind, TRequired, TList>
Properties
Section titled “Properties”$default
Section titled “$default”$default:
TypeOf<TKind> |undefined
Defined in: packages/input/src/input.ts:120
The default value of this option.
$description
Section titled “$description”$description:
string|undefined
Defined in: packages/input/src/input.ts:116
The description of this option.
$kind:
TKind
Defined in: packages/input/src/input.ts:108
The kind of this option.
$list:
TList
Defined in: packages/input/src/input.ts:128
If this option is a list.
$names
Section titled “$names”$names:
string[]
Defined in: packages/input/src/input.ts:112
The aliases of this option.
$required
Section titled “$required”$required:
TRequired
Defined in: packages/input/src/input.ts:124
If this option is required.
$separator
Section titled “$separator”$separator:
string|undefined
Defined in: packages/input/src/input.ts:132
A separator if this option is a list.
Methods
Section titled “Methods”default()
Section titled “default()”default(
value):this
Defined in: packages/input/src/input.ts:177
Sets a default value.
Parameters
Section titled “Parameters”TypeOf<TKind>
The default value.
Returns
Section titled “Returns”this
this
description()
Section titled “description()”description(
desc):this
Defined in: packages/input/src/input.ts:187
Sets a description.
Parameters
Section titled “Parameters”string
The description.
Returns
Section titled “Returns”this
this
list()
Section titled “list()”list(
separator?):Option<TKind,TRequired,true>
Defined in: packages/input/src/input.ts:148
Makes this option a list.
Parameters
Section titled “Parameters”separator?
Section titled “separator?”string
Returns
Section titled “Returns”Option<TKind, TRequired, true>
this
optional()
Section titled “optional()”optional():
Option<TKind,false,TList>
Defined in: packages/input/src/input.ts:167
Makes this option optional.
Returns
Section titled “Returns”Option<TKind, false, TList>
this
required()
Section titled “required()”required():
Option<TKind,true,TList>
Defined in: packages/input/src/input.ts:158
Makes this option required.
Returns
Section titled “Returns”Option<TKind, true, TList>
this