UNPKG

unitsnet-js

Version:

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

255 lines (254 loc) 9.83 kB
import { BaseUnit, ToStringOptions } from "../base-unit"; /** API DTO represents a Molarity */ export interface MolarityDto { /** The value of the Molarity */ value: number; /** The specific unit that the Molarity value is representing */ unit: MolarityUnits; } /** MolarityUnits enumeration */ export declare enum MolarityUnits { /** */ MolesPerCubicMeter = "MolePerCubicMeter", /** */ MolesPerLiter = "MolePerLiter", /** */ PoundMolesPerCubicFoot = "PoundMolePerCubicFoot", /** */ KilomolesPerCubicMeter = "KilomolePerCubicMeter", /** */ FemtomolesPerLiter = "FemtomolePerLiter", /** */ PicomolesPerLiter = "PicomolePerLiter", /** */ NanomolesPerLiter = "NanomolePerLiter", /** */ MicromolesPerLiter = "MicromolePerLiter", /** */ MillimolesPerLiter = "MillimolePerLiter", /** */ CentimolesPerLiter = "CentimolePerLiter", /** */ DecimolesPerLiter = "DecimolePerLiter" } /** Molar concentration, also called molarity, amount concentration or substance concentration, is a measure of the concentration of a solute in a solution, or of any chemical species, in terms of amount of substance in a given volume. */ export declare class Molarity extends BaseUnit { protected value: number; private molespercubicmeterLazy; private molesperliterLazy; private poundmolespercubicfootLazy; private kilomolespercubicmeterLazy; private femtomolesperliterLazy; private picomolesperliterLazy; private nanomolesperliterLazy; private micromolesperliterLazy; private millimolesperliterLazy; private centimolesperliterLazy; private decimolesperliterLazy; /** * Create a new Molarity. * @param value The value. * @param fromUnit The ‘Molarity’ unit to create from. * The default unit is MolesPerCubicMeter */ constructor(value: number, fromUnit?: MolarityUnits); /** * The base value of Molarity is MolesPerCubicMeter. * 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(): MolarityUnits.MolesPerCubicMeter; /** */ get MolesPerCubicMeter(): number; /** */ get MolesPerLiter(): number; /** */ get PoundMolesPerCubicFoot(): number; /** */ get KilomolesPerCubicMeter(): number; /** */ get FemtomolesPerLiter(): number; /** */ get PicomolesPerLiter(): number; /** */ get NanomolesPerLiter(): number; /** */ get MicromolesPerLiter(): number; /** */ get MillimolesPerLiter(): number; /** */ get CentimolesPerLiter(): number; /** */ get DecimolesPerLiter(): number; /** * Create a new Molarity instance from a MolesPerCubicMeter * * @param value The unit as MolesPerCubicMeter to create a new Molarity from. * @returns The new Molarity instance. */ static FromMolesPerCubicMeter(value: number): Molarity; /** * Create a new Molarity instance from a MolesPerLiter * * @param value The unit as MolesPerLiter to create a new Molarity from. * @returns The new Molarity instance. */ static FromMolesPerLiter(value: number): Molarity; /** * Create a new Molarity instance from a PoundMolesPerCubicFoot * * @param value The unit as PoundMolesPerCubicFoot to create a new Molarity from. * @returns The new Molarity instance. */ static FromPoundMolesPerCubicFoot(value: number): Molarity; /** * Create a new Molarity instance from a KilomolesPerCubicMeter * * @param value The unit as KilomolesPerCubicMeter to create a new Molarity from. * @returns The new Molarity instance. */ static FromKilomolesPerCubicMeter(value: number): Molarity; /** * Create a new Molarity instance from a FemtomolesPerLiter * * @param value The unit as FemtomolesPerLiter to create a new Molarity from. * @returns The new Molarity instance. */ static FromFemtomolesPerLiter(value: number): Molarity; /** * Create a new Molarity instance from a PicomolesPerLiter * * @param value The unit as PicomolesPerLiter to create a new Molarity from. * @returns The new Molarity instance. */ static FromPicomolesPerLiter(value: number): Molarity; /** * Create a new Molarity instance from a NanomolesPerLiter * * @param value The unit as NanomolesPerLiter to create a new Molarity from. * @returns The new Molarity instance. */ static FromNanomolesPerLiter(value: number): Molarity; /** * Create a new Molarity instance from a MicromolesPerLiter * * @param value The unit as MicromolesPerLiter to create a new Molarity from. * @returns The new Molarity instance. */ static FromMicromolesPerLiter(value: number): Molarity; /** * Create a new Molarity instance from a MillimolesPerLiter * * @param value The unit as MillimolesPerLiter to create a new Molarity from. * @returns The new Molarity instance. */ static FromMillimolesPerLiter(value: number): Molarity; /** * Create a new Molarity instance from a CentimolesPerLiter * * @param value The unit as CentimolesPerLiter to create a new Molarity from. * @returns The new Molarity instance. */ static FromCentimolesPerLiter(value: number): Molarity; /** * Create a new Molarity instance from a DecimolesPerLiter * * @param value The unit as DecimolesPerLiter to create a new Molarity from. * @returns The new Molarity instance. */ static FromDecimolesPerLiter(value: number): Molarity; /** * Gets the base unit enumeration associated with Molarity * @returns The unit enumeration that can be used to interact with this type */ protected static getUnitEnum(): typeof MolarityUnits; /** * 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(): MolarityUnits.MolesPerCubicMeter; /** * Create API DTO represent a Molarity unit. * @param holdInUnit The specific Molarity unit to be used in the unit representation at the DTO */ toDto(holdInUnit?: MolarityUnits): MolarityDto; /** * Create a Molarity unit from an API DTO representation. * @param dtoMolarity The Molarity API DTO representation */ static FromDto(dtoMolarity: MolarityDto): Molarity; /** * Convert Molarity to a specific unit value. * @param toUnit The specific unit to convert to * @returns The value of the specific unit provided. */ convert(toUnit: MolarityUnits): number; private convertFromBase; private convertToBase; /** * Format the Molarity to string. * Note! the default format for Molarity is MolesPerCubicMeter. * To specify the unit format set the 'unit' parameter. * @param unit The unit to format the Molarity. * @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 Molarity. */ toString(unit?: MolarityUnits, options?: number | ToStringOptions): string; /** * Get Molarity unit abbreviation. * Note! the default abbreviation for Molarity is MolesPerCubicMeter. * To specify the unit abbreviation set the 'unitAbbreviation' parameter. * @param unitAbbreviation The unit abbreviation of the Molarity. * @returns The abbreviation string of Molarity. */ getUnitAbbreviation(unitAbbreviation?: MolarityUnits): string; /** * Check if the given Molarity are equals to the current Molarity. * @param molarity The other Molarity. * @returns True if the given Molarity are equal to the current Molarity. */ equals(molarity: Molarity): boolean; /** * Compare the given Molarity against the current Molarity. * @param molarity The other Molarity. * @returns 0 if they are equal, -1 if the current Molarity is less then other, 1 if the current Molarity is greater then other. */ compareTo(molarity: Molarity): number; /** * Add the given Molarity with the current Molarity. * @param molarity The other Molarity. * @returns A new Molarity instance with the results. */ add(molarity: Molarity): Molarity; /** * Subtract the given Molarity with the current Molarity. * @param molarity The other Molarity. * @returns A new Molarity instance with the results. */ subtract(molarity: Molarity): Molarity; /** * Multiply the given Molarity with the current Molarity. * @param molarity The other Molarity. * @returns A new Molarity instance with the results. */ multiply(molarity: Molarity): Molarity; /** * Divide the given Molarity with the current Molarity. * @param molarity The other Molarity. * @returns A new Molarity instance with the results. */ divide(molarity: Molarity): Molarity; /** * Modulo the given Molarity with the current Molarity. * @param molarity The other Molarity. * @returns A new Molarity instance with the results. */ modulo(molarity: Molarity): Molarity; /** * Pow the given Molarity with the current Molarity. * @param molarity The other Molarity. * @returns A new Molarity instance with the results. */ pow(molarity: Molarity): Molarity; }