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

Inherited properties

Name Type Inherited from Description
_imodelConnection Protected Inherited undefined | IModelConnection BaseUnitFormattingSettingsProvider  
imodelConnection Accessor Protected Inherited ReadOnly undefined | IModelConnection BaseUnitFormattingSettingsProvider  
maintainOverridesPerIModel Accessor Inherited 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: 21 November, 2024