unitsnet-js
Version:
A better way to hold unit variables and easily convert to the destination unit
159 lines (158 loc) • 6.66 kB
TypeScript
import { BaseUnit, ToStringOptions } from "../base-unit";
/** API DTO represents a LeakRate */
export interface LeakRateDto {
/** The value of the LeakRate */
value: number;
/** The specific unit that the LeakRate value is representing */
unit: LeakRateUnits;
}
/** LeakRateUnits enumeration */
export declare enum LeakRateUnits {
/** */
PascalCubicMetersPerSecond = "PascalCubicMeterPerSecond",
/** */
MillibarLitersPerSecond = "MillibarLiterPerSecond",
/** */
TorrLitersPerSecond = "TorrLiterPerSecond"
}
/** A leakage rate of QL = 1 Pa-m³/s is given when the pressure in a closed, evacuated container with a volume of 1 m³ rises by 1 Pa per second or when the pressure in the container drops by 1 Pa in the event of overpressure. */
export declare class LeakRate extends BaseUnit {
protected value: number;
private pascalcubicmeterspersecondLazy;
private millibarliterspersecondLazy;
private torrliterspersecondLazy;
/**
* Create a new LeakRate.
* @param value The value.
* @param fromUnit The ‘LeakRate’ unit to create from.
* The default unit is PascalCubicMetersPerSecond
*/
constructor(value: number, fromUnit?: LeakRateUnits);
/**
* The base value of LeakRate is PascalCubicMetersPerSecond.
* 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(): LeakRateUnits.PascalCubicMetersPerSecond;
/** */
get PascalCubicMetersPerSecond(): number;
/** */
get MillibarLitersPerSecond(): number;
/** */
get TorrLitersPerSecond(): number;
/**
* Create a new LeakRate instance from a PascalCubicMetersPerSecond
*
* @param value The unit as PascalCubicMetersPerSecond to create a new LeakRate from.
* @returns The new LeakRate instance.
*/
static FromPascalCubicMetersPerSecond(value: number): LeakRate;
/**
* Create a new LeakRate instance from a MillibarLitersPerSecond
*
* @param value The unit as MillibarLitersPerSecond to create a new LeakRate from.
* @returns The new LeakRate instance.
*/
static FromMillibarLitersPerSecond(value: number): LeakRate;
/**
* Create a new LeakRate instance from a TorrLitersPerSecond
*
* @param value The unit as TorrLitersPerSecond to create a new LeakRate from.
* @returns The new LeakRate instance.
*/
static FromTorrLitersPerSecond(value: number): LeakRate;
/**
* Gets the base unit enumeration associated with LeakRate
* @returns The unit enumeration that can be used to interact with this type
*/
protected static getUnitEnum(): typeof LeakRateUnits;
/**
* 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(): LeakRateUnits.PascalCubicMetersPerSecond;
/**
* Create API DTO represent a LeakRate unit.
* @param holdInUnit The specific LeakRate unit to be used in the unit representation at the DTO
*/
toDto(holdInUnit?: LeakRateUnits): LeakRateDto;
/**
* Create a LeakRate unit from an API DTO representation.
* @param dtoLeakRate The LeakRate API DTO representation
*/
static FromDto(dtoLeakRate: LeakRateDto): LeakRate;
/**
* Convert LeakRate to a specific unit value.
* @param toUnit The specific unit to convert to
* @returns The value of the specific unit provided.
*/
convert(toUnit: LeakRateUnits): number;
private convertFromBase;
private convertToBase;
/**
* Format the LeakRate to string.
* Note! the default format for LeakRate is PascalCubicMetersPerSecond.
* To specify the unit format set the 'unit' parameter.
* @param unit The unit to format the LeakRate.
* @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 LeakRate.
*/
toString(unit?: LeakRateUnits, options?: number | ToStringOptions): string;
/**
* Get LeakRate unit abbreviation.
* Note! the default abbreviation for LeakRate is PascalCubicMetersPerSecond.
* To specify the unit abbreviation set the 'unitAbbreviation' parameter.
* @param unitAbbreviation The unit abbreviation of the LeakRate.
* @returns The abbreviation string of LeakRate.
*/
getUnitAbbreviation(unitAbbreviation?: LeakRateUnits): string;
/**
* Check if the given LeakRate are equals to the current LeakRate.
* @param leakRate The other LeakRate.
* @returns True if the given LeakRate are equal to the current LeakRate.
*/
equals(leakRate: LeakRate): boolean;
/**
* Compare the given LeakRate against the current LeakRate.
* @param leakRate The other LeakRate.
* @returns 0 if they are equal, -1 if the current LeakRate is less then other, 1 if the current LeakRate is greater then other.
*/
compareTo(leakRate: LeakRate): number;
/**
* Add the given LeakRate with the current LeakRate.
* @param leakRate The other LeakRate.
* @returns A new LeakRate instance with the results.
*/
add(leakRate: LeakRate): LeakRate;
/**
* Subtract the given LeakRate with the current LeakRate.
* @param leakRate The other LeakRate.
* @returns A new LeakRate instance with the results.
*/
subtract(leakRate: LeakRate): LeakRate;
/**
* Multiply the given LeakRate with the current LeakRate.
* @param leakRate The other LeakRate.
* @returns A new LeakRate instance with the results.
*/
multiply(leakRate: LeakRate): LeakRate;
/**
* Divide the given LeakRate with the current LeakRate.
* @param leakRate The other LeakRate.
* @returns A new LeakRate instance with the results.
*/
divide(leakRate: LeakRate): LeakRate;
/**
* Modulo the given LeakRate with the current LeakRate.
* @param leakRate The other LeakRate.
* @returns A new LeakRate instance with the results.
*/
modulo(leakRate: LeakRate): LeakRate;
/**
* Pow the given LeakRate with the current LeakRate.
* @param leakRate The other LeakRate.
* @returns A new LeakRate instance with the results.
*/
pow(leakRate: LeakRate): LeakRate;
}