UNPKG

nhb-toolbox

Version:

A versatile collection of smart, efficient, and reusable utility functions, classes and types for everyday development needs.

18 lines (17 loc) 971 B
import type { Numeric } from '../types/index'; import { $Area } from './area'; import { $Data } from './data'; import { $Length } from './length'; import { $Mass } from './mass'; import { $Temperature } from './temp'; import { $Time } from './time'; import type { $Unit, Converted } from './types'; import { $Volume } from './volume'; /** * @function `Converter` Creates instances of specific unit converter class based on the provided unit. * * @description Converts values between compatible units (time, length, data, temperature, mass, area, volume). * @remarks The returned instance exposes only methods relevant to the provided unit type. */ export declare function Converter<U extends $Unit>(value: Numeric, unit?: U): Converted<U>; export { $Area as AreaConverter, $Data as DataConverter, $Length as LengthConverter, $Mass as MassConverter, $Temperature as TemperatureConverter, $Time as TimeConverter, $Volume as VolumeConverter, Converter as converter, };