I think these type definitions exist so that libraries can all rely on the same specific type definition, which helps with cross compatibility.
If I was doing a simple binding for RAF I would use the method you have above, but if you’d like to use the type definition you’d need a (1) getter for window and (2) to specify it as a property of window
Thank you. Another question. I tried to use the Dom.window but my compiler complains that it can’t find the value Dom.window. I am using ReScript 11 rc-4
If you want to use web-apis, install rescript-webapi or at least use their repo as a reference to copy the bindings you need. The value binding for window looks like this: