import { CommandArg, CommandFlag, KernelContract, CommandSettings, CommandContract } from '@tensei/common'; /** * Abstract base class other classes must extend */ export declare abstract class BaseCommand implements CommandContract { options: { handler(): Promise; completed(): Promise; prepare(): Promise; }; argValues: {}; flagValues: {}; /** * Reference to the exit handler */ protected exitHandler?: () => void | Promise; kernel: KernelContract; /** * Command arguments */ args: CommandArg[]; /** * Command aliases */ aliases: string[]; /** * Command flags */ flags: CommandFlag[]; /** * Command name. The command will be registered using this name only. Make * sure their aren't any spaces inside the command name. */ name: string; commandName: string; /** * The description of the command displayed on the help screen. * A good command will always have some description. */ description: string; /** * Any settings a command wants to have. Helpful for third party * tools to read the settings in lifecycle hooks and make * certain decisions */ settings: CommandSettings; describe(description: string): this; stayAlive(): this; setName(name: string): this; arg(arg: Omit): this; flag(flag: Omit): this; /** * Define an argument directly on the command without using the decorator */ $addArgument(options: Partial): void; /** * Define a flag directly on the command without using the decorator */ $addFlag(options: Partial): void; /** * Reference to cli ui */ ui: any; /** * Parsed options on the command. They only exist when the command * is executed via kernel. */ parsed?: import('getopts').ParsedOptions; /** * The prompt for the command */ prompt: import('@poppinss/prompts').Prompt | import('@poppinss/prompts').FakePrompt; /** * Returns the instance of logger to log messages */ logger: any; /** * Reference to the colors */ colors: ReturnType['logger']['colors']; /** * Error raised by the command */ error?: any; /** * Command exit code */ exitCode?: number; run(callback: () => Promise): this; prepare(callback: () => Promise): this; completed(callback: () => Promise): this; /** * Execute the command */ exec(): Promise; /** * Register an onExit handler */ onExit(handler: () => void | Promise): this; /** * Trigger exit */ exit(): Promise; /** * Must be defined by the parent class */ handle?(...args: any[]): Promise; }