diff options
| author | Fridon <[email protected]> | 2022-06-20 17:47:11 +0400 |
|---|---|---|
| committer | Fridon <[email protected]> | 2022-06-20 17:47:11 +0400 |
| commit | a64258e7748134d4e0a114e0d893c139ad9c331b (patch) | |
| tree | b81edb45f8aca4d79530a52891ae9f5a998b0098 /src/models | |
| parent | 82a2f864b8f676b575d075151d7a2db0fe663b51 (diff) | |
| download | countryfetch-a64258e7748134d4e0a114e0d893c139ad9c331b.tar.xz countryfetch-a64258e7748134d4e0a114e0d893c139ad9c331b.zip | |
refactor
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; +} |
