ParserSpec Class
A ParserSpec holds information needed to parse a string into a quantity synchronously.
Methods
Name | Description | |
---|---|---|
constructor(outUnit: UnitProps, format: Format, conversions: UnitConversionSpec[]): ParserSpec | Constructor | |
parseToQuantityValue(inString: string): QuantityParseResult | Do the parsing. | |
create(format: Format, unitsProvider: UnitsProvider, outUnit: UnitProps, altUnitLabelsProvider?: AlternateUnitLabelsProvider): Promise<ParserSpec> Static | Static async method to create a ParserSpec given the format and unit of the quantity that will be passed to the Parser. |
Properties
Name | Type | Description | |
---|---|---|---|
_azimuthBaseConversion Protected | UnitConversionProps | undefined | ||
_revolutionConversion Protected | UnitConversionProps | undefined | ||
azimuthBaseConversion Accessor ReadOnly | undefined | UnitConversionProps | ||
format Accessor ReadOnly | Format | ||
outUnit Accessor ReadOnly | UnitProps | ||
revolutionConversion Accessor ReadOnly | undefined | UnitConversionProps | ||
unitConversions Accessor ReadOnly | UnitConversionSpec[] | Returns an array of UnitConversionSpecs for each unit label that may be used in the input string. |
Defined in
- quantity/src/ParserSpec.ts Line 16
Last Updated: 14 November, 2024
Found something wrong, missing, or unclear on this page?Raise an issue in our repo.