import Decimal, { Decimal as Decimal$1 } from "@formatjs/bigdecimal"; //#region packages/ecma402-abstract/types/core.d.ts type Locale = string; interface LocaleData { data: T; locale: Locale; } //#endregion //#region packages/ecma402-abstract/types/plural-rules.d.ts type LDMLPluralRule = "zero" | "one" | "two" | "few" | "many" | "other"; //#endregion //#region packages/ecma402-abstract/types/number.d.ts type NumberFormatNotation = "standard" | "scientific" | "engineering" | "compact"; type RoundingPriorityType = "auto" | "morePrecision" | "lessPrecision"; type NumberFormatRoundingType = "morePrecision" | "lessPrecision" | "significantDigits" | "fractionDigits"; type RoundingModeType = "ceil" | "floor" | "expand" | "trunc" | "halfCeil" | "halfFloor" | "halfExpand" | "halfTrunc" | "halfEven"; type UseGroupingType = "min2" | "auto" | "always" | boolean; interface NumberFormatDigitOptions { minimumIntegerDigits?: number; minimumSignificantDigits?: number; maximumSignificantDigits?: number; minimumFractionDigits?: number; maximumFractionDigits?: number; roundingPriority?: RoundingPriorityType; roundingIncrement?: number; roundingMode?: RoundingModeType; trailingZeroDisplay?: TrailingZeroDisplay; } interface NumberFormatDigitInternalSlots { minimumIntegerDigits: number; minimumSignificantDigits: number; maximumSignificantDigits: number; roundingType: NumberFormatRoundingType; minimumFractionDigits: number; maximumFractionDigits: number; notation: NumberFormatNotation; roundingIncrement: number; roundingMode: RoundingModeType; trailingZeroDisplay: TrailingZeroDisplay; roundingPriority: RoundingPriorityType; } type RawNumberLocaleData = LocaleData; interface NumberFormatLocaleInternalData { units: UnitDataTable; currencies: Record; numbers: RawNumberData; nu: string[]; } interface UnitDataTable { simple: Record; compound: Record; } interface UnitData { long: LDMLPluralRuleMap; short: LDMLPluralRuleMap; narrow: LDMLPluralRuleMap; perUnit: Record<"narrow" | "short" | "long", string | undefined>; } interface CompoundUnitData { long: string; short: string; narrow: string; } interface CurrencyData { displayName: LDMLPluralRuleMap; symbol: string; narrow: string; } type DecimalFormatNum = "1000" | "10000" | "100000" | "1000000" | "10000000" | "100000000" | "1000000000" | "10000000000" | "100000000000" | "1000000000000" | "10000000000000" | "100000000000000"; type NumberingSystem = string; /** * We only care about insertBetween bc we assume * `currencyMatch` & `surroundingMatch` are all the same * * @export * @interface CurrencySpacingData */ interface CurrencySpacingData { beforeInsertBetween: string; afterInsertBetween: string; } interface RawCurrencyData { currencySpacing: CurrencySpacingData; standard: string; accounting: string; short?: Record>; unitPattern: string; } interface SymbolsData { decimal: string; group: string; list: string; percentSign: string; plusSign: string; minusSign: string; exponential: string; superscriptingExponent: string; perMille: string; infinity: string; nan: string; timeSeparator: string; approximatelySign: string; rangeSign: string; currencyGroup?: string; currencyDecimal?: string; } interface RawNumberData { nu: string[]; symbols: Record; decimal: Record>; short: Record>; }>; percent: Record; currency: Record; } type LDMLPluralRuleMap = Omit>, "other"> & { other: T; }; type NumberFormatOptionsLocaleMatcher = "lookup" | "best fit"; type NumberFormatOptionsStyle = "decimal" | "percent" | "currency" | "unit"; type NumberFormatOptionsCompactDisplay = "short" | "long"; type NumberFormatOptionsCurrencyDisplay = "symbol" | "code" | "name" | "narrowSymbol"; type NumberFormatOptionsCurrencySign = "standard" | "accounting"; type NumberFormatOptionsNotation = NumberFormatNotation; type NumberFormatOptionsSignDisplay = "auto" | "always" | "never" | "exceptZero" | "negative"; type NumberFormatOptionsUnitDisplay = "long" | "short" | "narrow"; type TrailingZeroDisplay = "auto" | "stripIfInteger"; interface NumberFormatInternal extends NumberFormatDigitInternalSlots { locale: string; dataLocale: string; style: NumberFormatOptionsStyle; currency?: string; currencyDisplay: NumberFormatOptionsCurrencyDisplay; unit?: string; unitDisplay: NumberFormatOptionsUnitDisplay; currencySign: NumberFormatOptionsCurrencySign; notation: NumberFormatOptionsNotation; compactDisplay: NumberFormatOptionsCompactDisplay; signDisplay: NumberFormatOptionsSignDisplay; useGrouping?: UseGroupingType; pl: Intl.PluralRules; boundFormat?: Intl.NumberFormat["format"]; numberingSystem: string; dataLocaleData: NumberFormatLocaleInternalData; roundingMode: RoundingModeType; } type NumberFormatOptions = Omit & NumberFormatDigitOptions & { localeMatcher?: NumberFormatOptionsLocaleMatcher; style?: NumberFormatOptionsStyle; compactDisplay?: NumberFormatOptionsCompactDisplay; currencyDisplay?: NumberFormatOptionsCurrencyDisplay; currencySign?: NumberFormatOptionsCurrencySign; notation?: NumberFormatOptionsNotation; signDisplay?: NumberFormatOptionsSignDisplay; unit?: string; unitDisplay?: NumberFormatOptionsUnitDisplay; numberingSystem?: string; trailingZeroDisplay?: TrailingZeroDisplay; roundingPriority?: RoundingPriorityType; roundingIncrement?: number; roundingMode?: RoundingModeType; useGrouping?: UseGroupingType; }; type ResolvedNumberFormatOptions = Intl.ResolvedNumberFormatOptions & Pick; type NumberFormatPartTypes = Intl.NumberFormatPartTypes | "exponentSeparator" | "exponentMinusSign" | "exponentInteger" | "compact" | "unit" | "literal" | "approximatelySign"; interface NumberFormatPart { type: NumberFormatPartTypes; value: string; source?: string; } interface NumberRangeToParts extends NumberFormatPart { result: string; } //#endregion //#region packages/intl-numberformat/types.d.ts interface NumberFormat$1 { resolvedOptions(): ResolvedNumberFormatOptions; formatToParts(x: number | bigint | Decimal | string): NumberFormatPart[]; format(x: number | bigint | Decimal | string): string; formatRange(start: number | bigint | Decimal | string, end: number | bigint | Decimal | string): string; formatRangeToParts(start: number | bigint | Decimal | string, end: number | bigint | Decimal | string): NumberRangeToParts[]; } interface NumberFormatConstructor { new (locales?: string | string[], options?: NumberFormatOptions): NumberFormat$1; (locales?: string | string[], options?: NumberFormatOptions): NumberFormat$1; __addLocaleData(...data: RawNumberLocaleData[]): void; __addUnitData(locale: string, unitsData: RawNumberLocaleData["data"]["units"]): void; supportedLocalesOf(locales: string | string[], options?: Pick): string[]; getDefaultLocale(): string; __defaultLocale: string; localeData: Record; availableLocales: Set; polyfilled: boolean; } //#endregion //#region packages/intl-numberformat/core.d.ts type NumberFormat = NumberFormat$1; /** * https://tc39.es/ecma402/#sec-intl-numberformat-constructor */ declare const NumberFormat: NumberFormatConstructor; //#endregion export { NumberFormat }; //# sourceMappingURL=index.d.ts.map