decline-ts
Version:
Composable command-line parser for TypeScript - a (partial) porting of Scala decline using fp-ts
13 lines (12 loc) • 790 B
TypeScript
import { either } from 'fp-ts';
import { Either } from 'fp-ts/Either';
import { Accumulator, AccumulatorHKT } from '../index';
export declare const URI = "Validate";
export declare type URI = typeof URI;
export declare type Validate<A, B> = {
readonly _tag: URI;
readonly a: Accumulator<A>;
readonly f: (a: A) => Either<ReadonlyArray<string>, B>;
};
export declare const of: <A, B>(a: import("./Regular").Regular | import("./Flag").Flag | import("./Argument").Argument | import("./Arguments").Arguments | import("./Pure").Pure<A> | import("./OrElse").OrElse<A> | import("./Subcommand").Subcommand<A> | Validate<unknown, A> | import("./Ap").Ap<unknown, A>, f: (a_: A) => either.Either<readonly string[], B>) => Validate<A, B>;
export declare const validate: AccumulatorHKT<URI>;