This adds a ResizeCallback type instead of Function and adds the static detach/reset functions to ResizeSensor.
This allows the following:
const callback: ResizeSensorCallback = (size) => {
console.log(size.width); // size.width is a number
console.log(size.height); // size.height is a number
};
const sensor = new ResizeSensor(element, callback);
ResizeSensor.detach(element, callback); // type checked args
ResizeSensor.reset(element); // type checked args
sensor.detach(callback); // type checked arg
sensor.reset(); // type checked
…to ResizeSensor class
This adds a ResizeCallback type instead of Function and adds the static detach/reset functions to ResizeSensor.
This allows the following: