CountryTrivia型
リファレンスの説明と例は英語です。見出しと目次は日本語です。
The trivia about one country, from the /trivia entry: null where the source has none.
インポート
import type { CountryTrivia } from "@johnmorrisdotca/kuni/trivia";
定義
interface CountryTrivia {
alpha2: string;
inception: {
year: number;
day?: string;
} | null;
officialLanguages: readonly string[];
largestCity: {
id: string;
name: {
en: string;
ja: string | null;
};
} | null;
}
メンバー
| 名前 | 型 | 説明 |
|---|---|---|
alpha2 | string | ISO 3166-1 alpha-2, "JP" |
inception | { year: number; day?: string; } | null | When Wikidata says the country, as it is today, began (P571, inception): the year, and the day where Wikidata
gives one. Often the day of independence (India, 1947-08-15), sometimes a constitution or a union (Japan,
1947-05-03), so it is not a date of independence. |
officialLanguages | readonly string[] | The languages CLDR records as official there, by law or in fact, most spoken first: language subtags, ISO 639-1
where the language has one ("en") and ISO 639-3 otherwise ("gsw"). Empty where CLDR records none. The languages
people speak, official or not, are |
largestCity | { id: string; name: { en: string; ja: string | null; }; } | null | The city with the most people in the city itself (its city proper: the municipality or district that is the
city, as its census counts it), not the urban area round it: Rome for Italy, not Milan. Its id in /cities and its
name. |
例
import type { CountryTrivia } from "@johnmorrisdotca/kuni/trivia";
import { trivia } from "@johnmorrisdotca/kuni/trivia";
const value: CountryTrivia = trivia("JP")!;
console.log(typeof value === "object" ? Object.keys(value).slice(0,6) : value);[ 'alpha2', 'inception', 'officialLanguages', 'largestCity' ]出力(このページを作ったときに実行した結果)
この日本語は、まだ日本語を母語とする方の確認を受けていません。訂正を歓迎します。