-
Notifications
You must be signed in to change notification settings - Fork 1
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add TypeScript definitions #3
Conversation
This reverts commit d4d08e2.
This should be a temporary solution until TypeScript officially supports ResizeObserver.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Added some comments.
As an aside, it is possible to just add the tsconfig.js & get that to output TS type defs without converting everything to TS, just fyi. There's a guide here on how to do that, if you're interested.
I'm now waiting on TypeScript 4.2 to be released, which includes interfaces for Scheduled for 23 February: microsoft/TypeScript#41601 |
Context
We've added types to envato/react-breakpoints#8. Because its dependency on this package, we need to add types here as well for the exported code. An issue was raised for this: envato/react-breakpoints#11
Changes
Adds ResizeObserver interfaces by copying type definitions from @juggle/resize-observer. This polyfill is considered up-to-spec but I want to avoid adding it as a real dependency to this package for consumers. As an intermediate solution, I'm copying its type definitions until ResizeObserver API declarations missing microsoft/TypeScript#37861 is merged.