1 | import { ParsedOptions } from 'getopts';
|
2 | import { Prompt, FakePrompt } from '@poppinss/prompts';
|
3 | import { instantiate } from '@poppinss/cliui/build/api';
|
4 | import { ApplicationContract } from '@ioc:Adonis/Core/Application';
|
5 | import { CommandArg, CommandFlag, KernelContract, CommandSettings, CommandContract, GeneratorContract } from '../Contracts';
|
6 |
|
7 |
|
8 |
|
9 | export declare abstract class BaseCommand implements CommandContract {
|
10 | application: ApplicationContract;
|
11 | kernel: KernelContract;
|
12 | |
13 |
|
14 |
|
15 | protected exitHandler?: () => void | Promise<void>;
|
16 | |
17 |
|
18 |
|
19 | constructor(application: ApplicationContract, kernel: KernelContract);
|
20 | /**
|
21 | * Is the current command the main command executed from the
|
22 | * CLI
|
23 | */
|
24 | get isMain(): boolean;
|
25 | /**
|
26 | * Terminal is interactive
|
27 | */
|
28 | get isInteractive(): boolean;
|
29 | /**
|
30 | * Command arguments
|
31 | */
|
32 | static args: CommandArg[];
|
33 | /**
|
34 | * Command aliases
|
35 | */
|
36 | static aliases: string[];
|
37 | /**
|
38 | * Command flags
|
39 | */
|
40 | static flags: CommandFlag[];
|
41 | /**
|
42 | * Command name. The command will be registered using this name only. Make
|
43 | * sure their aren't any spaces inside the command name.
|
44 | */
|
45 | static commandName: string;
|
46 | /**
|
47 | * The description of the command displayed on the help screen.
|
48 | * A good command will always have some description.
|
49 | */
|
50 | static description: string;
|
51 | /**
|
52 | * Any settings a command wants to have. Helpful for third party
|
53 | * tools to read the settings in lifecycle hooks and make
|
54 | * certain decisions
|
55 | */
|
56 | static settings: CommandSettings;
|
57 | /**
|
58 | * Whether or not the command has been booted
|
59 | */
|
60 | static booted: boolean;
|
61 | /**
|
62 | * Boots the command by defining required static properties
|
63 | */
|
64 | static boot(): void;
|
65 | /**
|
66 | * Define an argument directly on the command without using the decorator
|
67 | */
|
68 | static $addArgument(options: Partial<CommandArg>): void;
|
69 | /**
|
70 | * Define a flag directly on the command without using the decorator
|
71 | */
|
72 | static $addFlag(options: Partial<CommandFlag>): void;
|
73 | /**
|
74 | * Reference to cli ui
|
75 | */
|
76 | ui: {
|
77 | table: () => import("@poppinss/cliui/build/src/Table").Table;
|
78 | tasks: {
|
79 | (): import("@poppinss/cliui/build/src/Task/Manager").TaskManager;
|
80 | verbose(): import("@poppinss/cliui/build/src/Task/Manager").TaskManager;
|
81 | };
|
82 | icons: {
|
83 | tick: string;
|
84 | cross: string;
|
85 | bullet: string;
|
86 | nodejs: string;
|
87 | pointer: string;
|
88 | info: string;
|
89 | warning: string;
|
90 | squareSmallFilled: string;
|
91 | };
|
92 | logger: import("@poppinss/cliui/build/src/Logger").Logger;
|
93 | sticker: () => import("@poppinss/cliui/build/src/Instructions").Instructions;
|
94 | instructions: () => import("@poppinss/cliui/build/src/Instructions").Instructions;
|
95 | isInteractive: boolean;
|
96 | supportsColors: boolean;
|
97 | consoleRenderer: import("@poppinss/cliui/build/src/Renderer/Console").ConsoleRenderer;
|
98 | testingRenderer: import("@poppinss/cliui/build/src/Renderer/Memory").MemoryRenderer;
|
99 | };
|
100 | |
101 |
|
102 |
|
103 |
|
104 | parsed?: ParsedOptions;
|
105 | |
106 |
|
107 |
|
108 | prompt: Prompt | FakePrompt;
|
109 | |
110 |
|
111 |
|
112 | logger: import("@poppinss/cliui/build/src/Logger").Logger;
|
113 | |
114 |
|
115 |
|
116 | colors: ReturnType<typeof instantiate>['logger']['colors'];
|
117 | |
118 |
|
119 |
|
120 | generator: GeneratorContract;
|
121 | |
122 |
|
123 |
|
124 | error?: any;
|
125 | |
126 |
|
127 |
|
128 | exitCode?: number;
|
129 | run?(...args: any[]): Promise<any>;
|
130 | prepare?(...args: any[]): Promise<any>;
|
131 | completed?(...args: any[]): Promise<any>;
|
132 | |
133 |
|
134 |
|
135 | exec(): Promise<any>;
|
136 | |
137 |
|
138 |
|
139 | onExit(handler: () => void | Promise<void>): this;
|
140 | |
141 |
|
142 |
|
143 | exit(): Promise<void>;
|
144 | |
145 |
|
146 |
|
147 | handle?(...args: any[]): Promise<any>;
|
148 | }
|