unitsnet-js
Version:
A better way to hold unit variables and easily convert to the destination unit
255 lines (254 loc) • 10.1 kB
TypeScript
import { BaseUnit, ToStringOptions } from "../base-unit";
/** API DTO represents a ElectricCharge */
export interface ElectricChargeDto {
/** The value of the ElectricCharge */
value: number;
/** The specific unit that the ElectricCharge value is representing */
unit: ElectricChargeUnits;
}
/** ElectricChargeUnits enumeration */
export declare enum ElectricChargeUnits {
/** */
Coulombs = "Coulomb",
/** */
AmpereHours = "AmpereHour",
/** */
Picocoulombs = "Picocoulomb",
/** */
Nanocoulombs = "Nanocoulomb",
/** */
Microcoulombs = "Microcoulomb",
/** */
Millicoulombs = "Millicoulomb",
/** */
Kilocoulombs = "Kilocoulomb",
/** */
Megacoulombs = "Megacoulomb",
/** */
MilliampereHours = "MilliampereHour",
/** */
KiloampereHours = "KiloampereHour",
/** */
MegaampereHours = "MegaampereHour"
}
/** Electric charge is the physical property of matter that causes it to experience a force when placed in an electromagnetic field. */
export declare class ElectricCharge extends BaseUnit {
protected value: number;
private coulombsLazy;
private amperehoursLazy;
private picocoulombsLazy;
private nanocoulombsLazy;
private microcoulombsLazy;
private millicoulombsLazy;
private kilocoulombsLazy;
private megacoulombsLazy;
private milliamperehoursLazy;
private kiloamperehoursLazy;
private megaamperehoursLazy;
/**
* Create a new ElectricCharge.
* @param value The value.
* @param fromUnit The ‘ElectricCharge’ unit to create from.
* The default unit is Coulombs
*/
constructor(value: number, fromUnit?: ElectricChargeUnits);
/**
* The base value of ElectricCharge is Coulombs.
* 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(): ElectricChargeUnits.Coulombs;
/** */
get Coulombs(): number;
/** */
get AmpereHours(): number;
/** */
get Picocoulombs(): number;
/** */
get Nanocoulombs(): number;
/** */
get Microcoulombs(): number;
/** */
get Millicoulombs(): number;
/** */
get Kilocoulombs(): number;
/** */
get Megacoulombs(): number;
/** */
get MilliampereHours(): number;
/** */
get KiloampereHours(): number;
/** */
get MegaampereHours(): number;
/**
* Create a new ElectricCharge instance from a Coulombs
*
* @param value The unit as Coulombs to create a new ElectricCharge from.
* @returns The new ElectricCharge instance.
*/
static FromCoulombs(value: number): ElectricCharge;
/**
* Create a new ElectricCharge instance from a AmpereHours
*
* @param value The unit as AmpereHours to create a new ElectricCharge from.
* @returns The new ElectricCharge instance.
*/
static FromAmpereHours(value: number): ElectricCharge;
/**
* Create a new ElectricCharge instance from a Picocoulombs
*
* @param value The unit as Picocoulombs to create a new ElectricCharge from.
* @returns The new ElectricCharge instance.
*/
static FromPicocoulombs(value: number): ElectricCharge;
/**
* Create a new ElectricCharge instance from a Nanocoulombs
*
* @param value The unit as Nanocoulombs to create a new ElectricCharge from.
* @returns The new ElectricCharge instance.
*/
static FromNanocoulombs(value: number): ElectricCharge;
/**
* Create a new ElectricCharge instance from a Microcoulombs
*
* @param value The unit as Microcoulombs to create a new ElectricCharge from.
* @returns The new ElectricCharge instance.
*/
static FromMicrocoulombs(value: number): ElectricCharge;
/**
* Create a new ElectricCharge instance from a Millicoulombs
*
* @param value The unit as Millicoulombs to create a new ElectricCharge from.
* @returns The new ElectricCharge instance.
*/
static FromMillicoulombs(value: number): ElectricCharge;
/**
* Create a new ElectricCharge instance from a Kilocoulombs
*
* @param value The unit as Kilocoulombs to create a new ElectricCharge from.
* @returns The new ElectricCharge instance.
*/
static FromKilocoulombs(value: number): ElectricCharge;
/**
* Create a new ElectricCharge instance from a Megacoulombs
*
* @param value The unit as Megacoulombs to create a new ElectricCharge from.
* @returns The new ElectricCharge instance.
*/
static FromMegacoulombs(value: number): ElectricCharge;
/**
* Create a new ElectricCharge instance from a MilliampereHours
*
* @param value The unit as MilliampereHours to create a new ElectricCharge from.
* @returns The new ElectricCharge instance.
*/
static FromMilliampereHours(value: number): ElectricCharge;
/**
* Create a new ElectricCharge instance from a KiloampereHours
*
* @param value The unit as KiloampereHours to create a new ElectricCharge from.
* @returns The new ElectricCharge instance.
*/
static FromKiloampereHours(value: number): ElectricCharge;
/**
* Create a new ElectricCharge instance from a MegaampereHours
*
* @param value The unit as MegaampereHours to create a new ElectricCharge from.
* @returns The new ElectricCharge instance.
*/
static FromMegaampereHours(value: number): ElectricCharge;
/**
* Gets the base unit enumeration associated with ElectricCharge
* @returns The unit enumeration that can be used to interact with this type
*/
protected static getUnitEnum(): typeof ElectricChargeUnits;
/**
* 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(): ElectricChargeUnits.Coulombs;
/**
* Create API DTO represent a ElectricCharge unit.
* @param holdInUnit The specific ElectricCharge unit to be used in the unit representation at the DTO
*/
toDto(holdInUnit?: ElectricChargeUnits): ElectricChargeDto;
/**
* Create a ElectricCharge unit from an API DTO representation.
* @param dtoElectricCharge The ElectricCharge API DTO representation
*/
static FromDto(dtoElectricCharge: ElectricChargeDto): ElectricCharge;
/**
* Convert ElectricCharge to a specific unit value.
* @param toUnit The specific unit to convert to
* @returns The value of the specific unit provided.
*/
convert(toUnit: ElectricChargeUnits): number;
private convertFromBase;
private convertToBase;
/**
* Format the ElectricCharge to string.
* Note! the default format for ElectricCharge is Coulombs.
* To specify the unit format set the 'unit' parameter.
* @param unit The unit to format the ElectricCharge.
* @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 ElectricCharge.
*/
toString(unit?: ElectricChargeUnits, options?: number | ToStringOptions): string;
/**
* Get ElectricCharge unit abbreviation.
* Note! the default abbreviation for ElectricCharge is Coulombs.
* To specify the unit abbreviation set the 'unitAbbreviation' parameter.
* @param unitAbbreviation The unit abbreviation of the ElectricCharge.
* @returns The abbreviation string of ElectricCharge.
*/
getUnitAbbreviation(unitAbbreviation?: ElectricChargeUnits): string;
/**
* Check if the given ElectricCharge are equals to the current ElectricCharge.
* @param electricCharge The other ElectricCharge.
* @returns True if the given ElectricCharge are equal to the current ElectricCharge.
*/
equals(electricCharge: ElectricCharge): boolean;
/**
* Compare the given ElectricCharge against the current ElectricCharge.
* @param electricCharge The other ElectricCharge.
* @returns 0 if they are equal, -1 if the current ElectricCharge is less then other, 1 if the current ElectricCharge is greater then other.
*/
compareTo(electricCharge: ElectricCharge): number;
/**
* Add the given ElectricCharge with the current ElectricCharge.
* @param electricCharge The other ElectricCharge.
* @returns A new ElectricCharge instance with the results.
*/
add(electricCharge: ElectricCharge): ElectricCharge;
/**
* Subtract the given ElectricCharge with the current ElectricCharge.
* @param electricCharge The other ElectricCharge.
* @returns A new ElectricCharge instance with the results.
*/
subtract(electricCharge: ElectricCharge): ElectricCharge;
/**
* Multiply the given ElectricCharge with the current ElectricCharge.
* @param electricCharge The other ElectricCharge.
* @returns A new ElectricCharge instance with the results.
*/
multiply(electricCharge: ElectricCharge): ElectricCharge;
/**
* Divide the given ElectricCharge with the current ElectricCharge.
* @param electricCharge The other ElectricCharge.
* @returns A new ElectricCharge instance with the results.
*/
divide(electricCharge: ElectricCharge): ElectricCharge;
/**
* Modulo the given ElectricCharge with the current ElectricCharge.
* @param electricCharge The other ElectricCharge.
* @returns A new ElectricCharge instance with the results.
*/
modulo(electricCharge: ElectricCharge): ElectricCharge;
/**
* Pow the given ElectricCharge with the current ElectricCharge.
* @param electricCharge The other ElectricCharge.
* @returns A new ElectricCharge instance with the results.
*/
pow(electricCharge: ElectricCharge): ElectricCharge;
}