unitsnet-js
Version:
A better way to hold unit variables and easily convert to the destination unit
219 lines (218 loc) • 9.08 kB
TypeScript
import { BaseUnit, ToStringOptions } from "../base-unit";
/** API DTO represents a ElectricReactance */
export interface ElectricReactanceDto {
/** The value of the ElectricReactance */
value: number;
/** The specific unit that the ElectricReactance value is representing */
unit: ElectricReactanceUnits;
}
/** ElectricReactanceUnits enumeration */
export declare enum ElectricReactanceUnits {
/** */
Ohms = "Ohm",
/** */
Nanoohms = "Nanoohm",
/** */
Microohms = "Microohm",
/** */
Milliohms = "Milliohm",
/** */
Kiloohms = "Kiloohm",
/** */
Megaohms = "Megaohm",
/** */
Gigaohms = "Gigaohm",
/** */
Teraohms = "Teraohm"
}
/** In electrical circuits, reactance is the opposition presented to alternating current by inductance and capacitance. Along with resistance, it is one of two elements of impedance. */
export declare class ElectricReactance extends BaseUnit {
protected value: number;
private ohmsLazy;
private nanoohmsLazy;
private microohmsLazy;
private milliohmsLazy;
private kiloohmsLazy;
private megaohmsLazy;
private gigaohmsLazy;
private teraohmsLazy;
/**
* Create a new ElectricReactance.
* @param value The value.
* @param fromUnit The ‘ElectricReactance’ unit to create from.
* The default unit is Ohms
*/
constructor(value: number, fromUnit?: ElectricReactanceUnits);
/**
* The base value of ElectricReactance is Ohms.
* 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(): ElectricReactanceUnits.Ohms;
/** */
get Ohms(): number;
/** */
get Nanoohms(): number;
/** */
get Microohms(): number;
/** */
get Milliohms(): number;
/** */
get Kiloohms(): number;
/** */
get Megaohms(): number;
/** */
get Gigaohms(): number;
/** */
get Teraohms(): number;
/**
* Create a new ElectricReactance instance from a Ohms
*
* @param value The unit as Ohms to create a new ElectricReactance from.
* @returns The new ElectricReactance instance.
*/
static FromOhms(value: number): ElectricReactance;
/**
* Create a new ElectricReactance instance from a Nanoohms
*
* @param value The unit as Nanoohms to create a new ElectricReactance from.
* @returns The new ElectricReactance instance.
*/
static FromNanoohms(value: number): ElectricReactance;
/**
* Create a new ElectricReactance instance from a Microohms
*
* @param value The unit as Microohms to create a new ElectricReactance from.
* @returns The new ElectricReactance instance.
*/
static FromMicroohms(value: number): ElectricReactance;
/**
* Create a new ElectricReactance instance from a Milliohms
*
* @param value The unit as Milliohms to create a new ElectricReactance from.
* @returns The new ElectricReactance instance.
*/
static FromMilliohms(value: number): ElectricReactance;
/**
* Create a new ElectricReactance instance from a Kiloohms
*
* @param value The unit as Kiloohms to create a new ElectricReactance from.
* @returns The new ElectricReactance instance.
*/
static FromKiloohms(value: number): ElectricReactance;
/**
* Create a new ElectricReactance instance from a Megaohms
*
* @param value The unit as Megaohms to create a new ElectricReactance from.
* @returns The new ElectricReactance instance.
*/
static FromMegaohms(value: number): ElectricReactance;
/**
* Create a new ElectricReactance instance from a Gigaohms
*
* @param value The unit as Gigaohms to create a new ElectricReactance from.
* @returns The new ElectricReactance instance.
*/
static FromGigaohms(value: number): ElectricReactance;
/**
* Create a new ElectricReactance instance from a Teraohms
*
* @param value The unit as Teraohms to create a new ElectricReactance from.
* @returns The new ElectricReactance instance.
*/
static FromTeraohms(value: number): ElectricReactance;
/**
* Gets the base unit enumeration associated with ElectricReactance
* @returns The unit enumeration that can be used to interact with this type
*/
protected static getUnitEnum(): typeof ElectricReactanceUnits;
/**
* 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(): ElectricReactanceUnits.Ohms;
/**
* Create API DTO represent a ElectricReactance unit.
* @param holdInUnit The specific ElectricReactance unit to be used in the unit representation at the DTO
*/
toDto(holdInUnit?: ElectricReactanceUnits): ElectricReactanceDto;
/**
* Create a ElectricReactance unit from an API DTO representation.
* @param dtoElectricReactance The ElectricReactance API DTO representation
*/
static FromDto(dtoElectricReactance: ElectricReactanceDto): ElectricReactance;
/**
* Convert ElectricReactance to a specific unit value.
* @param toUnit The specific unit to convert to
* @returns The value of the specific unit provided.
*/
convert(toUnit: ElectricReactanceUnits): number;
private convertFromBase;
private convertToBase;
/**
* Format the ElectricReactance to string.
* Note! the default format for ElectricReactance is Ohms.
* To specify the unit format set the 'unit' parameter.
* @param unit The unit to format the ElectricReactance.
* @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 ElectricReactance.
*/
toString(unit?: ElectricReactanceUnits, options?: number | ToStringOptions): string;
/**
* Get ElectricReactance unit abbreviation.
* Note! the default abbreviation for ElectricReactance is Ohms.
* To specify the unit abbreviation set the 'unitAbbreviation' parameter.
* @param unitAbbreviation The unit abbreviation of the ElectricReactance.
* @returns The abbreviation string of ElectricReactance.
*/
getUnitAbbreviation(unitAbbreviation?: ElectricReactanceUnits): string;
/**
* Check if the given ElectricReactance are equals to the current ElectricReactance.
* @param electricReactance The other ElectricReactance.
* @returns True if the given ElectricReactance are equal to the current ElectricReactance.
*/
equals(electricReactance: ElectricReactance): boolean;
/**
* Compare the given ElectricReactance against the current ElectricReactance.
* @param electricReactance The other ElectricReactance.
* @returns 0 if they are equal, -1 if the current ElectricReactance is less then other, 1 if the current ElectricReactance is greater then other.
*/
compareTo(electricReactance: ElectricReactance): number;
/**
* Add the given ElectricReactance with the current ElectricReactance.
* @param electricReactance The other ElectricReactance.
* @returns A new ElectricReactance instance with the results.
*/
add(electricReactance: ElectricReactance): ElectricReactance;
/**
* Subtract the given ElectricReactance with the current ElectricReactance.
* @param electricReactance The other ElectricReactance.
* @returns A new ElectricReactance instance with the results.
*/
subtract(electricReactance: ElectricReactance): ElectricReactance;
/**
* Multiply the given ElectricReactance with the current ElectricReactance.
* @param electricReactance The other ElectricReactance.
* @returns A new ElectricReactance instance with the results.
*/
multiply(electricReactance: ElectricReactance): ElectricReactance;
/**
* Divide the given ElectricReactance with the current ElectricReactance.
* @param electricReactance The other ElectricReactance.
* @returns A new ElectricReactance instance with the results.
*/
divide(electricReactance: ElectricReactance): ElectricReactance;
/**
* Modulo the given ElectricReactance with the current ElectricReactance.
* @param electricReactance The other ElectricReactance.
* @returns A new ElectricReactance instance with the results.
*/
modulo(electricReactance: ElectricReactance): ElectricReactance;
/**
* Pow the given ElectricReactance with the current ElectricReactance.
* @param electricReactance The other ElectricReactance.
* @returns A new ElectricReactance instance with the results.
*/
pow(electricReactance: ElectricReactance): ElectricReactance;
}