export function throttle any>( func: T, wait: number ): T { let lastTime = 0; return function (this: any, ...args: Parameters) { const now = Date.now(); if (now - lastTime >= wait) { lastTime = now; return func.apply(this, args); } } as T; }