type EnergySymbol = typeof energySymbols[number]; /** * Type predicate. * @param candidate The candidate to test. */ declare function isEnergySymbol(candidate: any): candidate is EnergySymbol; /** * All the Energy symbols. */ declare const energySymbols: readonly ["kJ", "J", "kCal", "cal", "kWh", "Wh", "eV"]; /** * The object representation of a measurement. * * @template Unit The type of the unit of measurement. * @template Value The type of the value of the measurement. */ type Measurement$1 = Number & { readonly value: Value; readonly unit: Unit; }; /** * Represents a dimension measurement. * @template Units - The units of the dimension. */ type Measurement = Measurement$1 & Alternatives; /** * Represents a collection of alternative measurements for different units. * * @template Units - The string literal type representing the available units. */ type Alternatives = { readonly [unit in Units]: Measurement; }; /** * A dimension is a map of units to creation functions. * Each function takes a number value and returns a * dimension measurement. * @template Units - The units of the dimension. */ type Dimension = { readonly [unit in Units]: (value: number) => Measurement; }; type Energy = Measurement; declare const energy: Dimension<"kJ" | "J" | "kCal" | "cal" | "kWh" | "Wh" | "eV">; declare const kilojoules: (value: number) => Measurement<"kJ" | "J" | "kCal" | "cal" | "kWh" | "Wh" | "eV">; declare const joules: (value: number) => Measurement<"kJ" | "J" | "kCal" | "cal" | "kWh" | "Wh" | "eV">; declare const kilocalories: (value: number) => Measurement<"kJ" | "J" | "kCal" | "cal" | "kWh" | "Wh" | "eV">; declare const calories: (value: number) => Measurement<"kJ" | "J" | "kCal" | "cal" | "kWh" | "Wh" | "eV">; declare const kilowattHours: (value: number) => Measurement<"kJ" | "J" | "kCal" | "cal" | "kWh" | "Wh" | "eV">; declare const wattHours: (value: number) => Measurement<"kJ" | "J" | "kCal" | "cal" | "kWh" | "Wh" | "eV">; declare const electronvolts: (value: number) => Measurement<"kJ" | "J" | "kCal" | "cal" | "kWh" | "Wh" | "eV">; export { calories, electronvolts, energy, energySymbols, isEnergySymbol, joules, kilocalories, kilojoules, kilowattHours, wattHours }; export type { Energy, EnergySymbol };