export type DebounceFunction = (...args: any[]) => (T | Promise); export declare const DEFAULT_DEBOUNCE_TIME = 180; export declare function debounceWithKey(key: symbol, callback: DebounceFunction, time?: number, thisObject?: any, ...args: any[]): Promise; /** * #### Debounces a function that delays invoking until after given time have elapsed since the last time the debounced function was invoked * * * * * * Example usage: * ```typescript * import { debounce } from "@thalesrc/js-utils/promise"; * * function foo() { * console.log("hello"); * } * * for (let i = 0; i < 5; i++) { * debounce(foo); * } * * // logs "hello" only once * ``` * * Static usage example: * ```typescript * import "@thalesrc/js-utils/dist/as-proto/debounce"; * * function foo() { * console.log("hello"); * } * * for (let i = 0; i < 5; i++) { * foo.debounce(); * } * * // logs "hello" only once * ``` * * * * * @param callback The function to execute only last of multiple execute requests by given time * @param [time = 180] Time for debouncing * @param [thisObject = null] This object to execute the callback function with * @param args Function arguments * @return A promise which resolves right after the debouncing sequence has been finished */ export declare function debounce(callback: DebounceFunction, time?: number, thisObject?: any, ...args: any[]): Promise;