getItemSync Method


getItemSync(name)

Gets an item from within this schema. To get by full name use lookupItem instead. If an item of the name exists but does not match the requested type, undefined is returned

getItemSync(name: string): SchemaItem | undefined

Parameter Type Description
name string  

Returns - SchemaItem | undefined



getItemSync<T extends SchemaItem>(name, itemConstructor)

Gets an item from within this schema. To get by full name use lookupItem instead. If an item of the name exists but does not match the requested type, undefined is returned

getItemSync<T extends SchemaItem>(name: string, itemConstructor: T): InstanceType<T> | undefined

Parameter Type Description
name string  
itemConstructor T The constructor of the item to return.

Returns - InstanceType<T> | undefined


Defined in

Last Updated: 28 April, 2026