UNPKG

unitsnet-js

Version:

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

279 lines (278 loc) 10.4 kB
import { BaseUnit, ToStringOptions } from "../base-unit"; /** API DTO represents a Impulse */ export interface ImpulseDto { /** The value of the Impulse */ value: number; /** The specific unit that the Impulse value is representing */ unit: ImpulseUnits; } /** ImpulseUnits enumeration */ export declare enum ImpulseUnits { /** */ KilogramMetersPerSecond = "KilogramMeterPerSecond", /** */ NewtonSeconds = "NewtonSecond", /** */ PoundFeetPerSecond = "PoundFootPerSecond", /** */ PoundForceSeconds = "PoundForceSecond", /** */ SlugFeetPerSecond = "SlugFootPerSecond", /** */ NanonewtonSeconds = "NanonewtonSecond", /** */ MicronewtonSeconds = "MicronewtonSecond", /** */ MillinewtonSeconds = "MillinewtonSecond", /** */ CentinewtonSeconds = "CentinewtonSecond", /** */ DecinewtonSeconds = "DecinewtonSecond", /** */ DecanewtonSeconds = "DecanewtonSecond", /** */ KilonewtonSeconds = "KilonewtonSecond", /** */ MeganewtonSeconds = "MeganewtonSecond" } /** In classical mechanics, impulse is the integral of a force, F, over the time interval, t, for which it acts. Impulse applied to an object produces an equivalent vector change in its linear momentum, also in the resultant direction. */ export declare class Impulse extends BaseUnit { protected value: number; private kilogrammeterspersecondLazy; private newtonsecondsLazy; private poundfeetpersecondLazy; private poundforcesecondsLazy; private slugfeetpersecondLazy; private nanonewtonsecondsLazy; private micronewtonsecondsLazy; private millinewtonsecondsLazy; private centinewtonsecondsLazy; private decinewtonsecondsLazy; private decanewtonsecondsLazy; private kilonewtonsecondsLazy; private meganewtonsecondsLazy; /** * Create a new Impulse. * @param value The value. * @param fromUnit The ‘Impulse’ unit to create from. * The default unit is NewtonSeconds */ constructor(value: number, fromUnit?: ImpulseUnits); /** * The base value of Impulse is NewtonSeconds. * 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(): ImpulseUnits.NewtonSeconds; /** */ get KilogramMetersPerSecond(): number; /** */ get NewtonSeconds(): number; /** */ get PoundFeetPerSecond(): number; /** */ get PoundForceSeconds(): number; /** */ get SlugFeetPerSecond(): number; /** */ get NanonewtonSeconds(): number; /** */ get MicronewtonSeconds(): number; /** */ get MillinewtonSeconds(): number; /** */ get CentinewtonSeconds(): number; /** */ get DecinewtonSeconds(): number; /** */ get DecanewtonSeconds(): number; /** */ get KilonewtonSeconds(): number; /** */ get MeganewtonSeconds(): number; /** * Create a new Impulse instance from a KilogramMetersPerSecond * * @param value The unit as KilogramMetersPerSecond to create a new Impulse from. * @returns The new Impulse instance. */ static FromKilogramMetersPerSecond(value: number): Impulse; /** * Create a new Impulse instance from a NewtonSeconds * * @param value The unit as NewtonSeconds to create a new Impulse from. * @returns The new Impulse instance. */ static FromNewtonSeconds(value: number): Impulse; /** * Create a new Impulse instance from a PoundFeetPerSecond * * @param value The unit as PoundFeetPerSecond to create a new Impulse from. * @returns The new Impulse instance. */ static FromPoundFeetPerSecond(value: number): Impulse; /** * Create a new Impulse instance from a PoundForceSeconds * * @param value The unit as PoundForceSeconds to create a new Impulse from. * @returns The new Impulse instance. */ static FromPoundForceSeconds(value: number): Impulse; /** * Create a new Impulse instance from a SlugFeetPerSecond * * @param value The unit as SlugFeetPerSecond to create a new Impulse from. * @returns The new Impulse instance. */ static FromSlugFeetPerSecond(value: number): Impulse; /** * Create a new Impulse instance from a NanonewtonSeconds * * @param value The unit as NanonewtonSeconds to create a new Impulse from. * @returns The new Impulse instance. */ static FromNanonewtonSeconds(value: number): Impulse; /** * Create a new Impulse instance from a MicronewtonSeconds * * @param value The unit as MicronewtonSeconds to create a new Impulse from. * @returns The new Impulse instance. */ static FromMicronewtonSeconds(value: number): Impulse; /** * Create a new Impulse instance from a MillinewtonSeconds * * @param value The unit as MillinewtonSeconds to create a new Impulse from. * @returns The new Impulse instance. */ static FromMillinewtonSeconds(value: number): Impulse; /** * Create a new Impulse instance from a CentinewtonSeconds * * @param value The unit as CentinewtonSeconds to create a new Impulse from. * @returns The new Impulse instance. */ static FromCentinewtonSeconds(value: number): Impulse; /** * Create a new Impulse instance from a DecinewtonSeconds * * @param value The unit as DecinewtonSeconds to create a new Impulse from. * @returns The new Impulse instance. */ static FromDecinewtonSeconds(value: number): Impulse; /** * Create a new Impulse instance from a DecanewtonSeconds * * @param value The unit as DecanewtonSeconds to create a new Impulse from. * @returns The new Impulse instance. */ static FromDecanewtonSeconds(value: number): Impulse; /** * Create a new Impulse instance from a KilonewtonSeconds * * @param value The unit as KilonewtonSeconds to create a new Impulse from. * @returns The new Impulse instance. */ static FromKilonewtonSeconds(value: number): Impulse; /** * Create a new Impulse instance from a MeganewtonSeconds * * @param value The unit as MeganewtonSeconds to create a new Impulse from. * @returns The new Impulse instance. */ static FromMeganewtonSeconds(value: number): Impulse; /** * Gets the base unit enumeration associated with Impulse * @returns The unit enumeration that can be used to interact with this type */ protected static getUnitEnum(): typeof ImpulseUnits; /** * 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(): ImpulseUnits.NewtonSeconds; /** * Create API DTO represent a Impulse unit. * @param holdInUnit The specific Impulse unit to be used in the unit representation at the DTO */ toDto(holdInUnit?: ImpulseUnits): ImpulseDto; /** * Create a Impulse unit from an API DTO representation. * @param dtoImpulse The Impulse API DTO representation */ static FromDto(dtoImpulse: ImpulseDto): Impulse; /** * Convert Impulse to a specific unit value. * @param toUnit The specific unit to convert to * @returns The value of the specific unit provided. */ convert(toUnit: ImpulseUnits): number; private convertFromBase; private convertToBase; /** * Format the Impulse to string. * Note! the default format for Impulse is NewtonSeconds. * To specify the unit format set the 'unit' parameter. * @param unit The unit to format the Impulse. * @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 Impulse. */ toString(unit?: ImpulseUnits, options?: number | ToStringOptions): string; /** * Get Impulse unit abbreviation. * Note! the default abbreviation for Impulse is NewtonSeconds. * To specify the unit abbreviation set the 'unitAbbreviation' parameter. * @param unitAbbreviation The unit abbreviation of the Impulse. * @returns The abbreviation string of Impulse. */ getUnitAbbreviation(unitAbbreviation?: ImpulseUnits): string; /** * Check if the given Impulse are equals to the current Impulse. * @param impulse The other Impulse. * @returns True if the given Impulse are equal to the current Impulse. */ equals(impulse: Impulse): boolean; /** * Compare the given Impulse against the current Impulse. * @param impulse The other Impulse. * @returns 0 if they are equal, -1 if the current Impulse is less then other, 1 if the current Impulse is greater then other. */ compareTo(impulse: Impulse): number; /** * Add the given Impulse with the current Impulse. * @param impulse The other Impulse. * @returns A new Impulse instance with the results. */ add(impulse: Impulse): Impulse; /** * Subtract the given Impulse with the current Impulse. * @param impulse The other Impulse. * @returns A new Impulse instance with the results. */ subtract(impulse: Impulse): Impulse; /** * Multiply the given Impulse with the current Impulse. * @param impulse The other Impulse. * @returns A new Impulse instance with the results. */ multiply(impulse: Impulse): Impulse; /** * Divide the given Impulse with the current Impulse. * @param impulse The other Impulse. * @returns A new Impulse instance with the results. */ divide(impulse: Impulse): Impulse; /** * Modulo the given Impulse with the current Impulse. * @param impulse The other Impulse. * @returns A new Impulse instance with the results. */ modulo(impulse: Impulse): Impulse; /** * Pow the given Impulse with the current Impulse. * @param impulse The other Impulse. * @returns A new Impulse instance with the results. */ pow(impulse: Impulse): Impulse; }