unitsnet-js
Version:
A better way to hold unit variables and easily convert to the destination unit
135 lines (134 loc) • 5.91 kB
TypeScript
import { BaseUnit, ToStringOptions } from "../base-unit";
/** API DTO represents a MagneticFlux */
export interface MagneticFluxDto {
/** The value of the MagneticFlux */
value: number;
/** The specific unit that the MagneticFlux value is representing */
unit: MagneticFluxUnits;
}
/** MagneticFluxUnits enumeration */
export declare enum MagneticFluxUnits {
/** */
Webers = "Weber"
}
/** In physics, specifically electromagnetism, the magnetic flux through a surface is the surface integral of the normal component of the magnetic field B passing through that surface. */
export declare class MagneticFlux extends BaseUnit {
protected value: number;
private webersLazy;
/**
* Create a new MagneticFlux.
* @param value The value.
* @param fromUnit The ‘MagneticFlux’ unit to create from.
* The default unit is Webers
*/
constructor(value: number, fromUnit?: MagneticFluxUnits);
/**
* The base value of MagneticFlux is Webers.
* 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(): MagneticFluxUnits.Webers;
/** */
get Webers(): number;
/**
* Create a new MagneticFlux instance from a Webers
*
* @param value The unit as Webers to create a new MagneticFlux from.
* @returns The new MagneticFlux instance.
*/
static FromWebers(value: number): MagneticFlux;
/**
* Gets the base unit enumeration associated with MagneticFlux
* @returns The unit enumeration that can be used to interact with this type
*/
protected static getUnitEnum(): typeof MagneticFluxUnits;
/**
* 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(): MagneticFluxUnits.Webers;
/**
* Create API DTO represent a MagneticFlux unit.
* @param holdInUnit The specific MagneticFlux unit to be used in the unit representation at the DTO
*/
toDto(holdInUnit?: MagneticFluxUnits): MagneticFluxDto;
/**
* Create a MagneticFlux unit from an API DTO representation.
* @param dtoMagneticFlux The MagneticFlux API DTO representation
*/
static FromDto(dtoMagneticFlux: MagneticFluxDto): MagneticFlux;
/**
* Convert MagneticFlux to a specific unit value.
* @param toUnit The specific unit to convert to
* @returns The value of the specific unit provided.
*/
convert(toUnit: MagneticFluxUnits): number;
private convertFromBase;
private convertToBase;
/**
* Format the MagneticFlux to string.
* Note! the default format for MagneticFlux is Webers.
* To specify the unit format set the 'unit' parameter.
* @param unit The unit to format the MagneticFlux.
* @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 MagneticFlux.
*/
toString(unit?: MagneticFluxUnits, options?: number | ToStringOptions): string;
/**
* Get MagneticFlux unit abbreviation.
* Note! the default abbreviation for MagneticFlux is Webers.
* To specify the unit abbreviation set the 'unitAbbreviation' parameter.
* @param unitAbbreviation The unit abbreviation of the MagneticFlux.
* @returns The abbreviation string of MagneticFlux.
*/
getUnitAbbreviation(unitAbbreviation?: MagneticFluxUnits): string;
/**
* Check if the given MagneticFlux are equals to the current MagneticFlux.
* @param magneticFlux The other MagneticFlux.
* @returns True if the given MagneticFlux are equal to the current MagneticFlux.
*/
equals(magneticFlux: MagneticFlux): boolean;
/**
* Compare the given MagneticFlux against the current MagneticFlux.
* @param magneticFlux The other MagneticFlux.
* @returns 0 if they are equal, -1 if the current MagneticFlux is less then other, 1 if the current MagneticFlux is greater then other.
*/
compareTo(magneticFlux: MagneticFlux): number;
/**
* Add the given MagneticFlux with the current MagneticFlux.
* @param magneticFlux The other MagneticFlux.
* @returns A new MagneticFlux instance with the results.
*/
add(magneticFlux: MagneticFlux): MagneticFlux;
/**
* Subtract the given MagneticFlux with the current MagneticFlux.
* @param magneticFlux The other MagneticFlux.
* @returns A new MagneticFlux instance with the results.
*/
subtract(magneticFlux: MagneticFlux): MagneticFlux;
/**
* Multiply the given MagneticFlux with the current MagneticFlux.
* @param magneticFlux The other MagneticFlux.
* @returns A new MagneticFlux instance with the results.
*/
multiply(magneticFlux: MagneticFlux): MagneticFlux;
/**
* Divide the given MagneticFlux with the current MagneticFlux.
* @param magneticFlux The other MagneticFlux.
* @returns A new MagneticFlux instance with the results.
*/
divide(magneticFlux: MagneticFlux): MagneticFlux;
/**
* Modulo the given MagneticFlux with the current MagneticFlux.
* @param magneticFlux The other MagneticFlux.
* @returns A new MagneticFlux instance with the results.
*/
modulo(magneticFlux: MagneticFlux): MagneticFlux;
/**
* Pow the given MagneticFlux with the current MagneticFlux.
* @param magneticFlux The other MagneticFlux.
* @returns A new MagneticFlux instance with the results.
*/
pow(magneticFlux: MagneticFlux): MagneticFlux;
}