unitsnet-js
Version:
A better way to hold unit variables and easily convert to the destination unit
291 lines (290 loc) • 12 kB
TypeScript
import { BaseUnit, ToStringOptions } from "../base-unit";
/** API DTO represents a Irradiance */
export interface IrradianceDto {
/** The value of the Irradiance */
value: number;
/** The specific unit that the Irradiance value is representing */
unit: IrradianceUnits;
}
/** IrradianceUnits enumeration */
export declare enum IrradianceUnits {
/** */
WattsPerSquareMeter = "WattPerSquareMeter",
/** */
WattsPerSquareCentimeter = "WattPerSquareCentimeter",
/** */
PicowattsPerSquareMeter = "PicowattPerSquareMeter",
/** */
NanowattsPerSquareMeter = "NanowattPerSquareMeter",
/** */
MicrowattsPerSquareMeter = "MicrowattPerSquareMeter",
/** */
MilliwattsPerSquareMeter = "MilliwattPerSquareMeter",
/** */
KilowattsPerSquareMeter = "KilowattPerSquareMeter",
/** */
MegawattsPerSquareMeter = "MegawattPerSquareMeter",
/** */
PicowattsPerSquareCentimeter = "PicowattPerSquareCentimeter",
/** */
NanowattsPerSquareCentimeter = "NanowattPerSquareCentimeter",
/** */
MicrowattsPerSquareCentimeter = "MicrowattPerSquareCentimeter",
/** */
MilliwattsPerSquareCentimeter = "MilliwattPerSquareCentimeter",
/** */
KilowattsPerSquareCentimeter = "KilowattPerSquareCentimeter",
/** */
MegawattsPerSquareCentimeter = "MegawattPerSquareCentimeter"
}
/** Irradiance is the intensity of ultraviolet (UV) or visible light incident on a surface. */
export declare class Irradiance extends BaseUnit {
protected value: number;
private wattspersquaremeterLazy;
private wattspersquarecentimeterLazy;
private picowattspersquaremeterLazy;
private nanowattspersquaremeterLazy;
private microwattspersquaremeterLazy;
private milliwattspersquaremeterLazy;
private kilowattspersquaremeterLazy;
private megawattspersquaremeterLazy;
private picowattspersquarecentimeterLazy;
private nanowattspersquarecentimeterLazy;
private microwattspersquarecentimeterLazy;
private milliwattspersquarecentimeterLazy;
private kilowattspersquarecentimeterLazy;
private megawattspersquarecentimeterLazy;
/**
* Create a new Irradiance.
* @param value The value.
* @param fromUnit The ‘Irradiance’ unit to create from.
* The default unit is WattsPerSquareMeter
*/
constructor(value: number, fromUnit?: IrradianceUnits);
/**
* The base value of Irradiance is WattsPerSquareMeter.
* 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(): IrradianceUnits.WattsPerSquareMeter;
/** */
get WattsPerSquareMeter(): number;
/** */
get WattsPerSquareCentimeter(): number;
/** */
get PicowattsPerSquareMeter(): number;
/** */
get NanowattsPerSquareMeter(): number;
/** */
get MicrowattsPerSquareMeter(): number;
/** */
get MilliwattsPerSquareMeter(): number;
/** */
get KilowattsPerSquareMeter(): number;
/** */
get MegawattsPerSquareMeter(): number;
/** */
get PicowattsPerSquareCentimeter(): number;
/** */
get NanowattsPerSquareCentimeter(): number;
/** */
get MicrowattsPerSquareCentimeter(): number;
/** */
get MilliwattsPerSquareCentimeter(): number;
/** */
get KilowattsPerSquareCentimeter(): number;
/** */
get MegawattsPerSquareCentimeter(): number;
/**
* Create a new Irradiance instance from a WattsPerSquareMeter
*
* @param value The unit as WattsPerSquareMeter to create a new Irradiance from.
* @returns The new Irradiance instance.
*/
static FromWattsPerSquareMeter(value: number): Irradiance;
/**
* Create a new Irradiance instance from a WattsPerSquareCentimeter
*
* @param value The unit as WattsPerSquareCentimeter to create a new Irradiance from.
* @returns The new Irradiance instance.
*/
static FromWattsPerSquareCentimeter(value: number): Irradiance;
/**
* Create a new Irradiance instance from a PicowattsPerSquareMeter
*
* @param value The unit as PicowattsPerSquareMeter to create a new Irradiance from.
* @returns The new Irradiance instance.
*/
static FromPicowattsPerSquareMeter(value: number): Irradiance;
/**
* Create a new Irradiance instance from a NanowattsPerSquareMeter
*
* @param value The unit as NanowattsPerSquareMeter to create a new Irradiance from.
* @returns The new Irradiance instance.
*/
static FromNanowattsPerSquareMeter(value: number): Irradiance;
/**
* Create a new Irradiance instance from a MicrowattsPerSquareMeter
*
* @param value The unit as MicrowattsPerSquareMeter to create a new Irradiance from.
* @returns The new Irradiance instance.
*/
static FromMicrowattsPerSquareMeter(value: number): Irradiance;
/**
* Create a new Irradiance instance from a MilliwattsPerSquareMeter
*
* @param value The unit as MilliwattsPerSquareMeter to create a new Irradiance from.
* @returns The new Irradiance instance.
*/
static FromMilliwattsPerSquareMeter(value: number): Irradiance;
/**
* Create a new Irradiance instance from a KilowattsPerSquareMeter
*
* @param value The unit as KilowattsPerSquareMeter to create a new Irradiance from.
* @returns The new Irradiance instance.
*/
static FromKilowattsPerSquareMeter(value: number): Irradiance;
/**
* Create a new Irradiance instance from a MegawattsPerSquareMeter
*
* @param value The unit as MegawattsPerSquareMeter to create a new Irradiance from.
* @returns The new Irradiance instance.
*/
static FromMegawattsPerSquareMeter(value: number): Irradiance;
/**
* Create a new Irradiance instance from a PicowattsPerSquareCentimeter
*
* @param value The unit as PicowattsPerSquareCentimeter to create a new Irradiance from.
* @returns The new Irradiance instance.
*/
static FromPicowattsPerSquareCentimeter(value: number): Irradiance;
/**
* Create a new Irradiance instance from a NanowattsPerSquareCentimeter
*
* @param value The unit as NanowattsPerSquareCentimeter to create a new Irradiance from.
* @returns The new Irradiance instance.
*/
static FromNanowattsPerSquareCentimeter(value: number): Irradiance;
/**
* Create a new Irradiance instance from a MicrowattsPerSquareCentimeter
*
* @param value The unit as MicrowattsPerSquareCentimeter to create a new Irradiance from.
* @returns The new Irradiance instance.
*/
static FromMicrowattsPerSquareCentimeter(value: number): Irradiance;
/**
* Create a new Irradiance instance from a MilliwattsPerSquareCentimeter
*
* @param value The unit as MilliwattsPerSquareCentimeter to create a new Irradiance from.
* @returns The new Irradiance instance.
*/
static FromMilliwattsPerSquareCentimeter(value: number): Irradiance;
/**
* Create a new Irradiance instance from a KilowattsPerSquareCentimeter
*
* @param value The unit as KilowattsPerSquareCentimeter to create a new Irradiance from.
* @returns The new Irradiance instance.
*/
static FromKilowattsPerSquareCentimeter(value: number): Irradiance;
/**
* Create a new Irradiance instance from a MegawattsPerSquareCentimeter
*
* @param value The unit as MegawattsPerSquareCentimeter to create a new Irradiance from.
* @returns The new Irradiance instance.
*/
static FromMegawattsPerSquareCentimeter(value: number): Irradiance;
/**
* Gets the base unit enumeration associated with Irradiance
* @returns The unit enumeration that can be used to interact with this type
*/
protected static getUnitEnum(): typeof IrradianceUnits;
/**
* 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(): IrradianceUnits.WattsPerSquareMeter;
/**
* Create API DTO represent a Irradiance unit.
* @param holdInUnit The specific Irradiance unit to be used in the unit representation at the DTO
*/
toDto(holdInUnit?: IrradianceUnits): IrradianceDto;
/**
* Create a Irradiance unit from an API DTO representation.
* @param dtoIrradiance The Irradiance API DTO representation
*/
static FromDto(dtoIrradiance: IrradianceDto): Irradiance;
/**
* Convert Irradiance to a specific unit value.
* @param toUnit The specific unit to convert to
* @returns The value of the specific unit provided.
*/
convert(toUnit: IrradianceUnits): number;
private convertFromBase;
private convertToBase;
/**
* Format the Irradiance to string.
* Note! the default format for Irradiance is WattsPerSquareMeter.
* To specify the unit format set the 'unit' parameter.
* @param unit The unit to format the Irradiance.
* @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 Irradiance.
*/
toString(unit?: IrradianceUnits, options?: number | ToStringOptions): string;
/**
* Get Irradiance unit abbreviation.
* Note! the default abbreviation for Irradiance is WattsPerSquareMeter.
* To specify the unit abbreviation set the 'unitAbbreviation' parameter.
* @param unitAbbreviation The unit abbreviation of the Irradiance.
* @returns The abbreviation string of Irradiance.
*/
getUnitAbbreviation(unitAbbreviation?: IrradianceUnits): string;
/**
* Check if the given Irradiance are equals to the current Irradiance.
* @param irradiance The other Irradiance.
* @returns True if the given Irradiance are equal to the current Irradiance.
*/
equals(irradiance: Irradiance): boolean;
/**
* Compare the given Irradiance against the current Irradiance.
* @param irradiance The other Irradiance.
* @returns 0 if they are equal, -1 if the current Irradiance is less then other, 1 if the current Irradiance is greater then other.
*/
compareTo(irradiance: Irradiance): number;
/**
* Add the given Irradiance with the current Irradiance.
* @param irradiance The other Irradiance.
* @returns A new Irradiance instance with the results.
*/
add(irradiance: Irradiance): Irradiance;
/**
* Subtract the given Irradiance with the current Irradiance.
* @param irradiance The other Irradiance.
* @returns A new Irradiance instance with the results.
*/
subtract(irradiance: Irradiance): Irradiance;
/**
* Multiply the given Irradiance with the current Irradiance.
* @param irradiance The other Irradiance.
* @returns A new Irradiance instance with the results.
*/
multiply(irradiance: Irradiance): Irradiance;
/**
* Divide the given Irradiance with the current Irradiance.
* @param irradiance The other Irradiance.
* @returns A new Irradiance instance with the results.
*/
divide(irradiance: Irradiance): Irradiance;
/**
* Modulo the given Irradiance with the current Irradiance.
* @param irradiance The other Irradiance.
* @returns A new Irradiance instance with the results.
*/
modulo(irradiance: Irradiance): Irradiance;
/**
* Pow the given Irradiance with the current Irradiance.
* @param irradiance The other Irradiance.
* @returns A new Irradiance instance with the results.
*/
pow(irradiance: Irradiance): Irradiance;
}