UNPKG

unitsnet-js

Version:

A better way to hold unit variables and easily convert to the destination unit

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