Unit Class

Beta  

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
constructor(schema: Schema, name: string): Unit    
fromJSON(unitProps: UnitProps): Promise<void>    
fromJSONSync(unitProps: UnitProps): void    
toJSON(standalone: boolean = false, includeSchemaVersion: boolean = false): UnitProps Save this Unit's properties to an object for serializing to JSON.  

Inherited methods

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

Properties

Name Type Description
_definition Protected string    
_denominator Protected undefined | number    
_numerator Protected undefined | number    
_offset Protected undefined | number    
_phenomenon Protected undefined | LazyLoadedPhenomenon    
_unitSystem Protected undefined | LazyLoadedUnitSystem    
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 Unit    
unitSystem Accessor ReadOnly undefined | LazyLoadedUnitSystem    

Inherited properties

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

Defined in

Last Updated: 20 June, 2023