UNPKG

@xapp/arachne-utils

Version:

13 lines (12 loc) 396 B
/*! Copyright (c) 2020, XAPP AI */ export declare class TimeoutError extends Error { readonly name = "TimeoutError"; } /** * Wraps the function that returns a promise with a timeout * * @param timeoutMs * @param promise * @param failureMessage */ export declare const promiseWithTimeout: <T>(timeoutMs: number, promise: () => Promise<T>, failureMessage?: string | Error) => Promise<T>;