UNPKG

unitsnet-js

Version:

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

291 lines (290 loc) 12.3 kB
import { BaseUnit, ToStringOptions } from "../base-unit"; /** API DTO represents a Acceleration */ export interface AccelerationDto { /** The value of the Acceleration */ value: number; /** The specific unit that the Acceleration value is representing */ unit: AccelerationUnits; } /** AccelerationUnits enumeration */ export declare enum AccelerationUnits { /** */ MetersPerSecondSquared = "MeterPerSecondSquared", /** */ InchesPerSecondSquared = "InchPerSecondSquared", /** */ FeetPerSecondSquared = "FootPerSecondSquared", /** */ KnotsPerSecond = "KnotPerSecond", /** */ KnotsPerMinute = "KnotPerMinute", /** */ KnotsPerHour = "KnotPerHour", /** */ StandardGravity = "StandardGravity", /** */ NanometersPerSecondSquared = "NanometerPerSecondSquared", /** */ MicrometersPerSecondSquared = "MicrometerPerSecondSquared", /** */ MillimetersPerSecondSquared = "MillimeterPerSecondSquared", /** */ CentimetersPerSecondSquared = "CentimeterPerSecondSquared", /** */ DecimetersPerSecondSquared = "DecimeterPerSecondSquared", /** */ KilometersPerSecondSquared = "KilometerPerSecondSquared", /** */ MillistandardGravity = "MillistandardGravity" } /** Acceleration, in physics, is the rate at which the velocity of an object changes over time. An object's acceleration is the net result of any and all forces acting on the object, as described by Newton's Second Law. The SI unit for acceleration is the Meter per second squared (m/s²). Accelerations are vector quantities (they have magnitude and direction) and add according to the parallelogram law. As a vector, the calculated net force is equal to the product of the object's mass (a scalar quantity) and the acceleration. */ export declare class Acceleration extends BaseUnit { protected value: number; private meterspersecondsquaredLazy; private inchespersecondsquaredLazy; private feetpersecondsquaredLazy; private knotspersecondLazy; private knotsperminuteLazy; private knotsperhourLazy; private standardgravityLazy; private nanometerspersecondsquaredLazy; private micrometerspersecondsquaredLazy; private millimeterspersecondsquaredLazy; private centimeterspersecondsquaredLazy; private decimeterspersecondsquaredLazy; private kilometerspersecondsquaredLazy; private millistandardgravityLazy; /** * Create a new Acceleration. * @param value The value. * @param fromUnit The ‘Acceleration’ unit to create from. * The default unit is MetersPerSecondSquared */ constructor(value: number, fromUnit?: AccelerationUnits); /** * The base value of Acceleration is MetersPerSecondSquared. * 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(): AccelerationUnits.MetersPerSecondSquared; /** */ get MetersPerSecondSquared(): number; /** */ get InchesPerSecondSquared(): number; /** */ get FeetPerSecondSquared(): number; /** */ get KnotsPerSecond(): number; /** */ get KnotsPerMinute(): number; /** */ get KnotsPerHour(): number; /** */ get StandardGravity(): number; /** */ get NanometersPerSecondSquared(): number; /** */ get MicrometersPerSecondSquared(): number; /** */ get MillimetersPerSecondSquared(): number; /** */ get CentimetersPerSecondSquared(): number; /** */ get DecimetersPerSecondSquared(): number; /** */ get KilometersPerSecondSquared(): number; /** */ get MillistandardGravity(): number; /** * Create a new Acceleration instance from a MetersPerSecondSquared * * @param value The unit as MetersPerSecondSquared to create a new Acceleration from. * @returns The new Acceleration instance. */ static FromMetersPerSecondSquared(value: number): Acceleration; /** * Create a new Acceleration instance from a InchesPerSecondSquared * * @param value The unit as InchesPerSecondSquared to create a new Acceleration from. * @returns The new Acceleration instance. */ static FromInchesPerSecondSquared(value: number): Acceleration; /** * Create a new Acceleration instance from a FeetPerSecondSquared * * @param value The unit as FeetPerSecondSquared to create a new Acceleration from. * @returns The new Acceleration instance. */ static FromFeetPerSecondSquared(value: number): Acceleration; /** * Create a new Acceleration instance from a KnotsPerSecond * * @param value The unit as KnotsPerSecond to create a new Acceleration from. * @returns The new Acceleration instance. */ static FromKnotsPerSecond(value: number): Acceleration; /** * Create a new Acceleration instance from a KnotsPerMinute * * @param value The unit as KnotsPerMinute to create a new Acceleration from. * @returns The new Acceleration instance. */ static FromKnotsPerMinute(value: number): Acceleration; /** * Create a new Acceleration instance from a KnotsPerHour * * @param value The unit as KnotsPerHour to create a new Acceleration from. * @returns The new Acceleration instance. */ static FromKnotsPerHour(value: number): Acceleration; /** * Create a new Acceleration instance from a StandardGravity * * @param value The unit as StandardGravity to create a new Acceleration from. * @returns The new Acceleration instance. */ static FromStandardGravity(value: number): Acceleration; /** * Create a new Acceleration instance from a NanometersPerSecondSquared * * @param value The unit as NanometersPerSecondSquared to create a new Acceleration from. * @returns The new Acceleration instance. */ static FromNanometersPerSecondSquared(value: number): Acceleration; /** * Create a new Acceleration instance from a MicrometersPerSecondSquared * * @param value The unit as MicrometersPerSecondSquared to create a new Acceleration from. * @returns The new Acceleration instance. */ static FromMicrometersPerSecondSquared(value: number): Acceleration; /** * Create a new Acceleration instance from a MillimetersPerSecondSquared * * @param value The unit as MillimetersPerSecondSquared to create a new Acceleration from. * @returns The new Acceleration instance. */ static FromMillimetersPerSecondSquared(value: number): Acceleration; /** * Create a new Acceleration instance from a CentimetersPerSecondSquared * * @param value The unit as CentimetersPerSecondSquared to create a new Acceleration from. * @returns The new Acceleration instance. */ static FromCentimetersPerSecondSquared(value: number): Acceleration; /** * Create a new Acceleration instance from a DecimetersPerSecondSquared * * @param value The unit as DecimetersPerSecondSquared to create a new Acceleration from. * @returns The new Acceleration instance. */ static FromDecimetersPerSecondSquared(value: number): Acceleration; /** * Create a new Acceleration instance from a KilometersPerSecondSquared * * @param value The unit as KilometersPerSecondSquared to create a new Acceleration from. * @returns The new Acceleration instance. */ static FromKilometersPerSecondSquared(value: number): Acceleration; /** * Create a new Acceleration instance from a MillistandardGravity * * @param value The unit as MillistandardGravity to create a new Acceleration from. * @returns The new Acceleration instance. */ static FromMillistandardGravity(value: number): Acceleration; /** * Gets the base unit enumeration associated with Acceleration * @returns The unit enumeration that can be used to interact with this type */ protected static getUnitEnum(): typeof AccelerationUnits; /** * 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(): AccelerationUnits.MetersPerSecondSquared; /** * Create API DTO represent a Acceleration unit. * @param holdInUnit The specific Acceleration unit to be used in the unit representation at the DTO */ toDto(holdInUnit?: AccelerationUnits): AccelerationDto; /** * Create a Acceleration unit from an API DTO representation. * @param dtoAcceleration The Acceleration API DTO representation */ static FromDto(dtoAcceleration: AccelerationDto): Acceleration; /** * Convert Acceleration to a specific unit value. * @param toUnit The specific unit to convert to * @returns The value of the specific unit provided. */ convert(toUnit: AccelerationUnits): number; private convertFromBase; private convertToBase; /** * Format the Acceleration to string. * Note! the default format for Acceleration is MetersPerSecondSquared. * To specify the unit format set the 'unit' parameter. * @param unit The unit to format the Acceleration. * @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 Acceleration. */ toString(unit?: AccelerationUnits, options?: number | ToStringOptions): string; /** * Get Acceleration unit abbreviation. * Note! the default abbreviation for Acceleration is MetersPerSecondSquared. * To specify the unit abbreviation set the 'unitAbbreviation' parameter. * @param unitAbbreviation The unit abbreviation of the Acceleration. * @returns The abbreviation string of Acceleration. */ getUnitAbbreviation(unitAbbreviation?: AccelerationUnits): string; /** * Check if the given Acceleration are equals to the current Acceleration. * @param acceleration The other Acceleration. * @returns True if the given Acceleration are equal to the current Acceleration. */ equals(acceleration: Acceleration): boolean; /** * Compare the given Acceleration against the current Acceleration. * @param acceleration The other Acceleration. * @returns 0 if they are equal, -1 if the current Acceleration is less then other, 1 if the current Acceleration is greater then other. */ compareTo(acceleration: Acceleration): number; /** * Add the given Acceleration with the current Acceleration. * @param acceleration The other Acceleration. * @returns A new Acceleration instance with the results. */ add(acceleration: Acceleration): Acceleration; /** * Subtract the given Acceleration with the current Acceleration. * @param acceleration The other Acceleration. * @returns A new Acceleration instance with the results. */ subtract(acceleration: Acceleration): Acceleration; /** * Multiply the given Acceleration with the current Acceleration. * @param acceleration The other Acceleration. * @returns A new Acceleration instance with the results. */ multiply(acceleration: Acceleration): Acceleration; /** * Divide the given Acceleration with the current Acceleration. * @param acceleration The other Acceleration. * @returns A new Acceleration instance with the results. */ divide(acceleration: Acceleration): Acceleration; /** * Modulo the given Acceleration with the current Acceleration. * @param acceleration The other Acceleration. * @returns A new Acceleration instance with the results. */ modulo(acceleration: Acceleration): Acceleration; /** * Pow the given Acceleration with the current Acceleration. * @param acceleration The other Acceleration. * @returns A new Acceleration instance with the results. */ pow(acceleration: Acceleration): Acceleration; }