unitsnet-js
Version:
A better way to hold unit variables and easily convert to the destination unit
171 lines (170 loc) • 8.84 kB
TypeScript
import { BaseUnit, ToStringOptions } from "../base-unit";
/** API DTO represents a SpecificFuelConsumption */
export interface SpecificFuelConsumptionDto {
/** The value of the SpecificFuelConsumption */
value: number;
/** The specific unit that the SpecificFuelConsumption value is representing */
unit: SpecificFuelConsumptionUnits;
}
/** SpecificFuelConsumptionUnits enumeration */
export declare enum SpecificFuelConsumptionUnits {
/** */
PoundsMassPerPoundForceHour = "PoundMassPerPoundForceHour",
/** */
KilogramsPerKilogramForceHour = "KilogramPerKilogramForceHour",
/** */
GramsPerKiloNewtonSecond = "GramPerKiloNewtonSecond",
/** */
KilogramsPerKiloNewtonSecond = "KilogramPerKiloNewtonSecond"
}
/** SFC is the fuel efficiency of an engine design with respect to thrust output */
export declare class SpecificFuelConsumption extends BaseUnit {
protected value: number;
private poundsmassperpoundforcehourLazy;
private kilogramsperkilogramforcehourLazy;
private gramsperkilonewtonsecondLazy;
private kilogramsperkilonewtonsecondLazy;
/**
* Create a new SpecificFuelConsumption.
* @param value The value.
* @param fromUnit The ‘SpecificFuelConsumption’ unit to create from.
* The default unit is GramsPerKiloNewtonSecond
*/
constructor(value: number, fromUnit?: SpecificFuelConsumptionUnits);
/**
* The base value of SpecificFuelConsumption is GramsPerKiloNewtonSecond.
* 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(): SpecificFuelConsumptionUnits.GramsPerKiloNewtonSecond;
/** */
get PoundsMassPerPoundForceHour(): number;
/** */
get KilogramsPerKilogramForceHour(): number;
/** */
get GramsPerKiloNewtonSecond(): number;
/** */
get KilogramsPerKiloNewtonSecond(): number;
/**
* Create a new SpecificFuelConsumption instance from a PoundsMassPerPoundForceHour
*
* @param value The unit as PoundsMassPerPoundForceHour to create a new SpecificFuelConsumption from.
* @returns The new SpecificFuelConsumption instance.
*/
static FromPoundsMassPerPoundForceHour(value: number): SpecificFuelConsumption;
/**
* Create a new SpecificFuelConsumption instance from a KilogramsPerKilogramForceHour
*
* @param value The unit as KilogramsPerKilogramForceHour to create a new SpecificFuelConsumption from.
* @returns The new SpecificFuelConsumption instance.
*/
static FromKilogramsPerKilogramForceHour(value: number): SpecificFuelConsumption;
/**
* Create a new SpecificFuelConsumption instance from a GramsPerKiloNewtonSecond
*
* @param value The unit as GramsPerKiloNewtonSecond to create a new SpecificFuelConsumption from.
* @returns The new SpecificFuelConsumption instance.
*/
static FromGramsPerKiloNewtonSecond(value: number): SpecificFuelConsumption;
/**
* Create a new SpecificFuelConsumption instance from a KilogramsPerKiloNewtonSecond
*
* @param value The unit as KilogramsPerKiloNewtonSecond to create a new SpecificFuelConsumption from.
* @returns The new SpecificFuelConsumption instance.
*/
static FromKilogramsPerKiloNewtonSecond(value: number): SpecificFuelConsumption;
/**
* Gets the base unit enumeration associated with SpecificFuelConsumption
* @returns The unit enumeration that can be used to interact with this type
*/
protected static getUnitEnum(): typeof SpecificFuelConsumptionUnits;
/**
* 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(): SpecificFuelConsumptionUnits.GramsPerKiloNewtonSecond;
/**
* Create API DTO represent a SpecificFuelConsumption unit.
* @param holdInUnit The specific SpecificFuelConsumption unit to be used in the unit representation at the DTO
*/
toDto(holdInUnit?: SpecificFuelConsumptionUnits): SpecificFuelConsumptionDto;
/**
* Create a SpecificFuelConsumption unit from an API DTO representation.
* @param dtoSpecificFuelConsumption The SpecificFuelConsumption API DTO representation
*/
static FromDto(dtoSpecificFuelConsumption: SpecificFuelConsumptionDto): SpecificFuelConsumption;
/**
* Convert SpecificFuelConsumption to a specific unit value.
* @param toUnit The specific unit to convert to
* @returns The value of the specific unit provided.
*/
convert(toUnit: SpecificFuelConsumptionUnits): number;
private convertFromBase;
private convertToBase;
/**
* Format the SpecificFuelConsumption to string.
* Note! the default format for SpecificFuelConsumption is GramsPerKiloNewtonSecond.
* To specify the unit format set the 'unit' parameter.
* @param unit The unit to format the SpecificFuelConsumption.
* @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 SpecificFuelConsumption.
*/
toString(unit?: SpecificFuelConsumptionUnits, options?: number | ToStringOptions): string;
/**
* Get SpecificFuelConsumption unit abbreviation.
* Note! the default abbreviation for SpecificFuelConsumption is GramsPerKiloNewtonSecond.
* To specify the unit abbreviation set the 'unitAbbreviation' parameter.
* @param unitAbbreviation The unit abbreviation of the SpecificFuelConsumption.
* @returns The abbreviation string of SpecificFuelConsumption.
*/
getUnitAbbreviation(unitAbbreviation?: SpecificFuelConsumptionUnits): string;
/**
* Check if the given SpecificFuelConsumption are equals to the current SpecificFuelConsumption.
* @param specificFuelConsumption The other SpecificFuelConsumption.
* @returns True if the given SpecificFuelConsumption are equal to the current SpecificFuelConsumption.
*/
equals(specificFuelConsumption: SpecificFuelConsumption): boolean;
/**
* Compare the given SpecificFuelConsumption against the current SpecificFuelConsumption.
* @param specificFuelConsumption The other SpecificFuelConsumption.
* @returns 0 if they are equal, -1 if the current SpecificFuelConsumption is less then other, 1 if the current SpecificFuelConsumption is greater then other.
*/
compareTo(specificFuelConsumption: SpecificFuelConsumption): number;
/**
* Add the given SpecificFuelConsumption with the current SpecificFuelConsumption.
* @param specificFuelConsumption The other SpecificFuelConsumption.
* @returns A new SpecificFuelConsumption instance with the results.
*/
add(specificFuelConsumption: SpecificFuelConsumption): SpecificFuelConsumption;
/**
* Subtract the given SpecificFuelConsumption with the current SpecificFuelConsumption.
* @param specificFuelConsumption The other SpecificFuelConsumption.
* @returns A new SpecificFuelConsumption instance with the results.
*/
subtract(specificFuelConsumption: SpecificFuelConsumption): SpecificFuelConsumption;
/**
* Multiply the given SpecificFuelConsumption with the current SpecificFuelConsumption.
* @param specificFuelConsumption The other SpecificFuelConsumption.
* @returns A new SpecificFuelConsumption instance with the results.
*/
multiply(specificFuelConsumption: SpecificFuelConsumption): SpecificFuelConsumption;
/**
* Divide the given SpecificFuelConsumption with the current SpecificFuelConsumption.
* @param specificFuelConsumption The other SpecificFuelConsumption.
* @returns A new SpecificFuelConsumption instance with the results.
*/
divide(specificFuelConsumption: SpecificFuelConsumption): SpecificFuelConsumption;
/**
* Modulo the given SpecificFuelConsumption with the current SpecificFuelConsumption.
* @param specificFuelConsumption The other SpecificFuelConsumption.
* @returns A new SpecificFuelConsumption instance with the results.
*/
modulo(specificFuelConsumption: SpecificFuelConsumption): SpecificFuelConsumption;
/**
* Pow the given SpecificFuelConsumption with the current SpecificFuelConsumption.
* @param specificFuelConsumption The other SpecificFuelConsumption.
* @returns A new SpecificFuelConsumption instance with the results.
*/
pow(specificFuelConsumption: SpecificFuelConsumption): SpecificFuelConsumption;
}