corde
Version:
A simple library for Discord bot tests
15 lines (14 loc) • 465 B
TypeScript
/**
* Executes a function with a timeout.
* If the function takes more time to run than what was provided in
* `timeout`, then this functions is rejected.
*
* @param fn Function to be executed.
* @param timeout Time that this function will wait.
* @returns Result of the executed function (`fn`)
* @internal
*/
export declare function executeWithTimeout<TResult extends any>(
fn: () => TResult | Promise<TResult>,
timeout: number,
): Promise<TResult>;