devkit-migration-rule.d.ts 1.3 KB

123456789101112131415161718192021222324
  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.dev/license
  7. */
  8. import { Rule, SchematicContext } from '@angular-devkit/schematics';
  9. import { MigrationCtor } from '../update-tool/migration';
  10. import { TargetVersion } from '../update-tool/target-version';
  11. import { DevkitContext, DevkitMigrationCtor } from './devkit-migration';
  12. import { UpgradeData } from './upgrade-data';
  13. /** List of migrations which run for the CDK update. */
  14. export declare const cdkMigrations: MigrationCtor<UpgradeData>[];
  15. export type NullableDevkitMigration = MigrationCtor<UpgradeData | null, DevkitContext>;
  16. type PostMigrationFn = (context: SchematicContext, targetVersion: TargetVersion, hasFailure: boolean) => void;
  17. /**
  18. * Creates a Angular schematic rule that runs the upgrade for the
  19. * specified target version.
  20. */
  21. export declare function createMigrationSchematicRule(targetVersion: TargetVersion, extraMigrations: NullableDevkitMigration[], upgradeData: UpgradeData, onMigrationCompleteFn?: PostMigrationFn): Rule;
  22. /** Whether the given migration type refers to a devkit migration */
  23. export declare function isDevkitMigration(value: MigrationCtor<any, any>): value is DevkitMigrationCtor<any>;
  24. export {};