import { Fraction } from 'fraction.js'; import { Unit } from './Unit'; import { Quantity } from './Quantity'; export declare const TYPE_TAG = "__unitlib_type"; export declare const UNIT_TYPE = "Unit"; export declare const QUANTITY_TYPE = "Quantity"; export declare const isUnit: (x: unknown) => x is Unit; export declare const isQuantity: (x: unknown) => x is Quantity; export interface BaseUnitDefinition { } export interface FactorDefinition { mul: number; base: number; exp: Fraction; } export interface DerivedUnitDefinition { } export type RoundingStrategy = 'down' | 'up' | 'toward-zero' | 'away-from-zero' | 'to-even' | 'to-odd' | 'stochastic' | 'half-down' | 'half-up' | 'half-toward-zero' | 'half-away-from-zero' | 'half-to-even' | 'half-to-odd' | 'half-random'; export interface Compactness { spaceAfterNumericPart?: boolean; spacesAroundDivision?: boolean; spacesAroundMultiplication?: boolean; } export interface NumberFormatOptions { fancyUnicode?: boolean; allowNegativeZero?: boolean; fractionalPartSeparator?: string; decimalPlaces?: number; roundingStrategy?: RoundingStrategy; digitGroupSeparator?: string; digitGroupLength?: number; } export interface UnitFormatOptions extends NumberFormatOptions { compact?: boolean | Compactness; forceExponential?: boolean; useNegativeExponents?: boolean; omitDenominatorParens?: boolean; } export interface QuantityFormatOptions extends UnitFormatOptions { } export type UnitFormatExponentPart = { type: 'exponent'; string: string; fraction: Fraction; number: number; }; export type UnitFormatUnitPart = { type: 'unit'; string: string; prefix: string; baseUnit: string; exponent?: UnitFormatExponentPart; denominator?: true; }; export type UnitFormatPart = UnitFormatExponentPart | UnitFormatUnitPart | { type: 'parens'; string: string; contents: UnitFormatPart[]; } | { type: 'multiplicator'; string: string; number: number; } | { type: 'base'; string: string; number: number; } | { type: 'multiplicationSign'; string: string; } | { type: 'divisionSign'; string: string; };