UNPKG

unitsnet-js

Version:

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

183 lines (182 loc) 8.2 kB
import { BaseUnit, ToStringOptions } from "../base-unit"; /** API DTO represents a ElectricPotentialAc */ export interface ElectricPotentialAcDto { /** The value of the ElectricPotentialAc */ value: number; /** The specific unit that the ElectricPotentialAc value is representing */ unit: ElectricPotentialAcUnits; } /** ElectricPotentialAcUnits enumeration */ export declare enum ElectricPotentialAcUnits { /** */ VoltsAc = "VoltAc", /** */ MicrovoltsAc = "MicrovoltAc", /** */ MillivoltsAc = "MillivoltAc", /** */ KilovoltsAc = "KilovoltAc", /** */ MegavoltsAc = "MegavoltAc" } /** The Electric Potential of a system known to use Alternating Current. */ export declare class ElectricPotentialAc extends BaseUnit { protected value: number; private voltsacLazy; private microvoltsacLazy; private millivoltsacLazy; private kilovoltsacLazy; private megavoltsacLazy; /** * Create a new ElectricPotentialAc. * @param value The value. * @param fromUnit The ‘ElectricPotentialAc’ unit to create from. * The default unit is VoltsAc */ constructor(value: number, fromUnit?: ElectricPotentialAcUnits); /** * The base value of ElectricPotentialAc is VoltsAc. * 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(): ElectricPotentialAcUnits.VoltsAc; /** */ get VoltsAc(): number; /** */ get MicrovoltsAc(): number; /** */ get MillivoltsAc(): number; /** */ get KilovoltsAc(): number; /** */ get MegavoltsAc(): number; /** * Create a new ElectricPotentialAc instance from a VoltsAc * * @param value The unit as VoltsAc to create a new ElectricPotentialAc from. * @returns The new ElectricPotentialAc instance. */ static FromVoltsAc(value: number): ElectricPotentialAc; /** * Create a new ElectricPotentialAc instance from a MicrovoltsAc * * @param value The unit as MicrovoltsAc to create a new ElectricPotentialAc from. * @returns The new ElectricPotentialAc instance. */ static FromMicrovoltsAc(value: number): ElectricPotentialAc; /** * Create a new ElectricPotentialAc instance from a MillivoltsAc * * @param value The unit as MillivoltsAc to create a new ElectricPotentialAc from. * @returns The new ElectricPotentialAc instance. */ static FromMillivoltsAc(value: number): ElectricPotentialAc; /** * Create a new ElectricPotentialAc instance from a KilovoltsAc * * @param value The unit as KilovoltsAc to create a new ElectricPotentialAc from. * @returns The new ElectricPotentialAc instance. */ static FromKilovoltsAc(value: number): ElectricPotentialAc; /** * Create a new ElectricPotentialAc instance from a MegavoltsAc * * @param value The unit as MegavoltsAc to create a new ElectricPotentialAc from. * @returns The new ElectricPotentialAc instance. */ static FromMegavoltsAc(value: number): ElectricPotentialAc; /** * Gets the base unit enumeration associated with ElectricPotentialAc * @returns The unit enumeration that can be used to interact with this type */ protected static getUnitEnum(): typeof ElectricPotentialAcUnits; /** * 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(): ElectricPotentialAcUnits.VoltsAc; /** * Create API DTO represent a ElectricPotentialAc unit. * @param holdInUnit The specific ElectricPotentialAc unit to be used in the unit representation at the DTO */ toDto(holdInUnit?: ElectricPotentialAcUnits): ElectricPotentialAcDto; /** * Create a ElectricPotentialAc unit from an API DTO representation. * @param dtoElectricPotentialAc The ElectricPotentialAc API DTO representation */ static FromDto(dtoElectricPotentialAc: ElectricPotentialAcDto): ElectricPotentialAc; /** * Convert ElectricPotentialAc to a specific unit value. * @param toUnit The specific unit to convert to * @returns The value of the specific unit provided. */ convert(toUnit: ElectricPotentialAcUnits): number; private convertFromBase; private convertToBase; /** * Format the ElectricPotentialAc to string. * Note! the default format for ElectricPotentialAc is VoltsAc. * To specify the unit format set the 'unit' parameter. * @param unit The unit to format the ElectricPotentialAc. * @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 ElectricPotentialAc. */ toString(unit?: ElectricPotentialAcUnits, options?: number | ToStringOptions): string; /** * Get ElectricPotentialAc unit abbreviation. * Note! the default abbreviation for ElectricPotentialAc is VoltsAc. * To specify the unit abbreviation set the 'unitAbbreviation' parameter. * @param unitAbbreviation The unit abbreviation of the ElectricPotentialAc. * @returns The abbreviation string of ElectricPotentialAc. */ getUnitAbbreviation(unitAbbreviation?: ElectricPotentialAcUnits): string; /** * Check if the given ElectricPotentialAc are equals to the current ElectricPotentialAc. * @param electricPotentialAc The other ElectricPotentialAc. * @returns True if the given ElectricPotentialAc are equal to the current ElectricPotentialAc. */ equals(electricPotentialAc: ElectricPotentialAc): boolean; /** * Compare the given ElectricPotentialAc against the current ElectricPotentialAc. * @param electricPotentialAc The other ElectricPotentialAc. * @returns 0 if they are equal, -1 if the current ElectricPotentialAc is less then other, 1 if the current ElectricPotentialAc is greater then other. */ compareTo(electricPotentialAc: ElectricPotentialAc): number; /** * Add the given ElectricPotentialAc with the current ElectricPotentialAc. * @param electricPotentialAc The other ElectricPotentialAc. * @returns A new ElectricPotentialAc instance with the results. */ add(electricPotentialAc: ElectricPotentialAc): ElectricPotentialAc; /** * Subtract the given ElectricPotentialAc with the current ElectricPotentialAc. * @param electricPotentialAc The other ElectricPotentialAc. * @returns A new ElectricPotentialAc instance with the results. */ subtract(electricPotentialAc: ElectricPotentialAc): ElectricPotentialAc; /** * Multiply the given ElectricPotentialAc with the current ElectricPotentialAc. * @param electricPotentialAc The other ElectricPotentialAc. * @returns A new ElectricPotentialAc instance with the results. */ multiply(electricPotentialAc: ElectricPotentialAc): ElectricPotentialAc; /** * Divide the given ElectricPotentialAc with the current ElectricPotentialAc. * @param electricPotentialAc The other ElectricPotentialAc. * @returns A new ElectricPotentialAc instance with the results. */ divide(electricPotentialAc: ElectricPotentialAc): ElectricPotentialAc; /** * Modulo the given ElectricPotentialAc with the current ElectricPotentialAc. * @param electricPotentialAc The other ElectricPotentialAc. * @returns A new ElectricPotentialAc instance with the results. */ modulo(electricPotentialAc: ElectricPotentialAc): ElectricPotentialAc; /** * Pow the given ElectricPotentialAc with the current ElectricPotentialAc. * @param electricPotentialAc The other ElectricPotentialAc. * @returns A new ElectricPotentialAc instance with the results. */ pow(electricPotentialAc: ElectricPotentialAc): ElectricPotentialAc; }