unitsnet-js
Version:
A better way to hold unit variables and easily convert to the destination unit
519 lines (518 loc) • 18.3 kB
TypeScript
import { BaseUnit, ToStringOptions } from "../base-unit";
/** API DTO represents a MassFlow */
export interface MassFlowDto {
/** The value of the MassFlow */
value: number;
/** The specific unit that the MassFlow value is representing */
unit: MassFlowUnits;
}
/** MassFlowUnits enumeration */
export declare enum MassFlowUnits {
/** */
GramsPerSecond = "GramPerSecond",
/** */
GramsPerDay = "GramPerDay",
/** */
GramsPerHour = "GramPerHour",
/** */
KilogramsPerHour = "KilogramPerHour",
/** */
KilogramsPerMinute = "KilogramPerMinute",
/** */
TonnesPerHour = "TonnePerHour",
/** */
PoundsPerDay = "PoundPerDay",
/** */
PoundsPerHour = "PoundPerHour",
/** */
PoundsPerMinute = "PoundPerMinute",
/** */
PoundsPerSecond = "PoundPerSecond",
/** */
TonnesPerDay = "TonnePerDay",
/** */
ShortTonsPerHour = "ShortTonPerHour",
/** */
NanogramsPerSecond = "NanogramPerSecond",
/** */
MicrogramsPerSecond = "MicrogramPerSecond",
/** */
MilligramsPerSecond = "MilligramPerSecond",
/** */
CentigramsPerSecond = "CentigramPerSecond",
/** */
DecigramsPerSecond = "DecigramPerSecond",
/** */
DecagramsPerSecond = "DecagramPerSecond",
/** */
HectogramsPerSecond = "HectogramPerSecond",
/** */
KilogramsPerSecond = "KilogramPerSecond",
/** */
NanogramsPerDay = "NanogramPerDay",
/** */
MicrogramsPerDay = "MicrogramPerDay",
/** */
MilligramsPerDay = "MilligramPerDay",
/** */
CentigramsPerDay = "CentigramPerDay",
/** */
DecigramsPerDay = "DecigramPerDay",
/** */
DecagramsPerDay = "DecagramPerDay",
/** */
HectogramsPerDay = "HectogramPerDay",
/** */
KilogramsPerDay = "KilogramPerDay",
/** */
MegagramsPerDay = "MegagramPerDay",
/** */
MegapoundsPerDay = "MegapoundPerDay",
/** */
MegapoundsPerHour = "MegapoundPerHour",
/** */
MegapoundsPerMinute = "MegapoundPerMinute",
/** */
MegapoundsPerSecond = "MegapoundPerSecond"
}
/** Mass flow is the ratio of the mass change to the time during which the change occurred (value of mass changes per unit time). */
export declare class MassFlow extends BaseUnit {
protected value: number;
private gramspersecondLazy;
private gramsperdayLazy;
private gramsperhourLazy;
private kilogramsperhourLazy;
private kilogramsperminuteLazy;
private tonnesperhourLazy;
private poundsperdayLazy;
private poundsperhourLazy;
private poundsperminuteLazy;
private poundspersecondLazy;
private tonnesperdayLazy;
private shorttonsperhourLazy;
private nanogramspersecondLazy;
private microgramspersecondLazy;
private milligramspersecondLazy;
private centigramspersecondLazy;
private decigramspersecondLazy;
private decagramspersecondLazy;
private hectogramspersecondLazy;
private kilogramspersecondLazy;
private nanogramsperdayLazy;
private microgramsperdayLazy;
private milligramsperdayLazy;
private centigramsperdayLazy;
private decigramsperdayLazy;
private decagramsperdayLazy;
private hectogramsperdayLazy;
private kilogramsperdayLazy;
private megagramsperdayLazy;
private megapoundsperdayLazy;
private megapoundsperhourLazy;
private megapoundsperminuteLazy;
private megapoundspersecondLazy;
/**
* Create a new MassFlow.
* @param value The value.
* @param fromUnit The ‘MassFlow’ unit to create from.
* The default unit is GramsPerSecond
*/
constructor(value: number, fromUnit?: MassFlowUnits);
/**
* The base value of MassFlow is GramsPerSecond.
* 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(): MassFlowUnits.GramsPerSecond;
/** */
get GramsPerSecond(): number;
/** */
get GramsPerDay(): number;
/** */
get GramsPerHour(): number;
/** */
get KilogramsPerHour(): number;
/** */
get KilogramsPerMinute(): number;
/** */
get TonnesPerHour(): number;
/** */
get PoundsPerDay(): number;
/** */
get PoundsPerHour(): number;
/** */
get PoundsPerMinute(): number;
/** */
get PoundsPerSecond(): number;
/** */
get TonnesPerDay(): number;
/** */
get ShortTonsPerHour(): number;
/** */
get NanogramsPerSecond(): number;
/** */
get MicrogramsPerSecond(): number;
/** */
get MilligramsPerSecond(): number;
/** */
get CentigramsPerSecond(): number;
/** */
get DecigramsPerSecond(): number;
/** */
get DecagramsPerSecond(): number;
/** */
get HectogramsPerSecond(): number;
/** */
get KilogramsPerSecond(): number;
/** */
get NanogramsPerDay(): number;
/** */
get MicrogramsPerDay(): number;
/** */
get MilligramsPerDay(): number;
/** */
get CentigramsPerDay(): number;
/** */
get DecigramsPerDay(): number;
/** */
get DecagramsPerDay(): number;
/** */
get HectogramsPerDay(): number;
/** */
get KilogramsPerDay(): number;
/** */
get MegagramsPerDay(): number;
/** */
get MegapoundsPerDay(): number;
/** */
get MegapoundsPerHour(): number;
/** */
get MegapoundsPerMinute(): number;
/** */
get MegapoundsPerSecond(): number;
/**
* Create a new MassFlow instance from a GramsPerSecond
*
* @param value The unit as GramsPerSecond to create a new MassFlow from.
* @returns The new MassFlow instance.
*/
static FromGramsPerSecond(value: number): MassFlow;
/**
* Create a new MassFlow instance from a GramsPerDay
*
* @param value The unit as GramsPerDay to create a new MassFlow from.
* @returns The new MassFlow instance.
*/
static FromGramsPerDay(value: number): MassFlow;
/**
* Create a new MassFlow instance from a GramsPerHour
*
* @param value The unit as GramsPerHour to create a new MassFlow from.
* @returns The new MassFlow instance.
*/
static FromGramsPerHour(value: number): MassFlow;
/**
* Create a new MassFlow instance from a KilogramsPerHour
*
* @param value The unit as KilogramsPerHour to create a new MassFlow from.
* @returns The new MassFlow instance.
*/
static FromKilogramsPerHour(value: number): MassFlow;
/**
* Create a new MassFlow instance from a KilogramsPerMinute
*
* @param value The unit as KilogramsPerMinute to create a new MassFlow from.
* @returns The new MassFlow instance.
*/
static FromKilogramsPerMinute(value: number): MassFlow;
/**
* Create a new MassFlow instance from a TonnesPerHour
*
* @param value The unit as TonnesPerHour to create a new MassFlow from.
* @returns The new MassFlow instance.
*/
static FromTonnesPerHour(value: number): MassFlow;
/**
* Create a new MassFlow instance from a PoundsPerDay
*
* @param value The unit as PoundsPerDay to create a new MassFlow from.
* @returns The new MassFlow instance.
*/
static FromPoundsPerDay(value: number): MassFlow;
/**
* Create a new MassFlow instance from a PoundsPerHour
*
* @param value The unit as PoundsPerHour to create a new MassFlow from.
* @returns The new MassFlow instance.
*/
static FromPoundsPerHour(value: number): MassFlow;
/**
* Create a new MassFlow instance from a PoundsPerMinute
*
* @param value The unit as PoundsPerMinute to create a new MassFlow from.
* @returns The new MassFlow instance.
*/
static FromPoundsPerMinute(value: number): MassFlow;
/**
* Create a new MassFlow instance from a PoundsPerSecond
*
* @param value The unit as PoundsPerSecond to create a new MassFlow from.
* @returns The new MassFlow instance.
*/
static FromPoundsPerSecond(value: number): MassFlow;
/**
* Create a new MassFlow instance from a TonnesPerDay
*
* @param value The unit as TonnesPerDay to create a new MassFlow from.
* @returns The new MassFlow instance.
*/
static FromTonnesPerDay(value: number): MassFlow;
/**
* Create a new MassFlow instance from a ShortTonsPerHour
*
* @param value The unit as ShortTonsPerHour to create a new MassFlow from.
* @returns The new MassFlow instance.
*/
static FromShortTonsPerHour(value: number): MassFlow;
/**
* Create a new MassFlow instance from a NanogramsPerSecond
*
* @param value The unit as NanogramsPerSecond to create a new MassFlow from.
* @returns The new MassFlow instance.
*/
static FromNanogramsPerSecond(value: number): MassFlow;
/**
* Create a new MassFlow instance from a MicrogramsPerSecond
*
* @param value The unit as MicrogramsPerSecond to create a new MassFlow from.
* @returns The new MassFlow instance.
*/
static FromMicrogramsPerSecond(value: number): MassFlow;
/**
* Create a new MassFlow instance from a MilligramsPerSecond
*
* @param value The unit as MilligramsPerSecond to create a new MassFlow from.
* @returns The new MassFlow instance.
*/
static FromMilligramsPerSecond(value: number): MassFlow;
/**
* Create a new MassFlow instance from a CentigramsPerSecond
*
* @param value The unit as CentigramsPerSecond to create a new MassFlow from.
* @returns The new MassFlow instance.
*/
static FromCentigramsPerSecond(value: number): MassFlow;
/**
* Create a new MassFlow instance from a DecigramsPerSecond
*
* @param value The unit as DecigramsPerSecond to create a new MassFlow from.
* @returns The new MassFlow instance.
*/
static FromDecigramsPerSecond(value: number): MassFlow;
/**
* Create a new MassFlow instance from a DecagramsPerSecond
*
* @param value The unit as DecagramsPerSecond to create a new MassFlow from.
* @returns The new MassFlow instance.
*/
static FromDecagramsPerSecond(value: number): MassFlow;
/**
* Create a new MassFlow instance from a HectogramsPerSecond
*
* @param value The unit as HectogramsPerSecond to create a new MassFlow from.
* @returns The new MassFlow instance.
*/
static FromHectogramsPerSecond(value: number): MassFlow;
/**
* Create a new MassFlow instance from a KilogramsPerSecond
*
* @param value The unit as KilogramsPerSecond to create a new MassFlow from.
* @returns The new MassFlow instance.
*/
static FromKilogramsPerSecond(value: number): MassFlow;
/**
* Create a new MassFlow instance from a NanogramsPerDay
*
* @param value The unit as NanogramsPerDay to create a new MassFlow from.
* @returns The new MassFlow instance.
*/
static FromNanogramsPerDay(value: number): MassFlow;
/**
* Create a new MassFlow instance from a MicrogramsPerDay
*
* @param value The unit as MicrogramsPerDay to create a new MassFlow from.
* @returns The new MassFlow instance.
*/
static FromMicrogramsPerDay(value: number): MassFlow;
/**
* Create a new MassFlow instance from a MilligramsPerDay
*
* @param value The unit as MilligramsPerDay to create a new MassFlow from.
* @returns The new MassFlow instance.
*/
static FromMilligramsPerDay(value: number): MassFlow;
/**
* Create a new MassFlow instance from a CentigramsPerDay
*
* @param value The unit as CentigramsPerDay to create a new MassFlow from.
* @returns The new MassFlow instance.
*/
static FromCentigramsPerDay(value: number): MassFlow;
/**
* Create a new MassFlow instance from a DecigramsPerDay
*
* @param value The unit as DecigramsPerDay to create a new MassFlow from.
* @returns The new MassFlow instance.
*/
static FromDecigramsPerDay(value: number): MassFlow;
/**
* Create a new MassFlow instance from a DecagramsPerDay
*
* @param value The unit as DecagramsPerDay to create a new MassFlow from.
* @returns The new MassFlow instance.
*/
static FromDecagramsPerDay(value: number): MassFlow;
/**
* Create a new MassFlow instance from a HectogramsPerDay
*
* @param value The unit as HectogramsPerDay to create a new MassFlow from.
* @returns The new MassFlow instance.
*/
static FromHectogramsPerDay(value: number): MassFlow;
/**
* Create a new MassFlow instance from a KilogramsPerDay
*
* @param value The unit as KilogramsPerDay to create a new MassFlow from.
* @returns The new MassFlow instance.
*/
static FromKilogramsPerDay(value: number): MassFlow;
/**
* Create a new MassFlow instance from a MegagramsPerDay
*
* @param value The unit as MegagramsPerDay to create a new MassFlow from.
* @returns The new MassFlow instance.
*/
static FromMegagramsPerDay(value: number): MassFlow;
/**
* Create a new MassFlow instance from a MegapoundsPerDay
*
* @param value The unit as MegapoundsPerDay to create a new MassFlow from.
* @returns The new MassFlow instance.
*/
static FromMegapoundsPerDay(value: number): MassFlow;
/**
* Create a new MassFlow instance from a MegapoundsPerHour
*
* @param value The unit as MegapoundsPerHour to create a new MassFlow from.
* @returns The new MassFlow instance.
*/
static FromMegapoundsPerHour(value: number): MassFlow;
/**
* Create a new MassFlow instance from a MegapoundsPerMinute
*
* @param value The unit as MegapoundsPerMinute to create a new MassFlow from.
* @returns The new MassFlow instance.
*/
static FromMegapoundsPerMinute(value: number): MassFlow;
/**
* Create a new MassFlow instance from a MegapoundsPerSecond
*
* @param value The unit as MegapoundsPerSecond to create a new MassFlow from.
* @returns The new MassFlow instance.
*/
static FromMegapoundsPerSecond(value: number): MassFlow;
/**
* Gets the base unit enumeration associated with MassFlow
* @returns The unit enumeration that can be used to interact with this type
*/
protected static getUnitEnum(): typeof MassFlowUnits;
/**
* 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(): MassFlowUnits.GramsPerSecond;
/**
* Create API DTO represent a MassFlow unit.
* @param holdInUnit The specific MassFlow unit to be used in the unit representation at the DTO
*/
toDto(holdInUnit?: MassFlowUnits): MassFlowDto;
/**
* Create a MassFlow unit from an API DTO representation.
* @param dtoMassFlow The MassFlow API DTO representation
*/
static FromDto(dtoMassFlow: MassFlowDto): MassFlow;
/**
* Convert MassFlow to a specific unit value.
* @param toUnit The specific unit to convert to
* @returns The value of the specific unit provided.
*/
convert(toUnit: MassFlowUnits): number;
private convertFromBase;
private convertToBase;
/**
* Format the MassFlow to string.
* Note! the default format for MassFlow is GramsPerSecond.
* To specify the unit format set the 'unit' parameter.
* @param unit The unit to format the MassFlow.
* @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 MassFlow.
*/
toString(unit?: MassFlowUnits, options?: number | ToStringOptions): string;
/**
* Get MassFlow unit abbreviation.
* Note! the default abbreviation for MassFlow is GramsPerSecond.
* To specify the unit abbreviation set the 'unitAbbreviation' parameter.
* @param unitAbbreviation The unit abbreviation of the MassFlow.
* @returns The abbreviation string of MassFlow.
*/
getUnitAbbreviation(unitAbbreviation?: MassFlowUnits): string;
/**
* Check if the given MassFlow are equals to the current MassFlow.
* @param massFlow The other MassFlow.
* @returns True if the given MassFlow are equal to the current MassFlow.
*/
equals(massFlow: MassFlow): boolean;
/**
* Compare the given MassFlow against the current MassFlow.
* @param massFlow The other MassFlow.
* @returns 0 if they are equal, -1 if the current MassFlow is less then other, 1 if the current MassFlow is greater then other.
*/
compareTo(massFlow: MassFlow): number;
/**
* Add the given MassFlow with the current MassFlow.
* @param massFlow The other MassFlow.
* @returns A new MassFlow instance with the results.
*/
add(massFlow: MassFlow): MassFlow;
/**
* Subtract the given MassFlow with the current MassFlow.
* @param massFlow The other MassFlow.
* @returns A new MassFlow instance with the results.
*/
subtract(massFlow: MassFlow): MassFlow;
/**
* Multiply the given MassFlow with the current MassFlow.
* @param massFlow The other MassFlow.
* @returns A new MassFlow instance with the results.
*/
multiply(massFlow: MassFlow): MassFlow;
/**
* Divide the given MassFlow with the current MassFlow.
* @param massFlow The other MassFlow.
* @returns A new MassFlow instance with the results.
*/
divide(massFlow: MassFlow): MassFlow;
/**
* Modulo the given MassFlow with the current MassFlow.
* @param massFlow The other MassFlow.
* @returns A new MassFlow instance with the results.
*/
modulo(massFlow: MassFlow): MassFlow;
/**
* Pow the given MassFlow with the current MassFlow.
* @param massFlow The other MassFlow.
* @returns A new MassFlow instance with the results.
*/
pow(massFlow: MassFlow): MassFlow;
}