@thi.ng/args
Version:
Declarative, functional CLI argument/options parser, value coercions, sub-commands etc.
15 lines • 1.05 kB
TypeScript
import type { Fn } from "@thi.ng/api";
import { Tuple, type KVDict, type KVMultiDict } from "./api.js";
export declare const coerceString: (x: string) => string;
export declare const coerceFloat: (x: string) => number;
export declare const coerceFloats: (values: string[]) => number[];
export declare const coerceHexInt: (x: string) => number;
export declare const coerceHexInts: (values: string[]) => number[];
export declare const coerceInt: (x: string) => number;
export declare const coerceInts: (values: string[]) => number[];
export declare const coerceJson: <T>(x: string) => T;
export declare const coerceOneOf: <K extends string>(values: readonly K[]) => (x: string) => K;
export declare function coerceKV(delim?: string, strict?: boolean, multi?: false): Fn<string[], KVDict>;
export declare function coerceKV(delim?: string, strict?: boolean, multi?: true): Fn<string[], KVMultiDict>;
export declare const coerceTuple: <T>(coerce: Fn<string, T>, size: number, delim?: string) => (src: string) => Tuple<T>;
//# sourceMappingURL=coerce.d.ts.map