UNPKG

@riaskov/metro-ru

Version:
36 lines (35 loc) 1.21 kB
export interface MetroStation { name: string; nameTranslit: string; lat: number; lon: number; lineColor: string; lineName: string; lineNameTranslit: string; order: number; nameTatar?: string; } export interface GeoPoint { latitude: number; longitude: number; } export declare function calculateDistance(start: GeoPoint, end: GeoPoint): number; export interface BaseStation { Name: string; Line: string; LineColor: string; Order: number; } export interface StandardStation extends BaseStation { Lat: number; Lon: number; } export interface KazanStation extends StandardStation { NameTatar: string; } type InternalStation = StandardStation | KazanStation; export declare function findClosestStations<T extends StandardStation>(stations: T[], lat: number, lon: number, n: number): [MetroStation, number][]; export declare function getStationNames(stations: BaseStation[]): string[]; export declare function getStationsByLineColor<T extends InternalStation>(stations: T[], lineColor: string): MetroStation[]; export declare function getStationNamesByLineColor<T extends InternalStation>(stations: T[], lineColor: string): string[]; export {};