@scaleway/use-i18n
Version:
A small hook to handle i18n
22 lines • 726 B
TypeScript
//#region src/formatUnit.d.ts
type ExponentName = '' | 'kilo' | 'mega' | 'giga' | 'tera' | 'peta' | 'exa' | 'zetta' | 'yotta';
type Unit = 'bit' | 'byte';
type SimpleUnits = `${ExponentName}${Unit}${'-humanized' | ''}`;
type ComplexUnits = `${Unit}${'s' | ''}${'-humanized' | ''}`;
type PerSecondUnit = `${ExponentName | ''}${'bit' | 'byte'}${'s' | ''}${'-per-second' | ''}${'-humanized' | ''}`;
type SupportedUnits = SimpleUnits | ComplexUnits | PerSecondUnit;
type FormatUnitOptions = {
unit: SupportedUnits;
/**
default: true
*/
short?: boolean;
maximumFractionDigits?: number;
minimumFractionDigits?: number;
/**
default: 10
*/
base?: 2 | 10;
};
//#endregion
export { FormatUnitOptions };