function.d.ts 1.1 KB

12345678910111213141516171819202122
  1. /**
  2. * If the key was passed before, then doesn't execute the func
  3. * @param {Function} func
  4. * @param {string} key
  5. */
  6. export declare function doOnce(func: () => void, key: string): void;
  7. /** @deprecated */
  8. export declare function getFunctionParameters(func: any): any;
  9. export declare function isFunction(val: any): boolean;
  10. export declare function executeInAWhile(funcs: Function[]): void;
  11. export declare function executeNextVMTurn(funcs: Function[]): void;
  12. export declare function executeAfter(funcs: Function[], milliseconds?: number): void;
  13. /**
  14. * from https://stackoverflow.com/questions/24004791/can-someone-explain-the-debounce-function-in-javascript
  15. * @param {Function} func The function to be debounced
  16. * @param {number} wait The time in ms to debounce
  17. * @param {boolean} immediate If it should run immediately or wait for the initial debounce delay
  18. * @return {Function} The debounced function
  19. */
  20. export declare function debounce(func: (...args: any[]) => void, wait: number, immediate?: boolean): (...args: any[]) => void;
  21. export declare function compose(...fns: Function[]): (arg: any) => any;
  22. export declare function callIfPresent(func: Function): void;