import { Option } from '../option/option'; import { Try } from './try'; /** * Success represents a computation that ended normally. It signals that a computation that may or * may not have completed did actually complete. */ declare class Success implements Try { private value; readonly isFailure: boolean; readonly isSuccess: boolean; constructor(value: A); 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: Success, defaultValue: () => B): B; map(f: (value: A) => B): Try; match(matcher: { Success: (a: A) => B; Failure: (e: Error) => B; }): B; orElse(this: Success, alternative: () => Try): Try; recover(fn: (error: Error) => A): Try; recoverWith(fn: (error: Error) => Try): Try; toOption(): Option; } export { Success };