diff options
Diffstat (limited to 'src/models')
| -rw-r--r-- | src/models/country.model.ts | 20 |
1 files changed, 20 insertions, 0 deletions
diff --git a/src/models/country.model.ts b/src/models/country.model.ts new file mode 100644 index 0000000..4765d5e --- /dev/null +++ b/src/models/country.model.ts @@ -0,0 +1,20 @@ +// For better currency types, this can be used later: +// https://github.com/freeall/currency-codes +// Same can be done for language abbreviations +export type CurrencyAbbr = string; +export type CurrencyInfo = { name: string; symbol: string }; +export type LangAbbr = string; + +export interface Country { + name: { + common: string; + official: string; + // Need type for nativeName later + }; + currencies: Record<CurrencyAbbr, CurrencyInfo>; + capital: string[]; + flag: string; + population: number; + languages: Record<LangAbbr, string>; + region: string; +} |
