48 lines
880 B
TypeScript
48 lines
880 B
TypeScript
import source from "./world-countries.json";
|
|
|
|
export type WorldCountry = {
|
|
code: string;
|
|
name: string;
|
|
nativeName?: string;
|
|
regionCount: number;
|
|
};
|
|
|
|
export type WorldCountryIndex = {
|
|
source: {
|
|
repository: string;
|
|
release: string;
|
|
url: string;
|
|
license: string;
|
|
};
|
|
countries: WorldCountry[];
|
|
};
|
|
|
|
export type WorldCity = {
|
|
code: string;
|
|
name: string;
|
|
nativeName?: string;
|
|
latitude: number;
|
|
longitude: number;
|
|
timezone: string;
|
|
};
|
|
|
|
export type WorldRegion = {
|
|
code: string;
|
|
name: string;
|
|
nativeName?: string;
|
|
latitude: number;
|
|
longitude: number;
|
|
timezone: string;
|
|
cities: WorldCity[];
|
|
};
|
|
|
|
export type WorldCountryData = {
|
|
code: string;
|
|
name: string;
|
|
nativeName?: string;
|
|
regions: WorldRegion[];
|
|
};
|
|
|
|
export const worldCountryIndex = source as WorldCountryIndex;
|
|
export const worldCountries = worldCountryIndex.countries;
|