UNPKG

unitsnet-js

Version:

A better way to hold unit variables and easily convert to the destination unit

159 lines (158 loc) 7.26 kB
import { BaseUnit, ToStringOptions } from "../base-unit"; /** API DTO represents a SpecificVolume */ export interface SpecificVolumeDto { /** The value of the SpecificVolume */ value: number; /** The specific unit that the SpecificVolume value is representing */ unit: SpecificVolumeUnits; } /** SpecificVolumeUnits enumeration */ export declare enum SpecificVolumeUnits { /** */ CubicMetersPerKilogram = "CubicMeterPerKilogram", /** */ CubicFeetPerPound = "CubicFootPerPound", /** */ MillicubicMetersPerKilogram = "MillicubicMeterPerKilogram" } /** In thermodynamics, the specific volume of a substance is the ratio of the substance's volume to its mass. It is the reciprocal of density and an intrinsic property of matter as well. */ export declare class SpecificVolume extends BaseUnit { protected value: number; private cubicmetersperkilogramLazy; private cubicfeetperpoundLazy; private millicubicmetersperkilogramLazy; /** * Create a new SpecificVolume. * @param value The value. * @param fromUnit The ‘SpecificVolume’ unit to create from. * The default unit is CubicMetersPerKilogram */ constructor(value: number, fromUnit?: SpecificVolumeUnits); /** * The base value of SpecificVolume is CubicMetersPerKilogram. * 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(): SpecificVolumeUnits.CubicMetersPerKilogram; /** */ get CubicMetersPerKilogram(): number; /** */ get CubicFeetPerPound(): number; /** */ get MillicubicMetersPerKilogram(): number; /** * Create a new SpecificVolume instance from a CubicMetersPerKilogram * * @param value The unit as CubicMetersPerKilogram to create a new SpecificVolume from. * @returns The new SpecificVolume instance. */ static FromCubicMetersPerKilogram(value: number): SpecificVolume; /** * Create a new SpecificVolume instance from a CubicFeetPerPound * * @param value The unit as CubicFeetPerPound to create a new SpecificVolume from. * @returns The new SpecificVolume instance. */ static FromCubicFeetPerPound(value: number): SpecificVolume; /** * Create a new SpecificVolume instance from a MillicubicMetersPerKilogram * * @param value The unit as MillicubicMetersPerKilogram to create a new SpecificVolume from. * @returns The new SpecificVolume instance. */ static FromMillicubicMetersPerKilogram(value: number): SpecificVolume; /** * Gets the base unit enumeration associated with SpecificVolume * @returns The unit enumeration that can be used to interact with this type */ protected static getUnitEnum(): typeof SpecificVolumeUnits; /** * 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(): SpecificVolumeUnits.CubicMetersPerKilogram; /** * Create API DTO represent a SpecificVolume unit. * @param holdInUnit The specific SpecificVolume unit to be used in the unit representation at the DTO */ toDto(holdInUnit?: SpecificVolumeUnits): SpecificVolumeDto; /** * Create a SpecificVolume unit from an API DTO representation. * @param dtoSpecificVolume The SpecificVolume API DTO representation */ static FromDto(dtoSpecificVolume: SpecificVolumeDto): SpecificVolume; /** * Convert SpecificVolume to a specific unit value. * @param toUnit The specific unit to convert to * @returns The value of the specific unit provided. */ convert(toUnit: SpecificVolumeUnits): number; private convertFromBase; private convertToBase; /** * Format the SpecificVolume to string. * Note! the default format for SpecificVolume is CubicMetersPerKilogram. * To specify the unit format set the 'unit' parameter. * @param unit The unit to format the SpecificVolume. * @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 SpecificVolume. */ toString(unit?: SpecificVolumeUnits, options?: number | ToStringOptions): string; /** * Get SpecificVolume unit abbreviation. * Note! the default abbreviation for SpecificVolume is CubicMetersPerKilogram. * To specify the unit abbreviation set the 'unitAbbreviation' parameter. * @param unitAbbreviation The unit abbreviation of the SpecificVolume. * @returns The abbreviation string of SpecificVolume. */ getUnitAbbreviation(unitAbbreviation?: SpecificVolumeUnits): string; /** * Check if the given SpecificVolume are equals to the current SpecificVolume. * @param specificVolume The other SpecificVolume. * @returns True if the given SpecificVolume are equal to the current SpecificVolume. */ equals(specificVolume: SpecificVolume): boolean; /** * Compare the given SpecificVolume against the current SpecificVolume. * @param specificVolume The other SpecificVolume. * @returns 0 if they are equal, -1 if the current SpecificVolume is less then other, 1 if the current SpecificVolume is greater then other. */ compareTo(specificVolume: SpecificVolume): number; /** * Add the given SpecificVolume with the current SpecificVolume. * @param specificVolume The other SpecificVolume. * @returns A new SpecificVolume instance with the results. */ add(specificVolume: SpecificVolume): SpecificVolume; /** * Subtract the given SpecificVolume with the current SpecificVolume. * @param specificVolume The other SpecificVolume. * @returns A new SpecificVolume instance with the results. */ subtract(specificVolume: SpecificVolume): SpecificVolume; /** * Multiply the given SpecificVolume with the current SpecificVolume. * @param specificVolume The other SpecificVolume. * @returns A new SpecificVolume instance with the results. */ multiply(specificVolume: SpecificVolume): SpecificVolume; /** * Divide the given SpecificVolume with the current SpecificVolume. * @param specificVolume The other SpecificVolume. * @returns A new SpecificVolume instance with the results. */ divide(specificVolume: SpecificVolume): SpecificVolume; /** * Modulo the given SpecificVolume with the current SpecificVolume. * @param specificVolume The other SpecificVolume. * @returns A new SpecificVolume instance with the results. */ modulo(specificVolume: SpecificVolume): SpecificVolume; /** * Pow the given SpecificVolume with the current SpecificVolume. * @param specificVolume The other SpecificVolume. * @returns A new SpecificVolume instance with the results. */ pow(specificVolume: SpecificVolume): SpecificVolume; }