UNPKG

unitsnet-js

Version:

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

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