UNPKG

unitsnet-js

Version:

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

135 lines (134 loc) 5.69 kB
import { BaseUnit, ToStringOptions } from "../base-unit"; /** API DTO represents a SolidAngle */ export interface SolidAngleDto { /** The value of the SolidAngle */ value: number; /** The specific unit that the SolidAngle value is representing */ unit: SolidAngleUnits; } /** SolidAngleUnits enumeration */ export declare enum SolidAngleUnits { /** */ Steradians = "Steradian" } /** In geometry, a solid angle is the two-dimensional angle in three-dimensional space that an object subtends at a point. */ export declare class SolidAngle extends BaseUnit { protected value: number; private steradiansLazy; /** * Create a new SolidAngle. * @param value The value. * @param fromUnit The ‘SolidAngle’ unit to create from. * The default unit is Steradians */ constructor(value: number, fromUnit?: SolidAngleUnits); /** * The base value of SolidAngle is Steradians. * 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(): SolidAngleUnits.Steradians; /** */ get Steradians(): number; /** * Create a new SolidAngle instance from a Steradians * * @param value The unit as Steradians to create a new SolidAngle from. * @returns The new SolidAngle instance. */ static FromSteradians(value: number): SolidAngle; /** * Gets the base unit enumeration associated with SolidAngle * @returns The unit enumeration that can be used to interact with this type */ protected static getUnitEnum(): typeof SolidAngleUnits; /** * 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(): SolidAngleUnits.Steradians; /** * Create API DTO represent a SolidAngle unit. * @param holdInUnit The specific SolidAngle unit to be used in the unit representation at the DTO */ toDto(holdInUnit?: SolidAngleUnits): SolidAngleDto; /** * Create a SolidAngle unit from an API DTO representation. * @param dtoSolidAngle The SolidAngle API DTO representation */ static FromDto(dtoSolidAngle: SolidAngleDto): SolidAngle; /** * Convert SolidAngle to a specific unit value. * @param toUnit The specific unit to convert to * @returns The value of the specific unit provided. */ convert(toUnit: SolidAngleUnits): number; private convertFromBase; private convertToBase; /** * Format the SolidAngle to string. * Note! the default format for SolidAngle is Steradians. * To specify the unit format set the 'unit' parameter. * @param unit The unit to format the SolidAngle. * @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 SolidAngle. */ toString(unit?: SolidAngleUnits, options?: number | ToStringOptions): string; /** * Get SolidAngle unit abbreviation. * Note! the default abbreviation for SolidAngle is Steradians. * To specify the unit abbreviation set the 'unitAbbreviation' parameter. * @param unitAbbreviation The unit abbreviation of the SolidAngle. * @returns The abbreviation string of SolidAngle. */ getUnitAbbreviation(unitAbbreviation?: SolidAngleUnits): string; /** * Check if the given SolidAngle are equals to the current SolidAngle. * @param solidAngle The other SolidAngle. * @returns True if the given SolidAngle are equal to the current SolidAngle. */ equals(solidAngle: SolidAngle): boolean; /** * Compare the given SolidAngle against the current SolidAngle. * @param solidAngle The other SolidAngle. * @returns 0 if they are equal, -1 if the current SolidAngle is less then other, 1 if the current SolidAngle is greater then other. */ compareTo(solidAngle: SolidAngle): number; /** * Add the given SolidAngle with the current SolidAngle. * @param solidAngle The other SolidAngle. * @returns A new SolidAngle instance with the results. */ add(solidAngle: SolidAngle): SolidAngle; /** * Subtract the given SolidAngle with the current SolidAngle. * @param solidAngle The other SolidAngle. * @returns A new SolidAngle instance with the results. */ subtract(solidAngle: SolidAngle): SolidAngle; /** * Multiply the given SolidAngle with the current SolidAngle. * @param solidAngle The other SolidAngle. * @returns A new SolidAngle instance with the results. */ multiply(solidAngle: SolidAngle): SolidAngle; /** * Divide the given SolidAngle with the current SolidAngle. * @param solidAngle The other SolidAngle. * @returns A new SolidAngle instance with the results. */ divide(solidAngle: SolidAngle): SolidAngle; /** * Modulo the given SolidAngle with the current SolidAngle. * @param solidAngle The other SolidAngle. * @returns A new SolidAngle instance with the results. */ modulo(solidAngle: SolidAngle): SolidAngle; /** * Pow the given SolidAngle with the current SolidAngle. * @param solidAngle The other SolidAngle. * @returns A new SolidAngle instance with the results. */ pow(solidAngle: SolidAngle): SolidAngle; }