Reference · Places: countries of a continent, and search (the size counts every tier)
SearchPlacesOptionstype
What searchPlaces may be asked.
Import it
import type { SearchPlacesOptions } from "@johnmorrisdotca/kuni/places";
Definition
interface SearchPlacesOptions {
lang?: "en" | "ja";
limit?: number;
tiers?: readonly CityTier[];
country?: string;
match?: "anywhere" | "start";
}
Members
| Name | Type | Description |
|---|---|---|
lang (optional) | "en" | "ja" | undefined | The language of each hit's |
limit (optional) | number | undefined | The most hits to return; 20 by default, at most 100. |
tiers (optional) | readonly CityTier[] | undefined | The tiers of cities to search: the capitals, the cities of a million or more and of 100,000 or more by default. |
country (optional) | string | undefined | Search the cities of this country only (every tier, loaded on its own), and no countries. |
match (optional) | "anywhere" | "start" | undefined | "anywhere" (the default) finds the text anywhere in a name. "start" finds it only at the start of a name or of a word in it (Paris, New York for "york"), and so fetches only the part of the capitals and of the 100k tier that holds such names (a few kilobytes, not the whole tier): the right one for a box that searches as somebody types. |
Examples
import type { SearchPlacesOptions } from "@johnmorrisdotca/kuni/places";
const value: SearchPlacesOptions = { lang: "ja", limit: 5 };
console.log(Object.keys(value).join(" "));lang limitWhat it prints (run when this page was built)