import type { Format } from './constants'; export interface FormatParts { decimal: string; group: string; literal: string; minusPosition: string; minusSign: string; parts: Intl.NumberFormatPart[]; position?: string; prefix: string; suffix: string; symbol: string; } export type FormatStyles = 'currency' | 'percent' | 'number'; export type StyleFormatParts = Record; interface FormatFunctionInput { decimal?: string; hasDecimal?: boolean; input: number; isDecimal?: boolean; significantDigits?: number; strippedValue?: string; suffix?: string; } export type FormatFunction = (input: FormatFunctionInput) => string; export type BaseFormatObject = Record; export interface GetFormatPartsOptions { currency: string; locale: string; } export interface FormatInput { elementValue: string; newValue: string; previousValue: string; rawValue: string; strippedValue: string; } export interface Formatter { format: (input: FormatInput) => string; pattern?: string; prefix?: string; suffix?: string; } export type Formatters = Record; export type Options = { currency: string; formatOptions: Intl.NumberFormatOptions; locale: string; }; export interface FormatsObject extends BaseFormatObject { formatParts: StyleFormatParts; } export interface FormatDecimalsInput { currency: string; elementValue: string; formatParts: FormatParts; formatter: FormatFunction; locale: string; newValue: string; rawValue: string; strippedValue: string; type: FormatStyles; } export interface FormatPartsOptions { currency?: string; locale?: string; type?: FormatStyles; } export interface TrimInputInput { callback?: (input: number) => number; options: Intl.NumberFormatOptions; type: FormatStyles; values: FormatFunctionInput; }