ronatskiy / country-flags-svg

A list of countries with url links to a svg image which you can simply use in your web application
MIT License
29 stars 27 forks source link

Typescript compatibility request #20

Open st-clair-clarke opened 3 years ago

st-clair-clarke commented 3 years ago

Hi, Is it possible to have Typescript definition files for country-flags-svg please.

Thanks

alexmac131 commented 2 years ago

Yes please, i would like this as well. This would then be more usable in angular 13 +

MihailCarabetchi commented 1 year ago
declare module 'country-flags-svg' {
  const countries: CountryData[];
  const flagUrls: Record<string, string>;

  function findFlagUrlByCountryName(countryName: string): string;
  function findFlagUrlByNationality(nationality: string): string;
  function findFlagUrlByIso2Code(iso2Code: string): string;
  function findFlagUrlByIso3Code(iso3Code: string): string;

  interface CountryData {
    name: string;
    demonym: string;
    flag: string;
    iso2: string;
    iso3: string;
    altSpellings: string[];
  }
}