Open IlCallo opened 5 years ago
would be great to also export your version of DOMRectReadOnly
.
I've got a function that I was trying to pass entry.contentRect
to,
so for the meantime, I'm just defining the argument as Partial<DOMRectReadOnly>
for now.
...
const myFunction = (domRect: Partial<DOMRectReadOnly>) => {/*do something*/}
...
for ( const entry of entries) {
myFunction(entry.contentRect); //works
}
Argument of type "DOMRectReadOnly" is not assignable to parameter of the type "DOMRectReadOnly"
But yeah, either just having this package use TypeScript's built-in DOMRectReadOnly
or exporting the one defined by this package would be nice.
Trying to
contentRect
property with right type, but nativeDOMRectReadOnly
has atoJSON
method that your interface doesn't have, this results into a type mismatch.