UNPKG

flight-planner

Version:

Plan and route VFR flights

90 lines (89 loc) 3.88 kB
import { Angle, Distance, Mass, Pressure, Speed, Temperature, Volume } from "convert-units"; /** * Defines unit preferences for various measurements used in flight planning. * * @interface UnitOptions * @property {UnitSpeed} [speed='kts'] - Unit for speed measurements (knots, kilometers per hour, miles per hour, or meters per second). * @property {UnitDistance} [distance='nm'] - Unit for distance measurements (nautical miles, kilometers, or miles). * @property {UnitAltitude} [altitude='ft'] - Unit for altitude measurements (feet or meters). * @property {UnitTemperature} [temperature='C'] - Unit for temperature measurements (Celsius or Fahrenheit). * @property {UnitPressure} [pressure='hPa'] - Unit for pressure measurements (hectopascals or inches of mercury). * @property {UnitWeight} [weight='kg'] - Unit for weight measurements (kilograms or pounds). * @property {UnitVolume} [volume='l'] - Unit for volume measurements (liters or gallons). * @property {UnitAngle} [angle='deg'] - Unit for angular measurements (degrees or radians). */ export interface UnitOptions { speed?: Speed; distance?: Distance; altitude?: Distance; elevation?: Distance; temperature?: Temperature; pressure?: Pressure; mass?: Mass; volume?: Volume; angle?: Angle; } /** * Converts speed from default units to the specified units. * * @param {number} speed - The speed value to convert. * @param {UnitOptions} units - The target unit options. * @returns {number} The converted speed. */ export declare const convertSpeed: (speed: number, units: UnitOptions) => number; /** * Converts elevation from default units to the specified units. * * @param {number} elevation - The elevation value to convert. * @param {UnitOptions} units - The target unit options. * @returns {number} The converted elevation. */ export declare const convertElevation: (elevation: number, units: UnitOptions) => number; /** * Converts altitude from default units to the specified units. * * @param {number} altitude - The altitude value to convert. * @param {UnitOptions} units - The target unit options. * @returns {number} The converted altitude. */ export declare const convertAltitude: (altitude: number, units: UnitOptions) => number; /** * Converts temperature from default units to the specified units. * * @param {number} temperature - The temperature value to convert. * @param {UnitOptions} units - The target unit options. * @returns {number} The converted temperature. */ export declare const convertTemperature: (temperature: number, units: UnitOptions) => number; /** * Converts pressure from default units to the specified units. * * @param {number} pressure - The pressure value to convert. * @param {UnitOptions} units - The target unit options. * @returns {number} The converted pressure. */ export declare const convertPressure: (pressure: number, units: UnitOptions) => number; /** * Converts distance from default units to the specified units. * * @param {number} distance - The distance value to convert. * @param {UnitOptions} units - The target unit options. * @returns {number} The converted distance. */ export declare const convertDistance: (distance: number, units: UnitOptions) => number; /** * Converts mass from default units to the specified units. * * @param {number} mass - The mass value to convert. * @param {UnitOptions} units - The target unit options. * @returns {number} The converted mass. */ export declare const convertMass: (mass: number, units: UnitOptions) => number; /** * Converts volume from default units to the specified units. * * @param {number} volume - The volume value to convert. * @param {UnitOptions} units - The target unit options. * @returns {number} The converted volume. */ export declare const convertVolume: (volume: number, units: UnitOptions) => number;