UNPKG

@qso-soft/shared

Version:

Shared library for QSO-soft

17 lines (16 loc) 670 B
interface GetTimeoutPromiseArgs { timeoutInSeconds: number; errorMessage?: string; } export declare const getTimeoutPromise: ({ timeoutInSeconds, errorMessage }: GetTimeoutPromiseArgs) => { timeout: NodeJS.Timeout | undefined; timeoutPromise: Promise<unknown>; }; type MakeRequestWithTimeoutArgs<RequestReturnType> = GetTimeoutPromiseArgs & { callback: () => Promise<RequestReturnType>; }; export declare const callFunctionWithTimeout: <RequestReturnType>({ timeoutInSeconds, callback, errorMessage, }: MakeRequestWithTimeoutArgs<RequestReturnType>) => Promise<{ result: RequestReturnType; timeout: NodeJS.Timeout | undefined; }>; export {};