/**
 * Routes module with lazy loading and spatial indexing
 *
 * Provides:
 * - Async lazy loading of region-specific route data
 * - Direct import support for binary files
 * - KDBush spatial indexing for fast nearby airport queries
 * - Adjacency lists for O(1) route lookup
 *
 * Data is auto-generated from Jonty/airline-route-data GitHub repository.
 */
import type { GlobalRoutes } from "./schema";
/**
 * Region codes for lazy loading
 */
export type Region = "NA" | "EU" | "APAC" | "ME" | "OTHER" | "LATAM" | "ALL";
/**
 * Lazy load region routes from binary file
 *
 * @param region - Region to load
 * @returns Route data for the specified region
 */
export declare function getRegionRoutes(region: Region): Promise<GlobalRoutes>;
/**
 * Load all regions and merge them
 *
 * @returns Map of all regions
 */
export declare function getAllRegions(): Promise<Map<Region, GlobalRoutes>>;
/**
 * Decode region from binary buffer (for direct import)
 *
 * @param region - Region name
 * @param buffer - Binary buffer
 * @returns Decoded routes
 */
export declare function decodeRegion(region: Region, buffer: ArrayBuffer): Promise<GlobalRoutes>;
/**
 * Route query parameters
 */
export interface RouteQuery {
    /** Origin airport IATA code */
    origin: string;
    /** Destination airport IATA code (optional - returns all routes from origin if not specified) */
    destination?: string;
    /** Filter by specific airline codes (optional) */
    airlines?: string[];
    /** Maximum distance in kilometers (optional) */
    maxDistanceKm?: number;
    /** Maximum duration in minutes (optional) */
    maxDurationMin?: number;
}
/**
 * Route query result
 */
export interface RouteResult {
    /** Origin airport IATA code */
    origin: string;
    /** Destination airport IATA code */
    destination: string;
    /** List of carrier IATA codes serving this route */
    carriers: string[];
    /** Distance in kilometers */
    distanceKm: number;
    /** Duration in minutes */
    durationMin: number;
}
/**
 * Find routes matching the query parameters
 *
 * @param routes - Route data
 * @param query - Query parameters
 * @returns Array of matching routes
 */
export declare function findRoutes(routes: GlobalRoutes, query: RouteQuery): RouteResult[];
/**
 * Check if a route exists between two airports
 *
 * @param routes - Route data
 * @param origin - Origin airport IATA code
 * @param destination - Destination airport IATA code
 * @returns True if route exists, false otherwise
 */
export declare function routeExists(routes: GlobalRoutes, origin: string, destination: string): boolean;
/**
 * Get all destinations from a given origin airport
 *
 * @param routes - Route data
 * @param origin - Origin airport IATA code
 * @returns Array of destination IATA codes
 */
export declare function getDestinations(routes: GlobalRoutes, origin: string): string[];
/**
 * Get route statistics for an airport
 *
 * @param routes - Route data
 * @param iata - Airport IATA code
 * @returns Statistics including route count, carrier count, and total distance
 */
export declare function getAirportRouteStats(routes: GlobalRoutes, iata: string): {
    routeCount: number;
    carrierCount: number;
    totalDistanceKm: number;
} | null;
/**
 * Route index with spatial and adjacency indexing
 *
 * Provides fast (<1ms) route lookup and spatial queries using KDBush
 */
export declare class RouteIndex {
    private spatialIndex;
    private _spatialIndexToAirport;
    private adjacencyList;
    private routeCache;
    private airportIndex;
    private airportList;
    private airportCoordinates;
    private routes;
    constructor(routes: GlobalRoutes, coordinates?: Map<string, {
        lat: number;
        lon: number;
    }>);
    /**
     * Build spatial and adjacency indexes
     */
    private buildIndexes;
    /**
     * Fast route lookup using adjacency list (<1ms)
     */
    findRoutes(origin: string, destination: string): RouteResult[];
    /**
     * Find airports near a location using spatial index
     *
     * @param lat - Latitude in decimal degrees
     * @param lon - Longitude in decimal degrees
     * @param km - Maximum distance in kilometers
     * @param maxResults - Maximum number of results to return (optional)
     * @returns Array of nearby airports with distances
     */
    findNearby(lat: number, lon: number, km: number, maxResults?: number): Array<{
        iata: string;
        distance: number;
    }>;
    /**
     * Calculate distance between two points using Haversine formula
     */
    private calculateDistance;
    /**
     * Get route statistics for an airport
     */
    getAirportStats(iata: string): {
        routeCount: number;
        carriers: number;
    } | null;
}
export * from "./schema";
export * from "./codec";
export * from "./pathfinding";
//# sourceMappingURL=index.d.ts.map