/** * Invokes the candidate function and returns undefined if an error is thrown from it. * * @param candidate - * The candidate function to run. * * @returns * The result from candidate. Returns undefined if candidate throws an Error. */ export declare function tryFallback(candidate: () => T): T | undefined; /** * Invokes the candidate function and returns fallback if an error is thrown from it. * * @param candidate - * The candidate function to run. * @param fallback - * The fallback value to return if candidate throws an error. * * @returns * The result from candidate. Returns fallback if candidate throws an Error. */ export declare function tryFallback(candidate: () => T, fallback: T): T; /** * Invokes the candidate function and returns undefined if an rejected promise is returned from it. * * @param candidate - * The candidate function to run. * * @returns * A promise that resolves with the result from candidate. Returns undefined * if candidate returns a rejected promise. */ export declare function tryFallbackAsync(candidate: () => Promise): Promise; /** * Invokes the candidate function and returns undefined if an rejected promise is returned from it. * * @param candidate - * The candidate function to run. * @param fallback - * The fallback value that will be returned if candidate returns a rejected promise. * * @returns * A promise that resolves with the result from candidate. Returns fallback * if candidate returns a rejected promise. */ export declare function tryFallbackAsync(candidate: () => Promise, fallback: T): Promise;