/** * Returns a promise that resolves after the specified number of milliseconds. * * @group Async * @example * ``` * await delay(1000) // wait for 1 second * ``` */ export declare function delay( /** * The number of milliseconds to delay. */ timeInMs: number): Promise; /** * Creates and returns a new debounced version of the passed function that will postpone its execution * until after wait milliseconds have elapsed since the last time it was invoked. * * @group Async * @example * ``` * const debounced = debounce(() => console.log('debounced'), 100) * debounced() // will be called after 100ms * ``` */ export declare function debounce( /** * The function to be debounced. */ func: (...args: A) => void, /** * The number of milliseconds to delay. */ timeInMs: number): (this: unknown, ...args: A) => void; /** * Creates a throttled function that will execute `func` at most once per `timeInMs` interval. * * @group Async * @example * ``` * const throttled = throttle(() => console.log('throttled'), 100) * throttled() // will be called immediately * throttled() // will be ignored * await delay(100) * throttled() // will be called after 100ms * ``` */ export declare function throttle( /** * The function to be throttled. */ func: (...args: A) => void, /** * The number of milliseconds to throttle invocations to. */ timeInMs: number, /** * Options object. */ options?: { /** * If `true` the `func` will be executed on the leading edge of the timeout. * @defaultValue `true` */ leading?: boolean; /** * If `true` the `func` will be executed on the trailing edge of the timeout. * @defaultValue `true` */ trailing?: boolean; }): (this: unknown, ...args: A) => void;