UNPKG

unitsnet-js

Version:

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

135 lines (134 loc) 6.52 kB
import { BaseUnit, ToStringOptions } from "../base-unit"; /** API DTO represents a LuminousIntensity */ export interface LuminousIntensityDto { /** The value of the LuminousIntensity */ value: number; /** The specific unit that the LuminousIntensity value is representing */ unit: LuminousIntensityUnits; } /** LuminousIntensityUnits enumeration */ export declare enum LuminousIntensityUnits { /** */ Candela = "Candela" } /** In photometry, luminous intensity is a measure of the wavelength-weighted power emitted by a light source in a particular direction per unit solid angle, based on the luminosity function, a standardized model of the sensitivity of the human eye. */ export declare class LuminousIntensity extends BaseUnit { protected value: number; private candelaLazy; /** * Create a new LuminousIntensity. * @param value The value. * @param fromUnit The ‘LuminousIntensity’ unit to create from. * The default unit is Candela */ constructor(value: number, fromUnit?: LuminousIntensityUnits); /** * The base value of LuminousIntensity is Candela. * 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(): LuminousIntensityUnits.Candela; /** */ get Candela(): number; /** * Create a new LuminousIntensity instance from a Candela * * @param value The unit as Candela to create a new LuminousIntensity from. * @returns The new LuminousIntensity instance. */ static FromCandela(value: number): LuminousIntensity; /** * Gets the base unit enumeration associated with LuminousIntensity * @returns The unit enumeration that can be used to interact with this type */ protected static getUnitEnum(): typeof LuminousIntensityUnits; /** * 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(): LuminousIntensityUnits.Candela; /** * Create API DTO represent a LuminousIntensity unit. * @param holdInUnit The specific LuminousIntensity unit to be used in the unit representation at the DTO */ toDto(holdInUnit?: LuminousIntensityUnits): LuminousIntensityDto; /** * Create a LuminousIntensity unit from an API DTO representation. * @param dtoLuminousIntensity The LuminousIntensity API DTO representation */ static FromDto(dtoLuminousIntensity: LuminousIntensityDto): LuminousIntensity; /** * Convert LuminousIntensity to a specific unit value. * @param toUnit The specific unit to convert to * @returns The value of the specific unit provided. */ convert(toUnit: LuminousIntensityUnits): number; private convertFromBase; private convertToBase; /** * Format the LuminousIntensity to string. * Note! the default format for LuminousIntensity is Candela. * To specify the unit format set the 'unit' parameter. * @param unit The unit to format the LuminousIntensity. * @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 LuminousIntensity. */ toString(unit?: LuminousIntensityUnits, options?: number | ToStringOptions): string; /** * Get LuminousIntensity unit abbreviation. * Note! the default abbreviation for LuminousIntensity is Candela. * To specify the unit abbreviation set the 'unitAbbreviation' parameter. * @param unitAbbreviation The unit abbreviation of the LuminousIntensity. * @returns The abbreviation string of LuminousIntensity. */ getUnitAbbreviation(unitAbbreviation?: LuminousIntensityUnits): string; /** * Check if the given LuminousIntensity are equals to the current LuminousIntensity. * @param luminousIntensity The other LuminousIntensity. * @returns True if the given LuminousIntensity are equal to the current LuminousIntensity. */ equals(luminousIntensity: LuminousIntensity): boolean; /** * Compare the given LuminousIntensity against the current LuminousIntensity. * @param luminousIntensity The other LuminousIntensity. * @returns 0 if they are equal, -1 if the current LuminousIntensity is less then other, 1 if the current LuminousIntensity is greater then other. */ compareTo(luminousIntensity: LuminousIntensity): number; /** * Add the given LuminousIntensity with the current LuminousIntensity. * @param luminousIntensity The other LuminousIntensity. * @returns A new LuminousIntensity instance with the results. */ add(luminousIntensity: LuminousIntensity): LuminousIntensity; /** * Subtract the given LuminousIntensity with the current LuminousIntensity. * @param luminousIntensity The other LuminousIntensity. * @returns A new LuminousIntensity instance with the results. */ subtract(luminousIntensity: LuminousIntensity): LuminousIntensity; /** * Multiply the given LuminousIntensity with the current LuminousIntensity. * @param luminousIntensity The other LuminousIntensity. * @returns A new LuminousIntensity instance with the results. */ multiply(luminousIntensity: LuminousIntensity): LuminousIntensity; /** * Divide the given LuminousIntensity with the current LuminousIntensity. * @param luminousIntensity The other LuminousIntensity. * @returns A new LuminousIntensity instance with the results. */ divide(luminousIntensity: LuminousIntensity): LuminousIntensity; /** * Modulo the given LuminousIntensity with the current LuminousIntensity. * @param luminousIntensity The other LuminousIntensity. * @returns A new LuminousIntensity instance with the results. */ modulo(luminousIntensity: LuminousIntensity): LuminousIntensity; /** * Pow the given LuminousIntensity with the current LuminousIntensity. * @param luminousIntensity The other LuminousIntensity. * @returns A new LuminousIntensity instance with the results. */ pow(luminousIntensity: LuminousIntensity): LuminousIntensity; }