timezone-support icon indicating copy to clipboard operation
timezone-support copied to clipboard

TS Typings do not export Time, TimeZoneOffset and TimeZoneInfo

Open powertomato opened this issue 6 years ago • 1 comments

Are those interfaces really considered private? If so then why some public functions use them as return and/or input types?

For now I need to use "any" or redefine the interfaces in my own code, which doesn't seem right.

powertomato avatar Oct 23 '19 13:10 powertomato

I agree this is an issue, but you can use TS generics to extract it from exported members:

import { convertDateToTime } from 'timezone-support'; // Time type is not exported from timezone-support type Time = ReturnType<typeof convertDateToTime>;

kravco avatar May 20 '20 18:05 kravco