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