17 lines
926 B
TypeScript
17 lines
926 B
TypeScript
import { ArgParser } from './argparser';
|
|
import { OutputOf } from './from';
|
|
import { Type, HasType } from './type';
|
|
import { ProvidesHelp, Displayed, Descriptive } from './helpdoc';
|
|
declare type StringType = Type<string, string>;
|
|
declare type RestPositionalsParser<Decoder extends Type<string, any>> = ArgParser<OutputOf<Decoder>[]> & ProvidesHelp;
|
|
/**
|
|
* Read all the positionals and decode them using the type provided.
|
|
* Works best when it is the last item on the `command` construct, to be
|
|
* used like the `...rest` operator in JS and TypeScript.
|
|
*
|
|
* @param config rest positionals argument config
|
|
*/
|
|
export declare function restPositionals<Decoder extends Type<string, any>>(config: HasType<Decoder> & Partial<Displayed & Descriptive>): RestPositionalsParser<Decoder>;
|
|
export declare function restPositionals(config?: Partial<HasType<never> & Displayed & Descriptive>): RestPositionalsParser<StringType>;
|
|
export {};
|