unitsnet-js
Version:
A better way to hold unit variables and easily convert to the destination unit
171 lines (170 loc) • 6.73 kB
TypeScript
import { BaseUnit, ToStringOptions } from "../base-unit";
/** API DTO represents a Illuminance */
export interface IlluminanceDto {
/** The value of the Illuminance */
value: number;
/** The specific unit that the Illuminance value is representing */
unit: IlluminanceUnits;
}
/** IlluminanceUnits enumeration */
export declare enum IlluminanceUnits {
/** */
Lux = "Lux",
/** */
Millilux = "Millilux",
/** */
Kilolux = "Kilolux",
/** */
Megalux = "Megalux"
}
/** In photometry, illuminance is the total luminous flux incident on a surface, per unit area. */
export declare class Illuminance extends BaseUnit {
protected value: number;
private luxLazy;
private milliluxLazy;
private kiloluxLazy;
private megaluxLazy;
/**
* Create a new Illuminance.
* @param value The value.
* @param fromUnit The ‘Illuminance’ unit to create from.
* The default unit is Lux
*/
constructor(value: number, fromUnit?: IlluminanceUnits);
/**
* The base value of Illuminance is Lux.
* 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(): IlluminanceUnits.Lux;
/** */
get Lux(): number;
/** */
get Millilux(): number;
/** */
get Kilolux(): number;
/** */
get Megalux(): number;
/**
* Create a new Illuminance instance from a Lux
*
* @param value The unit as Lux to create a new Illuminance from.
* @returns The new Illuminance instance.
*/
static FromLux(value: number): Illuminance;
/**
* Create a new Illuminance instance from a Millilux
*
* @param value The unit as Millilux to create a new Illuminance from.
* @returns The new Illuminance instance.
*/
static FromMillilux(value: number): Illuminance;
/**
* Create a new Illuminance instance from a Kilolux
*
* @param value The unit as Kilolux to create a new Illuminance from.
* @returns The new Illuminance instance.
*/
static FromKilolux(value: number): Illuminance;
/**
* Create a new Illuminance instance from a Megalux
*
* @param value The unit as Megalux to create a new Illuminance from.
* @returns The new Illuminance instance.
*/
static FromMegalux(value: number): Illuminance;
/**
* Gets the base unit enumeration associated with Illuminance
* @returns The unit enumeration that can be used to interact with this type
*/
protected static getUnitEnum(): typeof IlluminanceUnits;
/**
* 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(): IlluminanceUnits.Lux;
/**
* Create API DTO represent a Illuminance unit.
* @param holdInUnit The specific Illuminance unit to be used in the unit representation at the DTO
*/
toDto(holdInUnit?: IlluminanceUnits): IlluminanceDto;
/**
* Create a Illuminance unit from an API DTO representation.
* @param dtoIlluminance The Illuminance API DTO representation
*/
static FromDto(dtoIlluminance: IlluminanceDto): Illuminance;
/**
* Convert Illuminance to a specific unit value.
* @param toUnit The specific unit to convert to
* @returns The value of the specific unit provided.
*/
convert(toUnit: IlluminanceUnits): number;
private convertFromBase;
private convertToBase;
/**
* Format the Illuminance to string.
* Note! the default format for Illuminance is Lux.
* To specify the unit format set the 'unit' parameter.
* @param unit The unit to format the Illuminance.
* @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 Illuminance.
*/
toString(unit?: IlluminanceUnits, options?: number | ToStringOptions): string;
/**
* Get Illuminance unit abbreviation.
* Note! the default abbreviation for Illuminance is Lux.
* To specify the unit abbreviation set the 'unitAbbreviation' parameter.
* @param unitAbbreviation The unit abbreviation of the Illuminance.
* @returns The abbreviation string of Illuminance.
*/
getUnitAbbreviation(unitAbbreviation?: IlluminanceUnits): string;
/**
* Check if the given Illuminance are equals to the current Illuminance.
* @param illuminance The other Illuminance.
* @returns True if the given Illuminance are equal to the current Illuminance.
*/
equals(illuminance: Illuminance): boolean;
/**
* Compare the given Illuminance against the current Illuminance.
* @param illuminance The other Illuminance.
* @returns 0 if they are equal, -1 if the current Illuminance is less then other, 1 if the current Illuminance is greater then other.
*/
compareTo(illuminance: Illuminance): number;
/**
* Add the given Illuminance with the current Illuminance.
* @param illuminance The other Illuminance.
* @returns A new Illuminance instance with the results.
*/
add(illuminance: Illuminance): Illuminance;
/**
* Subtract the given Illuminance with the current Illuminance.
* @param illuminance The other Illuminance.
* @returns A new Illuminance instance with the results.
*/
subtract(illuminance: Illuminance): Illuminance;
/**
* Multiply the given Illuminance with the current Illuminance.
* @param illuminance The other Illuminance.
* @returns A new Illuminance instance with the results.
*/
multiply(illuminance: Illuminance): Illuminance;
/**
* Divide the given Illuminance with the current Illuminance.
* @param illuminance The other Illuminance.
* @returns A new Illuminance instance with the results.
*/
divide(illuminance: Illuminance): Illuminance;
/**
* Modulo the given Illuminance with the current Illuminance.
* @param illuminance The other Illuminance.
* @returns A new Illuminance instance with the results.
*/
modulo(illuminance: Illuminance): Illuminance;
/**
* Pow the given Illuminance with the current Illuminance.
* @param illuminance The other Illuminance.
* @returns A new Illuminance instance with the results.
*/
pow(illuminance: Illuminance): Illuminance;
}