UNPKG

unitsnet-js

Version:

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

171 lines (170 loc) 7.38 kB
import { BaseUnit, ToStringOptions } from "../base-unit"; /** API DTO represents a AmplitudeRatio */ export interface AmplitudeRatioDto { /** The value of the AmplitudeRatio */ value: number; /** The specific unit that the AmplitudeRatio value is representing */ unit: AmplitudeRatioUnits; } /** AmplitudeRatioUnits enumeration */ export declare enum AmplitudeRatioUnits { /** */ DecibelVolts = "DecibelVolt", /** */ DecibelMicrovolts = "DecibelMicrovolt", /** */ DecibelMillivolts = "DecibelMillivolt", /** */ DecibelsUnloaded = "DecibelUnloaded" } /** The strength of a signal expressed in decibels (dB) relative to one volt RMS. */ export declare class AmplitudeRatio extends BaseUnit { protected value: number; private decibelvoltsLazy; private decibelmicrovoltsLazy; private decibelmillivoltsLazy; private decibelsunloadedLazy; /** * Create a new AmplitudeRatio. * @param value The value. * @param fromUnit The ‘AmplitudeRatio’ unit to create from. * The default unit is DecibelVolts */ constructor(value: number, fromUnit?: AmplitudeRatioUnits); /** * The base value of AmplitudeRatio is DecibelVolts. * 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(): AmplitudeRatioUnits.DecibelVolts; /** */ get DecibelVolts(): number; /** */ get DecibelMicrovolts(): number; /** */ get DecibelMillivolts(): number; /** */ get DecibelsUnloaded(): number; /** * Create a new AmplitudeRatio instance from a DecibelVolts * * @param value The unit as DecibelVolts to create a new AmplitudeRatio from. * @returns The new AmplitudeRatio instance. */ static FromDecibelVolts(value: number): AmplitudeRatio; /** * Create a new AmplitudeRatio instance from a DecibelMicrovolts * * @param value The unit as DecibelMicrovolts to create a new AmplitudeRatio from. * @returns The new AmplitudeRatio instance. */ static FromDecibelMicrovolts(value: number): AmplitudeRatio; /** * Create a new AmplitudeRatio instance from a DecibelMillivolts * * @param value The unit as DecibelMillivolts to create a new AmplitudeRatio from. * @returns The new AmplitudeRatio instance. */ static FromDecibelMillivolts(value: number): AmplitudeRatio; /** * Create a new AmplitudeRatio instance from a DecibelsUnloaded * * @param value The unit as DecibelsUnloaded to create a new AmplitudeRatio from. * @returns The new AmplitudeRatio instance. */ static FromDecibelsUnloaded(value: number): AmplitudeRatio; /** * Gets the base unit enumeration associated with AmplitudeRatio * @returns The unit enumeration that can be used to interact with this type */ protected static getUnitEnum(): typeof AmplitudeRatioUnits; /** * 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(): AmplitudeRatioUnits.DecibelVolts; /** * Create API DTO represent a AmplitudeRatio unit. * @param holdInUnit The specific AmplitudeRatio unit to be used in the unit representation at the DTO */ toDto(holdInUnit?: AmplitudeRatioUnits): AmplitudeRatioDto; /** * Create a AmplitudeRatio unit from an API DTO representation. * @param dtoAmplitudeRatio The AmplitudeRatio API DTO representation */ static FromDto(dtoAmplitudeRatio: AmplitudeRatioDto): AmplitudeRatio; /** * Convert AmplitudeRatio to a specific unit value. * @param toUnit The specific unit to convert to * @returns The value of the specific unit provided. */ convert(toUnit: AmplitudeRatioUnits): number; private convertFromBase; private convertToBase; /** * Format the AmplitudeRatio to string. * Note! the default format for AmplitudeRatio is DecibelVolts. * To specify the unit format set the 'unit' parameter. * @param unit The unit to format the AmplitudeRatio. * @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 AmplitudeRatio. */ toString(unit?: AmplitudeRatioUnits, options?: number | ToStringOptions): string; /** * Get AmplitudeRatio unit abbreviation. * Note! the default abbreviation for AmplitudeRatio is DecibelVolts. * To specify the unit abbreviation set the 'unitAbbreviation' parameter. * @param unitAbbreviation The unit abbreviation of the AmplitudeRatio. * @returns The abbreviation string of AmplitudeRatio. */ getUnitAbbreviation(unitAbbreviation?: AmplitudeRatioUnits): string; /** * Check if the given AmplitudeRatio are equals to the current AmplitudeRatio. * @param amplitudeRatio The other AmplitudeRatio. * @returns True if the given AmplitudeRatio are equal to the current AmplitudeRatio. */ equals(amplitudeRatio: AmplitudeRatio): boolean; /** * Compare the given AmplitudeRatio against the current AmplitudeRatio. * @param amplitudeRatio The other AmplitudeRatio. * @returns 0 if they are equal, -1 if the current AmplitudeRatio is less then other, 1 if the current AmplitudeRatio is greater then other. */ compareTo(amplitudeRatio: AmplitudeRatio): number; /** * Add the given AmplitudeRatio with the current AmplitudeRatio. * @param amplitudeRatio The other AmplitudeRatio. * @returns A new AmplitudeRatio instance with the results. */ add(amplitudeRatio: AmplitudeRatio): AmplitudeRatio; /** * Subtract the given AmplitudeRatio with the current AmplitudeRatio. * @param amplitudeRatio The other AmplitudeRatio. * @returns A new AmplitudeRatio instance with the results. */ subtract(amplitudeRatio: AmplitudeRatio): AmplitudeRatio; /** * Multiply the given AmplitudeRatio with the current AmplitudeRatio. * @param amplitudeRatio The other AmplitudeRatio. * @returns A new AmplitudeRatio instance with the results. */ multiply(amplitudeRatio: AmplitudeRatio): AmplitudeRatio; /** * Divide the given AmplitudeRatio with the current AmplitudeRatio. * @param amplitudeRatio The other AmplitudeRatio. * @returns A new AmplitudeRatio instance with the results. */ divide(amplitudeRatio: AmplitudeRatio): AmplitudeRatio; /** * Modulo the given AmplitudeRatio with the current AmplitudeRatio. * @param amplitudeRatio The other AmplitudeRatio. * @returns A new AmplitudeRatio instance with the results. */ modulo(amplitudeRatio: AmplitudeRatio): AmplitudeRatio; /** * Pow the given AmplitudeRatio with the current AmplitudeRatio. * @param amplitudeRatio The other AmplitudeRatio. * @returns A new AmplitudeRatio instance with the results. */ pow(amplitudeRatio: AmplitudeRatio): AmplitudeRatio; }