UNPKG

unitsnet-js

Version:

A better way to hold unit variables and easily convert to the destination unit

159 lines (158 loc) 7.08 kB
import { BaseUnit, ToStringOptions } from "../base-unit"; /** API DTO represents a ApparentEnergy */ export interface ApparentEnergyDto { /** The value of the ApparentEnergy */ value: number; /** The specific unit that the ApparentEnergy value is representing */ unit: ApparentEnergyUnits; } /** ApparentEnergyUnits enumeration */ export declare enum ApparentEnergyUnits { /** */ VoltampereHours = "VoltampereHour", /** */ KilovoltampereHours = "KilovoltampereHour", /** */ MegavoltampereHours = "MegavoltampereHour" } /** A unit for expressing the integral of apparent power over time, equal to the product of 1 volt-ampere and 1 hour, or to 3600 joules. */ export declare class ApparentEnergy extends BaseUnit { protected value: number; private voltamperehoursLazy; private kilovoltamperehoursLazy; private megavoltamperehoursLazy; /** * Create a new ApparentEnergy. * @param value The value. * @param fromUnit The ‘ApparentEnergy’ unit to create from. * The default unit is VoltampereHours */ constructor(value: number, fromUnit?: ApparentEnergyUnits); /** * The base value of ApparentEnergy is VoltampereHours. * This accessor used when needs a value for calculations and it's better to use directly the base value */ get BaseValue(): number; /** Gets the default unit used when creating instances of the unit or its DTO */ protected get baseUnit(): ApparentEnergyUnits.VoltampereHours; /** */ get VoltampereHours(): number; /** */ get KilovoltampereHours(): number; /** */ get MegavoltampereHours(): number; /** * Create a new ApparentEnergy instance from a VoltampereHours * * @param value The unit as VoltampereHours to create a new ApparentEnergy from. * @returns The new ApparentEnergy instance. */ static FromVoltampereHours(value: number): ApparentEnergy; /** * Create a new ApparentEnergy instance from a KilovoltampereHours * * @param value The unit as KilovoltampereHours to create a new ApparentEnergy from. * @returns The new ApparentEnergy instance. */ static FromKilovoltampereHours(value: number): ApparentEnergy; /** * Create a new ApparentEnergy instance from a MegavoltampereHours * * @param value The unit as MegavoltampereHours to create a new ApparentEnergy from. * @returns The new ApparentEnergy instance. */ static FromMegavoltampereHours(value: number): ApparentEnergy; /** * Gets the base unit enumeration associated with ApparentEnergy * @returns The unit enumeration that can be used to interact with this type */ protected static getUnitEnum(): typeof ApparentEnergyUnits; /** * Gets the default unit used when creating instances of the unit or its DTO * @returns The unit enumeration value used as a default parameter in constructor and DTO methods */ protected static getBaseUnit(): ApparentEnergyUnits.VoltampereHours; /** * Create API DTO represent a ApparentEnergy unit. * @param holdInUnit The specific ApparentEnergy unit to be used in the unit representation at the DTO */ toDto(holdInUnit?: ApparentEnergyUnits): ApparentEnergyDto; /** * Create a ApparentEnergy unit from an API DTO representation. * @param dtoApparentEnergy The ApparentEnergy API DTO representation */ static FromDto(dtoApparentEnergy: ApparentEnergyDto): ApparentEnergy; /** * Convert ApparentEnergy to a specific unit value. * @param toUnit The specific unit to convert to * @returns The value of the specific unit provided. */ convert(toUnit: ApparentEnergyUnits): number; private convertFromBase; private convertToBase; /** * Format the ApparentEnergy to string. * Note! the default format for ApparentEnergy is VoltampereHours. * To specify the unit format set the 'unit' parameter. * @param unit The unit to format the ApparentEnergy. * @param options The ToString options, it also can be the number of fractional digits to keep that deprecated and moved to the options object. support in number will be dropped in the upcoming versions. * @returns The string format of the ApparentEnergy. */ toString(unit?: ApparentEnergyUnits, options?: number | ToStringOptions): string; /** * Get ApparentEnergy unit abbreviation. * Note! the default abbreviation for ApparentEnergy is VoltampereHours. * To specify the unit abbreviation set the 'unitAbbreviation' parameter. * @param unitAbbreviation The unit abbreviation of the ApparentEnergy. * @returns The abbreviation string of ApparentEnergy. */ getUnitAbbreviation(unitAbbreviation?: ApparentEnergyUnits): string; /** * Check if the given ApparentEnergy are equals to the current ApparentEnergy. * @param apparentEnergy The other ApparentEnergy. * @returns True if the given ApparentEnergy are equal to the current ApparentEnergy. */ equals(apparentEnergy: ApparentEnergy): boolean; /** * Compare the given ApparentEnergy against the current ApparentEnergy. * @param apparentEnergy The other ApparentEnergy. * @returns 0 if they are equal, -1 if the current ApparentEnergy is less then other, 1 if the current ApparentEnergy is greater then other. */ compareTo(apparentEnergy: ApparentEnergy): number; /** * Add the given ApparentEnergy with the current ApparentEnergy. * @param apparentEnergy The other ApparentEnergy. * @returns A new ApparentEnergy instance with the results. */ add(apparentEnergy: ApparentEnergy): ApparentEnergy; /** * Subtract the given ApparentEnergy with the current ApparentEnergy. * @param apparentEnergy The other ApparentEnergy. * @returns A new ApparentEnergy instance with the results. */ subtract(apparentEnergy: ApparentEnergy): ApparentEnergy; /** * Multiply the given ApparentEnergy with the current ApparentEnergy. * @param apparentEnergy The other ApparentEnergy. * @returns A new ApparentEnergy instance with the results. */ multiply(apparentEnergy: ApparentEnergy): ApparentEnergy; /** * Divide the given ApparentEnergy with the current ApparentEnergy. * @param apparentEnergy The other ApparentEnergy. * @returns A new ApparentEnergy instance with the results. */ divide(apparentEnergy: ApparentEnergy): ApparentEnergy; /** * Modulo the given ApparentEnergy with the current ApparentEnergy. * @param apparentEnergy The other ApparentEnergy. * @returns A new ApparentEnergy instance with the results. */ modulo(apparentEnergy: ApparentEnergy): ApparentEnergy; /** * Pow the given ApparentEnergy with the current ApparentEnergy. * @param apparentEnergy The other ApparentEnergy. * @returns A new ApparentEnergy instance with the results. */ pow(apparentEnergy: ApparentEnergy): ApparentEnergy; }