@rr0/place
Version:
Place representation API
21 lines (20 loc) • 804 B
TypeScript
import { Elevation, Place } from "./Place.js";
import { PlaceLocation } from "./location/PlaceLocation.js";
export declare abstract class PlaceService {
readonly rootDir: string;
protected readonly cache: Map<string, Place>;
protected readonly regex: RegExp;
protected constructor(rootDir: string);
read(fileName: string): Promise<Place>;
get(address: string): Promise<Place | undefined>;
getFileName(location: PlaceLocation): string;
protected abstract geocode(address: string): Promise<{
location: PlaceLocation;
data: any;
} | undefined>;
protected key(location: PlaceLocation): string;
protected abstract getElevation(location: PlaceLocation): Promise<Elevation | undefined>;
private cachePlace;
private create;
private save;
}