import { StrictValidator } from 'typanion'; import { CommandBuilder, RunState } from '../../core'; import { UsageError } from '../../errors'; import { BaseContext, CliContext } from '../Cli'; export declare const isOptionSymbol: unique symbol; export type GeneralOptionFlags = { description?: string; hidden?: boolean; required?: boolean; }; export type TupleOf> = Accumulator['length'] extends Arity ? Accumulator : TupleOf; export type Tuple = Arity extends Arity ? number extends Arity ? Array : TupleOf : never; export type WithArity = number extends Type['length'] ? Arity extends 0 ? boolean : Arity extends 1 ? Type : number extends Arity ? boolean | Type | Tuple : Tuple : Type; export type CommandOption = { [isOptionSymbol]: true; definition: (builder: CommandBuilder>, key: string) => void; transformer: (builder: CommandBuilder>, key: string, state: RunState, context: Context) => T; }; export type CommandOptionReturn = T; export declare function makeCommandOption(spec: Omit, typeof isOptionSymbol>): T; export declare function rerouteArguments(a: A | B, b: B): [Exclude, B]; export declare function rerouteArguments(a: A | B | undefined, b: B): [Exclude | undefined, B]; export declare function cleanValidationError(message: string, { mergeName }?: { mergeName?: boolean; }): string; export declare function formatError(message: string, errors: Array): UsageError; export declare function applyValidator(name: string, value: U, validator?: StrictValidator): U;