UNPKG

cmd-ts

Version:

> 💻 A type-driven command line argument parser, with awesome error reporting 🤤

17 lines (16 loc) • 926 B
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 {};