unitsnet-js
Version:
A better way to hold unit variables and easily convert to the destination unit
339 lines (338 loc) • 13.7 kB
TypeScript
import { BaseUnit, ToStringOptions } from "../base-unit";
/** API DTO represents a LinearDensity */
export interface LinearDensityDto {
/** The value of the LinearDensity */
value: number;
/** The specific unit that the LinearDensity value is representing */
unit: LinearDensityUnits;
}
/** LinearDensityUnits enumeration */
export declare enum LinearDensityUnits {
/** */
GramsPerMillimeter = "GramPerMillimeter",
/** */
GramsPerCentimeter = "GramPerCentimeter",
/** */
GramsPerMeter = "GramPerMeter",
/** */
PoundsPerInch = "PoundPerInch",
/** */
PoundsPerFoot = "PoundPerFoot",
/** */
GramsPerFoot = "GramPerFoot",
/** */
MicrogramsPerMillimeter = "MicrogramPerMillimeter",
/** */
MilligramsPerMillimeter = "MilligramPerMillimeter",
/** */
KilogramsPerMillimeter = "KilogramPerMillimeter",
/** */
MicrogramsPerCentimeter = "MicrogramPerCentimeter",
/** */
MilligramsPerCentimeter = "MilligramPerCentimeter",
/** */
KilogramsPerCentimeter = "KilogramPerCentimeter",
/** */
MicrogramsPerMeter = "MicrogramPerMeter",
/** */
MilligramsPerMeter = "MilligramPerMeter",
/** */
KilogramsPerMeter = "KilogramPerMeter",
/** */
MicrogramsPerFoot = "MicrogramPerFoot",
/** */
MilligramsPerFoot = "MilligramPerFoot",
/** */
KilogramsPerFoot = "KilogramPerFoot"
}
/** The Linear Density, or more precisely, the linear mass density, of a substance is its mass per unit length. The term linear density is most often used when describing the characteristics of one-dimensional objects, although linear density can also be used to describe the density of a three-dimensional quantity along one particular dimension. */
export declare class LinearDensity extends BaseUnit {
protected value: number;
private gramspermillimeterLazy;
private gramspercentimeterLazy;
private gramspermeterLazy;
private poundsperinchLazy;
private poundsperfootLazy;
private gramsperfootLazy;
private microgramspermillimeterLazy;
private milligramspermillimeterLazy;
private kilogramspermillimeterLazy;
private microgramspercentimeterLazy;
private milligramspercentimeterLazy;
private kilogramspercentimeterLazy;
private microgramspermeterLazy;
private milligramspermeterLazy;
private kilogramspermeterLazy;
private microgramsperfootLazy;
private milligramsperfootLazy;
private kilogramsperfootLazy;
/**
* Create a new LinearDensity.
* @param value The value.
* @param fromUnit The ‘LinearDensity’ unit to create from.
* The default unit is KilogramsPerMeter
*/
constructor(value: number, fromUnit?: LinearDensityUnits);
/**
* The base value of LinearDensity is KilogramsPerMeter.
* 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(): LinearDensityUnits.KilogramsPerMeter;
/** */
get GramsPerMillimeter(): number;
/** */
get GramsPerCentimeter(): number;
/** */
get GramsPerMeter(): number;
/** */
get PoundsPerInch(): number;
/** */
get PoundsPerFoot(): number;
/** */
get GramsPerFoot(): number;
/** */
get MicrogramsPerMillimeter(): number;
/** */
get MilligramsPerMillimeter(): number;
/** */
get KilogramsPerMillimeter(): number;
/** */
get MicrogramsPerCentimeter(): number;
/** */
get MilligramsPerCentimeter(): number;
/** */
get KilogramsPerCentimeter(): number;
/** */
get MicrogramsPerMeter(): number;
/** */
get MilligramsPerMeter(): number;
/** */
get KilogramsPerMeter(): number;
/** */
get MicrogramsPerFoot(): number;
/** */
get MilligramsPerFoot(): number;
/** */
get KilogramsPerFoot(): number;
/**
* Create a new LinearDensity instance from a GramsPerMillimeter
*
* @param value The unit as GramsPerMillimeter to create a new LinearDensity from.
* @returns The new LinearDensity instance.
*/
static FromGramsPerMillimeter(value: number): LinearDensity;
/**
* Create a new LinearDensity instance from a GramsPerCentimeter
*
* @param value The unit as GramsPerCentimeter to create a new LinearDensity from.
* @returns The new LinearDensity instance.
*/
static FromGramsPerCentimeter(value: number): LinearDensity;
/**
* Create a new LinearDensity instance from a GramsPerMeter
*
* @param value The unit as GramsPerMeter to create a new LinearDensity from.
* @returns The new LinearDensity instance.
*/
static FromGramsPerMeter(value: number): LinearDensity;
/**
* Create a new LinearDensity instance from a PoundsPerInch
*
* @param value The unit as PoundsPerInch to create a new LinearDensity from.
* @returns The new LinearDensity instance.
*/
static FromPoundsPerInch(value: number): LinearDensity;
/**
* Create a new LinearDensity instance from a PoundsPerFoot
*
* @param value The unit as PoundsPerFoot to create a new LinearDensity from.
* @returns The new LinearDensity instance.
*/
static FromPoundsPerFoot(value: number): LinearDensity;
/**
* Create a new LinearDensity instance from a GramsPerFoot
*
* @param value The unit as GramsPerFoot to create a new LinearDensity from.
* @returns The new LinearDensity instance.
*/
static FromGramsPerFoot(value: number): LinearDensity;
/**
* Create a new LinearDensity instance from a MicrogramsPerMillimeter
*
* @param value The unit as MicrogramsPerMillimeter to create a new LinearDensity from.
* @returns The new LinearDensity instance.
*/
static FromMicrogramsPerMillimeter(value: number): LinearDensity;
/**
* Create a new LinearDensity instance from a MilligramsPerMillimeter
*
* @param value The unit as MilligramsPerMillimeter to create a new LinearDensity from.
* @returns The new LinearDensity instance.
*/
static FromMilligramsPerMillimeter(value: number): LinearDensity;
/**
* Create a new LinearDensity instance from a KilogramsPerMillimeter
*
* @param value The unit as KilogramsPerMillimeter to create a new LinearDensity from.
* @returns The new LinearDensity instance.
*/
static FromKilogramsPerMillimeter(value: number): LinearDensity;
/**
* Create a new LinearDensity instance from a MicrogramsPerCentimeter
*
* @param value The unit as MicrogramsPerCentimeter to create a new LinearDensity from.
* @returns The new LinearDensity instance.
*/
static FromMicrogramsPerCentimeter(value: number): LinearDensity;
/**
* Create a new LinearDensity instance from a MilligramsPerCentimeter
*
* @param value The unit as MilligramsPerCentimeter to create a new LinearDensity from.
* @returns The new LinearDensity instance.
*/
static FromMilligramsPerCentimeter(value: number): LinearDensity;
/**
* Create a new LinearDensity instance from a KilogramsPerCentimeter
*
* @param value The unit as KilogramsPerCentimeter to create a new LinearDensity from.
* @returns The new LinearDensity instance.
*/
static FromKilogramsPerCentimeter(value: number): LinearDensity;
/**
* Create a new LinearDensity instance from a MicrogramsPerMeter
*
* @param value The unit as MicrogramsPerMeter to create a new LinearDensity from.
* @returns The new LinearDensity instance.
*/
static FromMicrogramsPerMeter(value: number): LinearDensity;
/**
* Create a new LinearDensity instance from a MilligramsPerMeter
*
* @param value The unit as MilligramsPerMeter to create a new LinearDensity from.
* @returns The new LinearDensity instance.
*/
static FromMilligramsPerMeter(value: number): LinearDensity;
/**
* Create a new LinearDensity instance from a KilogramsPerMeter
*
* @param value The unit as KilogramsPerMeter to create a new LinearDensity from.
* @returns The new LinearDensity instance.
*/
static FromKilogramsPerMeter(value: number): LinearDensity;
/**
* Create a new LinearDensity instance from a MicrogramsPerFoot
*
* @param value The unit as MicrogramsPerFoot to create a new LinearDensity from.
* @returns The new LinearDensity instance.
*/
static FromMicrogramsPerFoot(value: number): LinearDensity;
/**
* Create a new LinearDensity instance from a MilligramsPerFoot
*
* @param value The unit as MilligramsPerFoot to create a new LinearDensity from.
* @returns The new LinearDensity instance.
*/
static FromMilligramsPerFoot(value: number): LinearDensity;
/**
* Create a new LinearDensity instance from a KilogramsPerFoot
*
* @param value The unit as KilogramsPerFoot to create a new LinearDensity from.
* @returns The new LinearDensity instance.
*/
static FromKilogramsPerFoot(value: number): LinearDensity;
/**
* Gets the base unit enumeration associated with LinearDensity
* @returns The unit enumeration that can be used to interact with this type
*/
protected static getUnitEnum(): typeof LinearDensityUnits;
/**
* 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(): LinearDensityUnits.KilogramsPerMeter;
/**
* Create API DTO represent a LinearDensity unit.
* @param holdInUnit The specific LinearDensity unit to be used in the unit representation at the DTO
*/
toDto(holdInUnit?: LinearDensityUnits): LinearDensityDto;
/**
* Create a LinearDensity unit from an API DTO representation.
* @param dtoLinearDensity The LinearDensity API DTO representation
*/
static FromDto(dtoLinearDensity: LinearDensityDto): LinearDensity;
/**
* Convert LinearDensity to a specific unit value.
* @param toUnit The specific unit to convert to
* @returns The value of the specific unit provided.
*/
convert(toUnit: LinearDensityUnits): number;
private convertFromBase;
private convertToBase;
/**
* Format the LinearDensity to string.
* Note! the default format for LinearDensity is KilogramsPerMeter.
* To specify the unit format set the 'unit' parameter.
* @param unit The unit to format the LinearDensity.
* @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 LinearDensity.
*/
toString(unit?: LinearDensityUnits, options?: number | ToStringOptions): string;
/**
* Get LinearDensity unit abbreviation.
* Note! the default abbreviation for LinearDensity is KilogramsPerMeter.
* To specify the unit abbreviation set the 'unitAbbreviation' parameter.
* @param unitAbbreviation The unit abbreviation of the LinearDensity.
* @returns The abbreviation string of LinearDensity.
*/
getUnitAbbreviation(unitAbbreviation?: LinearDensityUnits): string;
/**
* Check if the given LinearDensity are equals to the current LinearDensity.
* @param linearDensity The other LinearDensity.
* @returns True if the given LinearDensity are equal to the current LinearDensity.
*/
equals(linearDensity: LinearDensity): boolean;
/**
* Compare the given LinearDensity against the current LinearDensity.
* @param linearDensity The other LinearDensity.
* @returns 0 if they are equal, -1 if the current LinearDensity is less then other, 1 if the current LinearDensity is greater then other.
*/
compareTo(linearDensity: LinearDensity): number;
/**
* Add the given LinearDensity with the current LinearDensity.
* @param linearDensity The other LinearDensity.
* @returns A new LinearDensity instance with the results.
*/
add(linearDensity: LinearDensity): LinearDensity;
/**
* Subtract the given LinearDensity with the current LinearDensity.
* @param linearDensity The other LinearDensity.
* @returns A new LinearDensity instance with the results.
*/
subtract(linearDensity: LinearDensity): LinearDensity;
/**
* Multiply the given LinearDensity with the current LinearDensity.
* @param linearDensity The other LinearDensity.
* @returns A new LinearDensity instance with the results.
*/
multiply(linearDensity: LinearDensity): LinearDensity;
/**
* Divide the given LinearDensity with the current LinearDensity.
* @param linearDensity The other LinearDensity.
* @returns A new LinearDensity instance with the results.
*/
divide(linearDensity: LinearDensity): LinearDensity;
/**
* Modulo the given LinearDensity with the current LinearDensity.
* @param linearDensity The other LinearDensity.
* @returns A new LinearDensity instance with the results.
*/
modulo(linearDensity: LinearDensity): LinearDensity;
/**
* Pow the given LinearDensity with the current LinearDensity.
* @param linearDensity The other LinearDensity.
* @returns A new LinearDensity instance with the results.
*/
pow(linearDensity: LinearDensity): LinearDensity;
}