import { type EscapeVoid, type AnyValue, type Unwrap, type BreakGenericLink } from "../../common"; import { type Right } from "./create"; /** * Applies a function only when the input is an Right. Otherwise, the original value is returned as-is. * * **Supported call styles:** * - Classic: `whenIsRight(input, theFunction)` → returns a value * - Curried: `whenIsRight(theFunction)` → returns a function waiting for the input * * If the condition matches, the callback runs; otherwise the original value is returned. * * ```ts * pipe( * true * ? E.success("true") * : E.error("false"), * * E.whenIsRight((value) => { * // type: "true" * }), * ); * ``` * * @see https://utils.duplojs.dev/en/v1/api/either/whenIsRight * * @namespace E * */ export declare function whenIsRight(theFunction: (eitherValue: Unwrap, Right>>) => GenericOutput): (input: GenericInput) => Exclude, Right> | GenericOutput; export declare function whenIsRight(input: GenericInput, theFunction: (eitherValue: Unwrap, Right>>) => GenericOutput): Exclude | GenericOutput;