/** * Applies minimum and maximum limits to a given number. * * @param number - The number to limit. * @param min - The minimum value allowed, or `undefined` for no minimum limit. * @param max - The maximum value allowed, or `undefined` for no maximum limit. * @returns The adjusted number, constrained within the specified min and max bounds. */ export declare const applyLimits: (number: number, min: number | undefined, max: number | undefined) => number; /** * Rounds a number to a specified precision and returns it as a string. * Supports both decimal and whole-number rounding based on the precision provided. * * @param value - The number to round, or `undefined` to return an empty string. * @param precision - The number of decimal places for rounding (e.g., 0.01 for 2 decimals). Can also be negative. * @returns The rounded number as a string. Returns an empty string if `value` is `undefined`. */ export declare const roundToPrecision: (value: number | undefined, precision: number) => string; /** * Data size (with binary prefix). Represents a multiple of 1024 bytes. * * @example "4MiB" = 4 * 1024 * 1024 = 4_194_304 bytes */ export type BinaryPrefixedSize = `${number}${IECPrefixSymbol}B`; /** * IEC prefix symbols. * * @see https://en.wikipedia.org/wiki/Binary_prefix */ export declare const IEC_PREFIX_SYMBOLS: readonly ["Ki", "Mi", "Gi", "Ti", "Pi", "Ei", "Zi", "Yi", "Ri", "Qi"]; /** * IEC prefix symbol. * * @see https://en.wikipedia.org/wiki/Binary_prefix */ export type IECPrefixSymbol = (typeof IEC_PREFIX_SYMBOLS)[number]; /** * Converts a [binary prefixed size](https://en.wikipedia.org/wiki/Binary_prefix) to its decimal representation in bytes. */ export declare const convertBinaryPrefixToBytes: (size: BinaryPrefixedSize | number) => number; /** * Formats the given number of bytes into a string using `Intl.NumberFormatter`. * * The native `Intl.NumberFormatter` displays 1GB as 1BB (billion bytes) etc. so this formatter fixes this to correctly display gigabyte, terabyte and petabyte. */ export declare const formatBytesToString: (locale: string, bytes: number) => string;