The code below shows that onResizeWindowHandles
is currently of type any
, but it should be an array of functions:
export default class PageLayoutManager {
private $Window: JQuery<Window>;
private onResizeWindowHandlers: any;
constructor () {
this.$Window = $(window);
this.handleWindowResize();
this.onResizeWindowHandlers = new Array();
}
public addWindowOnResizeHandler(newHandler: any): void {
this.onResizeWindowHandlers.push(newHandler);
}
private handleWindowResize(): void {
this.$Window.on('resize', () => {
this.onResizeWindowHandlers.forEach(handlerFunction => {
handlerFunction();
})
});
}
}
What is the correct way to define the type for onResizeWindowHandles
?