/** @packageDocumentation * @module Comparison */ import { AnyClass, AnyProperty, Constant, CustomAttributeClass, CustomAttributeContainerProps, ECClass, EntityClass, Enumeration, Format, InvertedUnit, KindOfQuantity, Mixin, Phenomenon, PropertyCategory, RelationshipClass, RelationshipConstraint, Schema, SchemaItem, SchemaItemKey, Unit } from "@itwin/ecschema-metadata"; import { ISchemaCompareReporter } from "./SchemaCompareReporter"; /** * Enum that identifies if Schema A is being iterated (Forward) or * Schema B is being iterated (Backward); * @alpha */ export declare enum SchemaCompareDirection { Forward = 0, Backward = 1 } /** * Interface for comparing EC Schemas. * @alpha */ export interface ISchemaComparer { compareSchemas(schemaA: Schema, schemaB: Schema): void; compareSchemaProps(schemaA: Schema, schemaB: Schema): void; compareSchemaItems(schemaItemA: SchemaItem, schemaItemB: SchemaItem | undefined): void; compareClasses(classA: AnyClass, classB: AnyClass): void; compareProperties(propertyA: AnyProperty, propertyB: AnyProperty | undefined): void; compareEntityClasses(entityA: EntityClass, entityB: EntityClass): void; compareMixins(mixinA: Mixin, mixinB: Mixin): void; compareRelationshipClasses(relationshipClassA: RelationshipClass, relationshipClassB: RelationshipClass): void; compareRelationshipConstraints(relationshipConstraintA: RelationshipConstraint, relationshipConstraintB: RelationshipConstraint): void; compareCustomAttributeClasses(customAttributeClassA: CustomAttributeClass, customAttributeClassB: CustomAttributeClass): void; compareCustomAttributeContainers(containerA: CustomAttributeContainerProps, containerB: CustomAttributeContainerProps): void; compareEnumerations(enumA: Enumeration, enumB: Enumeration): void; compareKindOfQuantities(koqA: KindOfQuantity, koqB: KindOfQuantity): void; comparePropertyCategories(categoryA: PropertyCategory, categoryB: PropertyCategory): void; compareFormats(formatA: Format, formatB: Format): void; compareUnits(unitA: Unit, unitB: Unit): void; compareInvertedUnits(invertedUnitA: InvertedUnit, invertedUnitB: InvertedUnit): void; comparePhenomenons(phenomenonA: Phenomenon, phenomenonB: Phenomenon): void; compareConstants(constantA: Constant, constantB: Constant): void; /** @internal */ resolveItem(item: SchemaItem, lookupSchema: Schema, itemConstructor: TItem): Promise | undefined>; /** @internal */ resolveProperty(propertyA: AnyProperty, ecClass: ECClass): Promise; /** @internal */ areEqualByName(itemKeyA?: Readonly | SchemaItem, itemKeyB?: Readonly | SchemaItem): boolean; } /** * Compares EC Schemas and reports differences using the [[IDiagnosticReporter]] objects * specified. * @alpha */ export declare class SchemaComparer { private _compareDirection; private _reporter; private _reporters; /** * Initializes a new SchemaComparer instance. * @param reporters The [[IDiagnosticReporter]] object(s) to use to report the results. */ constructor(...reporters: ISchemaCompareReporter[]); /** * Resolves a schema Item from the given lookup schema. * @internal */ resolveItem(item: SchemaItem, lookupSchema: Schema, itemConstructor: TItem): Promise | undefined>; /** * Resolves a property from a class. * @internal */ resolveProperty(propertyA: AnyProperty, ecClass: ECClass): Promise; /** * Compares two schema items to determine if they are the same by name. * @internal */ areEqualByName(itemKeyA?: Readonly | SchemaItem, itemKeyB?: Readonly | SchemaItem): boolean; /** * Compares two schemas to identify differences. * @param schemaA The first Schema. * @param schemaB The second Schema. */ compareSchemas(schemaA: Schema, schemaB: Schema): Promise; /** * Compares two schemas to identify differences between property values. * @param schemaA The first Schema. * @param schemaB The second Schema. */ compareSchemaProps(schemaA: Schema, schemaB: Schema): Promise; /** * Compares two SchemaItems to identify differences between property values. * @param schemaItemA The first SchemaItem. * @param schemaItemB The second SchemaItem. */ compareSchemaItems(schemaItemA: SchemaItem, schemaItemB: SchemaItem | undefined): Promise; /** * Compares two ECClasses to identify differences between property values. * @param classA The first ECClass. * @param classB The second ECClass. */ compareClasses(classA: AnyClass, classB: AnyClass): Promise; /** * Compares two ECProperties to identify differences between property values. * @param propertyA The first ECProperty. * @param propertyB The second ECProperty. */ compareProperties(propertyA: AnyProperty, propertyB: AnyProperty | undefined): Promise; /** * Compares two EntityClass objects to identify differences between property values. * @param entityA * @param entityB */ compareEntityClasses(entityA: EntityClass, entityB: EntityClass): Promise; /** * Compares two Mixin objects to identify differences between property values. * @param mixinA * @param mixinB */ compareMixins(mixinA: Mixin, mixinB: Mixin): Promise; /** * Compares two RelationshipClass objects to identify differences between property values. * @param relationshipA * @param relationshipB */ compareRelationshipClasses(relationshipA: RelationshipClass, relationshipB: RelationshipClass): Promise; /** * Compares two RelationshipConstraint objects to identify differences between property values. * @param relationshipConstraintA * @param relationshipConstraintB */ compareRelationshipConstraints(constraintA: RelationshipConstraint, constraintB: RelationshipConstraint): Promise; /** * Compares two CustomAttributeClass objects to identify differences between property values. * @param customAttributeClassA * @param customAttributeClassB */ compareCustomAttributeClasses(customAttributeClassA: CustomAttributeClass, customAttributeClassB: CustomAttributeClass): Promise; /** * Compares two CustomAttributeContainerProps objects to identify differences between property values. * @param containerA * @param containerB */ compareCustomAttributeContainers(containerA: CustomAttributeContainerProps, containerB: CustomAttributeContainerProps): Promise; /** * Compares two Enumeration objects to identify differences between property values. * @param enumA * @param enumB */ compareEnumerations(enumA: Enumeration, enumB: Enumeration): Promise; /** * Compares two KindOfQuantity objects to identify differences between property values. * @param koqA * @param koqB */ compareKindOfQuantities(koqA: KindOfQuantity, koqB: KindOfQuantity): Promise; /** * Compares two PropertyCategory objects to identify differences between property values. * @param categoryA * @param categoryB */ comparePropertyCategories(categoryA: PropertyCategory, categoryB: PropertyCategory): Promise; /** * Compares two Format objects to identify differences between property values. * @param formatA * @param formatB */ compareFormats(formatA: Format, formatB: Format): Promise; /** * Compares two Unit objects to identify differences between property values. * @param unitA * @param unitB */ compareUnits(unitA: Unit, unitB: Unit): Promise; /** * Compares two InvertedUnit objects to identify differences between property values. * @param invertedUnitA * @param invertedUnitB */ compareInvertedUnits(invertedUnitA: InvertedUnit, invertedUnitB: InvertedUnit): Promise; /** * Compares two Phenomenon objects to identify differences between property values. * @param phenomenonA * @param phenomenonB */ comparePhenomenons(phenomenonA: Phenomenon, phenomenonB: Phenomenon): Promise; /** * Compares two Constant objects to identify differences between property values. * @param constantA * @param constantB */ compareConstants(constantA: Constant, constantB: Constant): Promise; private comparePropertyType; private compareEnumerators; private compareFormatUnits; private areOverrideFormatsSameByName; /** * Compares two item keys. * @param itemKeyA item key A to compare to. * @param itemKeyB item key B to compare to. * @param topLevelSchemaNameA top level schema name in which the item A exists. * @param topLevelSchemaNameB top level schema name in which the item B exists. * @returns true if both names are the same and they come from their respective top level schema. */ private areItemsSameByName; /** * Looks for same classA in containerB using key. * @param classNameA name of the class to look for in containerB. * @param containerA container which classNameA belongs to. * @param containerB container in which to look for classNameA. * @returns true if a same classA is in containerB, otherwise false. */ private containerHasClass; } //# sourceMappingURL=SchemaComparer.d.ts.map