UNPKG

unitsnet-js

Version:

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

183 lines (182 loc) 8.09 kB
import { BaseUnit, ToStringOptions } from "../base-unit"; /** API DTO represents a ElectricInductance */ export interface ElectricInductanceDto { /** The value of the ElectricInductance */ value: number; /** The specific unit that the ElectricInductance value is representing */ unit: ElectricInductanceUnits; } /** ElectricInductanceUnits enumeration */ export declare enum ElectricInductanceUnits { /** */ Henries = "Henry", /** */ Picohenries = "Picohenry", /** */ Nanohenries = "Nanohenry", /** */ Microhenries = "Microhenry", /** */ Millihenries = "Millihenry" } /** Inductance is a property of an electrical conductor which opposes a change in current. */ export declare class ElectricInductance extends BaseUnit { protected value: number; private henriesLazy; private picohenriesLazy; private nanohenriesLazy; private microhenriesLazy; private millihenriesLazy; /** * Create a new ElectricInductance. * @param value The value. * @param fromUnit The ‘ElectricInductance’ unit to create from. * The default unit is Henries */ constructor(value: number, fromUnit?: ElectricInductanceUnits); /** * The base value of ElectricInductance is Henries. * 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(): ElectricInductanceUnits.Henries; /** */ get Henries(): number; /** */ get Picohenries(): number; /** */ get Nanohenries(): number; /** */ get Microhenries(): number; /** */ get Millihenries(): number; /** * Create a new ElectricInductance instance from a Henries * * @param value The unit as Henries to create a new ElectricInductance from. * @returns The new ElectricInductance instance. */ static FromHenries(value: number): ElectricInductance; /** * Create a new ElectricInductance instance from a Picohenries * * @param value The unit as Picohenries to create a new ElectricInductance from. * @returns The new ElectricInductance instance. */ static FromPicohenries(value: number): ElectricInductance; /** * Create a new ElectricInductance instance from a Nanohenries * * @param value The unit as Nanohenries to create a new ElectricInductance from. * @returns The new ElectricInductance instance. */ static FromNanohenries(value: number): ElectricInductance; /** * Create a new ElectricInductance instance from a Microhenries * * @param value The unit as Microhenries to create a new ElectricInductance from. * @returns The new ElectricInductance instance. */ static FromMicrohenries(value: number): ElectricInductance; /** * Create a new ElectricInductance instance from a Millihenries * * @param value The unit as Millihenries to create a new ElectricInductance from. * @returns The new ElectricInductance instance. */ static FromMillihenries(value: number): ElectricInductance; /** * Gets the base unit enumeration associated with ElectricInductance * @returns The unit enumeration that can be used to interact with this type */ protected static getUnitEnum(): typeof ElectricInductanceUnits; /** * 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(): ElectricInductanceUnits.Henries; /** * Create API DTO represent a ElectricInductance unit. * @param holdInUnit The specific ElectricInductance unit to be used in the unit representation at the DTO */ toDto(holdInUnit?: ElectricInductanceUnits): ElectricInductanceDto; /** * Create a ElectricInductance unit from an API DTO representation. * @param dtoElectricInductance The ElectricInductance API DTO representation */ static FromDto(dtoElectricInductance: ElectricInductanceDto): ElectricInductance; /** * Convert ElectricInductance to a specific unit value. * @param toUnit The specific unit to convert to * @returns The value of the specific unit provided. */ convert(toUnit: ElectricInductanceUnits): number; private convertFromBase; private convertToBase; /** * Format the ElectricInductance to string. * Note! the default format for ElectricInductance is Henries. * To specify the unit format set the 'unit' parameter. * @param unit The unit to format the ElectricInductance. * @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 ElectricInductance. */ toString(unit?: ElectricInductanceUnits, options?: number | ToStringOptions): string; /** * Get ElectricInductance unit abbreviation. * Note! the default abbreviation for ElectricInductance is Henries. * To specify the unit abbreviation set the 'unitAbbreviation' parameter. * @param unitAbbreviation The unit abbreviation of the ElectricInductance. * @returns The abbreviation string of ElectricInductance. */ getUnitAbbreviation(unitAbbreviation?: ElectricInductanceUnits): string; /** * Check if the given ElectricInductance are equals to the current ElectricInductance. * @param electricInductance The other ElectricInductance. * @returns True if the given ElectricInductance are equal to the current ElectricInductance. */ equals(electricInductance: ElectricInductance): boolean; /** * Compare the given ElectricInductance against the current ElectricInductance. * @param electricInductance The other ElectricInductance. * @returns 0 if they are equal, -1 if the current ElectricInductance is less then other, 1 if the current ElectricInductance is greater then other. */ compareTo(electricInductance: ElectricInductance): number; /** * Add the given ElectricInductance with the current ElectricInductance. * @param electricInductance The other ElectricInductance. * @returns A new ElectricInductance instance with the results. */ add(electricInductance: ElectricInductance): ElectricInductance; /** * Subtract the given ElectricInductance with the current ElectricInductance. * @param electricInductance The other ElectricInductance. * @returns A new ElectricInductance instance with the results. */ subtract(electricInductance: ElectricInductance): ElectricInductance; /** * Multiply the given ElectricInductance with the current ElectricInductance. * @param electricInductance The other ElectricInductance. * @returns A new ElectricInductance instance with the results. */ multiply(electricInductance: ElectricInductance): ElectricInductance; /** * Divide the given ElectricInductance with the current ElectricInductance. * @param electricInductance The other ElectricInductance. * @returns A new ElectricInductance instance with the results. */ divide(electricInductance: ElectricInductance): ElectricInductance; /** * Modulo the given ElectricInductance with the current ElectricInductance. * @param electricInductance The other ElectricInductance. * @returns A new ElectricInductance instance with the results. */ modulo(electricInductance: ElectricInductance): ElectricInductance; /** * Pow the given ElectricInductance with the current ElectricInductance. * @param electricInductance The other ElectricInductance. * @returns A new ElectricInductance instance with the results. */ pow(electricInductance: ElectricInductance): ElectricInductance; }