UNPKG

@dnb/eufemia

Version:

DNB Eufemia Design System UI Library

33 lines (32 loc) 1.09 kB
/** * Helpers to configure the `Intl.NumberFormat` compact notation. */ import type { NumberFormatValue } from './types'; import type { InternalNumberFormatOptions } from './types'; /** * Helper for getting a consistent compact format. * Mutates the given `opts` object. */ export declare function handleCompactBeforeDisplay({ value, locale, compact, decimals, opts, }: { value: NumberFormatValue; locale: string | null; compact: boolean | 'short' | 'long' | null; decimals?: number | string | null; opts: InternalNumberFormatOptions; }): void; /** * Helper for getting a consistent compact format. * Mutates the given `opts` object. */ export declare function handleCompactBeforeAria({ value, compact, opts, }: { value: NumberFormatValue; compact: boolean | 'short' | 'long' | null; opts: InternalNumberFormatOptions; }): void; /** * Checks if we should/can handle the compact format. */ export declare function canHandleCompact({ value, compact, }: { value: NumberFormatValue; compact: boolean | 'short' | 'long' | null; }): boolean;