UNPKG

unitsnet-js

Version:

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

195 lines (194 loc) 8.16 kB
import { BaseUnit, ToStringOptions } from "../base-unit"; /** API DTO represents a ApparentPower */ export interface ApparentPowerDto { /** The value of the ApparentPower */ value: number; /** The specific unit that the ApparentPower value is representing */ unit: ApparentPowerUnits; } /** ApparentPowerUnits enumeration */ export declare enum ApparentPowerUnits { /** */ Voltamperes = "Voltampere", /** */ Microvoltamperes = "Microvoltampere", /** */ Millivoltamperes = "Millivoltampere", /** */ Kilovoltamperes = "Kilovoltampere", /** */ Megavoltamperes = "Megavoltampere", /** */ Gigavoltamperes = "Gigavoltampere" } /** Power engineers measure apparent power as the magnitude of the vector sum of active and reactive power. Apparent power is the product of the root-mean-square of voltage and current. */ export declare class ApparentPower extends BaseUnit { protected value: number; private voltamperesLazy; private microvoltamperesLazy; private millivoltamperesLazy; private kilovoltamperesLazy; private megavoltamperesLazy; private gigavoltamperesLazy; /** * Create a new ApparentPower. * @param value The value. * @param fromUnit The ‘ApparentPower’ unit to create from. * The default unit is Voltamperes */ constructor(value: number, fromUnit?: ApparentPowerUnits); /** * The base value of ApparentPower is Voltamperes. * 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(): ApparentPowerUnits.Voltamperes; /** */ get Voltamperes(): number; /** */ get Microvoltamperes(): number; /** */ get Millivoltamperes(): number; /** */ get Kilovoltamperes(): number; /** */ get Megavoltamperes(): number; /** */ get Gigavoltamperes(): number; /** * Create a new ApparentPower instance from a Voltamperes * * @param value The unit as Voltamperes to create a new ApparentPower from. * @returns The new ApparentPower instance. */ static FromVoltamperes(value: number): ApparentPower; /** * Create a new ApparentPower instance from a Microvoltamperes * * @param value The unit as Microvoltamperes to create a new ApparentPower from. * @returns The new ApparentPower instance. */ static FromMicrovoltamperes(value: number): ApparentPower; /** * Create a new ApparentPower instance from a Millivoltamperes * * @param value The unit as Millivoltamperes to create a new ApparentPower from. * @returns The new ApparentPower instance. */ static FromMillivoltamperes(value: number): ApparentPower; /** * Create a new ApparentPower instance from a Kilovoltamperes * * @param value The unit as Kilovoltamperes to create a new ApparentPower from. * @returns The new ApparentPower instance. */ static FromKilovoltamperes(value: number): ApparentPower; /** * Create a new ApparentPower instance from a Megavoltamperes * * @param value The unit as Megavoltamperes to create a new ApparentPower from. * @returns The new ApparentPower instance. */ static FromMegavoltamperes(value: number): ApparentPower; /** * Create a new ApparentPower instance from a Gigavoltamperes * * @param value The unit as Gigavoltamperes to create a new ApparentPower from. * @returns The new ApparentPower instance. */ static FromGigavoltamperes(value: number): ApparentPower; /** * Gets the base unit enumeration associated with ApparentPower * @returns The unit enumeration that can be used to interact with this type */ protected static getUnitEnum(): typeof ApparentPowerUnits; /** * 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(): ApparentPowerUnits.Voltamperes; /** * Create API DTO represent a ApparentPower unit. * @param holdInUnit The specific ApparentPower unit to be used in the unit representation at the DTO */ toDto(holdInUnit?: ApparentPowerUnits): ApparentPowerDto; /** * Create a ApparentPower unit from an API DTO representation. * @param dtoApparentPower The ApparentPower API DTO representation */ static FromDto(dtoApparentPower: ApparentPowerDto): ApparentPower; /** * Convert ApparentPower to a specific unit value. * @param toUnit The specific unit to convert to * @returns The value of the specific unit provided. */ convert(toUnit: ApparentPowerUnits): number; private convertFromBase; private convertToBase; /** * Format the ApparentPower to string. * Note! the default format for ApparentPower is Voltamperes. * To specify the unit format set the 'unit' parameter. * @param unit The unit to format the ApparentPower. * @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 ApparentPower. */ toString(unit?: ApparentPowerUnits, options?: number | ToStringOptions): string; /** * Get ApparentPower unit abbreviation. * Note! the default abbreviation for ApparentPower is Voltamperes. * To specify the unit abbreviation set the 'unitAbbreviation' parameter. * @param unitAbbreviation The unit abbreviation of the ApparentPower. * @returns The abbreviation string of ApparentPower. */ getUnitAbbreviation(unitAbbreviation?: ApparentPowerUnits): string; /** * Check if the given ApparentPower are equals to the current ApparentPower. * @param apparentPower The other ApparentPower. * @returns True if the given ApparentPower are equal to the current ApparentPower. */ equals(apparentPower: ApparentPower): boolean; /** * Compare the given ApparentPower against the current ApparentPower. * @param apparentPower The other ApparentPower. * @returns 0 if they are equal, -1 if the current ApparentPower is less then other, 1 if the current ApparentPower is greater then other. */ compareTo(apparentPower: ApparentPower): number; /** * Add the given ApparentPower with the current ApparentPower. * @param apparentPower The other ApparentPower. * @returns A new ApparentPower instance with the results. */ add(apparentPower: ApparentPower): ApparentPower; /** * Subtract the given ApparentPower with the current ApparentPower. * @param apparentPower The other ApparentPower. * @returns A new ApparentPower instance with the results. */ subtract(apparentPower: ApparentPower): ApparentPower; /** * Multiply the given ApparentPower with the current ApparentPower. * @param apparentPower The other ApparentPower. * @returns A new ApparentPower instance with the results. */ multiply(apparentPower: ApparentPower): ApparentPower; /** * Divide the given ApparentPower with the current ApparentPower. * @param apparentPower The other ApparentPower. * @returns A new ApparentPower instance with the results. */ divide(apparentPower: ApparentPower): ApparentPower; /** * Modulo the given ApparentPower with the current ApparentPower. * @param apparentPower The other ApparentPower. * @returns A new ApparentPower instance with the results. */ modulo(apparentPower: ApparentPower): ApparentPower; /** * Pow the given ApparentPower with the current ApparentPower. * @param apparentPower The other ApparentPower. * @returns A new ApparentPower instance with the results. */ pow(apparentPower: ApparentPower): ApparentPower; }