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

Last Updated: 21 November, 2024