UNPKG

@itwin/ecschema-metadata

Version:

ECObjects core concepts in typescript

82 lines 3.29 kB
/** @packageDocumentation * @module Metadata */ import { MixinProps } from "../Deserialization/JsonProps"; import { SchemaItemType, StrengthDirection } from "../ECObjects"; import { LazyLoadedEntityClass } from "../Interfaces"; import { ECClass } from "./Class"; import { EntityClass } from "./EntityClass"; import { NavigationProperty } from "./Property"; import { RelationshipClass } from "./RelationshipClass"; import { Schema } from "./Schema"; import { SchemaItem } from "./SchemaItem"; /** * A Typescript class representation of a Mixin. * @public @preview */ export declare class Mixin extends ECClass { readonly schemaItemType: SchemaItemType; /** @internal */ static get schemaItemType(): SchemaItemType; private _appliesTo?; get appliesTo(): LazyLoadedEntityClass | undefined; /** @internal */ constructor(schema: Schema, name: string); /** * * @param name * @param relationship * @param direction * @internal */ protected createNavigationProperty(name: string, relationship: string | RelationshipClass, direction: string | StrengthDirection): Promise<NavigationProperty>; /** * * @param name * @param relationship * @param direction * @returns * * @internal */ protected createNavigationPropertySync(name: string, relationship: string | RelationshipClass, direction: string | StrengthDirection): NavigationProperty; /** * @internal */ protected setAppliesTo(appliesTo: LazyLoadedEntityClass): void; /** * Save this Mixin's properties to an object for serializing to JSON. * @param standalone Serialization includes only this object (as opposed to the full schema). * @param includeSchemaVersion Include the Schema's version information in the serialized object. */ toJSON(standalone?: boolean, includeSchemaVersion?: boolean): MixinProps; /** @internal */ toXml(schemaXml: Document): Promise<Element>; fromJSONSync(mixinProps: MixinProps): void; fromJSON(mixinProps: MixinProps): Promise<void>; applicableTo(entityClass: EntityClass): Promise<boolean>; /** * Type guard to check if the SchemaItem is of type Mixin. * @param item The SchemaItem to check. * @returns True if the item is a Mixin, false otherwise. */ static isMixin(item?: SchemaItem): item is Mixin; /** * Type assertion to check if the SchemaItem is of type Mixin. * @param item The SchemaItem to check. * @returns The item cast to Mixin if it is a Mixin, undefined otherwise. * @internal */ static assertIsMixin(item?: SchemaItem): asserts item is Mixin; } /** * @internal * An abstract class used for schema editing. */ export declare abstract class MutableMixin extends Mixin { abstract setAppliesTo(entityClass: LazyLoadedEntityClass): void; abstract createNavigationProperty(name: string, relationship: string | RelationshipClass, direction: string | StrengthDirection): Promise<NavigationProperty>; abstract createNavigationPropertySync(name: string, relationship: string | RelationshipClass, direction: string | StrengthDirection): NavigationProperty; abstract setDisplayLabel(displayLabel: string): void; } //# sourceMappingURL=Mixin.d.ts.map