unitsnet-js
Version:
A better way to hold unit variables and easily convert to the destination unit
243 lines (242 loc) • 9.8 kB
TypeScript
import { BaseUnit, ToStringOptions } from "../base-unit";
/** API DTO represents a Luminance */
export interface LuminanceDto {
/** The value of the Luminance */
value: number;
/** The specific unit that the Luminance value is representing */
unit: LuminanceUnits;
}
/** LuminanceUnits enumeration */
export declare enum LuminanceUnits {
/** */
CandelasPerSquareMeter = "CandelaPerSquareMeter",
/** */
CandelasPerSquareFoot = "CandelaPerSquareFoot",
/** */
CandelasPerSquareInch = "CandelaPerSquareInch",
/** */
Nits = "Nit",
/** */
NanocandelasPerSquareMeter = "NanocandelaPerSquareMeter",
/** */
MicrocandelasPerSquareMeter = "MicrocandelaPerSquareMeter",
/** */
MillicandelasPerSquareMeter = "MillicandelaPerSquareMeter",
/** */
CenticandelasPerSquareMeter = "CenticandelaPerSquareMeter",
/** */
DecicandelasPerSquareMeter = "DecicandelaPerSquareMeter",
/** */
KilocandelasPerSquareMeter = "KilocandelaPerSquareMeter"
}
/** Luminance is a photometric measure of the luminous intensity per unit area of light travelling in a given direction. */
export declare class Luminance extends BaseUnit {
protected value: number;
private candelaspersquaremeterLazy;
private candelaspersquarefootLazy;
private candelaspersquareinchLazy;
private nitsLazy;
private nanocandelaspersquaremeterLazy;
private microcandelaspersquaremeterLazy;
private millicandelaspersquaremeterLazy;
private centicandelaspersquaremeterLazy;
private decicandelaspersquaremeterLazy;
private kilocandelaspersquaremeterLazy;
/**
* Create a new Luminance.
* @param value The value.
* @param fromUnit The ‘Luminance’ unit to create from.
* The default unit is CandelasPerSquareMeter
*/
constructor(value: number, fromUnit?: LuminanceUnits);
/**
* The base value of Luminance is CandelasPerSquareMeter.
* 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(): LuminanceUnits.CandelasPerSquareMeter;
/** */
get CandelasPerSquareMeter(): number;
/** */
get CandelasPerSquareFoot(): number;
/** */
get CandelasPerSquareInch(): number;
/** */
get Nits(): number;
/** */
get NanocandelasPerSquareMeter(): number;
/** */
get MicrocandelasPerSquareMeter(): number;
/** */
get MillicandelasPerSquareMeter(): number;
/** */
get CenticandelasPerSquareMeter(): number;
/** */
get DecicandelasPerSquareMeter(): number;
/** */
get KilocandelasPerSquareMeter(): number;
/**
* Create a new Luminance instance from a CandelasPerSquareMeter
*
* @param value The unit as CandelasPerSquareMeter to create a new Luminance from.
* @returns The new Luminance instance.
*/
static FromCandelasPerSquareMeter(value: number): Luminance;
/**
* Create a new Luminance instance from a CandelasPerSquareFoot
*
* @param value The unit as CandelasPerSquareFoot to create a new Luminance from.
* @returns The new Luminance instance.
*/
static FromCandelasPerSquareFoot(value: number): Luminance;
/**
* Create a new Luminance instance from a CandelasPerSquareInch
*
* @param value The unit as CandelasPerSquareInch to create a new Luminance from.
* @returns The new Luminance instance.
*/
static FromCandelasPerSquareInch(value: number): Luminance;
/**
* Create a new Luminance instance from a Nits
*
* @param value The unit as Nits to create a new Luminance from.
* @returns The new Luminance instance.
*/
static FromNits(value: number): Luminance;
/**
* Create a new Luminance instance from a NanocandelasPerSquareMeter
*
* @param value The unit as NanocandelasPerSquareMeter to create a new Luminance from.
* @returns The new Luminance instance.
*/
static FromNanocandelasPerSquareMeter(value: number): Luminance;
/**
* Create a new Luminance instance from a MicrocandelasPerSquareMeter
*
* @param value The unit as MicrocandelasPerSquareMeter to create a new Luminance from.
* @returns The new Luminance instance.
*/
static FromMicrocandelasPerSquareMeter(value: number): Luminance;
/**
* Create a new Luminance instance from a MillicandelasPerSquareMeter
*
* @param value The unit as MillicandelasPerSquareMeter to create a new Luminance from.
* @returns The new Luminance instance.
*/
static FromMillicandelasPerSquareMeter(value: number): Luminance;
/**
* Create a new Luminance instance from a CenticandelasPerSquareMeter
*
* @param value The unit as CenticandelasPerSquareMeter to create a new Luminance from.
* @returns The new Luminance instance.
*/
static FromCenticandelasPerSquareMeter(value: number): Luminance;
/**
* Create a new Luminance instance from a DecicandelasPerSquareMeter
*
* @param value The unit as DecicandelasPerSquareMeter to create a new Luminance from.
* @returns The new Luminance instance.
*/
static FromDecicandelasPerSquareMeter(value: number): Luminance;
/**
* Create a new Luminance instance from a KilocandelasPerSquareMeter
*
* @param value The unit as KilocandelasPerSquareMeter to create a new Luminance from.
* @returns The new Luminance instance.
*/
static FromKilocandelasPerSquareMeter(value: number): Luminance;
/**
* Gets the base unit enumeration associated with Luminance
* @returns The unit enumeration that can be used to interact with this type
*/
protected static getUnitEnum(): typeof LuminanceUnits;
/**
* 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(): LuminanceUnits.CandelasPerSquareMeter;
/**
* Create API DTO represent a Luminance unit.
* @param holdInUnit The specific Luminance unit to be used in the unit representation at the DTO
*/
toDto(holdInUnit?: LuminanceUnits): LuminanceDto;
/**
* Create a Luminance unit from an API DTO representation.
* @param dtoLuminance The Luminance API DTO representation
*/
static FromDto(dtoLuminance: LuminanceDto): Luminance;
/**
* Convert Luminance to a specific unit value.
* @param toUnit The specific unit to convert to
* @returns The value of the specific unit provided.
*/
convert(toUnit: LuminanceUnits): number;
private convertFromBase;
private convertToBase;
/**
* Format the Luminance to string.
* Note! the default format for Luminance is CandelasPerSquareMeter.
* To specify the unit format set the 'unit' parameter.
* @param unit The unit to format the Luminance.
* @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 Luminance.
*/
toString(unit?: LuminanceUnits, options?: number | ToStringOptions): string;
/**
* Get Luminance unit abbreviation.
* Note! the default abbreviation for Luminance is CandelasPerSquareMeter.
* To specify the unit abbreviation set the 'unitAbbreviation' parameter.
* @param unitAbbreviation The unit abbreviation of the Luminance.
* @returns The abbreviation string of Luminance.
*/
getUnitAbbreviation(unitAbbreviation?: LuminanceUnits): string;
/**
* Check if the given Luminance are equals to the current Luminance.
* @param luminance The other Luminance.
* @returns True if the given Luminance are equal to the current Luminance.
*/
equals(luminance: Luminance): boolean;
/**
* Compare the given Luminance against the current Luminance.
* @param luminance The other Luminance.
* @returns 0 if they are equal, -1 if the current Luminance is less then other, 1 if the current Luminance is greater then other.
*/
compareTo(luminance: Luminance): number;
/**
* Add the given Luminance with the current Luminance.
* @param luminance The other Luminance.
* @returns A new Luminance instance with the results.
*/
add(luminance: Luminance): Luminance;
/**
* Subtract the given Luminance with the current Luminance.
* @param luminance The other Luminance.
* @returns A new Luminance instance with the results.
*/
subtract(luminance: Luminance): Luminance;
/**
* Multiply the given Luminance with the current Luminance.
* @param luminance The other Luminance.
* @returns A new Luminance instance with the results.
*/
multiply(luminance: Luminance): Luminance;
/**
* Divide the given Luminance with the current Luminance.
* @param luminance The other Luminance.
* @returns A new Luminance instance with the results.
*/
divide(luminance: Luminance): Luminance;
/**
* Modulo the given Luminance with the current Luminance.
* @param luminance The other Luminance.
* @returns A new Luminance instance with the results.
*/
modulo(luminance: Luminance): Luminance;
/**
* Pow the given Luminance with the current Luminance.
* @param luminance The other Luminance.
* @returns A new Luminance instance with the results.
*/
pow(luminance: Luminance): Luminance;
}