diff --git a/types/countries-and-timezones/countries-and-timezones-tests.ts b/types/countries-and-timezones/countries-and-timezones-tests.ts index a73344aa88..4d7e1df64d 100644 --- a/types/countries-and-timezones/countries-and-timezones-tests.ts +++ b/types/countries-and-timezones/countries-and-timezones-tests.ts @@ -1,6 +1,8 @@ import * as lib from 'countries-and-timezones'; +lib.getCountry('IT'); +lib.getTimezone('Europe/Warsaw'); lib.getAllCountries(); lib.getAllTimezones(); -lib.getCountriesForTimezone('Europe/London'); +lib.getCountryForTimezone('Europe/London'); lib.getTimezonesForCountry('GB'); diff --git a/types/countries-and-timezones/index.d.ts b/types/countries-and-timezones/index.d.ts index 3a84ea3b76..f410e37603 100644 --- a/types/countries-and-timezones/index.d.ts +++ b/types/countries-and-timezones/index.d.ts @@ -1,25 +1,28 @@ -// Type definitions for countries-and-timezones 1.0 +// Type definitions for countries-and-timezones 2.0 // Project: https://github.com/manuelmhtr/countries-and-timezones#readme // Definitions by: David Bird +// Piotr OkoĊ„ski // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped export interface Country { id: string; name: string; - timezones: string[]; + timezones: ReadonlyArray; } export interface Timezone { name: string; utcOffset: number; - offsetStr: string; - countries: string[]; + utcOffsetStr: string; + dstOffset: number; + dstOffsetStr: string; + aliasOf: string | null; + country: string | null; } -export function getAllCountries(): {[key: string]: Country}; - -export function getAllTimezones(): {[key: string]: Timezone}; - -export function getCountriesForTimezone(timezoneId: string): Country[]; - -export function getTimezonesForCountry(countryId: string): Timezone[]; +export function getCountry(id: string): Country; +export function getTimezone(name: string): Timezone; +export function getAllCountries(): Country[]; +export function getAllTimezones(): Timezone[]; +export function getCountryForTimezone(name: string): Country; +export function getTimezonesForCountry(id: string): Timezone[];