UNPKG

@itwin/ecschema-metadata

Version:

ECObjects core concepts in typescript

169 lines 6.98 kB
import { AbstractParser, CAProviderTuple } from "./AbstractParser"; import { ConstantProps, CustomAttributeClassProps, EntityClassProps, EnumerationProps, InvertedUnitProps, KindOfQuantityProps, MixinProps, NavigationPropertyProps, PhenomenonProps, PrimitiveArrayPropertyProps, PrimitivePropertyProps, PropertyCategoryProps, RelationshipClassProps, SchemaItemFormatProps, SchemaItemUnitProps, SchemaProps, SchemaReferenceProps, StructArrayPropertyProps, StructClassProps, StructPropertyProps, UnitSystemProps } from "./JsonProps"; import { ECSpecVersion } from "./Helper"; interface UnknownObject { readonly [name: string]: unknown; } /** @internal */ export declare class JsonParser extends AbstractParser<UnknownObject> { private _rawSchema; private _schemaName?; private _currentItemFullName?; constructor(rawSchema: Readonly<unknown>); get getECSpecVersion(): ECSpecVersion | undefined; static parseJSUri(uri: string): ECSpecVersion | undefined; /** * Type checks Schema and returns SchemaProps interface * @param this._rawSchema * @returns SchemaProps */ parseSchema(): SchemaProps; getReferences(): Iterable<SchemaReferenceProps>; private checkSchemaReference; getItems(): Iterable<[string, string, UnknownObject]>; findItem(itemName: string): [string, string, UnknownObject] | undefined; /** * Type checks all Schema Item attributes. * @param jsonObj The JSON object to check if it represents a Schema Item. */ private checkSchemaItemProps; getProperties(jsonObj: UnknownObject, itemName: string): Iterable<[string, string, UnknownObject]>; /** * Type checks Class and returns ClassProps interface * @param jsonObj The JSON object to check if it represents a Class. */ private checkClassProps; /** * Type checks entity class and returns EntityClassProps interface * @param jsonObj * @returns EntityClassProps */ parseEntityClass(jsonObj: UnknownObject): EntityClassProps; /** * Type checks mixin and returns MixinProps interface * @param jsonObj * @returns MixinProps */ parseMixin(jsonObj: UnknownObject): MixinProps; /** * Type checks custom attribute class and returns CustomAttributeClassProps interface * @param jsonObj * @returns CustomAttributeClassProps */ parseCustomAttributeClass(jsonObj: UnknownObject): CustomAttributeClassProps; parseStructClass(jsonObj: UnknownObject): StructClassProps; parseUnitSystem(jsonObj: UnknownObject): UnitSystemProps; /** * Type checks Relationship Class and returns RelationshipClassProps interface * @param jsonObj * @returns RelationshipClassProps */ parseRelationshipClass(jsonObj: UnknownObject): RelationshipClassProps; /** * Type checks Relationship Constraint and returns RelationshipConstraintProps interface. * @param jsonObj * @param isSource For sake of error message, is this relationship constraint a source or target * @returns RelationshipConstraintProps */ private checkRelationshipConstraintProps; /** * Type checks Enumeration and returns EnumerationProps interface * @param jsonObj * @returns EnumerationProps */ parseEnumeration(jsonObj: UnknownObject): EnumerationProps; /** * Type checks KindOfQuantity and returns KindOfQuantityProps interface * @param jsonObj * @returns KindOfQuantityProps */ parseKindOfQuantity(jsonObj: UnknownObject): KindOfQuantityProps; /** * Type checks Property Category and returns PropertyCategoryProps interface * @param jsonObj * @returns PropertyCategoryProps */ parsePropertyCategory(jsonObj: UnknownObject): PropertyCategoryProps; /** * Type checks unit and returns UnitProps interface * @param jsonObj * @returns UnitProps */ parseUnit(jsonObj: UnknownObject): SchemaItemUnitProps; /** * Type checks inverted unit and returns InvertedUnitProps interface * @param jsonObj * @returns InvertedUnitProps */ parseInvertedUnit(jsonObj: UnknownObject): InvertedUnitProps; /** * Type checks constant and returns ConstantProps interface * @param jsonObj * @returns ConstantProps */ parseConstant(jsonObj: UnknownObject): ConstantProps; /** * Type checks phenomenon and returns PhenomenonProps interface * @param jsonObj * @returns PhenomenonProps */ parsePhenomenon(jsonObj: UnknownObject): PhenomenonProps; /** * Type checks format and returns SchemaItemFormatProps interface * @param jsonObj * @returns SchemaItemFormatProps */ parseFormat(jsonObj: UnknownObject): SchemaItemFormatProps; private isValidPropertyType; /** * Type checks property and returns PropertyProps interface * @param jsonObj * @returns PropertyProps */ private checkPropertyProps; private checkPropertyTypename; private checkPropertyMinAndMaxOccurs; /** * Type checks PrimitiveOrEnumProperty and returns PrimitiveOrEnumPropertyBaseProps interface * @param jsonObj * @returns PrimitiveOrEnumPropertyBaseProps */ private checkPrimitiveOrEnumPropertyBaseProps; /** * Type checks PrimitiveProperty and returns PrimitivePropertyProps interface * @param jsonObj * @returns PrimitivePropertyProps */ parsePrimitiveProperty(jsonObj: UnknownObject): PrimitivePropertyProps; /** * Type checks StructProperty and returns StructPropertyProps interface * @param jsonObj * @returns StructPropertyProps */ parseStructProperty(jsonObj: UnknownObject): StructPropertyProps; /** * Type checks PrimitiveArrayProperty and returns PrimitiveArrayPropertyProps interface * @param jsonObj * @returns PrimitiveArrayPropertyProps */ parsePrimitiveArrayProperty(jsonObj: UnknownObject): PrimitiveArrayPropertyProps; /** * Type checks StructArrayProperty and returns StructArrayPropertyProps interface * @param jsonObj * @returns StructArrayPropertyProps */ parseStructArrayProperty(jsonObj: UnknownObject): StructArrayPropertyProps; /** * Type checks NavigationProperty and returns NavigationPropertyProps interface * @param jsonObj * @returns NavigationPropertyProps */ parseNavigationProperty(jsonObj: UnknownObject): NavigationPropertyProps; getSchemaCustomAttributeProviders(): Iterable<CAProviderTuple>; getClassCustomAttributeProviders(jsonObj: UnknownObject): Iterable<CAProviderTuple>; getPropertyCustomAttributeProviders(jsonObj: UnknownObject): Iterable<CAProviderTuple>; getRelationshipConstraintCustomAttributeProviders(jsonObj: UnknownObject): [Iterable<CAProviderTuple>, Iterable<CAProviderTuple>]; private getCustomAttributeProviders; } export {}; //# sourceMappingURL=JsonParser.d.ts.map