unitsnet-js
Version:
A better way to hold unit variables and easily convert to the destination unit
135 lines (134 loc) • 6.3 kB
TypeScript
import { BaseUnit, ToStringOptions } from "../base-unit";
/** API DTO represents a RelativeHumidity */
export interface RelativeHumidityDto {
/** The value of the RelativeHumidity */
value: number;
/** The specific unit that the RelativeHumidity value is representing */
unit: RelativeHumidityUnits;
}
/** RelativeHumidityUnits enumeration */
export declare enum RelativeHumidityUnits {
/** */
Percent = "Percent"
}
/** Relative humidity is a ratio of the actual water vapor present in the air to the maximum water vapor in the air at the given temperature. */
export declare class RelativeHumidity extends BaseUnit {
protected value: number;
private percentLazy;
/**
* Create a new RelativeHumidity.
* @param value The value.
* @param fromUnit The ‘RelativeHumidity’ unit to create from.
* The default unit is Percent
*/
constructor(value: number, fromUnit?: RelativeHumidityUnits);
/**
* The base value of RelativeHumidity is Percent.
* 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(): RelativeHumidityUnits.Percent;
/** */
get Percent(): number;
/**
* Create a new RelativeHumidity instance from a Percent
*
* @param value The unit as Percent to create a new RelativeHumidity from.
* @returns The new RelativeHumidity instance.
*/
static FromPercent(value: number): RelativeHumidity;
/**
* Gets the base unit enumeration associated with RelativeHumidity
* @returns The unit enumeration that can be used to interact with this type
*/
protected static getUnitEnum(): typeof RelativeHumidityUnits;
/**
* 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(): RelativeHumidityUnits.Percent;
/**
* Create API DTO represent a RelativeHumidity unit.
* @param holdInUnit The specific RelativeHumidity unit to be used in the unit representation at the DTO
*/
toDto(holdInUnit?: RelativeHumidityUnits): RelativeHumidityDto;
/**
* Create a RelativeHumidity unit from an API DTO representation.
* @param dtoRelativeHumidity The RelativeHumidity API DTO representation
*/
static FromDto(dtoRelativeHumidity: RelativeHumidityDto): RelativeHumidity;
/**
* Convert RelativeHumidity to a specific unit value.
* @param toUnit The specific unit to convert to
* @returns The value of the specific unit provided.
*/
convert(toUnit: RelativeHumidityUnits): number;
private convertFromBase;
private convertToBase;
/**
* Format the RelativeHumidity to string.
* Note! the default format for RelativeHumidity is Percent.
* To specify the unit format set the 'unit' parameter.
* @param unit The unit to format the RelativeHumidity.
* @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 RelativeHumidity.
*/
toString(unit?: RelativeHumidityUnits, options?: number | ToStringOptions): string;
/**
* Get RelativeHumidity unit abbreviation.
* Note! the default abbreviation for RelativeHumidity is Percent.
* To specify the unit abbreviation set the 'unitAbbreviation' parameter.
* @param unitAbbreviation The unit abbreviation of the RelativeHumidity.
* @returns The abbreviation string of RelativeHumidity.
*/
getUnitAbbreviation(unitAbbreviation?: RelativeHumidityUnits): string;
/**
* Check if the given RelativeHumidity are equals to the current RelativeHumidity.
* @param relativeHumidity The other RelativeHumidity.
* @returns True if the given RelativeHumidity are equal to the current RelativeHumidity.
*/
equals(relativeHumidity: RelativeHumidity): boolean;
/**
* Compare the given RelativeHumidity against the current RelativeHumidity.
* @param relativeHumidity The other RelativeHumidity.
* @returns 0 if they are equal, -1 if the current RelativeHumidity is less then other, 1 if the current RelativeHumidity is greater then other.
*/
compareTo(relativeHumidity: RelativeHumidity): number;
/**
* Add the given RelativeHumidity with the current RelativeHumidity.
* @param relativeHumidity The other RelativeHumidity.
* @returns A new RelativeHumidity instance with the results.
*/
add(relativeHumidity: RelativeHumidity): RelativeHumidity;
/**
* Subtract the given RelativeHumidity with the current RelativeHumidity.
* @param relativeHumidity The other RelativeHumidity.
* @returns A new RelativeHumidity instance with the results.
*/
subtract(relativeHumidity: RelativeHumidity): RelativeHumidity;
/**
* Multiply the given RelativeHumidity with the current RelativeHumidity.
* @param relativeHumidity The other RelativeHumidity.
* @returns A new RelativeHumidity instance with the results.
*/
multiply(relativeHumidity: RelativeHumidity): RelativeHumidity;
/**
* Divide the given RelativeHumidity with the current RelativeHumidity.
* @param relativeHumidity The other RelativeHumidity.
* @returns A new RelativeHumidity instance with the results.
*/
divide(relativeHumidity: RelativeHumidity): RelativeHumidity;
/**
* Modulo the given RelativeHumidity with the current RelativeHumidity.
* @param relativeHumidity The other RelativeHumidity.
* @returns A new RelativeHumidity instance with the results.
*/
modulo(relativeHumidity: RelativeHumidity): RelativeHumidity;
/**
* Pow the given RelativeHumidity with the current RelativeHumidity.
* @param relativeHumidity The other RelativeHumidity.
* @returns A new RelativeHumidity instance with the results.
*/
pow(relativeHumidity: RelativeHumidity): RelativeHumidity;
}