import { Config, ConfigOptions, IPlugin } from '@cli-engine/config'; import { args } from 'cli-flags'; import { HTTP } from 'http-call'; import * as flags from './flags'; export interface IMockReturn { cmd: T; stdout: string; stderr: string; } export declare type CommandRunFn = (this: ICommandClass, argv: string[], config: Config) => Promise; export declare type CommandMockFn = (this: ICommandClass, argv?: string[], config?: ConfigOptions) => Promise>; export interface ICommandClass { mock: CommandMockFn; run: CommandRunFn; new (config: Config): T; } export declare abstract class Command { protected config: Config; static id: string; static description: string | undefined; static hidden: boolean; static usage: string | undefined; static help: string | undefined; static aliases: string[]; static variableArgs: boolean; static flags: flags.Input; static args: args.IArg[]; static _version: any; static base: string; static plugin: IPlugin | undefined; /** * instantiate and run the command setting {mock: true} in the config (shorthand method) */ static mock: CommandMockFn; /** * instantiate and run the command */ static run: CommandRunFn; static buildHelp(config: Config): string; static buildHelpLine(config: Config): [string, string | undefined]; http: typeof HTTP; flags: { [name: string]: any; }; argv: string[]; args: { [name: string]: string; }; topic: null; command: null; description: null; hidden: null; usage: null; help: null; aliases: null; protected debug: (...args: any[]) => void; readonly ctor: typeof Command; constructor(config: Config); /** * actual command run code goes here */ abstract run(): Promise; protected init(argv: string[]): Promise; protected done(): Promise; }