export type IngestFn = (input: string | undefined) => T export type CoerceFn = (input: string) => T export type ValidateFn = (input: T) => T export type Unit = { ingest: IngestFn help?: string } & UnitReflection export type UnitReflection = { mode: string type: string fallback?: string } export type Arg = {name: N} & Unit export type Param = {flag?: string} & Unit export type Args = Arg[] export type Params = Record export type DistillInput> = I extends Unit ? T : never export type Opts = { help?: string validate?: ValidateFn } export type ModeFn = (type: Type, ...z: Z) => Unit export type Type = { name: string coerce: CoerceFn }