UNPKG

621 BTypeScriptView Raw
1import { CommandOptionReturn, GeneralOptionFlags } from "./utils";
2export type BooleanFlags = GeneralOptionFlags;
3/**
4 * Used to annotate boolean options.
5 *
6 * @example
7 * --foo --no-bar
8 * ► {"foo": true, "bar": false}
9 */
10export declare function Boolean(descriptor: string, opts: BooleanFlags & {
11 required: true;
12}): CommandOptionReturn<boolean>;
13export declare function Boolean(descriptor: string, opts?: BooleanFlags): CommandOptionReturn<boolean | undefined>;
14export declare function Boolean(descriptor: string, initialValue: boolean, opts?: Omit<BooleanFlags, 'required'>): CommandOptionReturn<boolean>;