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