Skip to content

Commit

Permalink
feat: update typings gen
Browse files Browse the repository at this point in the history
  • Loading branch information
dmythro committed Sep 11, 2023
1 parent bc55fea commit e136da7
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 10 deletions.
10 changes: 5 additions & 5 deletions dist/index.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -68,13 +68,13 @@ declare type TStringToCountry = Record<string, TCountryCode>
declare type TLanguages = Record<TLanguageCode, ILanguage>
declare type TLanguageToString = Record<TLanguageCode, string>

declare const getCountryCode: (countryName: string) => TCountryCode | false;
declare const getCountryData: (iso2: TCountryCode) => ICountryData;
declare const getCountryDataList: () => ICountryData[];
declare const getEmojiFlag: (countryCode: TCountryCode) => string;
declare const getCountryCode: (countryName: string) => TCountryCode | false
declare const getCountryData: (iso2: TCountryCode) => ICountryData
declare const getCountryDataList: () => ICountryData[]
declare const getEmojiFlag: (countryCode: TCountryCode) => string

declare const continents: TContinents
declare const countries: TCountries
declare const languages: TLanguages

export { continents, countries, getCountryCode, getCountryData, getCountryDataList, getEmojiFlag, languages };
export { continents, countries, getCountryCode, getCountryData, getCountryDataList, getEmojiFlag, languages }
10 changes: 5 additions & 5 deletions packages/scripts/tasks/generateTypings.ts
Original file line number Diff line number Diff line change
Expand Up @@ -19,16 +19,16 @@ export const generateTypings = (): void => {
.replace('keyof typeof languages', "'" + Object.keys(languages).join("' | '") + "'") +
[
'',
'declare const getCountryCode: (countryName: string) => TCountryCode | false;',
'declare const getCountryData: (iso2: TCountryCode) => ICountryData;',
'declare const getCountryDataList: () => ICountryData[];',
'declare const getEmojiFlag: (countryCode: TCountryCode) => string;',
'declare const getCountryCode: (countryName: string) => TCountryCode | false',
'declare const getCountryData: (iso2: TCountryCode) => ICountryData',
'declare const getCountryDataList: () => ICountryData[]',
'declare const getEmojiFlag: (countryCode: TCountryCode) => string',
'',
'declare const continents: TContinents',
'declare const countries: TCountries',
'declare const languages: TLanguages',
'',
'export { continents, countries, getCountryCode, getCountryData, getCountryDataList, getEmojiFlag, languages };',
'export { continents, countries, getCountryCode, getCountryData, getCountryDataList, getEmojiFlag, languages }',
].join('\n')

saveTextFile('index.d.ts', typings.trim())
Expand Down

0 comments on commit e136da7

Please sign in to comment.