unitsnet-js
Version:
A better way to hold unit variables and easily convert to the destination unit
159 lines (158 loc) • 8.2 kB
TypeScript
import { BaseUnit, ToStringOptions } from "../base-unit";
/** API DTO represents a ElectricReactiveEnergy */
export interface ElectricReactiveEnergyDto {
/** The value of the ElectricReactiveEnergy */
value: number;
/** The specific unit that the ElectricReactiveEnergy value is representing */
unit: ElectricReactiveEnergyUnits;
}
/** ElectricReactiveEnergyUnits enumeration */
export declare enum ElectricReactiveEnergyUnits {
/** */
VoltampereReactiveHours = "VoltampereReactiveHour",
/** */
KilovoltampereReactiveHours = "KilovoltampereReactiveHour",
/** */
MegavoltampereReactiveHours = "MegavoltampereReactiveHour"
}
/** The volt-ampere reactive hour (expressed as varh) is the reactive power of one Volt-ampere reactive produced in one hour. */
export declare class ElectricReactiveEnergy extends BaseUnit {
protected value: number;
private voltamperereactivehoursLazy;
private kilovoltamperereactivehoursLazy;
private megavoltamperereactivehoursLazy;
/**
* Create a new ElectricReactiveEnergy.
* @param value The value.
* @param fromUnit The ‘ElectricReactiveEnergy’ unit to create from.
* The default unit is VoltampereReactiveHours
*/
constructor(value: number, fromUnit?: ElectricReactiveEnergyUnits);
/**
* The base value of ElectricReactiveEnergy is VoltampereReactiveHours.
* 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(): ElectricReactiveEnergyUnits.VoltampereReactiveHours;
/** */
get VoltampereReactiveHours(): number;
/** */
get KilovoltampereReactiveHours(): number;
/** */
get MegavoltampereReactiveHours(): number;
/**
* Create a new ElectricReactiveEnergy instance from a VoltampereReactiveHours
*
* @param value The unit as VoltampereReactiveHours to create a new ElectricReactiveEnergy from.
* @returns The new ElectricReactiveEnergy instance.
*/
static FromVoltampereReactiveHours(value: number): ElectricReactiveEnergy;
/**
* Create a new ElectricReactiveEnergy instance from a KilovoltampereReactiveHours
*
* @param value The unit as KilovoltampereReactiveHours to create a new ElectricReactiveEnergy from.
* @returns The new ElectricReactiveEnergy instance.
*/
static FromKilovoltampereReactiveHours(value: number): ElectricReactiveEnergy;
/**
* Create a new ElectricReactiveEnergy instance from a MegavoltampereReactiveHours
*
* @param value The unit as MegavoltampereReactiveHours to create a new ElectricReactiveEnergy from.
* @returns The new ElectricReactiveEnergy instance.
*/
static FromMegavoltampereReactiveHours(value: number): ElectricReactiveEnergy;
/**
* Gets the base unit enumeration associated with ElectricReactiveEnergy
* @returns The unit enumeration that can be used to interact with this type
*/
protected static getUnitEnum(): typeof ElectricReactiveEnergyUnits;
/**
* 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(): ElectricReactiveEnergyUnits.VoltampereReactiveHours;
/**
* Create API DTO represent a ElectricReactiveEnergy unit.
* @param holdInUnit The specific ElectricReactiveEnergy unit to be used in the unit representation at the DTO
*/
toDto(holdInUnit?: ElectricReactiveEnergyUnits): ElectricReactiveEnergyDto;
/**
* Create a ElectricReactiveEnergy unit from an API DTO representation.
* @param dtoElectricReactiveEnergy The ElectricReactiveEnergy API DTO representation
*/
static FromDto(dtoElectricReactiveEnergy: ElectricReactiveEnergyDto): ElectricReactiveEnergy;
/**
* Convert ElectricReactiveEnergy to a specific unit value.
* @param toUnit The specific unit to convert to
* @returns The value of the specific unit provided.
*/
convert(toUnit: ElectricReactiveEnergyUnits): number;
private convertFromBase;
private convertToBase;
/**
* Format the ElectricReactiveEnergy to string.
* Note! the default format for ElectricReactiveEnergy is VoltampereReactiveHours.
* To specify the unit format set the 'unit' parameter.
* @param unit The unit to format the ElectricReactiveEnergy.
* @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 ElectricReactiveEnergy.
*/
toString(unit?: ElectricReactiveEnergyUnits, options?: number | ToStringOptions): string;
/**
* Get ElectricReactiveEnergy unit abbreviation.
* Note! the default abbreviation for ElectricReactiveEnergy is VoltampereReactiveHours.
* To specify the unit abbreviation set the 'unitAbbreviation' parameter.
* @param unitAbbreviation The unit abbreviation of the ElectricReactiveEnergy.
* @returns The abbreviation string of ElectricReactiveEnergy.
*/
getUnitAbbreviation(unitAbbreviation?: ElectricReactiveEnergyUnits): string;
/**
* Check if the given ElectricReactiveEnergy are equals to the current ElectricReactiveEnergy.
* @param electricReactiveEnergy The other ElectricReactiveEnergy.
* @returns True if the given ElectricReactiveEnergy are equal to the current ElectricReactiveEnergy.
*/
equals(electricReactiveEnergy: ElectricReactiveEnergy): boolean;
/**
* Compare the given ElectricReactiveEnergy against the current ElectricReactiveEnergy.
* @param electricReactiveEnergy The other ElectricReactiveEnergy.
* @returns 0 if they are equal, -1 if the current ElectricReactiveEnergy is less then other, 1 if the current ElectricReactiveEnergy is greater then other.
*/
compareTo(electricReactiveEnergy: ElectricReactiveEnergy): number;
/**
* Add the given ElectricReactiveEnergy with the current ElectricReactiveEnergy.
* @param electricReactiveEnergy The other ElectricReactiveEnergy.
* @returns A new ElectricReactiveEnergy instance with the results.
*/
add(electricReactiveEnergy: ElectricReactiveEnergy): ElectricReactiveEnergy;
/**
* Subtract the given ElectricReactiveEnergy with the current ElectricReactiveEnergy.
* @param electricReactiveEnergy The other ElectricReactiveEnergy.
* @returns A new ElectricReactiveEnergy instance with the results.
*/
subtract(electricReactiveEnergy: ElectricReactiveEnergy): ElectricReactiveEnergy;
/**
* Multiply the given ElectricReactiveEnergy with the current ElectricReactiveEnergy.
* @param electricReactiveEnergy The other ElectricReactiveEnergy.
* @returns A new ElectricReactiveEnergy instance with the results.
*/
multiply(electricReactiveEnergy: ElectricReactiveEnergy): ElectricReactiveEnergy;
/**
* Divide the given ElectricReactiveEnergy with the current ElectricReactiveEnergy.
* @param electricReactiveEnergy The other ElectricReactiveEnergy.
* @returns A new ElectricReactiveEnergy instance with the results.
*/
divide(electricReactiveEnergy: ElectricReactiveEnergy): ElectricReactiveEnergy;
/**
* Modulo the given ElectricReactiveEnergy with the current ElectricReactiveEnergy.
* @param electricReactiveEnergy The other ElectricReactiveEnergy.
* @returns A new ElectricReactiveEnergy instance with the results.
*/
modulo(electricReactiveEnergy: ElectricReactiveEnergy): ElectricReactiveEnergy;
/**
* Pow the given ElectricReactiveEnergy with the current ElectricReactiveEnergy.
* @param electricReactiveEnergy The other ElectricReactiveEnergy.
* @returns A new ElectricReactiveEnergy instance with the results.
*/
pow(electricReactiveEnergy: ElectricReactiveEnergy): ElectricReactiveEnergy;
}