unitsnet-js
Version:
A better way to hold unit variables and easily convert to the destination unit
327 lines (326 loc) • 14.2 kB
TypeScript
import { BaseUnit, ToStringOptions } from "../base-unit";
/** API DTO represents a SpecificWeight */
export interface SpecificWeightDto {
/** The value of the SpecificWeight */
value: number;
/** The specific unit that the SpecificWeight value is representing */
unit: SpecificWeightUnits;
}
/** SpecificWeightUnits enumeration */
export declare enum SpecificWeightUnits {
/** */
NewtonsPerCubicMillimeter = "NewtonPerCubicMillimeter",
/** */
NewtonsPerCubicCentimeter = "NewtonPerCubicCentimeter",
/** */
NewtonsPerCubicMeter = "NewtonPerCubicMeter",
/** */
KilogramsForcePerCubicMillimeter = "KilogramForcePerCubicMillimeter",
/** */
KilogramsForcePerCubicCentimeter = "KilogramForcePerCubicCentimeter",
/** */
KilogramsForcePerCubicMeter = "KilogramForcePerCubicMeter",
/** */
PoundsForcePerCubicInch = "PoundForcePerCubicInch",
/** */
PoundsForcePerCubicFoot = "PoundForcePerCubicFoot",
/** */
TonnesForcePerCubicMillimeter = "TonneForcePerCubicMillimeter",
/** */
TonnesForcePerCubicCentimeter = "TonneForcePerCubicCentimeter",
/** */
TonnesForcePerCubicMeter = "TonneForcePerCubicMeter",
/** */
KilonewtonsPerCubicMillimeter = "KilonewtonPerCubicMillimeter",
/** */
KilonewtonsPerCubicCentimeter = "KilonewtonPerCubicCentimeter",
/** */
KilonewtonsPerCubicMeter = "KilonewtonPerCubicMeter",
/** */
MeganewtonsPerCubicMeter = "MeganewtonPerCubicMeter",
/** */
KilopoundsForcePerCubicInch = "KilopoundForcePerCubicInch",
/** */
KilopoundsForcePerCubicFoot = "KilopoundForcePerCubicFoot"
}
/** The SpecificWeight, or more precisely, the volumetric weight density, of a substance is its weight per unit volume. */
export declare class SpecificWeight extends BaseUnit {
protected value: number;
private newtonspercubicmillimeterLazy;
private newtonspercubiccentimeterLazy;
private newtonspercubicmeterLazy;
private kilogramsforcepercubicmillimeterLazy;
private kilogramsforcepercubiccentimeterLazy;
private kilogramsforcepercubicmeterLazy;
private poundsforcepercubicinchLazy;
private poundsforcepercubicfootLazy;
private tonnesforcepercubicmillimeterLazy;
private tonnesforcepercubiccentimeterLazy;
private tonnesforcepercubicmeterLazy;
private kilonewtonspercubicmillimeterLazy;
private kilonewtonspercubiccentimeterLazy;
private kilonewtonspercubicmeterLazy;
private meganewtonspercubicmeterLazy;
private kilopoundsforcepercubicinchLazy;
private kilopoundsforcepercubicfootLazy;
/**
* Create a new SpecificWeight.
* @param value The value.
* @param fromUnit The ‘SpecificWeight’ unit to create from.
* The default unit is NewtonsPerCubicMeter
*/
constructor(value: number, fromUnit?: SpecificWeightUnits);
/**
* The base value of SpecificWeight is NewtonsPerCubicMeter.
* 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(): SpecificWeightUnits.NewtonsPerCubicMeter;
/** */
get NewtonsPerCubicMillimeter(): number;
/** */
get NewtonsPerCubicCentimeter(): number;
/** */
get NewtonsPerCubicMeter(): number;
/** */
get KilogramsForcePerCubicMillimeter(): number;
/** */
get KilogramsForcePerCubicCentimeter(): number;
/** */
get KilogramsForcePerCubicMeter(): number;
/** */
get PoundsForcePerCubicInch(): number;
/** */
get PoundsForcePerCubicFoot(): number;
/** */
get TonnesForcePerCubicMillimeter(): number;
/** */
get TonnesForcePerCubicCentimeter(): number;
/** */
get TonnesForcePerCubicMeter(): number;
/** */
get KilonewtonsPerCubicMillimeter(): number;
/** */
get KilonewtonsPerCubicCentimeter(): number;
/** */
get KilonewtonsPerCubicMeter(): number;
/** */
get MeganewtonsPerCubicMeter(): number;
/** */
get KilopoundsForcePerCubicInch(): number;
/** */
get KilopoundsForcePerCubicFoot(): number;
/**
* Create a new SpecificWeight instance from a NewtonsPerCubicMillimeter
*
* @param value The unit as NewtonsPerCubicMillimeter to create a new SpecificWeight from.
* @returns The new SpecificWeight instance.
*/
static FromNewtonsPerCubicMillimeter(value: number): SpecificWeight;
/**
* Create a new SpecificWeight instance from a NewtonsPerCubicCentimeter
*
* @param value The unit as NewtonsPerCubicCentimeter to create a new SpecificWeight from.
* @returns The new SpecificWeight instance.
*/
static FromNewtonsPerCubicCentimeter(value: number): SpecificWeight;
/**
* Create a new SpecificWeight instance from a NewtonsPerCubicMeter
*
* @param value The unit as NewtonsPerCubicMeter to create a new SpecificWeight from.
* @returns The new SpecificWeight instance.
*/
static FromNewtonsPerCubicMeter(value: number): SpecificWeight;
/**
* Create a new SpecificWeight instance from a KilogramsForcePerCubicMillimeter
*
* @param value The unit as KilogramsForcePerCubicMillimeter to create a new SpecificWeight from.
* @returns The new SpecificWeight instance.
*/
static FromKilogramsForcePerCubicMillimeter(value: number): SpecificWeight;
/**
* Create a new SpecificWeight instance from a KilogramsForcePerCubicCentimeter
*
* @param value The unit as KilogramsForcePerCubicCentimeter to create a new SpecificWeight from.
* @returns The new SpecificWeight instance.
*/
static FromKilogramsForcePerCubicCentimeter(value: number): SpecificWeight;
/**
* Create a new SpecificWeight instance from a KilogramsForcePerCubicMeter
*
* @param value The unit as KilogramsForcePerCubicMeter to create a new SpecificWeight from.
* @returns The new SpecificWeight instance.
*/
static FromKilogramsForcePerCubicMeter(value: number): SpecificWeight;
/**
* Create a new SpecificWeight instance from a PoundsForcePerCubicInch
*
* @param value The unit as PoundsForcePerCubicInch to create a new SpecificWeight from.
* @returns The new SpecificWeight instance.
*/
static FromPoundsForcePerCubicInch(value: number): SpecificWeight;
/**
* Create a new SpecificWeight instance from a PoundsForcePerCubicFoot
*
* @param value The unit as PoundsForcePerCubicFoot to create a new SpecificWeight from.
* @returns The new SpecificWeight instance.
*/
static FromPoundsForcePerCubicFoot(value: number): SpecificWeight;
/**
* Create a new SpecificWeight instance from a TonnesForcePerCubicMillimeter
*
* @param value The unit as TonnesForcePerCubicMillimeter to create a new SpecificWeight from.
* @returns The new SpecificWeight instance.
*/
static FromTonnesForcePerCubicMillimeter(value: number): SpecificWeight;
/**
* Create a new SpecificWeight instance from a TonnesForcePerCubicCentimeter
*
* @param value The unit as TonnesForcePerCubicCentimeter to create a new SpecificWeight from.
* @returns The new SpecificWeight instance.
*/
static FromTonnesForcePerCubicCentimeter(value: number): SpecificWeight;
/**
* Create a new SpecificWeight instance from a TonnesForcePerCubicMeter
*
* @param value The unit as TonnesForcePerCubicMeter to create a new SpecificWeight from.
* @returns The new SpecificWeight instance.
*/
static FromTonnesForcePerCubicMeter(value: number): SpecificWeight;
/**
* Create a new SpecificWeight instance from a KilonewtonsPerCubicMillimeter
*
* @param value The unit as KilonewtonsPerCubicMillimeter to create a new SpecificWeight from.
* @returns The new SpecificWeight instance.
*/
static FromKilonewtonsPerCubicMillimeter(value: number): SpecificWeight;
/**
* Create a new SpecificWeight instance from a KilonewtonsPerCubicCentimeter
*
* @param value The unit as KilonewtonsPerCubicCentimeter to create a new SpecificWeight from.
* @returns The new SpecificWeight instance.
*/
static FromKilonewtonsPerCubicCentimeter(value: number): SpecificWeight;
/**
* Create a new SpecificWeight instance from a KilonewtonsPerCubicMeter
*
* @param value The unit as KilonewtonsPerCubicMeter to create a new SpecificWeight from.
* @returns The new SpecificWeight instance.
*/
static FromKilonewtonsPerCubicMeter(value: number): SpecificWeight;
/**
* Create a new SpecificWeight instance from a MeganewtonsPerCubicMeter
*
* @param value The unit as MeganewtonsPerCubicMeter to create a new SpecificWeight from.
* @returns The new SpecificWeight instance.
*/
static FromMeganewtonsPerCubicMeter(value: number): SpecificWeight;
/**
* Create a new SpecificWeight instance from a KilopoundsForcePerCubicInch
*
* @param value The unit as KilopoundsForcePerCubicInch to create a new SpecificWeight from.
* @returns The new SpecificWeight instance.
*/
static FromKilopoundsForcePerCubicInch(value: number): SpecificWeight;
/**
* Create a new SpecificWeight instance from a KilopoundsForcePerCubicFoot
*
* @param value The unit as KilopoundsForcePerCubicFoot to create a new SpecificWeight from.
* @returns The new SpecificWeight instance.
*/
static FromKilopoundsForcePerCubicFoot(value: number): SpecificWeight;
/**
* Gets the base unit enumeration associated with SpecificWeight
* @returns The unit enumeration that can be used to interact with this type
*/
protected static getUnitEnum(): typeof SpecificWeightUnits;
/**
* 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(): SpecificWeightUnits.NewtonsPerCubicMeter;
/**
* Create API DTO represent a SpecificWeight unit.
* @param holdInUnit The specific SpecificWeight unit to be used in the unit representation at the DTO
*/
toDto(holdInUnit?: SpecificWeightUnits): SpecificWeightDto;
/**
* Create a SpecificWeight unit from an API DTO representation.
* @param dtoSpecificWeight The SpecificWeight API DTO representation
*/
static FromDto(dtoSpecificWeight: SpecificWeightDto): SpecificWeight;
/**
* Convert SpecificWeight to a specific unit value.
* @param toUnit The specific unit to convert to
* @returns The value of the specific unit provided.
*/
convert(toUnit: SpecificWeightUnits): number;
private convertFromBase;
private convertToBase;
/**
* Format the SpecificWeight to string.
* Note! the default format for SpecificWeight is NewtonsPerCubicMeter.
* To specify the unit format set the 'unit' parameter.
* @param unit The unit to format the SpecificWeight.
* @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 SpecificWeight.
*/
toString(unit?: SpecificWeightUnits, options?: number | ToStringOptions): string;
/**
* Get SpecificWeight unit abbreviation.
* Note! the default abbreviation for SpecificWeight is NewtonsPerCubicMeter.
* To specify the unit abbreviation set the 'unitAbbreviation' parameter.
* @param unitAbbreviation The unit abbreviation of the SpecificWeight.
* @returns The abbreviation string of SpecificWeight.
*/
getUnitAbbreviation(unitAbbreviation?: SpecificWeightUnits): string;
/**
* Check if the given SpecificWeight are equals to the current SpecificWeight.
* @param specificWeight The other SpecificWeight.
* @returns True if the given SpecificWeight are equal to the current SpecificWeight.
*/
equals(specificWeight: SpecificWeight): boolean;
/**
* Compare the given SpecificWeight against the current SpecificWeight.
* @param specificWeight The other SpecificWeight.
* @returns 0 if they are equal, -1 if the current SpecificWeight is less then other, 1 if the current SpecificWeight is greater then other.
*/
compareTo(specificWeight: SpecificWeight): number;
/**
* Add the given SpecificWeight with the current SpecificWeight.
* @param specificWeight The other SpecificWeight.
* @returns A new SpecificWeight instance with the results.
*/
add(specificWeight: SpecificWeight): SpecificWeight;
/**
* Subtract the given SpecificWeight with the current SpecificWeight.
* @param specificWeight The other SpecificWeight.
* @returns A new SpecificWeight instance with the results.
*/
subtract(specificWeight: SpecificWeight): SpecificWeight;
/**
* Multiply the given SpecificWeight with the current SpecificWeight.
* @param specificWeight The other SpecificWeight.
* @returns A new SpecificWeight instance with the results.
*/
multiply(specificWeight: SpecificWeight): SpecificWeight;
/**
* Divide the given SpecificWeight with the current SpecificWeight.
* @param specificWeight The other SpecificWeight.
* @returns A new SpecificWeight instance with the results.
*/
divide(specificWeight: SpecificWeight): SpecificWeight;
/**
* Modulo the given SpecificWeight with the current SpecificWeight.
* @param specificWeight The other SpecificWeight.
* @returns A new SpecificWeight instance with the results.
*/
modulo(specificWeight: SpecificWeight): SpecificWeight;
/**
* Pow the given SpecificWeight with the current SpecificWeight.
* @param specificWeight The other SpecificWeight.
* @returns A new SpecificWeight instance with the results.
*/
pow(specificWeight: SpecificWeight): SpecificWeight;
}