getBoundingClientRect method of a ISuperNode. According to the types (typescript) these elements like x etc should be promises, but they are just plain properties. I know this is from a dependency you use, but it's still pretty annoying, nee to manually cast it.
E.g.:
const myEl = await myFrame.querySelector(
'css path',
);
const rect =
(await myEl.getBoundingClientRect()) as any as {
x: number;
y: number;
width: number;
height: number;
Without the cast above it thinks that the return object of await myEl.getBoundingClientRect() has its properties like x as a promise. But a debugger shows that it is a plain number, not a promise.
getBoundingClientRect method of a ISuperNode. According to the types (typescript) these elements like x etc should be promises, but they are just plain properties. I know this is from a dependency you use, but it's still pretty annoying, nee to manually cast it.
E.g.:
Without the cast above it thinks that the return object of
await myEl.getBoundingClientRect()
has its properties likex
as a promise. But a debugger shows that it is a plain number, not a promise.