@itwin/ecschema-metadata
Version:
ECObjects core concepts in typescript
42 lines • 2.12 kB
TypeScript
import { SchemaContext } from "../Context";
import { SchemaItemProps, SchemaProps } from "../Deserialization/JsonProps";
import { CustomAttribute } from "../Metadata/CustomAttribute";
/**
* 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, context: SchemaContext): 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, context: SchemaContext): Promise<SchemaItemProps[] | undefined>;
private static parseItems;
static parseItem(props: SchemaItemProps, schemaName: string, context: SchemaContext): Promise<SchemaItemProps>;
}
/**
* 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;
//# sourceMappingURL=SchemaParser.d.ts.map