upgrade-data.d.ts 1.8 KB

12345678910111213141516171819202122232425262728293031323334
  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 { MigrationRule } from '../update-tool/migration-rule';
  9. import { ValueOfChanges, VersionChanges } from '../update-tool/version-changes';
  10. import { AttributeSelectorUpgradeData, ClassNameUpgradeData, ConstructorChecksUpgradeData, CssSelectorUpgradeData, ElementSelectorUpgradeData, InputNameUpgradeData, MethodCallUpgradeData, OutputNameUpgradeData, PropertyNameUpgradeData } from './data';
  11. /** Upgrade data for the Angular CDK. */
  12. export declare const cdkUpgradeData: RuleUpgradeData;
  13. /**
  14. * Interface that describes the upgrade data that needs to be defined when using the CDK
  15. * upgrade rules.
  16. */
  17. export interface RuleUpgradeData {
  18. attributeSelectors: VersionChanges<AttributeSelectorUpgradeData>;
  19. classNames: VersionChanges<ClassNameUpgradeData>;
  20. constructorChecks: VersionChanges<ConstructorChecksUpgradeData>;
  21. cssSelectors: VersionChanges<CssSelectorUpgradeData>;
  22. elementSelectors: VersionChanges<ElementSelectorUpgradeData>;
  23. inputNames: VersionChanges<InputNameUpgradeData>;
  24. methodCallChecks: VersionChanges<MethodCallUpgradeData>;
  25. outputNames: VersionChanges<OutputNameUpgradeData>;
  26. propertyNames: VersionChanges<PropertyNameUpgradeData>;
  27. }
  28. /**
  29. * Gets the reduced upgrade data for the specified data key from the rule walker options.
  30. *
  31. * The function reads out the target version and upgrade data object from the rule options and
  32. * resolves the specified data portion that is specifically tied to the target version.
  33. */
  34. export declare function getVersionUpgradeData<T extends keyof RuleUpgradeData, U = ValueOfChanges<RuleUpgradeData[T]>>(r: MigrationRule<RuleUpgradeData>, dataName: T): U[];