/** @packageDocumentation * @module Quantity */ import { UnitConversionProps, UnitConversionSpec, UnitProps, UnitsProvider } from "../Interfaces"; import { Format } from "./Format"; /** A class that contains both formatting information and the conversion factors necessary to convert from an input unit to the units specified in the format. * Once created the FormatterSpec will be able to format quantity values with synchronous calls. * @beta */ export declare class FormatterSpec { protected _name: string; protected _conversions: UnitConversionSpec[]; protected _format: Format; protected _persistenceUnit: UnitProps; protected _azimuthBaseConversion?: UnitConversionProps; protected _revolutionConversion?: UnitConversionProps; /** Constructor * @param name The name of a format specification. * @param format Defines the output format for the quantity value. * @param conversions An array of conversion factors necessary to convert from an input unit to the units specified in the format. * @param persistenceUnit The unit the magnitude value is input. * @param azimuthBaseConversion The conversion used to interpret azimuth base values. * @param revolutionConversion The conversion used to determine a revolution value (used for bearing and azimuth). */ constructor(name: string, format: Format, conversions?: UnitConversionSpec[], persistenceUnit?: UnitProps, azimuthBaseConversion?: UnitConversionProps, revolutionConversion?: UnitConversionProps); get name(): string; /** Returns an array of UnitConversionSpecs, one for each unit that is to be shown in the formatted quantity string. */ get unitConversions(): UnitConversionSpec[]; get format(): Format; get persistenceUnit(): UnitProps; get azimuthBaseConversion(): UnitConversionProps | undefined; get revolutionConversion(): UnitConversionProps | undefined; /** Build conversion specs for ratio format with 2 composite units (numerator/denominator). */ private static getRatioUnitConversions; /** Get an array of UnitConversionSpecs, one for each unit that is to be shown in the formatted quantity string. */ static getUnitConversions(format: Format, unitsProvider: UnitsProvider, inputUnit?: UnitProps): Promise; /** Static async method to create a FormatSpec given the format and unit of the quantity that will be passed to the Formatter. The input unit will * be used to generate conversion information for each unit specified in the Format. This method is async due to the fact that the units provider must make * async calls to lookup unit definitions. * @param name The name of a format specification. * @param unitsProvider The units provider is used to look up unit definitions and provide conversion information for converting between units. * @param inputUnit The unit the value to be formatted. This unit is often referred to as persistence unit. */ static create(name: string, format: Format, unitsProvider: UnitsProvider, inputUnit?: UnitProps): Promise; /** Format a quantity value. */ applyFormatting(magnitude: number): string; } //# sourceMappingURL=FormatterSpec.d.ts.map