throttle.d.ts 456 B

1234567891011121314151617
  1. /**
  2. * Throttle a function
  3. */
  4. export declare function throttle(func: any, wait: number, options?: any): (this: any) => any;
  5. /**
  6. * Throttle decorator
  7. *
  8. * class MyClass {
  9. * throttleable(10)
  10. * myFn() { ... }
  11. * }
  12. */
  13. export declare function throttleable(duration: number, options?: any): (target: any, key: string | number | symbol, descriptor: PropertyDescriptor) => {
  14. configurable: boolean;
  15. enumerable: boolean;
  16. get: () => any;
  17. };