-export function debounce(func, waitMs, immediate) {
- let timeout;
- return function debouncedWrapper(...args) {
- const context = this;
+export function debounce(func: Function, waitMs: number, immediate: boolean): Function {
+ let timeout: number|null = null;
+ return function debouncedWrapper(this: any, ...args: any[]) {
+ const context: any = this;