mirror of
https://github.com/gosticks/DefinitelyTyped.git
synced 2025-10-16 12:05:41 +00:00
17 lines
645 B
TypeScript
17 lines
645 B
TypeScript
// Type definitions for p-timeout 1.2
|
|
// Project: https://github.com/sindresorhus/p-timeout#readme
|
|
// Definitions by: BendingBender <https://github.com/BendingBender>
|
|
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
|
|
|
|
export = pTimeout;
|
|
|
|
declare function pTimeout<T>(input: PromiseLike<T>, ms: number, message?: string | pTimeout.TimeoutError): Promise<T>;
|
|
declare function pTimeout<T, R>(input: PromiseLike<T>, ms: number, fallback: () => R | Promise<R>): Promise<T | R>;
|
|
|
|
declare namespace pTimeout {
|
|
class TimeoutError extends Error {
|
|
readonly name: 'TimeoutError';
|
|
constructor(message?: string);
|
|
}
|
|
}
|