From a64258e7748134d4e0a114e0d893c139ad9c331b Mon Sep 17 00:00:00 2001 From: Fridon Date: Mon, 20 Jun 2022 17:47:11 +0400 Subject: refactor --- src/models/country.model.ts | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) create mode 100644 src/models/country.model.ts (limited to 'src/models') 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; + capital: string[]; + flag: string; + population: number; + languages: Record; + region: string; +} -- cgit v1.2.3