UNPKG

@itwin/ecschema-metadata

Version:

ECObjects core concepts in typescript

198 lines • 6.68 kB
/** @packageDocumentation * @module Metadata */ export { PropertyType } from "./PropertyTypes"; /** * Identifies a class as abstract or sealed * * @public @preview */ export declare enum ECClassModifier { None = 0, Abstract = 1, Sealed = 2 } /** * An enumeration that has all the schema item type names as values * * @enum {string} * @public @preview */ export declare enum SchemaItemType { EntityClass = "EntityClass", Mixin = "Mixin", StructClass = "StructClass", CustomAttributeClass = "CustomAttributeClass", RelationshipClass = "RelationshipClass", Enumeration = "Enumeration", KindOfQuantity = "KindOfQuantity", PropertyCategory = "PropertyCategory", Unit = "Unit", InvertedUnit = "InvertedUnit", Constant = "Constant", Phenomenon = "Phenomenon", UnitSystem = "UnitSystem", Format = "Format" } /** * Additional Schema Item Types which define classes of item types * @public @preview */ export declare enum AbstractSchemaItemType { Class = "Class", SchemaItem = "SchemaItem" } /** * Defines types of items that may be provided to identify supported items * @public @preview */ export type SupportedSchemaItemType = SchemaItemType | AbstractSchemaItemType; /** * Primitive data types for ECProperties. * @public @preview */ export declare enum PrimitiveType { Uninitialized = 0, Binary = 257, Boolean = 513, DateTime = 769, Double = 1025, Integer = 1281, Long = 1537, Point2d = 1793, Point3d = 2049, String = 2305, IGeometry = 2561 } /** * Defines the valid CustomAttribute container types. * @public @preview */ export declare enum CustomAttributeContainerType { Schema = 1, EntityClass = 2, CustomAttributeClass = 4, StructClass = 8, RelationshipClass = 16, AnyClass = 30, PrimitiveProperty = 32, StructProperty = 64, PrimitiveArrayProperty = 128, StructArrayProperty = 256, NavigationProperty = 512, AnyProperty = 992, SourceRelationshipConstraint = 1024, TargetRelationshipConstraint = 2048, AnyRelationshipConstraint = 3072, Any = 4095 } /** * Defines what sort of match should be used when locating a schema. * @public @preview */ export declare enum SchemaMatchType { Identical = 0, Exact = 1, LatestWriteCompatible = 2, Latest = 3, LatestReadCompatible = 4 } /** * Identifer for an ECRelationshipConstraint. Used to determine the side of the relationship the constraint is representing. * @public @preview */ export declare enum RelationshipEnd { Source = 0, Target = 1 } /** * Defines the how the lifetime of the source and target are related. * * @public @preview */ export declare enum StrengthType { Referencing = 0, Holding = 1, Embedding = 2 } /** * Defines the which side of the relationship is the starting point of the relationship. This impacts how relationship strength is applied. * * @public @preview */ export declare enum StrengthDirection { /** The source is the starting point of the relationship. */ Forward = 1, /** The target is the starting point of the relationship. */ Backward = 2 } /** * Parses the provided string into an ECClassModifier if the string is a valid modifier. * @param modifier The modifier string to parse. * @beta */ export declare function parseClassModifier(modifier: string): ECClassModifier | undefined; /** * @return A string representing the provided ECClassModifier. If the modifier is not valid, an empty string is returned. * @beta */ export declare function classModifierToString(modifier: ECClassModifier): string; /** * Tries to parse the given string as one of the 8 schema item types. * @param type The schema item type string to parse. * @returns A valid SchemaItemType if successfully parsed. Otherwise, undefined if the provided string is not a valid SchemaItemType. * @beta */ export declare function parseSchemaItemType(type: string): SchemaItemType | undefined; /** * Converts a valid SchemaItemType to a display string. * @param value The SchemaItemType to stringify. * @return A string representing the provided SchemaItemType. If the type is not valid, an empty string is returned. * @beta * @deprecated in 4.6.0 - will not be removed until after 2026-06-13. SchemaItemType is a string enum so just use it directly */ export declare function schemaItemTypeToString(value: SchemaItemType): string; /** @internal */ export declare function schemaItemTypeToXmlString(value: SchemaItemType): string; /** * Tries to parse the given string as one of the 10 primitive types. * @param type The primitive type string to parse. * @returns A valid PrimitiveType if successfully parsed, or undefined if the provided string is not a valid PrimitiveType. * @beta */ export declare function parsePrimitiveType(type: string): PrimitiveType | undefined; /** @beta */ export declare function primitiveTypeToString(type: PrimitiveType): string; /** * Parses the given string into the appropriate CustomAttributeContainerType if the string is valid. * @param type The container type string to parse. * @beta */ export declare function parseCustomAttributeContainerType(type: string): CustomAttributeContainerType | undefined; /** * Creates a string representing a valid CustomAttributeContainerType. * @param value The CustomAttributeContainerType to stringify. * @return A string representing the provided CustomAttributeContainerType. If the type is not valid, an empty string is returned. * @beta */ export declare function containerTypeToString(type: CustomAttributeContainerType): string; /** @beta */ export declare function parseRelationshipEnd(end: string): RelationshipEnd | undefined; /** @beta */ export declare function relationshipEndToString(end: RelationshipEnd): string; /** * Takes a string representing a StrengthType, will parse it and return the corresponding StrengthType. * @throws ECSchemaStatus.InvalidStrength if the provided string that is not valid * @param strength * @beta */ export declare function parseStrength(strength: string): StrengthType | undefined; /** @beta */ export declare function strengthToString(strength: StrengthType): string; /** @beta */ export declare function parseStrengthDirection(direction: string): StrengthDirection | undefined; /** @beta */ export declare function strengthDirectionToString(direction: StrengthDirection): string; /** Compares a SchemaItemType against supported type. * @beta */ export declare function isSupportedSchemaItemType(value: SchemaItemType, supported: SupportedSchemaItemType): boolean; //# sourceMappingURL=ECObjects.d.ts.map