import type { AsyncMonad, Alternative, Container, Catamorphism } from "@sweet-monads/interfaces"; declare const enum EitherType { Left = "Left", Right = "Right" } declare class EitherConstructor implements AsyncMonad, Alternative, Container, Catamorphism<[L, R]> { private readonly type; readonly value: T extends EitherType.Left ? L : R; static chain(f: (v: R) => Promise>): (m: Either) => Promise>; static chain(f: (v: R) => Promise>): (m: Either) => Promise>; static chain(f: (v: R) => Promise>): (m: Either) => Promise>; static mergeInOne(values: [Either]): Either; static mergeInOne(values: [Either, Either]): Either; static mergeInOne(values: [Either, Either, Either]): Either; static mergeInOne(values: [Either, Either, Either, Either]): Either; static mergeInOne(values: [Either, Either, Either, Either, Either]): Either; static mergeInOne(values: [Either, Either, Either, Either, Either, Either]): Either; static mergeInOne(values: [ Either, Either, Either, Either, Either, Either, Either ]): Either; static mergeInOne(values: [ Either, Either, Either, Either, Either, Either, Either, Either ]): Either; static mergeInOne(values: [ Either, Either, Either, Either, Either, Either, Either, Either, Either ]): Either; static mergeInOne(values: [ Either, Either, Either, Either, Either, Either, Either, Either, Either, Either ]): Either; static mergeInOne(either: Array>): Either; static merge: typeof EitherConstructor.mergeInOne; static mergeInMany(values: [Either]): Either, [R1]>; static mergeInMany(values: [Either, Either]): Either, [R1, R2]>; static mergeInMany(values: [Either, Either, Either]): Either, [R1, R2, R3]>; static mergeInMany(values: [Either, Either, Either, Either]): Either, [R1, R2, R3, R4]>; static mergeInMany(values: [Either, Either, Either, Either, Either]): EitherConstructor, [R1, R2, R3, R4, R5]>; static mergeInMany(values: [Either, Either, Either, Either, Either, Either]): Either, [R1, R2, R3, R4, R5, R6]>; static mergeInMany(values: [ Either, Either, Either, Either, Either, Either, Either ]): Either, [R1, R2, R3, R4, R5, R6, R7]>; static mergeInMany(values: [ Either, Either, Either, Either, Either, Either, Either, Either ]): EitherConstructor, [R1, R2, R3, R4, R5, R6, R7, R8]>; static mergeInMany(values: [ Either, Either, Either, Either, Either, Either, Either, Either, Either ]): Either, [R1, R2, R3, R4, R5, R6, R7, R8, R9]>; static mergeInMany(values: [ Either, Either, Either, Either, Either, Either, Either, Either, Either, Either ]): Either, [R1, R2, R3, R4, R5, R6, R7, R8, R9, R10]>; static mergeInMany(either: Array>): Either; static from(v: T): Either; static fromPromise(promise: Promise): Promise>; static fromTry(fn: () => R): Either; static right(v: T): Either; static left(v: T): Either; private constructor(); isLeft(): this is EitherConstructor; isRight(): this is EitherConstructor; join(this: Either>): Either; mapRight(f: (r: R) => T): Either; mapLeft(f: (l: L) => T): Either; map(f: (r: R) => T): Either; asyncMap(f: (r: R) => Promise): Promise>; apply(this: Either B>, arg: Either): Either; apply(this: Either, fn: Either B>): Either; asyncApply(this: Either Promise>, arg: Either | A>): Promise>; asyncApply(this: Either | A>, fn: Either B>>): Promise>; chain(f: (r: R) => Either): Either; asyncChain(f: (r: R) => Promise>): Promise>; or(x: Either): Either; unwrap(errorFactory?: (x: L) => unknown): R; unwrapOr(x: R): R; unwrapOrElse(f: (l: L) => R): R; fold(mapLeft: (l: L) => C, mapRight: (r: R) => C): C; get [Symbol.toStringTag](): string; } export type Either = EitherConstructor | EitherConstructor; export declare const merge: typeof EitherConstructor.mergeInOne, mergeInOne: typeof EitherConstructor.mergeInOne, mergeInMany: typeof EitherConstructor.mergeInMany, left: typeof EitherConstructor.left, right: typeof EitherConstructor.right, from: typeof EitherConstructor.from, fromTry: typeof EitherConstructor.fromTry, fromPromise: typeof EitherConstructor.fromPromise, chain: typeof EitherConstructor.chain; export declare const isEither: (value: unknown) => value is Either; export {};