diff options
| author | Fridon <[email protected]> | 2022-06-20 00:52:25 +0400 |
|---|---|---|
| committer | Fridon <[email protected]> | 2022-06-20 00:52:25 +0400 |
| commit | 65261a5ae2ee9c7492b119f1ab1a2a8c19126ef0 (patch) | |
| tree | 29d2108aad9b60c248c8ddc11f8d861791ea558a /models | |
| download | countryfetch-65261a5ae2ee9c7492b119f1ab1a2a8c19126ef0.tar.xz countryfetch-65261a5ae2ee9c7492b119f1ab1a2a8c19126ef0.zip | |
initial commit
Diffstat (limited to 'models')
| -rw-r--r-- | models/country.model.ts | 18 |
1 files changed, 18 insertions, 0 deletions
diff --git a/models/country.model.ts b/models/country.model.ts new file mode 100644 index 0000000..7fa8de0 --- /dev/null +++ b/models/country.model.ts @@ -0,0 +1,18 @@ +// For better currency types, this can be used later: +// https://github.com/freeall/currency-codes +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>; +} |
