UNPKG

unitsnet-js

Version:

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

291 lines (290 loc) 12.7 kB
import { BaseUnit, ToStringOptions } from "../base-unit"; /** API DTO represents a Area */ export interface AreaDto { /** The value of the Area */ value: number; /** The specific unit that the Area value is representing */ unit: AreaUnits; } /** AreaUnits enumeration */ export declare enum AreaUnits { /** */ SquareKilometers = "SquareKilometer", /** */ SquareMeters = "SquareMeter", /** */ SquareDecimeters = "SquareDecimeter", /** */ SquareCentimeters = "SquareCentimeter", /** */ SquareMillimeters = "SquareMillimeter", /** */ SquareMicrometers = "SquareMicrometer", /** The statute mile was standardised between the British Commonwealth and the United States by an international agreement in 1959, when it was formally redefined with respect to SI units as exactly 1,609.344 metres. */ SquareMiles = "SquareMile", /** The yard (symbol: yd) is an English unit of length in both the British imperial and US customary systems of measurement equalling 3 feet (or 36 inches). Since 1959 the yard has been by international agreement standardized as exactly 0.9144 meter. A distance of 1,760 yards is equal to 1 mile. */ SquareYards = "SquareYard", /** */ SquareFeet = "SquareFoot", /** In the United States, the foot was defined as 12 inches, with the inch being defined by the Mendenhall Order of 1893 as 39.37 inches = 1 m. This makes a U.S. survey foot exactly 1200/3937 meters. */ UsSurveySquareFeet = "UsSurveySquareFoot", /** */ SquareInches = "SquareInch", /** Based upon the international yard and pound agreement of 1959, an acre may be declared as exactly 4,046.8564224 square metres. */ Acres = "Acre", /** */ Hectares = "Hectare", /** */ SquareNauticalMiles = "SquareNauticalMile" } /** Area is a quantity that expresses the extent of a two-dimensional surface or shape, or planar lamina, in the plane. Area can be understood as the amount of material with a given thickness that would be necessary to fashion a model of the shape, or the amount of paint necessary to cover the surface with a single coat.[1] It is the two-dimensional analog of the length of a curve (a one-dimensional concept) or the volume of a solid (a three-dimensional concept). */ export declare class Area extends BaseUnit { protected value: number; private squarekilometersLazy; private squaremetersLazy; private squaredecimetersLazy; private squarecentimetersLazy; private squaremillimetersLazy; private squaremicrometersLazy; private squaremilesLazy; private squareyardsLazy; private squarefeetLazy; private ussurveysquarefeetLazy; private squareinchesLazy; private acresLazy; private hectaresLazy; private squarenauticalmilesLazy; /** * Create a new Area. * @param value The value. * @param fromUnit The ‘Area’ unit to create from. * The default unit is SquareMeters */ constructor(value: number, fromUnit?: AreaUnits); /** * The base value of Area is SquareMeters. * 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(): AreaUnits.SquareMeters; /** */ get SquareKilometers(): number; /** */ get SquareMeters(): number; /** */ get SquareDecimeters(): number; /** */ get SquareCentimeters(): number; /** */ get SquareMillimeters(): number; /** */ get SquareMicrometers(): number; /** The statute mile was standardised between the British Commonwealth and the United States by an international agreement in 1959, when it was formally redefined with respect to SI units as exactly 1,609.344 metres. */ get SquareMiles(): number; /** The yard (symbol: yd) is an English unit of length in both the British imperial and US customary systems of measurement equalling 3 feet (or 36 inches). Since 1959 the yard has been by international agreement standardized as exactly 0.9144 meter. A distance of 1,760 yards is equal to 1 mile. */ get SquareYards(): number; /** */ get SquareFeet(): number; /** In the United States, the foot was defined as 12 inches, with the inch being defined by the Mendenhall Order of 1893 as 39.37 inches = 1 m. This makes a U.S. survey foot exactly 1200/3937 meters. */ get UsSurveySquareFeet(): number; /** */ get SquareInches(): number; /** Based upon the international yard and pound agreement of 1959, an acre may be declared as exactly 4,046.8564224 square metres. */ get Acres(): number; /** */ get Hectares(): number; /** */ get SquareNauticalMiles(): number; /** * Create a new Area instance from a SquareKilometers * * @param value The unit as SquareKilometers to create a new Area from. * @returns The new Area instance. */ static FromSquareKilometers(value: number): Area; /** * Create a new Area instance from a SquareMeters * * @param value The unit as SquareMeters to create a new Area from. * @returns The new Area instance. */ static FromSquareMeters(value: number): Area; /** * Create a new Area instance from a SquareDecimeters * * @param value The unit as SquareDecimeters to create a new Area from. * @returns The new Area instance. */ static FromSquareDecimeters(value: number): Area; /** * Create a new Area instance from a SquareCentimeters * * @param value The unit as SquareCentimeters to create a new Area from. * @returns The new Area instance. */ static FromSquareCentimeters(value: number): Area; /** * Create a new Area instance from a SquareMillimeters * * @param value The unit as SquareMillimeters to create a new Area from. * @returns The new Area instance. */ static FromSquareMillimeters(value: number): Area; /** * Create a new Area instance from a SquareMicrometers * * @param value The unit as SquareMicrometers to create a new Area from. * @returns The new Area instance. */ static FromSquareMicrometers(value: number): Area; /** * Create a new Area instance from a SquareMiles * The statute mile was standardised between the British Commonwealth and the United States by an international agreement in 1959, when it was formally redefined with respect to SI units as exactly 1,609.344 metres. * @param value The unit as SquareMiles to create a new Area from. * @returns The new Area instance. */ static FromSquareMiles(value: number): Area; /** * Create a new Area instance from a SquareYards * The yard (symbol: yd) is an English unit of length in both the British imperial and US customary systems of measurement equalling 3 feet (or 36 inches). Since 1959 the yard has been by international agreement standardized as exactly 0.9144 meter. A distance of 1,760 yards is equal to 1 mile. * @param value The unit as SquareYards to create a new Area from. * @returns The new Area instance. */ static FromSquareYards(value: number): Area; /** * Create a new Area instance from a SquareFeet * * @param value The unit as SquareFeet to create a new Area from. * @returns The new Area instance. */ static FromSquareFeet(value: number): Area; /** * Create a new Area instance from a UsSurveySquareFeet * In the United States, the foot was defined as 12 inches, with the inch being defined by the Mendenhall Order of 1893 as 39.37 inches = 1 m. This makes a U.S. survey foot exactly 1200/3937 meters. * @param value The unit as UsSurveySquareFeet to create a new Area from. * @returns The new Area instance. */ static FromUsSurveySquareFeet(value: number): Area; /** * Create a new Area instance from a SquareInches * * @param value The unit as SquareInches to create a new Area from. * @returns The new Area instance. */ static FromSquareInches(value: number): Area; /** * Create a new Area instance from a Acres * Based upon the international yard and pound agreement of 1959, an acre may be declared as exactly 4,046.8564224 square metres. * @param value The unit as Acres to create a new Area from. * @returns The new Area instance. */ static FromAcres(value: number): Area; /** * Create a new Area instance from a Hectares * * @param value The unit as Hectares to create a new Area from. * @returns The new Area instance. */ static FromHectares(value: number): Area; /** * Create a new Area instance from a SquareNauticalMiles * * @param value The unit as SquareNauticalMiles to create a new Area from. * @returns The new Area instance. */ static FromSquareNauticalMiles(value: number): Area; /** * Gets the base unit enumeration associated with Area * @returns The unit enumeration that can be used to interact with this type */ protected static getUnitEnum(): typeof AreaUnits; /** * 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(): AreaUnits.SquareMeters; /** * Create API DTO represent a Area unit. * @param holdInUnit The specific Area unit to be used in the unit representation at the DTO */ toDto(holdInUnit?: AreaUnits): AreaDto; /** * Create a Area unit from an API DTO representation. * @param dtoArea The Area API DTO representation */ static FromDto(dtoArea: AreaDto): Area; /** * Convert Area to a specific unit value. * @param toUnit The specific unit to convert to * @returns The value of the specific unit provided. */ convert(toUnit: AreaUnits): number; private convertFromBase; private convertToBase; /** * Format the Area to string. * Note! the default format for Area is SquareMeters. * To specify the unit format set the 'unit' parameter. * @param unit The unit to format the Area. * @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 Area. */ toString(unit?: AreaUnits, options?: number | ToStringOptions): string; /** * Get Area unit abbreviation. * Note! the default abbreviation for Area is SquareMeters. * To specify the unit abbreviation set the 'unitAbbreviation' parameter. * @param unitAbbreviation The unit abbreviation of the Area. * @returns The abbreviation string of Area. */ getUnitAbbreviation(unitAbbreviation?: AreaUnits): string; /** * Check if the given Area are equals to the current Area. * @param area The other Area. * @returns True if the given Area are equal to the current Area. */ equals(area: Area): boolean; /** * Compare the given Area against the current Area. * @param area The other Area. * @returns 0 if they are equal, -1 if the current Area is less then other, 1 if the current Area is greater then other. */ compareTo(area: Area): number; /** * Add the given Area with the current Area. * @param area The other Area. * @returns A new Area instance with the results. */ add(area: Area): Area; /** * Subtract the given Area with the current Area. * @param area The other Area. * @returns A new Area instance with the results. */ subtract(area: Area): Area; /** * Multiply the given Area with the current Area. * @param area The other Area. * @returns A new Area instance with the results. */ multiply(area: Area): Area; /** * Divide the given Area with the current Area. * @param area The other Area. * @returns A new Area instance with the results. */ divide(area: Area): Area; /** * Modulo the given Area with the current Area. * @param area The other Area. * @returns A new Area instance with the results. */ modulo(area: Area): Area; /** * Pow the given Area with the current Area. * @param area The other Area. * @returns A new Area instance with the results. */ pow(area: Area): Area; }