ParserSpec Class
Beta
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 | |
---|---|---|---|
format Accessor ReadOnly | Format | ||
outUnit Accessor ReadOnly | UnitProps | ||
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: 30 November, 2023