decline-ts
Version:
Composable command-line parser for TypeScript - a (partial) porting of Scala decline using fp-ts
21 lines (20 loc) • 686 B
TypeScript
import { ReadonlyNonEmptyArray } from 'fp-ts/ReadonlyNonEmptyArray';
import { Command } from './Command';
export declare type Help = {
readonly errors: ReadonlyArray<string>;
readonly prefix: ReadonlyNonEmptyArray<string>;
readonly usage: ReadonlyArray<string>;
readonly body: ReadonlyArray<string>;
};
export declare namespace Help {
/**
* Constructors
*/
const fromCommand: (parser: Command<unknown>) => Help;
/**
* Methods
*/
const withErrors: (moreErrors: ReadonlyArray<string>) => (help: Help) => Help;
const withPrefix: (prefix: ReadonlyArray<string>) => (help: Help) => Help;
const stringify: (help: Help) => string;
}