import { EventEmitter } from 'node:events'; import Command, { GlobalCommand } from './Command'; import type { CommandConfig, CommandExample, HelpCallback } from './Command'; import type { OptionConfig } from './Option'; /** * @param name The program name to display in help and version message */ export declare const cli: (name?: string) => CLI; declare interface ParsedArgv { args: ReadonlyArray options: ParsedOptions } export declare interface ParseOptions { run?: boolean exitOnError?: boolean } /** Parsed command-line options */ export type ParsedOptions = Record; export declare class CLI extends EventEmitter { name: string; commands: Command[]; globalCommand: GlobalCommand; matchedCommand?: Command; matchedCommandName?: string; rawArgs: string[]; args: ParsedArgv['args']; options: ParsedArgv['options']; showHelpOnExit?: boolean; showVersionOnExit?: boolean; enableDidYouMean: boolean; signalHandlersSet: boolean; isVerbose: boolean; isQuiet: boolean; isDebug: boolean; isNoInteraction: boolean; environment?: string; isDryRun: boolean; isForce: boolean; useEmoji: boolean; theme?: string; isNoCache: boolean; constructor(name?: string); handleSignals(cleanup?: () => void | Promise): this; didYouMean(enabled?: boolean): this; verbose(): this; quiet(): this; debug(): this; noInteraction(): this; env(): this; dryRun(): this; force(): this; emoji(): this; themes(): this; cache(): this; usage(text: string): this; command(rawName: string, description?: string, config?: CommandConfig): Command; option(rawName: string, description: string, config?: OptionConfig): this; help(callback?: HelpCallback): this; version(version: string, customFlags?: string): this; example(example: CommandExample): this; outputHelp(): void; outputVersion(): void; unsetMatchedCommand(): void; showCommandNotFound(input: string): void; parse(argv?: string[], options?: ParseOptions): Promise; run(argv?: string[]): Promise; handleUsageError(err: unknown): void; runMatchedCommand(): Promise; removeSignalHandlers(): this; destroy(): void; } export default CLI;