getSchemaItemSync Method
getSchemaItemSync<T extends >(schemaNameOrKey, itemNameOrCtor?)
getSchemaItemSync<T extends >(schemaNameOrKey: string | SchemaItemKey, itemNameOrCtor?: T): undefined | SchemaItem
Parameter | Type | Description |
---|---|---|
schemaNameOrKey | string | SchemaItemKey | |
itemNameOrCtor | T |
Returns - undefined | SchemaItem
getSchemaItemSync<T extends >(schemaNameOrKey, itemNameOrCtor, itemConstructor?)
getSchemaItemSync<T extends >(schemaNameOrKey: string, itemNameOrCtor: string, itemConstructor?: T): undefined | InstanceType<T>
Parameter | Type | Description |
---|---|---|
schemaNameOrKey | string | |
itemNameOrCtor | string | |
itemConstructor | T |
Returns - undefined | InstanceType<T>
getSchemaItemSync<T extends >(schemaNameOrKey, itemNameOrCtor, itemConstructor?)
getSchemaItemSync<T extends >(schemaNameOrKey: string, itemNameOrCtor: string, itemConstructor?: T): undefined | SchemaItem
Parameter | Type | Description |
---|---|---|
schemaNameOrKey | string | |
itemNameOrCtor | string | |
itemConstructor | T |
Returns - undefined | SchemaItem
getSchemaItemSync<T extends >(schemaNameOrKey, itemNameOrCtor?)
Gets the schema item from the specified schema if it exists in this SchemaContext. Will return undefined if the cached schema is partially loaded. Use getSchemaItem to await until the schema is completely loaded.
getSchemaItemSync<T extends >(schemaNameOrKey: string | SchemaItemKey, itemNameOrCtor?: T): undefined | InstanceType<T>
@returns The requested schema item, or undefined
if the item could not be found.
@example
const schemaItem = schemaContext.getSchemaItemSync(new SchemaItemKey("TestElement", new SchemaKey("TestSchema")));
const schemaItemWithCtor = schemaContext.getSchemaItemSync(new SchemaItemKey("TestElement", new SchemaKey("TestSchema")), EntityClass);
const schemaItemByName = schemaContext.getSchemaItemSync("TestSchema", "TestElement");
const schemaItemByNameWithCtor = schemaContext.getSchemaItemSync("TestSchema", "TestElement", EntityClass);
const schemaItemFullName = schemaContext.getSchemaItemSync("TestSchema:TestElement", EntityClass);
const schemaItemFullNameWithCtor = schemaContext.getSchemaItemSync("TestSchema:TestElement", EntityClass);
const schemaItemFullNameSep = schemaContext.getSchemaItemSync("TestSchema.TestElement", EntityClass);
const schemaItemFullNameSepWithCtor = schemaContext.getSchemaItemSync("TestSchema.TestElement", EntityClass);
Parameter | Type | Description |
---|---|---|
schemaNameOrKey | string | SchemaItemKey | |
itemNameOrCtor | T |
Returns - undefined | InstanceType<T>
The requested schema item, or undefined
if the item could not be found.
Defined in
- ecschema-metadata/src/Context.ts Line 477
Last Updated: 04 April, 2025