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