@thi.ng/args
Version:
Declarative, functional CLI argument/options parser, app framework, arg value coercions, multi/sub-commands, usage generation, error handling etc.
12 lines • 853 B
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 coerceHexInt: (x: string) => number;
export declare const coerceInt: (x: 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