LocalUnitFormatProvider Class

Implementation of BaseUnitFormattingSettingsProvider that stores and retrieves data in local storage.

Extends

Methods

Name Description
constructor(quantityFormatter: QuantityFormatter, maintainOverridesPerIModel?: boolean): LocalUnitFormatProvider If maintainOverridesPerIModel is true, the base class will set up listeners to monitor active iModel  
remove(quantityTypeKey: string): Promise<boolean> Removes the override formats for a specific quantity type.  
retrieve(quantityTypeKey: string): Promise<undefined | OverrideFormatEntry> Retrieves serialized JSON object containing format overrides for a specific quantity type.  
retrieveUnitSystem(defaultKey: UnitSystemKey): Promise<UnitSystemKey> Retrieves the active unit system typically based on the "active" iModelConnection.  
store(quantityTypeKey: string, overrideProps: OverrideFormatEntry): Promise<boolean> Serializes JSON object containing format overrides for a specific quantity type.  
storeUnitSystemKey(unitSystemKey: UnitSystemKey): Promise<boolean> Store the active unit system typically for the "active" iModelConnection.  

Inherited methods

Name Inherited from Description
applyQuantityFormattingSettingsForIModel(imodel?: IModelConnection): Promise<void> Protected BaseUnitFormattingSettingsProvider  
buildQuantityFormatOverridesMap(): Promise<Map<UnitSystemKey, Map<string, FormatProps>>> Protected BaseUnitFormattingSettingsProvider function to convert from serialized JSON format for Quantity Type overrides to build a map compatible with QuantityManager
loadOverrides(imodel?: IModelConnection): Promise<void> BaseUnitFormattingSettingsProvider Function to load overrides for a specific IModelConnection.
storeFormatOverrides(__namedParameters: QuantityFormatOverridesChangedArgs): Promise<void> BaseUnitFormattingSettingsProvider function called to save format overrides
storeUnitSystemSetting(__namedParameters: FormattingUnitSystemChangedArgs): Promise<void> BaseUnitFormattingSettingsProvider save UnitSystem for active iModel

Inherited properties

Name Type Inherited from Description
_imodelConnection Protected undefined | IModelConnection BaseUnitFormattingSettingsProvider  
imodelConnection Accessor ProtectedReadOnly undefined | IModelConnection BaseUnitFormattingSettingsProvider  
maintainOverridesPerIModel Accessor ReadOnly boolean BaseUnitFormattingSettingsProvider property that is set by the implementation to inform the BaseUnitFormattingSettingsProvider if the provider
should trigger reloading of the overrides when the "active" imodel changes.

Defined in

Last Updated: 19 April, 2024