Skip to content

Interface: BaseOptions ​

Common options shared by all base combinators.

Signature ​

ts
export interface BaseOptions

Properties ​

NameTypeDescription
description (optional)stringHuman-readable description for help text generation.
hidden (optional)booleanHide from generated help or usage output.
required (optional)booleanMark as required. A literal true or false is kept in the type of the schema: true types the value as present, as required does, and false makes a positional argument optional. So does a required that may be false: one of type boolean that the options always have, or a false that they have only in some cases, with no required in the others, such as optional ? { required: false } : {}. A true that the options have only in some cases, such as strict ? { required: true } : {}, is not kept. TypeScript widens a required: true to boolean in options written apart from the call, such as const options = { required: true }, which makes a positional argument optional, as a required typed as any does: write such options as const. Options whose type only says that required is a boolean that may be missing, as the type of this property does, keep a positional argument typed as present, as options without required do. So do optional ? { required: flag } : {}, and the options that a generic helper takes as a type parameter, such as T extends IntegerOptions, whose required TypeScript reads from the constraint. Use unrequired for such a positional argument when it may be missing.
short (optional)stringSingle character short alias.

Released under the MIT License.