/** @packageDocumentation * @module Quantity */ import { UnitProps, UnitsProvider } from "../Interfaces"; import { DecimalPrecision, FormatTraits, FormatType, FractionalPrecision, RatioFormatType, RatioType, ScientificType, ShowSignOption } from "./FormatEnums"; import { CloneOptions, FormatProps, ResolvedFormatProps } from "./Interfaces"; /** A base Format class with shared properties and functionality between quantity and ecschema-metadata Format classes * @beta */ export declare class BaseFormat { private _name; protected _roundFactor: number; protected _type: FormatType; protected _precision: number; protected _showSignOption: ShowSignOption; protected _decimalSeparator: string; protected _thousandSeparator: string; protected _uomSeparator: string; protected _stationSeparator: string; protected _formatTraits: FormatTraits; protected _spacer: string; protected _includeZero: boolean; protected _minWidth?: number; protected _scientificType?: ScientificType; protected _stationOffsetSize?: number; protected _stationBaseFactor?: number; protected _ratioType?: RatioType; protected _ratioFormatType?: RatioFormatType; protected _ratioSeparator?: string; protected _azimuthBase?: number; protected _azimuthBaseUnit?: UnitProps; protected _azimuthCounterClockwise?: boolean; protected _revolutionUnit?: UnitProps; protected _allowMathematicOperations: boolean; constructor(name: string); get name(): string; get roundFactor(): number; set roundFactor(roundFactor: number); get type(): FormatType; set type(formatType: FormatType); get precision(): DecimalPrecision | FractionalPrecision; set precision(precision: DecimalPrecision | FractionalPrecision); get minWidth(): number | undefined; set minWidth(minWidth: number | undefined); get scientificType(): ScientificType | undefined; set scientificType(scientificType: ScientificType | undefined); get ratioType(): RatioType | undefined; set ratioType(ratioType: RatioType | undefined); get ratioFormatType(): RatioFormatType | undefined; set ratioFormatType(ratioFormatType: RatioFormatType | undefined); get ratioSeparator(): string | undefined; set ratioSeparator(ratioSeparator: string | undefined); get showSignOption(): ShowSignOption; set showSignOption(showSignOption: ShowSignOption); get decimalSeparator(): string; set decimalSeparator(decimalSeparator: string); get thousandSeparator(): string; set thousandSeparator(thousandSeparator: string); get uomSeparator(): string; set uomSeparator(uomSeparator: string); get stationSeparator(): string; set stationSeparator(stationSeparator: string); get stationOffsetSize(): number | undefined; set stationOffsetSize(stationOffsetSize: number | undefined); /** Gets the station base factor used for station formatting. This is a positive integer that acts as a multiplier * for the base offset calculation. The default value is 1. */ get stationBaseFactor(): number | undefined; set stationBaseFactor(stationBaseFactor: number | undefined); get allowMathematicOperations(): boolean; set allowMathematicOperations(allowMathematicOperations: boolean); get formatTraits(): FormatTraits; set formatTraits(formatTraits: FormatTraits); get spacer(): string | undefined; set spacer(spacer: string | undefined); get spacerOrDefault(): string; get includeZero(): boolean | undefined; set includeZero(includeZero: boolean | undefined); get azimuthBase(): number | undefined; set azimuthBase(azimuthBase: number | undefined); get azimuthBaseUnit(): UnitProps | undefined; set azimuthBaseUnit(azimuthBaseUnit: UnitProps | undefined); get azimuthCounterClockwise(): boolean | undefined; set azimuthCounterClockwise(azimuthCounterClockwise: boolean | undefined); get azimuthClockwiseOrDefault(): boolean; get revolutionUnit(): UnitProps | undefined; set revolutionUnit(revolutionUnit: UnitProps | undefined); /** This method parses input string that is typically extracted for persisted JSON data and validates that the string is a valid FormatType. Throws exception if not valid. */ parseFormatTraits(formatTraitsFromJson: string | string[]): void; /** This method returns true if the formatTrait is set in this Format object. */ hasFormatTraitSet(formatTrait: FormatTraits): boolean; loadFormatProperties(formatProps: FormatProps | ResolvedFormatProps): void; } /** A class used to define the specifications for formatting quantity values. This class is typically loaded by reading [[FormatProps]]. * @beta */ export declare class Format extends BaseFormat { protected _units?: Array<[UnitProps, string | undefined]>; protected _customProps?: any; /** Constructor * @param name The name of a format specification. TODO: make optional or remove */ constructor(name: string); get units(): Array<[UnitProps, string | undefined]> | undefined; get hasUnits(): boolean; get customProps(): any; static isFormatTraitSetInProps(formatProps: FormatProps, trait: FormatTraits): boolean; /** * Clone Format */ clone(options?: CloneOptions): Format; /** * Populates this Format with the values from the provided. */ fromJSON(unitsProvider: UnitsProvider, jsonObj: FormatProps): Promise; fromFullyResolvedJSON(jsonObj: ResolvedFormatProps): void; /** Create a Format from FormatProps */ static createFromJSON(name: string, unitsProvider: UnitsProvider, formatProps: FormatProps): Promise; static createFromFullyResolvedJSON(name: string, formatProps: ResolvedFormatProps): Format; /** * Returns a JSON object that contain the specification for this Format. */ toJSON(): FormatProps; toFullyResolvedJSON(): ResolvedFormatProps; } //# sourceMappingURL=Format.d.ts.map