UNPKG

@itwin/ecschema-metadata

Version:

ECObjects core concepts in typescript

48 lines 2.33 kB
import { SchemaItemProps, SchemaProps } from "../Deserialization/JsonProps"; import { SchemaItemType } from "../ECObjects"; import { SchemaInfo } from "../Interfaces"; import { CustomAttribute } from "../Metadata/CustomAttribute"; interface NamedSchemaItemProps extends SchemaItemProps { name: string; schemaItemType: SchemaItemType; } /** * Parses SchemaProps JSON returned from an ECSql query and returns the correct SchemaProps JSON object. * This is necessary as a small amount information (ie. CustomAttributes, unqualified type names, etc.) * returned from the iModelDb is in a different format than is required for a given Schema or * SchemaItemProps JSON object. * @internal */ export declare class SchemaParser { /** * Corrects the SchemaProps JSON returned from the query to a proper SchemaProps * JSON object. * @param schema The SchemaProps JSON object to parse. * @param context The SchemaContext that will contain the schema and it's references. * @returns The corrected SchemaProps JSON. */ static parse(schema: SchemaProps, schemaInfos: Iterable<SchemaInfo>): Promise<SchemaProps>; /** * Parse the given SchemaItemProps array, as returned from an ECSql query, and returns the corrected SchemaItemProps. * @param schemaItems The SchemaItemProps array returned from an iModelDb. * @param schemaName The name of the Schema to which the SchemaItemProps belong. * @param context The SchemaContext containing the Schema. * @returns The corrected SchemaItemProps. */ static parseSchemaItems(schemaItems: readonly SchemaItemProps[], schemaName: string, schemaInfos: Iterable<SchemaInfo>): Promise<NamedSchemaItemProps[] | undefined>; private static parseItems; static parseItem(props: SchemaItemProps, schemaName: string, schemaInfos: Iterable<SchemaInfo>): Promise<NamedSchemaItemProps>; } /** * Utility method to parse CustomAttribute data retrieved from a ECSql query. * @param customAttribute CustomAttribute data as retrieved from an iModel query. * @returns The CustomAttribute instance. * @internal */ export declare function parseCustomAttribute(customAttribute: { ecClass: string; ecSchema: string; [propName: string]: any; }): CustomAttribute; export {}; //# sourceMappingURL=SchemaParser.d.ts.map