UNPKG

unitsnet-js

Version:

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

231 lines (230 loc) 9.92 kB
import { BaseUnit, ToStringOptions } from "../base-unit"; /** API DTO represents a KinematicViscosity */ export interface KinematicViscosityDto { /** The value of the KinematicViscosity */ value: number; /** The specific unit that the KinematicViscosity value is representing */ unit: KinematicViscosityUnits; } /** KinematicViscosityUnits enumeration */ export declare enum KinematicViscosityUnits { /** */ SquareMetersPerSecond = "SquareMeterPerSecond", /** */ Stokes = "Stokes", /** */ SquareFeetPerSecond = "SquareFootPerSecond", /** */ Nanostokes = "Nanostokes", /** */ Microstokes = "Microstokes", /** */ Millistokes = "Millistokes", /** */ Centistokes = "Centistokes", /** */ Decistokes = "Decistokes", /** */ Kilostokes = "Kilostokes" } /** The viscosity of a fluid is a measure of its resistance to gradual deformation by shear stress or tensile stress. */ export declare class KinematicViscosity extends BaseUnit { protected value: number; private squaremeterspersecondLazy; private stokesLazy; private squarefeetpersecondLazy; private nanostokesLazy; private microstokesLazy; private millistokesLazy; private centistokesLazy; private decistokesLazy; private kilostokesLazy; /** * Create a new KinematicViscosity. * @param value The value. * @param fromUnit The ‘KinematicViscosity’ unit to create from. * The default unit is SquareMetersPerSecond */ constructor(value: number, fromUnit?: KinematicViscosityUnits); /** * The base value of KinematicViscosity is SquareMetersPerSecond. * 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(): KinematicViscosityUnits.SquareMetersPerSecond; /** */ get SquareMetersPerSecond(): number; /** */ get Stokes(): number; /** */ get SquareFeetPerSecond(): number; /** */ get Nanostokes(): number; /** */ get Microstokes(): number; /** */ get Millistokes(): number; /** */ get Centistokes(): number; /** */ get Decistokes(): number; /** */ get Kilostokes(): number; /** * Create a new KinematicViscosity instance from a SquareMetersPerSecond * * @param value The unit as SquareMetersPerSecond to create a new KinematicViscosity from. * @returns The new KinematicViscosity instance. */ static FromSquareMetersPerSecond(value: number): KinematicViscosity; /** * Create a new KinematicViscosity instance from a Stokes * * @param value The unit as Stokes to create a new KinematicViscosity from. * @returns The new KinematicViscosity instance. */ static FromStokes(value: number): KinematicViscosity; /** * Create a new KinematicViscosity instance from a SquareFeetPerSecond * * @param value The unit as SquareFeetPerSecond to create a new KinematicViscosity from. * @returns The new KinematicViscosity instance. */ static FromSquareFeetPerSecond(value: number): KinematicViscosity; /** * Create a new KinematicViscosity instance from a Nanostokes * * @param value The unit as Nanostokes to create a new KinematicViscosity from. * @returns The new KinematicViscosity instance. */ static FromNanostokes(value: number): KinematicViscosity; /** * Create a new KinematicViscosity instance from a Microstokes * * @param value The unit as Microstokes to create a new KinematicViscosity from. * @returns The new KinematicViscosity instance. */ static FromMicrostokes(value: number): KinematicViscosity; /** * Create a new KinematicViscosity instance from a Millistokes * * @param value The unit as Millistokes to create a new KinematicViscosity from. * @returns The new KinematicViscosity instance. */ static FromMillistokes(value: number): KinematicViscosity; /** * Create a new KinematicViscosity instance from a Centistokes * * @param value The unit as Centistokes to create a new KinematicViscosity from. * @returns The new KinematicViscosity instance. */ static FromCentistokes(value: number): KinematicViscosity; /** * Create a new KinematicViscosity instance from a Decistokes * * @param value The unit as Decistokes to create a new KinematicViscosity from. * @returns The new KinematicViscosity instance. */ static FromDecistokes(value: number): KinematicViscosity; /** * Create a new KinematicViscosity instance from a Kilostokes * * @param value The unit as Kilostokes to create a new KinematicViscosity from. * @returns The new KinematicViscosity instance. */ static FromKilostokes(value: number): KinematicViscosity; /** * Gets the base unit enumeration associated with KinematicViscosity * @returns The unit enumeration that can be used to interact with this type */ protected static getUnitEnum(): typeof KinematicViscosityUnits; /** * 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(): KinematicViscosityUnits.SquareMetersPerSecond; /** * Create API DTO represent a KinematicViscosity unit. * @param holdInUnit The specific KinematicViscosity unit to be used in the unit representation at the DTO */ toDto(holdInUnit?: KinematicViscosityUnits): KinematicViscosityDto; /** * Create a KinematicViscosity unit from an API DTO representation. * @param dtoKinematicViscosity The KinematicViscosity API DTO representation */ static FromDto(dtoKinematicViscosity: KinematicViscosityDto): KinematicViscosity; /** * Convert KinematicViscosity to a specific unit value. * @param toUnit The specific unit to convert to * @returns The value of the specific unit provided. */ convert(toUnit: KinematicViscosityUnits): number; private convertFromBase; private convertToBase; /** * Format the KinematicViscosity to string. * Note! the default format for KinematicViscosity is SquareMetersPerSecond. * To specify the unit format set the 'unit' parameter. * @param unit The unit to format the KinematicViscosity. * @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 KinematicViscosity. */ toString(unit?: KinematicViscosityUnits, options?: number | ToStringOptions): string; /** * Get KinematicViscosity unit abbreviation. * Note! the default abbreviation for KinematicViscosity is SquareMetersPerSecond. * To specify the unit abbreviation set the 'unitAbbreviation' parameter. * @param unitAbbreviation The unit abbreviation of the KinematicViscosity. * @returns The abbreviation string of KinematicViscosity. */ getUnitAbbreviation(unitAbbreviation?: KinematicViscosityUnits): string; /** * Check if the given KinematicViscosity are equals to the current KinematicViscosity. * @param kinematicViscosity The other KinematicViscosity. * @returns True if the given KinematicViscosity are equal to the current KinematicViscosity. */ equals(kinematicViscosity: KinematicViscosity): boolean; /** * Compare the given KinematicViscosity against the current KinematicViscosity. * @param kinematicViscosity The other KinematicViscosity. * @returns 0 if they are equal, -1 if the current KinematicViscosity is less then other, 1 if the current KinematicViscosity is greater then other. */ compareTo(kinematicViscosity: KinematicViscosity): number; /** * Add the given KinematicViscosity with the current KinematicViscosity. * @param kinematicViscosity The other KinematicViscosity. * @returns A new KinematicViscosity instance with the results. */ add(kinematicViscosity: KinematicViscosity): KinematicViscosity; /** * Subtract the given KinematicViscosity with the current KinematicViscosity. * @param kinematicViscosity The other KinematicViscosity. * @returns A new KinematicViscosity instance with the results. */ subtract(kinematicViscosity: KinematicViscosity): KinematicViscosity; /** * Multiply the given KinematicViscosity with the current KinematicViscosity. * @param kinematicViscosity The other KinematicViscosity. * @returns A new KinematicViscosity instance with the results. */ multiply(kinematicViscosity: KinematicViscosity): KinematicViscosity; /** * Divide the given KinematicViscosity with the current KinematicViscosity. * @param kinematicViscosity The other KinematicViscosity. * @returns A new KinematicViscosity instance with the results. */ divide(kinematicViscosity: KinematicViscosity): KinematicViscosity; /** * Modulo the given KinematicViscosity with the current KinematicViscosity. * @param kinematicViscosity The other KinematicViscosity. * @returns A new KinematicViscosity instance with the results. */ modulo(kinematicViscosity: KinematicViscosity): KinematicViscosity; /** * Pow the given KinematicViscosity with the current KinematicViscosity. * @param kinematicViscosity The other KinematicViscosity. * @returns A new KinematicViscosity instance with the results. */ pow(kinematicViscosity: KinematicViscosity): KinematicViscosity; }