export interface ThrottleOptions { /** * Enforced milliseconds between calls. For `when='trailing'` this is the debounce delay. */ delay?: number; /** * When to call the throttled function. Defaults to `both`. */ when?: 'both' | 'leading' | 'trailing'; } /** * Throttles calls to a callback that returns a void promise. * Immediately invokes the callback on the first call unless `when` is `'trailing'`. * If the throttled function is called while a call is pending or queued, * the call is queued to run `delay` after it's made, * or, if a call is still running then, `delay` after that call settles, * and only the last call's args run. * In other words, all calls and their args are discarded * during the pending window except for the most recent. * Calls never overlap: a call made while the queued call runs opens a new window. * Unlike debouncing, this calls the throttled callback * both on the leading and trailing edges of the delay window by default, * and this can be customized by setting `when` to `'leading'` or `'trailing'`. * It also differs from a queue where every call to the throttled callback eventually runs. * The promise returned for a queued call settles like the callback's, * rejecting with its error, and the throttle keeps working after a rejection. * @returns same as `cb` */ export declare const throttle: ) => Promise>(cb: T, { delay, when }?: ThrottleOptions) => T; //# sourceMappingURL=throttle.d.ts.map