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 { SchematicContext, Tree } from '@angular-devkit/schematics';
|
---|
9 | import { ProjectDefinition } from '@angular-devkit/core/src/workspace';
|
---|
10 | import { Constructor, Migration, PostMigrationAction } from '../update-tool/migration';
|
---|
11 | export declare type DevkitContext = {
|
---|
12 | /** Devkit tree for the current migrations. Can be used to insert/remove files. */
|
---|
13 | tree: Tree;
|
---|
14 | /** Name of the project the migrations run against. */
|
---|
15 | projectName: string;
|
---|
16 | /** Workspace project the migrations run against. */
|
---|
17 | project: ProjectDefinition;
|
---|
18 | /** Whether the migrations run for a test target. */
|
---|
19 | isTestTarget: boolean;
|
---|
20 | };
|
---|
21 | export declare abstract class DevkitMigration<Data> extends Migration<Data, DevkitContext> {
|
---|
22 | /** Prints an informative message with context on the current target. */
|
---|
23 | protected printInfo(text: string): void;
|
---|
24 | /**
|
---|
25 | * Optional static method that will be called once the migration of all project
|
---|
26 | * targets has been performed. This method can be used to make changes respecting the
|
---|
27 | * migration result of all individual targets. e.g. removing HammerJS if it
|
---|
28 | * is not needed in any project target.
|
---|
29 | */
|
---|
30 | static globalPostMigration?(tree: Tree, context: SchematicContext): PostMigrationAction;
|
---|
31 | }
|
---|
32 | export declare type DevkitMigrationCtor<Data> = Constructor<DevkitMigration<Data>> & {
|
---|
33 | [m in keyof typeof DevkitMigration]: (typeof DevkitMigration)[m];
|
---|
34 | };
|
---|