Unit Class

An abstract class that adds the ability to define Units and everything that goes with them, within an ECSchema as a first-class concept is to allow the iModel to not be dependent on any hard-coded Units

Extends

Methods

Name Description
fromJSON(unitProps: SchemaItemUnitProps): Promise<void>    
fromJSONSync(unitProps: SchemaItemUnitProps): void    
toJSON(standalone: booleanfalse, includeSchemaVersion: booleanfalse): SchemaItemUnitProps Save this Unit's properties to an object for serializing to JSON.  
isUnit(item?: SchemaItem): item is Unit Static Type guard to check if the SchemaItem is of type Unit.  

Inherited methods

Name Inherited from Description
equalByKey(thisSchemaItem: SchemaItem, thatSchemaItemOrKey?: SchemaItemKey | SchemaItem): boolean Static Inherited SchemaItem Indicates if the two SchemaItem objects are equal by comparing their respective key properties.
parseFullName(fullName: string): [string, string] Static Inherited SchemaItem Parses the given full name, {schemaName}.{schemaItemName} or {schemaName}:{schemaItemName}, into two separate strings.

Properties

Name Type Description
definition Accessor ReadOnly string    
denominator Accessor ReadOnly number    
hasDenominator Accessor ReadOnly boolean    
hasNumerator Accessor ReadOnly boolean    
hasOffset Accessor ReadOnly boolean    
numerator Accessor ReadOnly number    
offset Accessor ReadOnly number    
phenomenon Accessor ReadOnly undefined | LazyLoadedPhenomenon    
schemaItemType Readonly SchemaItemType Get the type of item represented by this instance  
unitSystem Accessor ReadOnly undefined | LazyLoadedUnitSystem    

Inherited properties

Name Type Inherited from Description
description Accessor Inherited ReadOnly undefined | string SchemaItem  
fullName Accessor Inherited ReadOnly string SchemaItem  
key Accessor Inherited ReadOnly SchemaItemKey SchemaItem  
label Accessor Inherited ReadOnly undefined | string SchemaItem  
name Accessor Inherited ReadOnly string SchemaItem  
schema Readonly Inherited Schema SchemaItem  

Defined in

Last Updated: 23 April, 2025