unitsnet-js
Version:
A better way to hold unit variables and easily convert to the destination unit
159 lines (158 loc) • 7.99 kB
TypeScript
import { BaseUnit, ToStringOptions } from "../base-unit";
/** API DTO represents a ElectricApparentEnergy */
export interface ElectricApparentEnergyDto {
/** The value of the ElectricApparentEnergy */
value: number;
/** The specific unit that the ElectricApparentEnergy value is representing */
unit: ElectricApparentEnergyUnits;
}
/** ElectricApparentEnergyUnits enumeration */
export declare enum ElectricApparentEnergyUnits {
/** */
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 ElectricApparentEnergy extends BaseUnit {
protected value: number;
private voltamperehoursLazy;
private kilovoltamperehoursLazy;
private megavoltamperehoursLazy;
/**
* Create a new ElectricApparentEnergy.
* @param value The value.
* @param fromUnit The ‘ElectricApparentEnergy’ unit to create from.
* The default unit is VoltampereHours
*/
constructor(value: number, fromUnit?: ElectricApparentEnergyUnits);
/**
* The base value of ElectricApparentEnergy 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(): ElectricApparentEnergyUnits.VoltampereHours;
/** */
get VoltampereHours(): number;
/** */
get KilovoltampereHours(): number;
/** */
get MegavoltampereHours(): number;
/**
* Create a new ElectricApparentEnergy instance from a VoltampereHours
*
* @param value The unit as VoltampereHours to create a new ElectricApparentEnergy from.
* @returns The new ElectricApparentEnergy instance.
*/
static FromVoltampereHours(value: number): ElectricApparentEnergy;
/**
* Create a new ElectricApparentEnergy instance from a KilovoltampereHours
*
* @param value The unit as KilovoltampereHours to create a new ElectricApparentEnergy from.
* @returns The new ElectricApparentEnergy instance.
*/
static FromKilovoltampereHours(value: number): ElectricApparentEnergy;
/**
* Create a new ElectricApparentEnergy instance from a MegavoltampereHours
*
* @param value The unit as MegavoltampereHours to create a new ElectricApparentEnergy from.
* @returns The new ElectricApparentEnergy instance.
*/
static FromMegavoltampereHours(value: number): ElectricApparentEnergy;
/**
* Gets the base unit enumeration associated with ElectricApparentEnergy
* @returns The unit enumeration that can be used to interact with this type
*/
protected static getUnitEnum(): typeof ElectricApparentEnergyUnits;
/**
* 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(): ElectricApparentEnergyUnits.VoltampereHours;
/**
* Create API DTO represent a ElectricApparentEnergy unit.
* @param holdInUnit The specific ElectricApparentEnergy unit to be used in the unit representation at the DTO
*/
toDto(holdInUnit?: ElectricApparentEnergyUnits): ElectricApparentEnergyDto;
/**
* Create a ElectricApparentEnergy unit from an API DTO representation.
* @param dtoElectricApparentEnergy The ElectricApparentEnergy API DTO representation
*/
static FromDto(dtoElectricApparentEnergy: ElectricApparentEnergyDto): ElectricApparentEnergy;
/**
* Convert ElectricApparentEnergy to a specific unit value.
* @param toUnit The specific unit to convert to
* @returns The value of the specific unit provided.
*/
convert(toUnit: ElectricApparentEnergyUnits): number;
private convertFromBase;
private convertToBase;
/**
* Format the ElectricApparentEnergy to string.
* Note! the default format for ElectricApparentEnergy is VoltampereHours.
* To specify the unit format set the 'unit' parameter.
* @param unit The unit to format the ElectricApparentEnergy.
* @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 ElectricApparentEnergy.
*/
toString(unit?: ElectricApparentEnergyUnits, options?: number | ToStringOptions): string;
/**
* Get ElectricApparentEnergy unit abbreviation.
* Note! the default abbreviation for ElectricApparentEnergy is VoltampereHours.
* To specify the unit abbreviation set the 'unitAbbreviation' parameter.
* @param unitAbbreviation The unit abbreviation of the ElectricApparentEnergy.
* @returns The abbreviation string of ElectricApparentEnergy.
*/
getUnitAbbreviation(unitAbbreviation?: ElectricApparentEnergyUnits): string;
/**
* Check if the given ElectricApparentEnergy are equals to the current ElectricApparentEnergy.
* @param electricApparentEnergy The other ElectricApparentEnergy.
* @returns True if the given ElectricApparentEnergy are equal to the current ElectricApparentEnergy.
*/
equals(electricApparentEnergy: ElectricApparentEnergy): boolean;
/**
* Compare the given ElectricApparentEnergy against the current ElectricApparentEnergy.
* @param electricApparentEnergy The other ElectricApparentEnergy.
* @returns 0 if they are equal, -1 if the current ElectricApparentEnergy is less then other, 1 if the current ElectricApparentEnergy is greater then other.
*/
compareTo(electricApparentEnergy: ElectricApparentEnergy): number;
/**
* Add the given ElectricApparentEnergy with the current ElectricApparentEnergy.
* @param electricApparentEnergy The other ElectricApparentEnergy.
* @returns A new ElectricApparentEnergy instance with the results.
*/
add(electricApparentEnergy: ElectricApparentEnergy): ElectricApparentEnergy;
/**
* Subtract the given ElectricApparentEnergy with the current ElectricApparentEnergy.
* @param electricApparentEnergy The other ElectricApparentEnergy.
* @returns A new ElectricApparentEnergy instance with the results.
*/
subtract(electricApparentEnergy: ElectricApparentEnergy): ElectricApparentEnergy;
/**
* Multiply the given ElectricApparentEnergy with the current ElectricApparentEnergy.
* @param electricApparentEnergy The other ElectricApparentEnergy.
* @returns A new ElectricApparentEnergy instance with the results.
*/
multiply(electricApparentEnergy: ElectricApparentEnergy): ElectricApparentEnergy;
/**
* Divide the given ElectricApparentEnergy with the current ElectricApparentEnergy.
* @param electricApparentEnergy The other ElectricApparentEnergy.
* @returns A new ElectricApparentEnergy instance with the results.
*/
divide(electricApparentEnergy: ElectricApparentEnergy): ElectricApparentEnergy;
/**
* Modulo the given ElectricApparentEnergy with the current ElectricApparentEnergy.
* @param electricApparentEnergy The other ElectricApparentEnergy.
* @returns A new ElectricApparentEnergy instance with the results.
*/
modulo(electricApparentEnergy: ElectricApparentEnergy): ElectricApparentEnergy;
/**
* Pow the given ElectricApparentEnergy with the current ElectricApparentEnergy.
* @param electricApparentEnergy The other ElectricApparentEnergy.
* @returns A new ElectricApparentEnergy instance with the results.
*/
pow(electricApparentEnergy: ElectricApparentEnergy): ElectricApparentEnergy;
}