Skip to content

Commit

Permalink
fix: Add declarations for modules with the limited time zone data
Browse files Browse the repository at this point in the history
  • Loading branch information
prantlf committed Oct 6, 2018
1 parent 2c68c3c commit d52464d
Showing 1 changed file with 25 additions and 4 deletions.
29 changes: 25 additions & 4 deletions index.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,22 @@ declare module 'timezone-support' {
}
}

declare module 'timezone-support/dist/parse-format' {
function parseZonedTime (input: string, format: string): Time
function formatZonedTime (time: Time, format: string): string

export { parseZonedTime, formatZonedTime }
}

interface PackedTimeZones {
[ key: string ]: string
}

interface TimeZoneData {
zones: PackedTimeZones
links: Array<string>
}

declare module 'timezone-support/dist/lookup-convert' {
interface PackedTimeZones {
[ key: string ]: string
Expand All @@ -64,11 +80,16 @@ declare module 'timezone-support/dist/lookup-convert' {
}
}

declare module 'timezone-support/dist/parse-format' {
function parseZonedTime (input: string, format: string): Time
function formatZonedTime (time: Time, format: string): string
declare module 'timezone-support/dist/data-2012-2022' {
const data: TimeZoneData

export { parseZonedTime, formatZonedTime }
export default data
}

declare module 'timezone-support/dist/index-2012-2022' {
export {
listTimeZones, findTimeZone, getUTCOffset, getZonedTime, getUnixTime, setTimeZone, convertTimeToDate, convertDateToTime
}
}

// export as namespace timezoneSupport;

0 comments on commit d52464d

Please sign in to comment.