import { Option } from '../option/option'; import { Try } from './try'; /** * Failure represents a computation that threw an exception during execution. It signals that a * computation that may or may not have succeeded ended up failing. */ declare class Failure implements Try { private error; readonly exception: Error; readonly isFailure: boolean; readonly isSuccess: boolean; constructor(error: Error); equals(other: Try): boolean; filter(predicate: (value: A) => boolean): Try; flatMap(f: (value: A) => Try): Try; foreach(run: (value: A) => void): void; get(): A; getOrElse(this: Failure, defaultValue: () => B): B; map(f: (value: A) => B): Try; match(matcher: { Success: (a: A) => B; Failure: (e: Error) => B; }): B; orElse(this: Failure, alternative: () => Try): Try; recover(fn: (error: Error) => A): Try; recoverWith(fn: (error: Error) => Try): Try; toOption(): Option; } export { Failure };