/// import { EventEmitter } from 'events'; import Command, { HelpCallback, CommandExample } from './Command'; import { OptionConfig } from './Option'; interface ParsedArgv { args: string[]; options: { [k: string]: any; }; } declare class CAC extends EventEmitter { bin: string; commands: Command[]; globalCommand: Command; matchedCommand: Command; /** * Raw CLI arguments */ rawArgs: string[]; /** * Parsed CLI arguments */ args: string[]; /** * Parsed CLI options, camelCased */ options: { [k: string]: any; }; constructor(); usage(text: string): this; command(rawName: string, description: string): Command; option(rawName: string, description: string, config?: OptionConfig): this; help(callback?: HelpCallback): this; version(version: string, customFlags?: string): this; /** * Add a global example * @param example */ example(example: CommandExample): this; outputHelp(subCommand?: boolean): this; outputVersion(): this; parse(argv?: string[]): ParsedArgv; private minimist; private runCommandAction; } declare const cac: () => CAC; export = cac;