import { type AnyValue, type BreakGenericLink, type EscapeVoid, type Unwrap } from "../../common"; import { type Left } from "../left"; import { type Right } from "../right"; import { bool } from "./create"; import { type BoolTruthy } from "./truthy"; type Either = Right | Left; type ToEither = GenericValue extends Either ? GenericValue : ReturnType>; type MatchingInput = GenericInput extends unknown ? [ToEither] extends [BoolTruthy] ? GenericInput : never : never; type OtherwiseInput = Exclude, MatchingInput>>; /** * Runs one callback for BoolTruthy values and an otherwise callback for every remaining raw input. * * **Supported call styles:** * - Classic: `whenIsBoolTruthyOtherwise(input, theFunction, otherwiseFunction)` → returns a callback result * - Curried: `whenIsBoolTruthyOtherwise(theFunction, otherwiseFunction)` → returns a function waiting for the input * * The matching callback keeps the same unwrapped-value contract as the corresponding `when` function. The otherwise callback receives the original raw input, excluding only inputs known to match the condition. * * ```ts * const matched = E.whenIsBoolTruthyOtherwise( * "value" as const, * (value) => value, * () => "otherwise", * ); // matching raw value * * const fallback = E.whenIsBoolTruthyOtherwise( * "" as const, * (value) => value, * (value) => value, * ); // original raw input * * const piped = pipe( * "value" as const, * E.whenIsBoolTruthyOtherwise( * (value) => value, * () => "otherwise", * ), * ); // matching raw value * ``` * * @see https://utils.duplojs.dev/en/v1/api/either/whenIsBoolTruthyOtherwise * * @namespace E * * */ export declare function whenIsBoolTruthyOtherwise(theFunction: (eitherValue: Unwrap>, BoolTruthy>>) => GenericOutput, otherwiseFunction: (value: OtherwiseInput) => GenericOtherwiseOutput): (input: GenericInput) => BreakGenericLink | BreakGenericLink; export declare function whenIsBoolTruthyOtherwise(input: GenericInput, theFunction: (eitherValue: Unwrap>, BoolTruthy>>) => GenericOutput, otherwiseFunction: (value: OtherwiseInput) => GenericOtherwiseOutput): BreakGenericLink | BreakGenericLink; export {};