import { EitherInterface } from './interfaces/either.interface'; import { Right } from './right'; /** * @class Left */ export declare class Left implements EitherInterface { /** * Lift a value into Either. * @param {TNewValue} x * @returns {Left} */ static of(x: TNewValue): Left; /** * @returns {any} */ static readonly [Symbol.species]: any; /** * Internally stored value. */ protected readonly _value: T; /** * @constructor * @param {T} x */ constructor(x: T); /** * Apply the function value of current Either to another Either. * @param {Left} v * @returns {Left} */ ap(v: EitherInterface): Left; /** * Transform the Left value of the Either using a unary function to monad. * @param {(x: T) => Left} f * @returns {Left} */ chain(f: (x: T) => EitherInterface): Left; /** * Concat the Left value of the Either with another Left or keep Left on either side. * @param {Left} x * @returns {Left} */ concat(x: EitherInterface): Left; /** * Transform internal value of the either. * @param {(e: T) => TNewResult} f * @returns {FunctorInterface} */ map(f: (e: T) => TNewResult): Left; /** * Lift a value into Either. * @param {TNewValue} x * @returns {Left} */ of(x: TNewValue): Left; /** * Unsafely get internal value of the Either. * @returns {T} */ unsafeGet(): T; /** * Swap disjunction values. * @returns {Right} */ swap(): Right; /** * Get value fot the Either if in its Leftmost case or run provided function. * @param {(x: T) => TNewResult} f * @returns {T} */ getOrElse(f: (x?: T) => TNewResult): TNewResult; /** * Safely get value of the Either. * @param {(x: T) => TLeftResult} f * @param {(x: T) => TLeftResult} g * @returns {any} */ fold(f: (x: T) => TLeftResult, g: (x: T) => any): TLeftResult; /** * Test if the Either equals another Either. * @param {Left} x * @returns {boolean} */ equals(x: Left): boolean; /** * Approval for Either to be Left. * @returns {boolean} */ readonly isRight: boolean; /** * Approval for Either to be Left. * @returns {boolean} */ readonly isLeft: boolean; /** * @returns {string} */ toString(): string; }