UNPKG

unitsnet-js

Version:

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

231 lines (230 loc) 9.46 kB
import { BaseUnit, ToStringOptions } from "../base-unit"; /** API DTO represents a ElectricCurrent */ export interface ElectricCurrentDto { /** The value of the ElectricCurrent */ value: number; /** The specific unit that the ElectricCurrent value is representing */ unit: ElectricCurrentUnits; } /** ElectricCurrentUnits enumeration */ export declare enum ElectricCurrentUnits { /** */ Amperes = "Ampere", /** */ Femtoamperes = "Femtoampere", /** */ Picoamperes = "Picoampere", /** */ Nanoamperes = "Nanoampere", /** */ Microamperes = "Microampere", /** */ Milliamperes = "Milliampere", /** */ Centiamperes = "Centiampere", /** */ Kiloamperes = "Kiloampere", /** */ Megaamperes = "Megaampere" } /** An electric current is a flow of electric charge. In electric circuits this charge is often carried by moving electrons in a wire. It can also be carried by ions in an electrolyte, or by both ions and electrons such as in a plasma. */ export declare class ElectricCurrent extends BaseUnit { protected value: number; private amperesLazy; private femtoamperesLazy; private picoamperesLazy; private nanoamperesLazy; private microamperesLazy; private milliamperesLazy; private centiamperesLazy; private kiloamperesLazy; private megaamperesLazy; /** * Create a new ElectricCurrent. * @param value The value. * @param fromUnit The ‘ElectricCurrent’ unit to create from. * The default unit is Amperes */ constructor(value: number, fromUnit?: ElectricCurrentUnits); /** * The base value of ElectricCurrent is Amperes. * 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(): ElectricCurrentUnits.Amperes; /** */ get Amperes(): number; /** */ get Femtoamperes(): number; /** */ get Picoamperes(): number; /** */ get Nanoamperes(): number; /** */ get Microamperes(): number; /** */ get Milliamperes(): number; /** */ get Centiamperes(): number; /** */ get Kiloamperes(): number; /** */ get Megaamperes(): number; /** * Create a new ElectricCurrent instance from a Amperes * * @param value The unit as Amperes to create a new ElectricCurrent from. * @returns The new ElectricCurrent instance. */ static FromAmperes(value: number): ElectricCurrent; /** * Create a new ElectricCurrent instance from a Femtoamperes * * @param value The unit as Femtoamperes to create a new ElectricCurrent from. * @returns The new ElectricCurrent instance. */ static FromFemtoamperes(value: number): ElectricCurrent; /** * Create a new ElectricCurrent instance from a Picoamperes * * @param value The unit as Picoamperes to create a new ElectricCurrent from. * @returns The new ElectricCurrent instance. */ static FromPicoamperes(value: number): ElectricCurrent; /** * Create a new ElectricCurrent instance from a Nanoamperes * * @param value The unit as Nanoamperes to create a new ElectricCurrent from. * @returns The new ElectricCurrent instance. */ static FromNanoamperes(value: number): ElectricCurrent; /** * Create a new ElectricCurrent instance from a Microamperes * * @param value The unit as Microamperes to create a new ElectricCurrent from. * @returns The new ElectricCurrent instance. */ static FromMicroamperes(value: number): ElectricCurrent; /** * Create a new ElectricCurrent instance from a Milliamperes * * @param value The unit as Milliamperes to create a new ElectricCurrent from. * @returns The new ElectricCurrent instance. */ static FromMilliamperes(value: number): ElectricCurrent; /** * Create a new ElectricCurrent instance from a Centiamperes * * @param value The unit as Centiamperes to create a new ElectricCurrent from. * @returns The new ElectricCurrent instance. */ static FromCentiamperes(value: number): ElectricCurrent; /** * Create a new ElectricCurrent instance from a Kiloamperes * * @param value The unit as Kiloamperes to create a new ElectricCurrent from. * @returns The new ElectricCurrent instance. */ static FromKiloamperes(value: number): ElectricCurrent; /** * Create a new ElectricCurrent instance from a Megaamperes * * @param value The unit as Megaamperes to create a new ElectricCurrent from. * @returns The new ElectricCurrent instance. */ static FromMegaamperes(value: number): ElectricCurrent; /** * Gets the base unit enumeration associated with ElectricCurrent * @returns The unit enumeration that can be used to interact with this type */ protected static getUnitEnum(): typeof ElectricCurrentUnits; /** * 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(): ElectricCurrentUnits.Amperes; /** * Create API DTO represent a ElectricCurrent unit. * @param holdInUnit The specific ElectricCurrent unit to be used in the unit representation at the DTO */ toDto(holdInUnit?: ElectricCurrentUnits): ElectricCurrentDto; /** * Create a ElectricCurrent unit from an API DTO representation. * @param dtoElectricCurrent The ElectricCurrent API DTO representation */ static FromDto(dtoElectricCurrent: ElectricCurrentDto): ElectricCurrent; /** * Convert ElectricCurrent to a specific unit value. * @param toUnit The specific unit to convert to * @returns The value of the specific unit provided. */ convert(toUnit: ElectricCurrentUnits): number; private convertFromBase; private convertToBase; /** * Format the ElectricCurrent to string. * Note! the default format for ElectricCurrent is Amperes. * To specify the unit format set the 'unit' parameter. * @param unit The unit to format the ElectricCurrent. * @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 ElectricCurrent. */ toString(unit?: ElectricCurrentUnits, options?: number | ToStringOptions): string; /** * Get ElectricCurrent unit abbreviation. * Note! the default abbreviation for ElectricCurrent is Amperes. * To specify the unit abbreviation set the 'unitAbbreviation' parameter. * @param unitAbbreviation The unit abbreviation of the ElectricCurrent. * @returns The abbreviation string of ElectricCurrent. */ getUnitAbbreviation(unitAbbreviation?: ElectricCurrentUnits): string; /** * Check if the given ElectricCurrent are equals to the current ElectricCurrent. * @param electricCurrent The other ElectricCurrent. * @returns True if the given ElectricCurrent are equal to the current ElectricCurrent. */ equals(electricCurrent: ElectricCurrent): boolean; /** * Compare the given ElectricCurrent against the current ElectricCurrent. * @param electricCurrent The other ElectricCurrent. * @returns 0 if they are equal, -1 if the current ElectricCurrent is less then other, 1 if the current ElectricCurrent is greater then other. */ compareTo(electricCurrent: ElectricCurrent): number; /** * Add the given ElectricCurrent with the current ElectricCurrent. * @param electricCurrent The other ElectricCurrent. * @returns A new ElectricCurrent instance with the results. */ add(electricCurrent: ElectricCurrent): ElectricCurrent; /** * Subtract the given ElectricCurrent with the current ElectricCurrent. * @param electricCurrent The other ElectricCurrent. * @returns A new ElectricCurrent instance with the results. */ subtract(electricCurrent: ElectricCurrent): ElectricCurrent; /** * Multiply the given ElectricCurrent with the current ElectricCurrent. * @param electricCurrent The other ElectricCurrent. * @returns A new ElectricCurrent instance with the results. */ multiply(electricCurrent: ElectricCurrent): ElectricCurrent; /** * Divide the given ElectricCurrent with the current ElectricCurrent. * @param electricCurrent The other ElectricCurrent. * @returns A new ElectricCurrent instance with the results. */ divide(electricCurrent: ElectricCurrent): ElectricCurrent; /** * Modulo the given ElectricCurrent with the current ElectricCurrent. * @param electricCurrent The other ElectricCurrent. * @returns A new ElectricCurrent instance with the results. */ modulo(electricCurrent: ElectricCurrent): ElectricCurrent; /** * Pow the given ElectricCurrent with the current ElectricCurrent. * @param electricCurrent The other ElectricCurrent. * @returns A new ElectricCurrent instance with the results. */ pow(electricCurrent: ElectricCurrent): ElectricCurrent; }