リファレンス · 場所:大陸の国と検索(サイズはすべての段階を含みます)
SearchPlacesOptions型
リファレンスの説明と例は英語です。見出しと目次は日本語です。
What searchPlaces may be asked.
インポート
import type { SearchPlacesOptions } from "@johnmorrisdotca/kuni/places";
定義
interface SearchPlacesOptions {
lang?: "en" | "ja";
limit?: number;
tiers?: readonly CityTier[];
country?: string;
match?: "anywhere" | "start";
}
メンバー
| 名前 | 型 | 説明 |
|---|---|---|
lang (省略可) | "en" | "ja" | undefined | The language of each hit's |
limit (省略可) | number | undefined | The most hits to return; 20 by default, at most 100. |
tiers (省略可) | 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 (省略可) | string | undefined | Search the cities of this country only (every tier, loaded on its own), and no countries. |
match (省略可) | "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. |
例
import type { SearchPlacesOptions } from "@johnmorrisdotca/kuni/places";
const value: SearchPlacesOptions = { lang: "ja", limit: 5 };
console.log(Object.keys(value).join(" "));lang limit出力(このページを作ったときに実行した結果)
この日本語は、まだ日本語を母語とする方の確認を受けていません。訂正を歓迎します。