UNPKG

flight-planner

Version:

Plan and route VFR flights

42 lines (41 loc) 1.52 kB
import { ICAO } from "./index.js"; /** * RepositoryBase class provides a base implementation for repositories. * * @abstract * @class RepositoryBase<T> * @template T - The type of data to be fetched. */ export declare abstract class RepositoryBase<T> { /** * Fetches data by ICAO codes. * * @param icao - An array of ICAO codes. * @returns A promise that resolves to an array of data. */ abstract fetchByICAO(icao: readonly ICAO[]): Promise<T[]>; /** * Fetches data by geographic bounding box. * * @param bbox - The bounding box coordinates [west, south, east, north]. * @returns A promise that resolves to an array of data. */ fetchByBbox?(bbox: GeoJSON.BBox): Promise<T[]>; /** * Fetches data by geographic location within specified radius. * * @param location - The location coordinates [longitude, latitude]. * @param distance - The radius in kilometers. * @returns A promise that resolves to an array of data. */ fetchByRadius?(location: GeoJSON.Position, distance: number): Promise<T[]>; /** * Fetches data by geographic location within specified radius. * * @param location - The location coordinates [longitude, latitude]. * @param radius - The radius in kilometers (default: 100, max: 1000). * @returns A promise that resolves to an array of data. */ fetchByLocation(location: GeoJSON.Position, radius?: number): Promise<T[]>; } export default RepositoryBase;