unitsnet-js
Version:
A better way to hold unit variables and easily convert to the destination unit
135 lines (134 loc) • 6.97 kB
TypeScript
import { BaseUnit, ToStringOptions } from "../base-unit";
/** API DTO represents a ElectricChargeDensity */
export interface ElectricChargeDensityDto {
/** The value of the ElectricChargeDensity */
value: number;
/** The specific unit that the ElectricChargeDensity value is representing */
unit: ElectricChargeDensityUnits;
}
/** ElectricChargeDensityUnits enumeration */
export declare enum ElectricChargeDensityUnits {
/** */
CoulombsPerCubicMeter = "CoulombPerCubicMeter"
}
/** In electromagnetism, charge density is a measure of the amount of electric charge per volume. */
export declare class ElectricChargeDensity extends BaseUnit {
protected value: number;
private coulombspercubicmeterLazy;
/**
* Create a new ElectricChargeDensity.
* @param value The value.
* @param fromUnit The ‘ElectricChargeDensity’ unit to create from.
* The default unit is CoulombsPerCubicMeter
*/
constructor(value: number, fromUnit?: ElectricChargeDensityUnits);
/**
* The base value of ElectricChargeDensity is CoulombsPerCubicMeter.
* 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(): ElectricChargeDensityUnits.CoulombsPerCubicMeter;
/** */
get CoulombsPerCubicMeter(): number;
/**
* Create a new ElectricChargeDensity instance from a CoulombsPerCubicMeter
*
* @param value The unit as CoulombsPerCubicMeter to create a new ElectricChargeDensity from.
* @returns The new ElectricChargeDensity instance.
*/
static FromCoulombsPerCubicMeter(value: number): ElectricChargeDensity;
/**
* Gets the base unit enumeration associated with ElectricChargeDensity
* @returns The unit enumeration that can be used to interact with this type
*/
protected static getUnitEnum(): typeof ElectricChargeDensityUnits;
/**
* 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(): ElectricChargeDensityUnits.CoulombsPerCubicMeter;
/**
* Create API DTO represent a ElectricChargeDensity unit.
* @param holdInUnit The specific ElectricChargeDensity unit to be used in the unit representation at the DTO
*/
toDto(holdInUnit?: ElectricChargeDensityUnits): ElectricChargeDensityDto;
/**
* Create a ElectricChargeDensity unit from an API DTO representation.
* @param dtoElectricChargeDensity The ElectricChargeDensity API DTO representation
*/
static FromDto(dtoElectricChargeDensity: ElectricChargeDensityDto): ElectricChargeDensity;
/**
* Convert ElectricChargeDensity to a specific unit value.
* @param toUnit The specific unit to convert to
* @returns The value of the specific unit provided.
*/
convert(toUnit: ElectricChargeDensityUnits): number;
private convertFromBase;
private convertToBase;
/**
* Format the ElectricChargeDensity to string.
* Note! the default format for ElectricChargeDensity is CoulombsPerCubicMeter.
* To specify the unit format set the 'unit' parameter.
* @param unit The unit to format the ElectricChargeDensity.
* @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 ElectricChargeDensity.
*/
toString(unit?: ElectricChargeDensityUnits, options?: number | ToStringOptions): string;
/**
* Get ElectricChargeDensity unit abbreviation.
* Note! the default abbreviation for ElectricChargeDensity is CoulombsPerCubicMeter.
* To specify the unit abbreviation set the 'unitAbbreviation' parameter.
* @param unitAbbreviation The unit abbreviation of the ElectricChargeDensity.
* @returns The abbreviation string of ElectricChargeDensity.
*/
getUnitAbbreviation(unitAbbreviation?: ElectricChargeDensityUnits): string;
/**
* Check if the given ElectricChargeDensity are equals to the current ElectricChargeDensity.
* @param electricChargeDensity The other ElectricChargeDensity.
* @returns True if the given ElectricChargeDensity are equal to the current ElectricChargeDensity.
*/
equals(electricChargeDensity: ElectricChargeDensity): boolean;
/**
* Compare the given ElectricChargeDensity against the current ElectricChargeDensity.
* @param electricChargeDensity The other ElectricChargeDensity.
* @returns 0 if they are equal, -1 if the current ElectricChargeDensity is less then other, 1 if the current ElectricChargeDensity is greater then other.
*/
compareTo(electricChargeDensity: ElectricChargeDensity): number;
/**
* Add the given ElectricChargeDensity with the current ElectricChargeDensity.
* @param electricChargeDensity The other ElectricChargeDensity.
* @returns A new ElectricChargeDensity instance with the results.
*/
add(electricChargeDensity: ElectricChargeDensity): ElectricChargeDensity;
/**
* Subtract the given ElectricChargeDensity with the current ElectricChargeDensity.
* @param electricChargeDensity The other ElectricChargeDensity.
* @returns A new ElectricChargeDensity instance with the results.
*/
subtract(electricChargeDensity: ElectricChargeDensity): ElectricChargeDensity;
/**
* Multiply the given ElectricChargeDensity with the current ElectricChargeDensity.
* @param electricChargeDensity The other ElectricChargeDensity.
* @returns A new ElectricChargeDensity instance with the results.
*/
multiply(electricChargeDensity: ElectricChargeDensity): ElectricChargeDensity;
/**
* Divide the given ElectricChargeDensity with the current ElectricChargeDensity.
* @param electricChargeDensity The other ElectricChargeDensity.
* @returns A new ElectricChargeDensity instance with the results.
*/
divide(electricChargeDensity: ElectricChargeDensity): ElectricChargeDensity;
/**
* Modulo the given ElectricChargeDensity with the current ElectricChargeDensity.
* @param electricChargeDensity The other ElectricChargeDensity.
* @returns A new ElectricChargeDensity instance with the results.
*/
modulo(electricChargeDensity: ElectricChargeDensity): ElectricChargeDensity;
/**
* Pow the given ElectricChargeDensity with the current ElectricChargeDensity.
* @param electricChargeDensity The other ElectricChargeDensity.
* @returns A new ElectricChargeDensity instance with the results.
*/
pow(electricChargeDensity: ElectricChargeDensity): ElectricChargeDensity;
}