UNPKG

unitsnet-js

Version:

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

147 lines (146 loc) 7.29 kB
import { BaseUnit, ToStringOptions } from "../base-unit"; /** API DTO represents a ThermalResistance */ export interface ThermalResistanceDto { /** The value of the ThermalResistance */ value: number; /** The specific unit that the ThermalResistance value is representing */ unit: ThermalResistanceUnits; } /** ThermalResistanceUnits enumeration */ export declare enum ThermalResistanceUnits { /** */ KelvinsPerWatt = "KelvinPerWatt", /** */ DegreesCelsiusPerWatt = "DegreeCelsiusPerWatt" } /** Thermal resistance (R) measures the opposition to the heat current in a material or system. It is measured in units of kelvins per watt (K/W) and indicates how much temperature difference (in kelvins) is required to transfer a unit of heat current (in watts) through the material or object. It is essential to optimize the building insulation, evaluate the efficiency of electronic devices, and enhance the performance of heat sinks in various applications. */ export declare class ThermalResistance extends BaseUnit { protected value: number; private kelvinsperwattLazy; private degreescelsiusperwattLazy; /** * Create a new ThermalResistance. * @param value The value. * @param fromUnit The ‘ThermalResistance’ unit to create from. * The default unit is KelvinsPerWatt */ constructor(value: number, fromUnit?: ThermalResistanceUnits); /** * The base value of ThermalResistance is KelvinsPerWatt. * 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(): ThermalResistanceUnits.KelvinsPerWatt; /** */ get KelvinsPerWatt(): number; /** */ get DegreesCelsiusPerWatt(): number; /** * Create a new ThermalResistance instance from a KelvinsPerWatt * * @param value The unit as KelvinsPerWatt to create a new ThermalResistance from. * @returns The new ThermalResistance instance. */ static FromKelvinsPerWatt(value: number): ThermalResistance; /** * Create a new ThermalResistance instance from a DegreesCelsiusPerWatt * * @param value The unit as DegreesCelsiusPerWatt to create a new ThermalResistance from. * @returns The new ThermalResistance instance. */ static FromDegreesCelsiusPerWatt(value: number): ThermalResistance; /** * Gets the base unit enumeration associated with ThermalResistance * @returns The unit enumeration that can be used to interact with this type */ protected static getUnitEnum(): typeof ThermalResistanceUnits; /** * 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(): ThermalResistanceUnits.KelvinsPerWatt; /** * Create API DTO represent a ThermalResistance unit. * @param holdInUnit The specific ThermalResistance unit to be used in the unit representation at the DTO */ toDto(holdInUnit?: ThermalResistanceUnits): ThermalResistanceDto; /** * Create a ThermalResistance unit from an API DTO representation. * @param dtoThermalResistance The ThermalResistance API DTO representation */ static FromDto(dtoThermalResistance: ThermalResistanceDto): ThermalResistance; /** * Convert ThermalResistance to a specific unit value. * @param toUnit The specific unit to convert to * @returns The value of the specific unit provided. */ convert(toUnit: ThermalResistanceUnits): number; private convertFromBase; private convertToBase; /** * Format the ThermalResistance to string. * Note! the default format for ThermalResistance is KelvinsPerWatt. * To specify the unit format set the 'unit' parameter. * @param unit The unit to format the ThermalResistance. * @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 ThermalResistance. */ toString(unit?: ThermalResistanceUnits, options?: number | ToStringOptions): string; /** * Get ThermalResistance unit abbreviation. * Note! the default abbreviation for ThermalResistance is KelvinsPerWatt. * To specify the unit abbreviation set the 'unitAbbreviation' parameter. * @param unitAbbreviation The unit abbreviation of the ThermalResistance. * @returns The abbreviation string of ThermalResistance. */ getUnitAbbreviation(unitAbbreviation?: ThermalResistanceUnits): string; /** * Check if the given ThermalResistance are equals to the current ThermalResistance. * @param thermalResistance The other ThermalResistance. * @returns True if the given ThermalResistance are equal to the current ThermalResistance. */ equals(thermalResistance: ThermalResistance): boolean; /** * Compare the given ThermalResistance against the current ThermalResistance. * @param thermalResistance The other ThermalResistance. * @returns 0 if they are equal, -1 if the current ThermalResistance is less then other, 1 if the current ThermalResistance is greater then other. */ compareTo(thermalResistance: ThermalResistance): number; /** * Add the given ThermalResistance with the current ThermalResistance. * @param thermalResistance The other ThermalResistance. * @returns A new ThermalResistance instance with the results. */ add(thermalResistance: ThermalResistance): ThermalResistance; /** * Subtract the given ThermalResistance with the current ThermalResistance. * @param thermalResistance The other ThermalResistance. * @returns A new ThermalResistance instance with the results. */ subtract(thermalResistance: ThermalResistance): ThermalResistance; /** * Multiply the given ThermalResistance with the current ThermalResistance. * @param thermalResistance The other ThermalResistance. * @returns A new ThermalResistance instance with the results. */ multiply(thermalResistance: ThermalResistance): ThermalResistance; /** * Divide the given ThermalResistance with the current ThermalResistance. * @param thermalResistance The other ThermalResistance. * @returns A new ThermalResistance instance with the results. */ divide(thermalResistance: ThermalResistance): ThermalResistance; /** * Modulo the given ThermalResistance with the current ThermalResistance. * @param thermalResistance The other ThermalResistance. * @returns A new ThermalResistance instance with the results. */ modulo(thermalResistance: ThermalResistance): ThermalResistance; /** * Pow the given ThermalResistance with the current ThermalResistance. * @param thermalResistance The other ThermalResistance. * @returns A new ThermalResistance instance with the results. */ pow(thermalResistance: ThermalResistance): ThermalResistance; }