CustomQuantityTypeDefinition Interface
CustomQuantityTypeDefinition interface is used to define a Custom quantity type that can be registered with the QuantityFormatter.
A custom quantity formatter must be able to generate a FormatterSpec and ParserSpec that will be called to format and parse values.
Optionally it can provide specification of custom properties that it will use to define any formatting options. CustomQuantityTypeDefinitions
must be registered with the QuantityFormatter using the method IModelApp.quantityFormatter.registerQuantityType
.
Extends
Properties
Name | Type | Description | |
---|---|---|---|
isCompatibleFormatProps | (formatProps: FormatProps) => boolean | ||
primaryPropEditorSpecs | undefined | CustomFormatPropEditorSpec[] | An array of specifications that are used to generate a label and editor in the UI used to display and edit the FormatProps. | |
secondaryPropEditorSpecs | undefined | CustomFormatPropEditorSpec[] | An array of specifications that are used to generate a label and editor in the UI used to display and edit the FormatProps. |
Inherited properties
Name | Type | Inherited from | Description |
---|---|---|---|
description | string | QuantityTypeDefinition | Localized description that may be used to provide detailed description for the Quantity type. |
generateFormatterSpec | (formatProps: FormatProps, unitsProvider: UnitsProvider) => Promise<FormatterSpec> | QuantityTypeDefinition | |
generateParserSpec | (formatProps: FormatProps, unitsProvider: UnitsProvider, alternateUnitLabelsProvider?: AlternateUnitLabelsProvider) => Promise<ParserSpec> | QuantityTypeDefinition | |
getDefaultFormatPropsBySystem | (requestedSystem: UnitSystemKey) => FormatProps | QuantityTypeDefinition | |
key Readonly | string | QuantityTypeDefinition | String used as a key to look up the quantity type. |
label | string | QuantityTypeDefinition | Localized label to display in UI |
persistenceUnit Readonly | UnitProps | QuantityTypeDefinition | The unit that the magnitude of the quantity is stored ie. |
type Readonly | QuantityTypeArg | QuantityTypeDefinition | The type value which can be one of the standard QuantityType enum values or a unique string if defining a custom type. |
Defined in
Last Updated: 15 March, 2024
Found something wrong, missing, or unclear on this page?
Raise an issue in our repo.