QuantityTypeDefinition Interface
This interface supplies the definition of a standard
quantity type that is registered with the QuantityFormatter.
A standard
quantity type could be one of the nine delivered QuantityTypes or a CustomQuantityTypeDefinition.
Properties
Name | Type | Description | |
---|---|---|---|
description | string | Localized description that may be used to provide detailed description for the Quantity type. | |
generateFormatterSpec | (formatProps: FormatProps, unitsProvider: UnitsProvider) => Promise<FormatterSpec> | Async function to generate a [FormatterSpec]$(core-quantity) that will be called to format values. | |
generateParserSpec | (formatProps: FormatProps, unitsProvider: UnitsProvider, alternateUnitLabelsProvider?: AlternateUnitLabelsProvider) => Promise<ParserSpec> | Async function to generate a [ParserSpec]$(core-quantity) that will be called to parse a string into a quantity value. | |
getDefaultFormatPropsBySystem | (requestedSystem: UnitSystemKey) => FormatProps | ||
key Readonly | string | String used as a key to look up the quantity type. | |
label | string | Localized label to display in UI | |
persistenceUnit Readonly | UnitProps | The unit that the magnitude of the quantity is stored ie. | |
type Readonly | QuantityTypeArg | 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: 17 December, 2024
Found something wrong, missing, or unclear on this page?Raise an issue in our repo.