@itwin/ecschema-metadata
Version:
ECObjects core concepts in typescript
42 lines • 2.34 kB
TypeScript
import { ISchemaLocater, SchemaContext } from "./Context";
import { SchemaProps } from "./Deserialization/JsonProps";
import { SchemaMatchType } from "./ECObjects";
import { SchemaInfo } from "./Interfaces";
import { Schema } from "./Metadata/Schema";
import { SchemaKey } from "./SchemaKey";
/**
* Gets the full schema Json for the input schema name or undefined if not found
* @throws [Error] if the schema is found but json cannot be returned
* @public @preview
*/
export type SchemaPropsGetter = (schemaName: string) => SchemaProps | undefined;
/**
* An ISchemaLocater implementation for locating and retrieving EC Schema objects using a function
* that returns the Schema Json for a given schema name
* @public @preview
*/
export declare class SchemaJsonLocater implements ISchemaLocater {
private _getSchemaProps;
constructor(getSchemaProps: SchemaPropsGetter);
/** Get a schema by [SchemaKey]
* @param schemaKey The [SchemaKey] that identifies the schema.
* @param matchType The [SchemaMatchType] to used for comparing schema versions.
* @param context The [SchemaContext] used to facilitate schema location.
* @throws [ECSchemaError]($ecschema-metadata) if the schema exists, but cannot be loaded.
*/
getSchema(schemaKey: SchemaKey, matchType: SchemaMatchType, context: SchemaContext): Promise<Schema | undefined>;
/**
* Gets the schema info which matches the provided SchemaKey. The schema info may be returned before the schema is fully loaded.
* @param schemaKey The SchemaKey describing the schema to get from the cache.
* @param matchType The match type to use when locating the schema
*/
getSchemaInfo(schemaKey: SchemaKey, matchType: SchemaMatchType, context: SchemaContext): Promise<SchemaInfo | undefined>;
/** Get a schema by [SchemaKey] synchronously.
* @param schemaKey The [SchemaKey] that identifies the schema.
* @param matchType The [SchemaMatchType] to used for comparing schema versions.
* @param context The [SchemaContext] used to facilitate schema location.
* @throws [Error]($ecschema-metadata) if the schema exists, but cannot be loaded.
*/
getSchemaSync(schemaKey: SchemaKey, _matchType: SchemaMatchType, context: SchemaContext): Schema | undefined;
}
//# sourceMappingURL=SchemaJsonLocater.d.ts.map