20 lines
1.2 KiB
TypeScript
20 lines
1.2 KiB
TypeScript
import { ArgParser } from './argparser';
|
|
import { OutputOf } from './from';
|
|
import { ProvidesHelp, Descriptive, LongDoc, EnvDoc, ShortDoc } from './helpdoc';
|
|
import { Type, HasType } from './type';
|
|
import { Default } from './default';
|
|
import { AllOrNothing } from './utils';
|
|
declare type StringType = Type<string, string>;
|
|
/**
|
|
* Decodes an argument which is in the form of a key and a value, and allows parsing the following ways:
|
|
*
|
|
* - `--long=value` where `long` is the provided `long`
|
|
* - `--long value` where `long` is the provided `long`
|
|
* - `-s=value` where `s` is the provided `short`
|
|
* - `-s value` where `s` is the provided `short`
|
|
* @param config flag configurations
|
|
*/
|
|
export declare function option<Decoder extends Type<string, any>>(config: LongDoc & HasType<Decoder> & Partial<Descriptive & EnvDoc & ShortDoc> & AllOrNothing<Default<OutputOf<Decoder>>>): ArgParser<OutputOf<Decoder>> & ProvidesHelp & Partial<Descriptive>;
|
|
export declare function option(config: LongDoc & Partial<HasType<never> & Descriptive & EnvDoc & ShortDoc> & AllOrNothing<Default<OutputOf<StringType>>>): ArgParser<OutputOf<StringType>> & ProvidesHelp & Partial<Descriptive>;
|
|
export {};
|