#Where to get the types for an experimental JS constructor?

5 messages · Page 1 of 1 (latest)

broken python
#

The ScrollTimeline constructor (https://developer.mozilla.org/en-US/docs/Web/API/ScrollTimeline/ScrollTimeline) is relatively new, and I'd like to use it in a project, but TypeScript says it doesn't know what it is. I figure either something isn't up to date with the latest JavaScript constructors, or experimental constructors are never included in something... I'm not really sure where to go from here. How can I do a new ScrollTimeline() in React?

MDN Web Docs

The ScrollTimeline() constructor creates a new ScrollTimeline object instance.

lime glacier
#

i think most of the built-in DOM typings are generated from WebIDL definitions in the specifications or something like that. i don't know what the whole toolchain looks like, but they're updated via PRs like this

#

not sure if there's source material that you could use to generate the types yourself so you don't have to write them by hand

broken python
#

Thanks!