import type { InferredOptionType, Options, PositionalOptions } from "yargs"; import type { ArgumentOptions } from "./argument.js"; import type { OptionOptions } from "./option.js"; export interface BaseArgOptions { prompt?: true | string; requires?: string | string[]; excludes?: string | string[]; } export type InferArgType = O extends { default: number; } ? number : O extends { type: 'number'; optional: true; } ? number | undefined : O extends { type: 'number'; variadic: true; } ? Array : O extends { type: 'number'; } ? number : O extends { default: boolean; } ? boolean : O extends { type: 'boolean'; optional: true; } ? boolean | undefined : O extends { type: 'boolean'; variadic: true; } ? Array : O extends { type: 'boolean'; } ? boolean : O extends { choices: ReadonlyArray; type: 'array'; } ? C[] : O extends { choices: ReadonlyArray; default: ReadonlyArray; } ? C[] : O extends { choices: ReadonlyArray; variadic: true; } ? C[] : O extends { choices: ReadonlyArray; optional: true; } ? C | undefined : O extends { choices: ReadonlyArray; } ? C : O extends { default: string; } ? string : O extends { optional: true; } ? string | undefined : O extends { variadic: true; } ? Array : unknown extends InferredOptionType ? F : InferredOptionType; export declare class BaseArg { protected name: string; protected options: ArgumentOptions | OptionOptions; constructor(name: string); /** * Set the argument/option description. */ description(description: string): this; /** * Whether this argument/option can be interactive. */ isPromptable(): boolean; /** * Returns the prompt line. */ getPrompt(): string; /** * Get default value, if specified. */ getDefault(): any; /** * Get possible values, is specified. * @todo See if we can add this to autocompleter */ getChoices(): import("yargs").Choices | undefined; /** * Get type, is specified. */ getType(): "array" | "count" | import("yargs").PositionalOptionsType | undefined; /** * Returns the argument/option identifier. */ getName(): string; /** * Returns the argument/option description. */ getDescription(): string | undefined; /** * Returns the argument/option options. */ getOptions(): OptionOptions | ArgumentOptions; protected static getYargsOptions(options: T): { implies: string | string[] | undefined; conflicts: string | string[] | undefined; } & Omit; }