unitsnet-js
Version:
A better way to hold unit variables and easily convert to the destination unit
171 lines (170 loc) • 8.56 kB
TypeScript
import { BaseUnit, ToStringOptions } from "../base-unit";
/** API DTO represents a ElectricReactivePower */
export interface ElectricReactivePowerDto {
/** The value of the ElectricReactivePower */
value: number;
/** The specific unit that the ElectricReactivePower value is representing */
unit: ElectricReactivePowerUnits;
}
/** ElectricReactivePowerUnits enumeration */
export declare enum ElectricReactivePowerUnits {
/** */
VoltamperesReactive = "VoltampereReactive",
/** */
KilovoltamperesReactive = "KilovoltampereReactive",
/** */
MegavoltamperesReactive = "MegavoltampereReactive",
/** */
GigavoltamperesReactive = "GigavoltampereReactive"
}
/** In electric power transmission and distribution, volt-ampere reactive (var) is a unit of measurement of reactive power. Reactive power exists in an AC circuit when the current and voltage are not in phase. */
export declare class ElectricReactivePower extends BaseUnit {
protected value: number;
private voltamperesreactiveLazy;
private kilovoltamperesreactiveLazy;
private megavoltamperesreactiveLazy;
private gigavoltamperesreactiveLazy;
/**
* Create a new ElectricReactivePower.
* @param value The value.
* @param fromUnit The ‘ElectricReactivePower’ unit to create from.
* The default unit is VoltamperesReactive
*/
constructor(value: number, fromUnit?: ElectricReactivePowerUnits);
/**
* The base value of ElectricReactivePower is VoltamperesReactive.
* 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(): ElectricReactivePowerUnits.VoltamperesReactive;
/** */
get VoltamperesReactive(): number;
/** */
get KilovoltamperesReactive(): number;
/** */
get MegavoltamperesReactive(): number;
/** */
get GigavoltamperesReactive(): number;
/**
* Create a new ElectricReactivePower instance from a VoltamperesReactive
*
* @param value The unit as VoltamperesReactive to create a new ElectricReactivePower from.
* @returns The new ElectricReactivePower instance.
*/
static FromVoltamperesReactive(value: number): ElectricReactivePower;
/**
* Create a new ElectricReactivePower instance from a KilovoltamperesReactive
*
* @param value The unit as KilovoltamperesReactive to create a new ElectricReactivePower from.
* @returns The new ElectricReactivePower instance.
*/
static FromKilovoltamperesReactive(value: number): ElectricReactivePower;
/**
* Create a new ElectricReactivePower instance from a MegavoltamperesReactive
*
* @param value The unit as MegavoltamperesReactive to create a new ElectricReactivePower from.
* @returns The new ElectricReactivePower instance.
*/
static FromMegavoltamperesReactive(value: number): ElectricReactivePower;
/**
* Create a new ElectricReactivePower instance from a GigavoltamperesReactive
*
* @param value The unit as GigavoltamperesReactive to create a new ElectricReactivePower from.
* @returns The new ElectricReactivePower instance.
*/
static FromGigavoltamperesReactive(value: number): ElectricReactivePower;
/**
* Gets the base unit enumeration associated with ElectricReactivePower
* @returns The unit enumeration that can be used to interact with this type
*/
protected static getUnitEnum(): typeof ElectricReactivePowerUnits;
/**
* 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(): ElectricReactivePowerUnits.VoltamperesReactive;
/**
* Create API DTO represent a ElectricReactivePower unit.
* @param holdInUnit The specific ElectricReactivePower unit to be used in the unit representation at the DTO
*/
toDto(holdInUnit?: ElectricReactivePowerUnits): ElectricReactivePowerDto;
/**
* Create a ElectricReactivePower unit from an API DTO representation.
* @param dtoElectricReactivePower The ElectricReactivePower API DTO representation
*/
static FromDto(dtoElectricReactivePower: ElectricReactivePowerDto): ElectricReactivePower;
/**
* Convert ElectricReactivePower to a specific unit value.
* @param toUnit The specific unit to convert to
* @returns The value of the specific unit provided.
*/
convert(toUnit: ElectricReactivePowerUnits): number;
private convertFromBase;
private convertToBase;
/**
* Format the ElectricReactivePower to string.
* Note! the default format for ElectricReactivePower is VoltamperesReactive.
* To specify the unit format set the 'unit' parameter.
* @param unit The unit to format the ElectricReactivePower.
* @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 ElectricReactivePower.
*/
toString(unit?: ElectricReactivePowerUnits, options?: number | ToStringOptions): string;
/**
* Get ElectricReactivePower unit abbreviation.
* Note! the default abbreviation for ElectricReactivePower is VoltamperesReactive.
* To specify the unit abbreviation set the 'unitAbbreviation' parameter.
* @param unitAbbreviation The unit abbreviation of the ElectricReactivePower.
* @returns The abbreviation string of ElectricReactivePower.
*/
getUnitAbbreviation(unitAbbreviation?: ElectricReactivePowerUnits): string;
/**
* Check if the given ElectricReactivePower are equals to the current ElectricReactivePower.
* @param electricReactivePower The other ElectricReactivePower.
* @returns True if the given ElectricReactivePower are equal to the current ElectricReactivePower.
*/
equals(electricReactivePower: ElectricReactivePower): boolean;
/**
* Compare the given ElectricReactivePower against the current ElectricReactivePower.
* @param electricReactivePower The other ElectricReactivePower.
* @returns 0 if they are equal, -1 if the current ElectricReactivePower is less then other, 1 if the current ElectricReactivePower is greater then other.
*/
compareTo(electricReactivePower: ElectricReactivePower): number;
/**
* Add the given ElectricReactivePower with the current ElectricReactivePower.
* @param electricReactivePower The other ElectricReactivePower.
* @returns A new ElectricReactivePower instance with the results.
*/
add(electricReactivePower: ElectricReactivePower): ElectricReactivePower;
/**
* Subtract the given ElectricReactivePower with the current ElectricReactivePower.
* @param electricReactivePower The other ElectricReactivePower.
* @returns A new ElectricReactivePower instance with the results.
*/
subtract(electricReactivePower: ElectricReactivePower): ElectricReactivePower;
/**
* Multiply the given ElectricReactivePower with the current ElectricReactivePower.
* @param electricReactivePower The other ElectricReactivePower.
* @returns A new ElectricReactivePower instance with the results.
*/
multiply(electricReactivePower: ElectricReactivePower): ElectricReactivePower;
/**
* Divide the given ElectricReactivePower with the current ElectricReactivePower.
* @param electricReactivePower The other ElectricReactivePower.
* @returns A new ElectricReactivePower instance with the results.
*/
divide(electricReactivePower: ElectricReactivePower): ElectricReactivePower;
/**
* Modulo the given ElectricReactivePower with the current ElectricReactivePower.
* @param electricReactivePower The other ElectricReactivePower.
* @returns A new ElectricReactivePower instance with the results.
*/
modulo(electricReactivePower: ElectricReactivePower): ElectricReactivePower;
/**
* Pow the given ElectricReactivePower with the current ElectricReactivePower.
* @param electricReactivePower The other ElectricReactivePower.
* @returns A new ElectricReactivePower instance with the results.
*/
pow(electricReactivePower: ElectricReactivePower): ElectricReactivePower;
}