/** * Individual command argument classes. */ import type { ITabCompleteContext } from './context'; import type { ITabCompleteResult, PathType } from './tab_complete'; export declare abstract class Argument { readonly shortName: string; readonly longName: string; readonly description: string; constructor(shortName: string, longName: string, description: string); get isSet(): boolean; /** * Parse remaining args and return those args not consumed. */ parse(currentArg: string, args: string[]): string[]; protected set(): void; protected _isSet: boolean; } export declare class BooleanArgument extends Argument { constructor(shortName: string, longName: string, description: string); } export declare class OptionalStringArgument extends BooleanArgument { constructor(shortName: string, longName: string, description: string); get string(): string | undefined; parse(currentArg: string, args: string[]): string[]; private _string?; } /** * A collection of position arguments. * Greedily consumes all remaining arguments as strings. */ export declare class PositionalArguments extends Argument { readonly options: PositionalArguments.IOptions; constructor(options?: PositionalArguments.IOptions); get length(): number; /** * Parse remaining args. This will consume all the args, throwing an error if there are any args * of an incorrect form. */ parse(currentArg: string, args: string[]): string[]; get strings(): string[]; private _strings; } export declare class PositionalPathArguments extends PositionalArguments { readonly options: PositionalPathArguments.IOptions; constructor(options?: PositionalPathArguments.IOptions); } export declare namespace PositionalArguments { interface IOptions { min?: number; max?: number; /** * Function to return possible matches for tab completion. * The token for completion is context.args.at(-1) as it may be an empty string. * The possibles are subsequently filtered using startsWith(token-for-completion). */ tabComplete?: (context: ITabCompleteContext) => Promise; } } export declare namespace PositionalPathArguments { interface IOptions extends PositionalArguments.IOptions { pathType?: PathType; } }