1 |
|
2 |
|
3 |
|
4 |
|
5 |
|
6 |
|
7 |
|
8 | import { analytics, logging } from '@angular-devkit/core';
|
9 | import { Arguments, CommandContext, CommandDescription, CommandDescriptionMap, CommandScope, CommandWorkspace, Option, SubCommandDescription } from './interface';
|
10 | export interface BaseCommandOptions {
|
11 | help?: boolean | string;
|
12 | }
|
13 | export declare abstract class Command<T extends BaseCommandOptions = BaseCommandOptions> {
|
14 | readonly description: CommandDescription;
|
15 | protected readonly logger: logging.Logger;
|
16 | allowMissingWorkspace: boolean;
|
17 | workspace: CommandWorkspace;
|
18 | analytics: analytics.Analytics;
|
19 | protected static commandMap: () => Promise<CommandDescriptionMap>;
|
20 | static setCommandMap(map: () => Promise<CommandDescriptionMap>): void;
|
21 | constructor(context: CommandContext, description: CommandDescription, logger: logging.Logger);
|
22 | initialize(options: T & Arguments): Promise<void>;
|
23 | printHelp(options: T & Arguments): Promise<number>;
|
24 | printJsonHelp(_options: T & Arguments): Promise<number>;
|
25 | protected printHelpUsage(): Promise<void>;
|
26 | protected printHelpSubcommand(subcommand: SubCommandDescription): Promise<void>;
|
27 | protected printHelpOptions(options?: Option[]): Promise<void>;
|
28 | validateScope(scope?: CommandScope): Promise<void>;
|
29 | reportAnalytics(paths: string[], options: T & Arguments, dimensions?: (boolean | number | string)[], metrics?: (boolean | number | string)[]): Promise<void>;
|
30 | abstract run(options: T & Arguments): Promise<number | void>;
|
31 | validateAndRun(options: T & Arguments): Promise<number | void>;
|
32 | }
|