UNPKG

unitsnet-js

Version:

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

207 lines (206 loc) 8.94 kB
import { BaseUnit, ToStringOptions } from "../base-unit"; /** API DTO represents a Compressibility */ export interface CompressibilityDto { /** The value of the Compressibility */ value: number; /** The specific unit that the Compressibility value is representing */ unit: CompressibilityUnits; } /** CompressibilityUnits enumeration */ export declare enum CompressibilityUnits { /** */ InversePascals = "InversePascal", /** */ InverseKilopascals = "InverseKilopascal", /** */ InverseMegapascals = "InverseMegapascal", /** */ InverseAtmospheres = "InverseAtmosphere", /** */ InverseMillibars = "InverseMillibar", /** */ InverseBars = "InverseBar", /** */ InversePoundsForcePerSquareInch = "InversePoundForcePerSquareInch" } /** Compressibility is the measure of the relative volume change of a fluid or solid in response to pressure changes. */ export declare class Compressibility extends BaseUnit { protected value: number; private inversepascalsLazy; private inversekilopascalsLazy; private inversemegapascalsLazy; private inverseatmospheresLazy; private inversemillibarsLazy; private inversebarsLazy; private inversepoundsforcepersquareinchLazy; /** * Create a new Compressibility. * @param value The value. * @param fromUnit The ‘Compressibility’ unit to create from. * The default unit is InversePascals */ constructor(value: number, fromUnit?: CompressibilityUnits); /** * The base value of Compressibility is InversePascals. * 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(): CompressibilityUnits.InversePascals; /** */ get InversePascals(): number; /** */ get InverseKilopascals(): number; /** */ get InverseMegapascals(): number; /** */ get InverseAtmospheres(): number; /** */ get InverseMillibars(): number; /** */ get InverseBars(): number; /** */ get InversePoundsForcePerSquareInch(): number; /** * Create a new Compressibility instance from a InversePascals * * @param value The unit as InversePascals to create a new Compressibility from. * @returns The new Compressibility instance. */ static FromInversePascals(value: number): Compressibility; /** * Create a new Compressibility instance from a InverseKilopascals * * @param value The unit as InverseKilopascals to create a new Compressibility from. * @returns The new Compressibility instance. */ static FromInverseKilopascals(value: number): Compressibility; /** * Create a new Compressibility instance from a InverseMegapascals * * @param value The unit as InverseMegapascals to create a new Compressibility from. * @returns The new Compressibility instance. */ static FromInverseMegapascals(value: number): Compressibility; /** * Create a new Compressibility instance from a InverseAtmospheres * * @param value The unit as InverseAtmospheres to create a new Compressibility from. * @returns The new Compressibility instance. */ static FromInverseAtmospheres(value: number): Compressibility; /** * Create a new Compressibility instance from a InverseMillibars * * @param value The unit as InverseMillibars to create a new Compressibility from. * @returns The new Compressibility instance. */ static FromInverseMillibars(value: number): Compressibility; /** * Create a new Compressibility instance from a InverseBars * * @param value The unit as InverseBars to create a new Compressibility from. * @returns The new Compressibility instance. */ static FromInverseBars(value: number): Compressibility; /** * Create a new Compressibility instance from a InversePoundsForcePerSquareInch * * @param value The unit as InversePoundsForcePerSquareInch to create a new Compressibility from. * @returns The new Compressibility instance. */ static FromInversePoundsForcePerSquareInch(value: number): Compressibility; /** * Gets the base unit enumeration associated with Compressibility * @returns The unit enumeration that can be used to interact with this type */ protected static getUnitEnum(): typeof CompressibilityUnits; /** * 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(): CompressibilityUnits.InversePascals; /** * Create API DTO represent a Compressibility unit. * @param holdInUnit The specific Compressibility unit to be used in the unit representation at the DTO */ toDto(holdInUnit?: CompressibilityUnits): CompressibilityDto; /** * Create a Compressibility unit from an API DTO representation. * @param dtoCompressibility The Compressibility API DTO representation */ static FromDto(dtoCompressibility: CompressibilityDto): Compressibility; /** * Convert Compressibility to a specific unit value. * @param toUnit The specific unit to convert to * @returns The value of the specific unit provided. */ convert(toUnit: CompressibilityUnits): number; private convertFromBase; private convertToBase; /** * Format the Compressibility to string. * Note! the default format for Compressibility is InversePascals. * To specify the unit format set the 'unit' parameter. * @param unit The unit to format the Compressibility. * @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 Compressibility. */ toString(unit?: CompressibilityUnits, options?: number | ToStringOptions): string; /** * Get Compressibility unit abbreviation. * Note! the default abbreviation for Compressibility is InversePascals. * To specify the unit abbreviation set the 'unitAbbreviation' parameter. * @param unitAbbreviation The unit abbreviation of the Compressibility. * @returns The abbreviation string of Compressibility. */ getUnitAbbreviation(unitAbbreviation?: CompressibilityUnits): string; /** * Check if the given Compressibility are equals to the current Compressibility. * @param compressibility The other Compressibility. * @returns True if the given Compressibility are equal to the current Compressibility. */ equals(compressibility: Compressibility): boolean; /** * Compare the given Compressibility against the current Compressibility. * @param compressibility The other Compressibility. * @returns 0 if they are equal, -1 if the current Compressibility is less then other, 1 if the current Compressibility is greater then other. */ compareTo(compressibility: Compressibility): number; /** * Add the given Compressibility with the current Compressibility. * @param compressibility The other Compressibility. * @returns A new Compressibility instance with the results. */ add(compressibility: Compressibility): Compressibility; /** * Subtract the given Compressibility with the current Compressibility. * @param compressibility The other Compressibility. * @returns A new Compressibility instance with the results. */ subtract(compressibility: Compressibility): Compressibility; /** * Multiply the given Compressibility with the current Compressibility. * @param compressibility The other Compressibility. * @returns A new Compressibility instance with the results. */ multiply(compressibility: Compressibility): Compressibility; /** * Divide the given Compressibility with the current Compressibility. * @param compressibility The other Compressibility. * @returns A new Compressibility instance with the results. */ divide(compressibility: Compressibility): Compressibility; /** * Modulo the given Compressibility with the current Compressibility. * @param compressibility The other Compressibility. * @returns A new Compressibility instance with the results. */ modulo(compressibility: Compressibility): Compressibility; /** * Pow the given Compressibility with the current Compressibility. * @param compressibility The other Compressibility. * @returns A new Compressibility instance with the results. */ pow(compressibility: Compressibility): Compressibility; }