UNPKG

unitsnet-js

Version:

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

135 lines (134 loc) 5.98 kB
import { BaseUnit, ToStringOptions } from "../base-unit"; /** API DTO represents a Permeability */ export interface PermeabilityDto { /** The value of the Permeability */ value: number; /** The specific unit that the Permeability value is representing */ unit: PermeabilityUnits; } /** PermeabilityUnits enumeration */ export declare enum PermeabilityUnits { /** */ HenriesPerMeter = "HenryPerMeter" } /** In electromagnetism, permeability is the measure of the ability of a material to support the formation of a magnetic field within itself. */ export declare class Permeability extends BaseUnit { protected value: number; private henriespermeterLazy; /** * Create a new Permeability. * @param value The value. * @param fromUnit The ‘Permeability’ unit to create from. * The default unit is HenriesPerMeter */ constructor(value: number, fromUnit?: PermeabilityUnits); /** * The base value of Permeability is HenriesPerMeter. * 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(): PermeabilityUnits.HenriesPerMeter; /** */ get HenriesPerMeter(): number; /** * Create a new Permeability instance from a HenriesPerMeter * * @param value The unit as HenriesPerMeter to create a new Permeability from. * @returns The new Permeability instance. */ static FromHenriesPerMeter(value: number): Permeability; /** * Gets the base unit enumeration associated with Permeability * @returns The unit enumeration that can be used to interact with this type */ protected static getUnitEnum(): typeof PermeabilityUnits; /** * 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(): PermeabilityUnits.HenriesPerMeter; /** * Create API DTO represent a Permeability unit. * @param holdInUnit The specific Permeability unit to be used in the unit representation at the DTO */ toDto(holdInUnit?: PermeabilityUnits): PermeabilityDto; /** * Create a Permeability unit from an API DTO representation. * @param dtoPermeability The Permeability API DTO representation */ static FromDto(dtoPermeability: PermeabilityDto): Permeability; /** * Convert Permeability to a specific unit value. * @param toUnit The specific unit to convert to * @returns The value of the specific unit provided. */ convert(toUnit: PermeabilityUnits): number; private convertFromBase; private convertToBase; /** * Format the Permeability to string. * Note! the default format for Permeability is HenriesPerMeter. * To specify the unit format set the 'unit' parameter. * @param unit The unit to format the Permeability. * @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 Permeability. */ toString(unit?: PermeabilityUnits, options?: number | ToStringOptions): string; /** * Get Permeability unit abbreviation. * Note! the default abbreviation for Permeability is HenriesPerMeter. * To specify the unit abbreviation set the 'unitAbbreviation' parameter. * @param unitAbbreviation The unit abbreviation of the Permeability. * @returns The abbreviation string of Permeability. */ getUnitAbbreviation(unitAbbreviation?: PermeabilityUnits): string; /** * Check if the given Permeability are equals to the current Permeability. * @param permeability The other Permeability. * @returns True if the given Permeability are equal to the current Permeability. */ equals(permeability: Permeability): boolean; /** * Compare the given Permeability against the current Permeability. * @param permeability The other Permeability. * @returns 0 if they are equal, -1 if the current Permeability is less then other, 1 if the current Permeability is greater then other. */ compareTo(permeability: Permeability): number; /** * Add the given Permeability with the current Permeability. * @param permeability The other Permeability. * @returns A new Permeability instance with the results. */ add(permeability: Permeability): Permeability; /** * Subtract the given Permeability with the current Permeability. * @param permeability The other Permeability. * @returns A new Permeability instance with the results. */ subtract(permeability: Permeability): Permeability; /** * Multiply the given Permeability with the current Permeability. * @param permeability The other Permeability. * @returns A new Permeability instance with the results. */ multiply(permeability: Permeability): Permeability; /** * Divide the given Permeability with the current Permeability. * @param permeability The other Permeability. * @returns A new Permeability instance with the results. */ divide(permeability: Permeability): Permeability; /** * Modulo the given Permeability with the current Permeability. * @param permeability The other Permeability. * @returns A new Permeability instance with the results. */ modulo(permeability: Permeability): Permeability; /** * Pow the given Permeability with the current Permeability. * @param permeability The other Permeability. * @returns A new Permeability instance with the results. */ pow(permeability: Permeability): Permeability; }