UNPKG

clefairy

Version:

Typed CLI argv parser and main function wrapper

14 lines (13 loc) 1.29 kB
import { Path } from "clef-parse"; export declare const requiredString: unique symbol; export declare const requiredNumber: unique symbol; export declare const requiredBoolean: unique symbol; export declare const requiredPath: unique symbol; export declare const requiredSymbols: Set<symbol>; export declare const optionalString: unique symbol; export declare const optionalNumber: unique symbol; export declare const optionalBoolean: unique symbol; export declare const optionalPath: unique symbol; export type TypeSymbol = typeof requiredString | typeof requiredNumber | typeof requiredBoolean | typeof requiredPath | typeof optionalString | typeof optionalNumber | typeof optionalBoolean | typeof optionalPath; export type TypeSymbolToType<Input extends TypeSymbol> = Input extends typeof requiredString ? string : Input extends typeof requiredNumber ? number : Input extends typeof requiredBoolean ? boolean : Input extends typeof requiredPath ? Path : Input extends typeof optionalString ? string | undefined : Input extends typeof optionalNumber ? number | undefined : Input extends typeof optionalBoolean ? boolean | undefined : Input extends typeof optionalPath ? Path | undefined : never; export declare function valueMatchesSymbolType(value: any, symbol: TypeSymbol): boolean;