import { type HereCitySource, type HereTown } from "./here-city.ts"; import type { Place } from "./places.ts"; export interface HereCityHost { /** `false` leaves every label as the page set it. A number is the kilometre limit. */ setLimit(limit: false | number): void; /** The places to draw. A `here` place whose city is known has that city's name; every other place is the one given. */ named(places: readonly Place[]): readonly Place[]; /** The page's language changed: name the places again from the cities already loaded. */ refresh(): void; readonly stats: { on: boolean; maxKm: number; loaded: boolean; pending: boolean; }; dispose(): void; } export interface HereCityOptions { language(): "en" | "ja"; /** Cities have arrived, or the language changed, so the element can lay the names out once. */ onChange(): void; /** kuni could not be loaded. */ onError?(error: unknown): void; /** The city list. The default is kuni's capitals, cities of a million and cities of 100,000, loaded only when a `here` place asks. */ load?(): Promise; /** One country's cities, every tier. The default is kuni's `citiesOf`, once per country. */ towns?(country: string): Promise; } /** * The namer for one element. `load` runs at most once, and only after `setLimit` is a number and `named` is given a `here` place. */ export declare function createHereCity(options: HereCityOptions): HereCityHost;