Type alias WithKnownValue<P, T>

WithKnownValue<P, T>: {
    example?: Readonly<T>;
    fallback?: Readonly<T> | DefaultCallback<T>;
    parse?: ParseCallback<P, T>;
}

Defines attributes common to options with known values.

Type Parameters

  • P

    The parameter data type

  • T

    The option value data type

Type declaration

  • Optional Readonly example?: Readonly<T>

    The option example value. Replaces the option type in the help message parameter column.

  • Optional Readonly fallback?: Readonly<T> | DefaultCallback<T>

    A fallback value that is used if the option is specified, but without any parameter. This makes the option parameter(s) optional, both for single-valued and array-valued options.

  • Optional Readonly parse?: ParseCallback<P, T>

    A custom callback to parse the value of the option parameter(s). It should return the new option value. Normalization and constraints will be applied to the returned value.