unitsnet-js
Version:
A better way to hold unit variables and easily convert to the destination unit
231 lines (230 loc) • 9.86 kB
TypeScript
import { BaseUnit, ToStringOptions } from "../base-unit";
/** API DTO represents a VolumePerLength */
export interface VolumePerLengthDto {
/** The value of the VolumePerLength */
value: number;
/** The specific unit that the VolumePerLength value is representing */
unit: VolumePerLengthUnits;
}
/** VolumePerLengthUnits enumeration */
export declare enum VolumePerLengthUnits {
/** */
CubicMetersPerMeter = "CubicMeterPerMeter",
/** */
LitersPerMeter = "LiterPerMeter",
/** */
LitersPerKilometer = "LiterPerKilometer",
/** */
LitersPerMillimeter = "LiterPerMillimeter",
/** */
OilBarrelsPerFoot = "OilBarrelPerFoot",
/** */
CubicYardsPerFoot = "CubicYardPerFoot",
/** */
CubicYardsPerUsSurveyFoot = "CubicYardPerUsSurveyFoot",
/** */
UsGallonsPerMile = "UsGallonPerMile",
/** */
ImperialGallonsPerMile = "ImperialGallonPerMile"
}
/** Volume, typically of fluid, that a container can hold within a unit of length. */
export declare class VolumePerLength extends BaseUnit {
protected value: number;
private cubicmeterspermeterLazy;
private literspermeterLazy;
private litersperkilometerLazy;
private literspermillimeterLazy;
private oilbarrelsperfootLazy;
private cubicyardsperfootLazy;
private cubicyardsperussurveyfootLazy;
private usgallonspermileLazy;
private imperialgallonspermileLazy;
/**
* Create a new VolumePerLength.
* @param value The value.
* @param fromUnit The ‘VolumePerLength’ unit to create from.
* The default unit is CubicMetersPerMeter
*/
constructor(value: number, fromUnit?: VolumePerLengthUnits);
/**
* The base value of VolumePerLength is CubicMetersPerMeter.
* 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(): VolumePerLengthUnits.CubicMetersPerMeter;
/** */
get CubicMetersPerMeter(): number;
/** */
get LitersPerMeter(): number;
/** */
get LitersPerKilometer(): number;
/** */
get LitersPerMillimeter(): number;
/** */
get OilBarrelsPerFoot(): number;
/** */
get CubicYardsPerFoot(): number;
/** */
get CubicYardsPerUsSurveyFoot(): number;
/** */
get UsGallonsPerMile(): number;
/** */
get ImperialGallonsPerMile(): number;
/**
* Create a new VolumePerLength instance from a CubicMetersPerMeter
*
* @param value The unit as CubicMetersPerMeter to create a new VolumePerLength from.
* @returns The new VolumePerLength instance.
*/
static FromCubicMetersPerMeter(value: number): VolumePerLength;
/**
* Create a new VolumePerLength instance from a LitersPerMeter
*
* @param value The unit as LitersPerMeter to create a new VolumePerLength from.
* @returns The new VolumePerLength instance.
*/
static FromLitersPerMeter(value: number): VolumePerLength;
/**
* Create a new VolumePerLength instance from a LitersPerKilometer
*
* @param value The unit as LitersPerKilometer to create a new VolumePerLength from.
* @returns The new VolumePerLength instance.
*/
static FromLitersPerKilometer(value: number): VolumePerLength;
/**
* Create a new VolumePerLength instance from a LitersPerMillimeter
*
* @param value The unit as LitersPerMillimeter to create a new VolumePerLength from.
* @returns The new VolumePerLength instance.
*/
static FromLitersPerMillimeter(value: number): VolumePerLength;
/**
* Create a new VolumePerLength instance from a OilBarrelsPerFoot
*
* @param value The unit as OilBarrelsPerFoot to create a new VolumePerLength from.
* @returns The new VolumePerLength instance.
*/
static FromOilBarrelsPerFoot(value: number): VolumePerLength;
/**
* Create a new VolumePerLength instance from a CubicYardsPerFoot
*
* @param value The unit as CubicYardsPerFoot to create a new VolumePerLength from.
* @returns The new VolumePerLength instance.
*/
static FromCubicYardsPerFoot(value: number): VolumePerLength;
/**
* Create a new VolumePerLength instance from a CubicYardsPerUsSurveyFoot
*
* @param value The unit as CubicYardsPerUsSurveyFoot to create a new VolumePerLength from.
* @returns The new VolumePerLength instance.
*/
static FromCubicYardsPerUsSurveyFoot(value: number): VolumePerLength;
/**
* Create a new VolumePerLength instance from a UsGallonsPerMile
*
* @param value The unit as UsGallonsPerMile to create a new VolumePerLength from.
* @returns The new VolumePerLength instance.
*/
static FromUsGallonsPerMile(value: number): VolumePerLength;
/**
* Create a new VolumePerLength instance from a ImperialGallonsPerMile
*
* @param value The unit as ImperialGallonsPerMile to create a new VolumePerLength from.
* @returns The new VolumePerLength instance.
*/
static FromImperialGallonsPerMile(value: number): VolumePerLength;
/**
* Gets the base unit enumeration associated with VolumePerLength
* @returns The unit enumeration that can be used to interact with this type
*/
protected static getUnitEnum(): typeof VolumePerLengthUnits;
/**
* 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(): VolumePerLengthUnits.CubicMetersPerMeter;
/**
* Create API DTO represent a VolumePerLength unit.
* @param holdInUnit The specific VolumePerLength unit to be used in the unit representation at the DTO
*/
toDto(holdInUnit?: VolumePerLengthUnits): VolumePerLengthDto;
/**
* Create a VolumePerLength unit from an API DTO representation.
* @param dtoVolumePerLength The VolumePerLength API DTO representation
*/
static FromDto(dtoVolumePerLength: VolumePerLengthDto): VolumePerLength;
/**
* Convert VolumePerLength to a specific unit value.
* @param toUnit The specific unit to convert to
* @returns The value of the specific unit provided.
*/
convert(toUnit: VolumePerLengthUnits): number;
private convertFromBase;
private convertToBase;
/**
* Format the VolumePerLength to string.
* Note! the default format for VolumePerLength is CubicMetersPerMeter.
* To specify the unit format set the 'unit' parameter.
* @param unit The unit to format the VolumePerLength.
* @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 VolumePerLength.
*/
toString(unit?: VolumePerLengthUnits, options?: number | ToStringOptions): string;
/**
* Get VolumePerLength unit abbreviation.
* Note! the default abbreviation for VolumePerLength is CubicMetersPerMeter.
* To specify the unit abbreviation set the 'unitAbbreviation' parameter.
* @param unitAbbreviation The unit abbreviation of the VolumePerLength.
* @returns The abbreviation string of VolumePerLength.
*/
getUnitAbbreviation(unitAbbreviation?: VolumePerLengthUnits): string;
/**
* Check if the given VolumePerLength are equals to the current VolumePerLength.
* @param volumePerLength The other VolumePerLength.
* @returns True if the given VolumePerLength are equal to the current VolumePerLength.
*/
equals(volumePerLength: VolumePerLength): boolean;
/**
* Compare the given VolumePerLength against the current VolumePerLength.
* @param volumePerLength The other VolumePerLength.
* @returns 0 if they are equal, -1 if the current VolumePerLength is less then other, 1 if the current VolumePerLength is greater then other.
*/
compareTo(volumePerLength: VolumePerLength): number;
/**
* Add the given VolumePerLength with the current VolumePerLength.
* @param volumePerLength The other VolumePerLength.
* @returns A new VolumePerLength instance with the results.
*/
add(volumePerLength: VolumePerLength): VolumePerLength;
/**
* Subtract the given VolumePerLength with the current VolumePerLength.
* @param volumePerLength The other VolumePerLength.
* @returns A new VolumePerLength instance with the results.
*/
subtract(volumePerLength: VolumePerLength): VolumePerLength;
/**
* Multiply the given VolumePerLength with the current VolumePerLength.
* @param volumePerLength The other VolumePerLength.
* @returns A new VolumePerLength instance with the results.
*/
multiply(volumePerLength: VolumePerLength): VolumePerLength;
/**
* Divide the given VolumePerLength with the current VolumePerLength.
* @param volumePerLength The other VolumePerLength.
* @returns A new VolumePerLength instance with the results.
*/
divide(volumePerLength: VolumePerLength): VolumePerLength;
/**
* Modulo the given VolumePerLength with the current VolumePerLength.
* @param volumePerLength The other VolumePerLength.
* @returns A new VolumePerLength instance with the results.
*/
modulo(volumePerLength: VolumePerLength): VolumePerLength;
/**
* Pow the given VolumePerLength with the current VolumePerLength.
* @param volumePerLength The other VolumePerLength.
* @returns A new VolumePerLength instance with the results.
*/
pow(volumePerLength: VolumePerLength): VolumePerLength;
}