UNPKG

unitsnet-js

Version:

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

651 lines (650 loc) 25 kB
import { BaseUnit, ToStringOptions } from "../base-unit"; /** API DTO represents a PowerDensity */ export interface PowerDensityDto { /** The value of the PowerDensity */ value: number; /** The specific unit that the PowerDensity value is representing */ unit: PowerDensityUnits; } /** PowerDensityUnits enumeration */ export declare enum PowerDensityUnits { /** */ WattsPerCubicMeter = "WattPerCubicMeter", /** */ WattsPerCubicInch = "WattPerCubicInch", /** */ WattsPerCubicFoot = "WattPerCubicFoot", /** */ WattsPerLiter = "WattPerLiter", /** */ PicowattsPerCubicMeter = "PicowattPerCubicMeter", /** */ NanowattsPerCubicMeter = "NanowattPerCubicMeter", /** */ MicrowattsPerCubicMeter = "MicrowattPerCubicMeter", /** */ MilliwattsPerCubicMeter = "MilliwattPerCubicMeter", /** */ DeciwattsPerCubicMeter = "DeciwattPerCubicMeter", /** */ DecawattsPerCubicMeter = "DecawattPerCubicMeter", /** */ KilowattsPerCubicMeter = "KilowattPerCubicMeter", /** */ MegawattsPerCubicMeter = "MegawattPerCubicMeter", /** */ GigawattsPerCubicMeter = "GigawattPerCubicMeter", /** */ TerawattsPerCubicMeter = "TerawattPerCubicMeter", /** */ PicowattsPerCubicInch = "PicowattPerCubicInch", /** */ NanowattsPerCubicInch = "NanowattPerCubicInch", /** */ MicrowattsPerCubicInch = "MicrowattPerCubicInch", /** */ MilliwattsPerCubicInch = "MilliwattPerCubicInch", /** */ DeciwattsPerCubicInch = "DeciwattPerCubicInch", /** */ DecawattsPerCubicInch = "DecawattPerCubicInch", /** */ KilowattsPerCubicInch = "KilowattPerCubicInch", /** */ MegawattsPerCubicInch = "MegawattPerCubicInch", /** */ GigawattsPerCubicInch = "GigawattPerCubicInch", /** */ TerawattsPerCubicInch = "TerawattPerCubicInch", /** */ PicowattsPerCubicFoot = "PicowattPerCubicFoot", /** */ NanowattsPerCubicFoot = "NanowattPerCubicFoot", /** */ MicrowattsPerCubicFoot = "MicrowattPerCubicFoot", /** */ MilliwattsPerCubicFoot = "MilliwattPerCubicFoot", /** */ DeciwattsPerCubicFoot = "DeciwattPerCubicFoot", /** */ DecawattsPerCubicFoot = "DecawattPerCubicFoot", /** */ KilowattsPerCubicFoot = "KilowattPerCubicFoot", /** */ MegawattsPerCubicFoot = "MegawattPerCubicFoot", /** */ GigawattsPerCubicFoot = "GigawattPerCubicFoot", /** */ TerawattsPerCubicFoot = "TerawattPerCubicFoot", /** */ PicowattsPerLiter = "PicowattPerLiter", /** */ NanowattsPerLiter = "NanowattPerLiter", /** */ MicrowattsPerLiter = "MicrowattPerLiter", /** */ MilliwattsPerLiter = "MilliwattPerLiter", /** */ DeciwattsPerLiter = "DeciwattPerLiter", /** */ DecawattsPerLiter = "DecawattPerLiter", /** */ KilowattsPerLiter = "KilowattPerLiter", /** */ MegawattsPerLiter = "MegawattPerLiter", /** */ GigawattsPerLiter = "GigawattPerLiter", /** */ TerawattsPerLiter = "TerawattPerLiter" } /** The amount of power in a volume. */ export declare class PowerDensity extends BaseUnit { protected value: number; private wattspercubicmeterLazy; private wattspercubicinchLazy; private wattspercubicfootLazy; private wattsperliterLazy; private picowattspercubicmeterLazy; private nanowattspercubicmeterLazy; private microwattspercubicmeterLazy; private milliwattspercubicmeterLazy; private deciwattspercubicmeterLazy; private decawattspercubicmeterLazy; private kilowattspercubicmeterLazy; private megawattspercubicmeterLazy; private gigawattspercubicmeterLazy; private terawattspercubicmeterLazy; private picowattspercubicinchLazy; private nanowattspercubicinchLazy; private microwattspercubicinchLazy; private milliwattspercubicinchLazy; private deciwattspercubicinchLazy; private decawattspercubicinchLazy; private kilowattspercubicinchLazy; private megawattspercubicinchLazy; private gigawattspercubicinchLazy; private terawattspercubicinchLazy; private picowattspercubicfootLazy; private nanowattspercubicfootLazy; private microwattspercubicfootLazy; private milliwattspercubicfootLazy; private deciwattspercubicfootLazy; private decawattspercubicfootLazy; private kilowattspercubicfootLazy; private megawattspercubicfootLazy; private gigawattspercubicfootLazy; private terawattspercubicfootLazy; private picowattsperliterLazy; private nanowattsperliterLazy; private microwattsperliterLazy; private milliwattsperliterLazy; private deciwattsperliterLazy; private decawattsperliterLazy; private kilowattsperliterLazy; private megawattsperliterLazy; private gigawattsperliterLazy; private terawattsperliterLazy; /** * Create a new PowerDensity. * @param value The value. * @param fromUnit The ‘PowerDensity’ unit to create from. * The default unit is WattsPerCubicMeter */ constructor(value: number, fromUnit?: PowerDensityUnits); /** * The base value of PowerDensity is WattsPerCubicMeter. * 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(): PowerDensityUnits.WattsPerCubicMeter; /** */ get WattsPerCubicMeter(): number; /** */ get WattsPerCubicInch(): number; /** */ get WattsPerCubicFoot(): number; /** */ get WattsPerLiter(): number; /** */ get PicowattsPerCubicMeter(): number; /** */ get NanowattsPerCubicMeter(): number; /** */ get MicrowattsPerCubicMeter(): number; /** */ get MilliwattsPerCubicMeter(): number; /** */ get DeciwattsPerCubicMeter(): number; /** */ get DecawattsPerCubicMeter(): number; /** */ get KilowattsPerCubicMeter(): number; /** */ get MegawattsPerCubicMeter(): number; /** */ get GigawattsPerCubicMeter(): number; /** */ get TerawattsPerCubicMeter(): number; /** */ get PicowattsPerCubicInch(): number; /** */ get NanowattsPerCubicInch(): number; /** */ get MicrowattsPerCubicInch(): number; /** */ get MilliwattsPerCubicInch(): number; /** */ get DeciwattsPerCubicInch(): number; /** */ get DecawattsPerCubicInch(): number; /** */ get KilowattsPerCubicInch(): number; /** */ get MegawattsPerCubicInch(): number; /** */ get GigawattsPerCubicInch(): number; /** */ get TerawattsPerCubicInch(): number; /** */ get PicowattsPerCubicFoot(): number; /** */ get NanowattsPerCubicFoot(): number; /** */ get MicrowattsPerCubicFoot(): number; /** */ get MilliwattsPerCubicFoot(): number; /** */ get DeciwattsPerCubicFoot(): number; /** */ get DecawattsPerCubicFoot(): number; /** */ get KilowattsPerCubicFoot(): number; /** */ get MegawattsPerCubicFoot(): number; /** */ get GigawattsPerCubicFoot(): number; /** */ get TerawattsPerCubicFoot(): number; /** */ get PicowattsPerLiter(): number; /** */ get NanowattsPerLiter(): number; /** */ get MicrowattsPerLiter(): number; /** */ get MilliwattsPerLiter(): number; /** */ get DeciwattsPerLiter(): number; /** */ get DecawattsPerLiter(): number; /** */ get KilowattsPerLiter(): number; /** */ get MegawattsPerLiter(): number; /** */ get GigawattsPerLiter(): number; /** */ get TerawattsPerLiter(): number; /** * Create a new PowerDensity instance from a WattsPerCubicMeter * * @param value The unit as WattsPerCubicMeter to create a new PowerDensity from. * @returns The new PowerDensity instance. */ static FromWattsPerCubicMeter(value: number): PowerDensity; /** * Create a new PowerDensity instance from a WattsPerCubicInch * * @param value The unit as WattsPerCubicInch to create a new PowerDensity from. * @returns The new PowerDensity instance. */ static FromWattsPerCubicInch(value: number): PowerDensity; /** * Create a new PowerDensity instance from a WattsPerCubicFoot * * @param value The unit as WattsPerCubicFoot to create a new PowerDensity from. * @returns The new PowerDensity instance. */ static FromWattsPerCubicFoot(value: number): PowerDensity; /** * Create a new PowerDensity instance from a WattsPerLiter * * @param value The unit as WattsPerLiter to create a new PowerDensity from. * @returns The new PowerDensity instance. */ static FromWattsPerLiter(value: number): PowerDensity; /** * Create a new PowerDensity instance from a PicowattsPerCubicMeter * * @param value The unit as PicowattsPerCubicMeter to create a new PowerDensity from. * @returns The new PowerDensity instance. */ static FromPicowattsPerCubicMeter(value: number): PowerDensity; /** * Create a new PowerDensity instance from a NanowattsPerCubicMeter * * @param value The unit as NanowattsPerCubicMeter to create a new PowerDensity from. * @returns The new PowerDensity instance. */ static FromNanowattsPerCubicMeter(value: number): PowerDensity; /** * Create a new PowerDensity instance from a MicrowattsPerCubicMeter * * @param value The unit as MicrowattsPerCubicMeter to create a new PowerDensity from. * @returns The new PowerDensity instance. */ static FromMicrowattsPerCubicMeter(value: number): PowerDensity; /** * Create a new PowerDensity instance from a MilliwattsPerCubicMeter * * @param value The unit as MilliwattsPerCubicMeter to create a new PowerDensity from. * @returns The new PowerDensity instance. */ static FromMilliwattsPerCubicMeter(value: number): PowerDensity; /** * Create a new PowerDensity instance from a DeciwattsPerCubicMeter * * @param value The unit as DeciwattsPerCubicMeter to create a new PowerDensity from. * @returns The new PowerDensity instance. */ static FromDeciwattsPerCubicMeter(value: number): PowerDensity; /** * Create a new PowerDensity instance from a DecawattsPerCubicMeter * * @param value The unit as DecawattsPerCubicMeter to create a new PowerDensity from. * @returns The new PowerDensity instance. */ static FromDecawattsPerCubicMeter(value: number): PowerDensity; /** * Create a new PowerDensity instance from a KilowattsPerCubicMeter * * @param value The unit as KilowattsPerCubicMeter to create a new PowerDensity from. * @returns The new PowerDensity instance. */ static FromKilowattsPerCubicMeter(value: number): PowerDensity; /** * Create a new PowerDensity instance from a MegawattsPerCubicMeter * * @param value The unit as MegawattsPerCubicMeter to create a new PowerDensity from. * @returns The new PowerDensity instance. */ static FromMegawattsPerCubicMeter(value: number): PowerDensity; /** * Create a new PowerDensity instance from a GigawattsPerCubicMeter * * @param value The unit as GigawattsPerCubicMeter to create a new PowerDensity from. * @returns The new PowerDensity instance. */ static FromGigawattsPerCubicMeter(value: number): PowerDensity; /** * Create a new PowerDensity instance from a TerawattsPerCubicMeter * * @param value The unit as TerawattsPerCubicMeter to create a new PowerDensity from. * @returns The new PowerDensity instance. */ static FromTerawattsPerCubicMeter(value: number): PowerDensity; /** * Create a new PowerDensity instance from a PicowattsPerCubicInch * * @param value The unit as PicowattsPerCubicInch to create a new PowerDensity from. * @returns The new PowerDensity instance. */ static FromPicowattsPerCubicInch(value: number): PowerDensity; /** * Create a new PowerDensity instance from a NanowattsPerCubicInch * * @param value The unit as NanowattsPerCubicInch to create a new PowerDensity from. * @returns The new PowerDensity instance. */ static FromNanowattsPerCubicInch(value: number): PowerDensity; /** * Create a new PowerDensity instance from a MicrowattsPerCubicInch * * @param value The unit as MicrowattsPerCubicInch to create a new PowerDensity from. * @returns The new PowerDensity instance. */ static FromMicrowattsPerCubicInch(value: number): PowerDensity; /** * Create a new PowerDensity instance from a MilliwattsPerCubicInch * * @param value The unit as MilliwattsPerCubicInch to create a new PowerDensity from. * @returns The new PowerDensity instance. */ static FromMilliwattsPerCubicInch(value: number): PowerDensity; /** * Create a new PowerDensity instance from a DeciwattsPerCubicInch * * @param value The unit as DeciwattsPerCubicInch to create a new PowerDensity from. * @returns The new PowerDensity instance. */ static FromDeciwattsPerCubicInch(value: number): PowerDensity; /** * Create a new PowerDensity instance from a DecawattsPerCubicInch * * @param value The unit as DecawattsPerCubicInch to create a new PowerDensity from. * @returns The new PowerDensity instance. */ static FromDecawattsPerCubicInch(value: number): PowerDensity; /** * Create a new PowerDensity instance from a KilowattsPerCubicInch * * @param value The unit as KilowattsPerCubicInch to create a new PowerDensity from. * @returns The new PowerDensity instance. */ static FromKilowattsPerCubicInch(value: number): PowerDensity; /** * Create a new PowerDensity instance from a MegawattsPerCubicInch * * @param value The unit as MegawattsPerCubicInch to create a new PowerDensity from. * @returns The new PowerDensity instance. */ static FromMegawattsPerCubicInch(value: number): PowerDensity; /** * Create a new PowerDensity instance from a GigawattsPerCubicInch * * @param value The unit as GigawattsPerCubicInch to create a new PowerDensity from. * @returns The new PowerDensity instance. */ static FromGigawattsPerCubicInch(value: number): PowerDensity; /** * Create a new PowerDensity instance from a TerawattsPerCubicInch * * @param value The unit as TerawattsPerCubicInch to create a new PowerDensity from. * @returns The new PowerDensity instance. */ static FromTerawattsPerCubicInch(value: number): PowerDensity; /** * Create a new PowerDensity instance from a PicowattsPerCubicFoot * * @param value The unit as PicowattsPerCubicFoot to create a new PowerDensity from. * @returns The new PowerDensity instance. */ static FromPicowattsPerCubicFoot(value: number): PowerDensity; /** * Create a new PowerDensity instance from a NanowattsPerCubicFoot * * @param value The unit as NanowattsPerCubicFoot to create a new PowerDensity from. * @returns The new PowerDensity instance. */ static FromNanowattsPerCubicFoot(value: number): PowerDensity; /** * Create a new PowerDensity instance from a MicrowattsPerCubicFoot * * @param value The unit as MicrowattsPerCubicFoot to create a new PowerDensity from. * @returns The new PowerDensity instance. */ static FromMicrowattsPerCubicFoot(value: number): PowerDensity; /** * Create a new PowerDensity instance from a MilliwattsPerCubicFoot * * @param value The unit as MilliwattsPerCubicFoot to create a new PowerDensity from. * @returns The new PowerDensity instance. */ static FromMilliwattsPerCubicFoot(value: number): PowerDensity; /** * Create a new PowerDensity instance from a DeciwattsPerCubicFoot * * @param value The unit as DeciwattsPerCubicFoot to create a new PowerDensity from. * @returns The new PowerDensity instance. */ static FromDeciwattsPerCubicFoot(value: number): PowerDensity; /** * Create a new PowerDensity instance from a DecawattsPerCubicFoot * * @param value The unit as DecawattsPerCubicFoot to create a new PowerDensity from. * @returns The new PowerDensity instance. */ static FromDecawattsPerCubicFoot(value: number): PowerDensity; /** * Create a new PowerDensity instance from a KilowattsPerCubicFoot * * @param value The unit as KilowattsPerCubicFoot to create a new PowerDensity from. * @returns The new PowerDensity instance. */ static FromKilowattsPerCubicFoot(value: number): PowerDensity; /** * Create a new PowerDensity instance from a MegawattsPerCubicFoot * * @param value The unit as MegawattsPerCubicFoot to create a new PowerDensity from. * @returns The new PowerDensity instance. */ static FromMegawattsPerCubicFoot(value: number): PowerDensity; /** * Create a new PowerDensity instance from a GigawattsPerCubicFoot * * @param value The unit as GigawattsPerCubicFoot to create a new PowerDensity from. * @returns The new PowerDensity instance. */ static FromGigawattsPerCubicFoot(value: number): PowerDensity; /** * Create a new PowerDensity instance from a TerawattsPerCubicFoot * * @param value The unit as TerawattsPerCubicFoot to create a new PowerDensity from. * @returns The new PowerDensity instance. */ static FromTerawattsPerCubicFoot(value: number): PowerDensity; /** * Create a new PowerDensity instance from a PicowattsPerLiter * * @param value The unit as PicowattsPerLiter to create a new PowerDensity from. * @returns The new PowerDensity instance. */ static FromPicowattsPerLiter(value: number): PowerDensity; /** * Create a new PowerDensity instance from a NanowattsPerLiter * * @param value The unit as NanowattsPerLiter to create a new PowerDensity from. * @returns The new PowerDensity instance. */ static FromNanowattsPerLiter(value: number): PowerDensity; /** * Create a new PowerDensity instance from a MicrowattsPerLiter * * @param value The unit as MicrowattsPerLiter to create a new PowerDensity from. * @returns The new PowerDensity instance. */ static FromMicrowattsPerLiter(value: number): PowerDensity; /** * Create a new PowerDensity instance from a MilliwattsPerLiter * * @param value The unit as MilliwattsPerLiter to create a new PowerDensity from. * @returns The new PowerDensity instance. */ static FromMilliwattsPerLiter(value: number): PowerDensity; /** * Create a new PowerDensity instance from a DeciwattsPerLiter * * @param value The unit as DeciwattsPerLiter to create a new PowerDensity from. * @returns The new PowerDensity instance. */ static FromDeciwattsPerLiter(value: number): PowerDensity; /** * Create a new PowerDensity instance from a DecawattsPerLiter * * @param value The unit as DecawattsPerLiter to create a new PowerDensity from. * @returns The new PowerDensity instance. */ static FromDecawattsPerLiter(value: number): PowerDensity; /** * Create a new PowerDensity instance from a KilowattsPerLiter * * @param value The unit as KilowattsPerLiter to create a new PowerDensity from. * @returns The new PowerDensity instance. */ static FromKilowattsPerLiter(value: number): PowerDensity; /** * Create a new PowerDensity instance from a MegawattsPerLiter * * @param value The unit as MegawattsPerLiter to create a new PowerDensity from. * @returns The new PowerDensity instance. */ static FromMegawattsPerLiter(value: number): PowerDensity; /** * Create a new PowerDensity instance from a GigawattsPerLiter * * @param value The unit as GigawattsPerLiter to create a new PowerDensity from. * @returns The new PowerDensity instance. */ static FromGigawattsPerLiter(value: number): PowerDensity; /** * Create a new PowerDensity instance from a TerawattsPerLiter * * @param value The unit as TerawattsPerLiter to create a new PowerDensity from. * @returns The new PowerDensity instance. */ static FromTerawattsPerLiter(value: number): PowerDensity; /** * Gets the base unit enumeration associated with PowerDensity * @returns The unit enumeration that can be used to interact with this type */ protected static getUnitEnum(): typeof PowerDensityUnits; /** * 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(): PowerDensityUnits.WattsPerCubicMeter; /** * Create API DTO represent a PowerDensity unit. * @param holdInUnit The specific PowerDensity unit to be used in the unit representation at the DTO */ toDto(holdInUnit?: PowerDensityUnits): PowerDensityDto; /** * Create a PowerDensity unit from an API DTO representation. * @param dtoPowerDensity The PowerDensity API DTO representation */ static FromDto(dtoPowerDensity: PowerDensityDto): PowerDensity; /** * Convert PowerDensity to a specific unit value. * @param toUnit The specific unit to convert to * @returns The value of the specific unit provided. */ convert(toUnit: PowerDensityUnits): number; private convertFromBase; private convertToBase; /** * Format the PowerDensity to string. * Note! the default format for PowerDensity is WattsPerCubicMeter. * To specify the unit format set the 'unit' parameter. * @param unit The unit to format the PowerDensity. * @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 PowerDensity. */ toString(unit?: PowerDensityUnits, options?: number | ToStringOptions): string; /** * Get PowerDensity unit abbreviation. * Note! the default abbreviation for PowerDensity is WattsPerCubicMeter. * To specify the unit abbreviation set the 'unitAbbreviation' parameter. * @param unitAbbreviation The unit abbreviation of the PowerDensity. * @returns The abbreviation string of PowerDensity. */ getUnitAbbreviation(unitAbbreviation?: PowerDensityUnits): string; /** * Check if the given PowerDensity are equals to the current PowerDensity. * @param powerDensity The other PowerDensity. * @returns True if the given PowerDensity are equal to the current PowerDensity. */ equals(powerDensity: PowerDensity): boolean; /** * Compare the given PowerDensity against the current PowerDensity. * @param powerDensity The other PowerDensity. * @returns 0 if they are equal, -1 if the current PowerDensity is less then other, 1 if the current PowerDensity is greater then other. */ compareTo(powerDensity: PowerDensity): number; /** * Add the given PowerDensity with the current PowerDensity. * @param powerDensity The other PowerDensity. * @returns A new PowerDensity instance with the results. */ add(powerDensity: PowerDensity): PowerDensity; /** * Subtract the given PowerDensity with the current PowerDensity. * @param powerDensity The other PowerDensity. * @returns A new PowerDensity instance with the results. */ subtract(powerDensity: PowerDensity): PowerDensity; /** * Multiply the given PowerDensity with the current PowerDensity. * @param powerDensity The other PowerDensity. * @returns A new PowerDensity instance with the results. */ multiply(powerDensity: PowerDensity): PowerDensity; /** * Divide the given PowerDensity with the current PowerDensity. * @param powerDensity The other PowerDensity. * @returns A new PowerDensity instance with the results. */ divide(powerDensity: PowerDensity): PowerDensity; /** * Modulo the given PowerDensity with the current PowerDensity. * @param powerDensity The other PowerDensity. * @returns A new PowerDensity instance with the results. */ modulo(powerDensity: PowerDensity): PowerDensity; /** * Pow the given PowerDensity with the current PowerDensity. * @param powerDensity The other PowerDensity. * @returns A new PowerDensity instance with the results. */ pow(powerDensity: PowerDensity): PowerDensity; }