aboutsummaryrefslogtreecommitdiff
path: root/src/models/country.model.ts
blob: 1a6b3ae8400953729bf334e6eff9a83eb8b3f4e2 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
// For better currency types, this can be used later:
// https://github.com/freeall/currency-codes
// Same can be done for language abbreviations
type CurrencyAbbr = string;
type CurrencyInfo = { name: string; symbol: string };
type LangAbbr = string;

export type Currencies = Record<CurrencyAbbr, CurrencyInfo>;
export type Languages = Record<LangAbbr, string>;
export enum Region {
  Asia = "Asia",
  Europe = "Europe",
  Americas = "Americas",
  Africa = "Africa",
  Oceania = "Oceania",
  Antarctic = "Antarctic",
}

export interface Country {
  name: {
    common: string;
    official: string;
    // Need type for nativeName later
  };
  currencies: Currencies;
  capital: string[];
  flag: string;
  population: number;
  languages: Languages;
  region: Region;
}