[6a3a178] | 1 | /**
|
---|
| 2 | * @license
|
---|
| 3 | * Copyright Google LLC All Rights Reserved.
|
---|
| 4 | *
|
---|
| 5 | * Use of this source code is governed by an MIT-style license that can be
|
---|
| 6 | * found in the LICENSE file at https://angular.io/license
|
---|
| 7 | */
|
---|
| 8 | import { analytics, logging } from '@angular-devkit/core';
|
---|
| 9 | import { AngularWorkspace } from '../utilities/config';
|
---|
| 10 | import { Arguments, CommandContext, CommandDescription, CommandDescriptionMap, CommandScope, Option } from './interface';
|
---|
| 11 | export interface BaseCommandOptions {
|
---|
| 12 | help?: boolean | string;
|
---|
| 13 | }
|
---|
| 14 | export declare abstract class Command<T extends BaseCommandOptions = BaseCommandOptions> {
|
---|
| 15 | protected readonly context: CommandContext;
|
---|
| 16 | readonly description: CommandDescription;
|
---|
| 17 | protected readonly logger: logging.Logger;
|
---|
| 18 | protected allowMissingWorkspace: boolean;
|
---|
| 19 | protected useReportAnalytics: boolean;
|
---|
| 20 | readonly workspace?: AngularWorkspace;
|
---|
| 21 | readonly analytics: analytics.Analytics;
|
---|
| 22 | protected static commandMap: () => Promise<CommandDescriptionMap>;
|
---|
| 23 | static setCommandMap(map: () => Promise<CommandDescriptionMap>): void;
|
---|
| 24 | constructor(context: CommandContext, description: CommandDescription, logger: logging.Logger);
|
---|
| 25 | initialize(options: T & Arguments): Promise<number | void>;
|
---|
| 26 | printHelp(): Promise<number>;
|
---|
| 27 | printJsonHelp(): Promise<number>;
|
---|
| 28 | protected printHelpUsage(): Promise<void>;
|
---|
| 29 | protected printHelpOptions(options?: Option[]): Promise<void>;
|
---|
| 30 | validateScope(scope?: CommandScope): Promise<void>;
|
---|
| 31 | reportAnalytics(paths: string[], options: Arguments, dimensions?: (boolean | number | string)[], metrics?: (boolean | number | string)[]): Promise<void>;
|
---|
| 32 | abstract run(options: T & Arguments): Promise<number | void>;
|
---|
| 33 | validateAndRun(options: T & Arguments): Promise<number | void>;
|
---|
| 34 | }
|
---|