1 |
|
2 |
|
3 |
|
4 |
|
5 |
|
6 |
|
7 |
|
8 | import { logging } from '@angular-devkit/core';
|
9 | import { workflow } from '@angular-devkit/schematics';
|
10 | import { FileSystemCollection, FileSystemEngine, FileSystemSchematic, NodeWorkflow } from '@angular-devkit/schematics/tools';
|
11 | import { BaseCommandOptions, Command } from './command';
|
12 | import { Arguments, CommandContext, CommandDescription, Option } from './interface';
|
13 | export interface BaseSchematicSchema {
|
14 | debug?: boolean;
|
15 | dryRun?: boolean;
|
16 | force?: boolean;
|
17 | interactive?: boolean;
|
18 | defaults?: boolean;
|
19 | packageRegistry?: string;
|
20 | }
|
21 | export interface RunSchematicOptions extends BaseSchematicSchema {
|
22 | collectionName: string;
|
23 | schematicName: string;
|
24 | additionalOptions?: {
|
25 | [key: string]: {};
|
26 | };
|
27 | schematicOptions?: string[];
|
28 | showNothingDone?: boolean;
|
29 | }
|
30 | export declare class UnknownCollectionError extends Error {
|
31 | constructor(collectionName: string);
|
32 | }
|
33 | export declare abstract class SchematicCommand<T extends BaseSchematicSchema & BaseCommandOptions> extends Command<T> {
|
34 | readonly allowPrivateSchematics: boolean;
|
35 | private _host;
|
36 | private _workspace;
|
37 | protected _workflow: NodeWorkflow;
|
38 | protected defaultCollectionName: string;
|
39 | protected collectionName: string;
|
40 | protected schematicName?: string;
|
41 | constructor(context: CommandContext, description: CommandDescription, logger: logging.Logger);
|
42 | initialize(options: T & Arguments): Promise<void>;
|
43 | printHelp(): Promise<number>;
|
44 | printHelpUsage(): Promise<void>;
|
45 | protected getEngine(): FileSystemEngine;
|
46 | protected getCollection(collectionName: string): FileSystemCollection;
|
47 | protected getSchematic(collection: FileSystemCollection, schematicName: string, allowPrivate?: boolean): FileSystemSchematic;
|
48 | protected setPathOptions(options: Option[], workingDir: string): {
|
49 | [name: string]: string;
|
50 | };
|
51 | protected createWorkflow(options: BaseSchematicSchema): Promise<workflow.BaseWorkflow>;
|
52 | protected getDefaultSchematicCollection(): Promise<string>;
|
53 | protected runSchematic(options: RunSchematicOptions): Promise<number | void>;
|
54 | protected parseFreeFormArguments(schematicOptions: string[]): Promise<Arguments>;
|
55 | protected parseArguments(schematicOptions: string[], options: Option[] | null): Promise<Arguments>;
|
56 | private _loadWorkspace;
|
57 | }
|