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 | Return true if the FormatProps have the necessary custom property definition |
|
primaryPropEditorSpecs | CustomFormatPropEditorSpec[] | undefined | An array of specifications that are used to generate a label and editor in the UI used to display and edit the FormatProps. | |
secondaryPropEditorSpecs | CustomFormatPropEditorSpec[] | undefined | 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 Inherited | string | QuantityTypeDefinition | Localized description that may be used to provide detailed description for the Quantity type. |
generateFormatterSpec Inherited | (formatProps: FormatProps, unitsProvider: UnitsProvider) => Promise<FormatterSpec> | QuantityTypeDefinition | Async function to generate a [FormatterSpec]$(core-quantity) that will be called to format values. |
generateParserSpec Inherited | (formatProps: FormatProps, unitsProvider: UnitsProvider, alternateUnitLabelsProvider?: AlternateUnitLabelsProvider) => Promise<ParserSpec> | QuantityTypeDefinition | Async function to generate a [ParserSpec]$(core-quantity) that will be called to parse a string into a quantity value. |
getDefaultFormatPropsBySystem Inherited | (requestedSystem: UnitSystemKey) => FormatProps | QuantityTypeDefinition | |
key Readonly Inherited | string | QuantityTypeDefinition | String used as a key to look up the quantity type. |
label Inherited | string | QuantityTypeDefinition | Localized label to display in UI |
persistenceUnit Readonly Inherited | UnitProps | QuantityTypeDefinition | The unit that the magnitude of the quantity is stored ie. |
type Readonly Inherited | 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: 14 November, 2024
Found something wrong, missing, or unclear on this page?Raise an issue in our repo.