UNPKG

magnitude-core

Version:
24 lines (23 loc) 1.01 kB
export type RetryMode = { mode: 'retry_on_partial_message'; errorSubstrings: string[]; } | { mode: 'retry_all'; }; export type RetryParams = { retryLimit: number; delayMs: number; showWarnOnRetry: boolean; }; export type RetryOptions = RetryMode & RetryParams; export declare function retryOnErrorIsSuccess<T>(fnToRetry: () => Promise<T>, retryOptions: RetryMode & Partial<RetryParams>): Promise<boolean>; export declare function retryOnError<T>(fnToRetry: () => Promise<T>, retryOptions: RetryMode & Partial<RetryParams>): Promise<T>; /** * Performs a deep comparison between two values to determine if they are equivalent. * * @param a The first value to compare. * @param b The second value to compare. * @param cache A WeakMap to handle circular references. Should not be provided by the caller. * @returns `true` if the values are deeply equal, `false` otherwise. */ export declare function deepEquals(a: any, b: any, cache?: WeakMap<object, WeakSet<object>>): boolean;