import { type EscapeVoid, type AnyValue, type Unwrap, type BreakGenericLink, type FalsyValue } from "../../common"; import { type Kind } from "../../common/kind"; import { boolKind } from "./base"; import { bool } from "./create"; import { type Left } from "../left"; import { type Right } from "../right"; export declare const boolFalsyKind: import("../../common").KindHandler>; /** * @deprecated use boolFalsyKind */ export declare const eitherBoolFalsyKind: import("../../common").KindHandler>; type _BoolFalsy = (Left<"bool", GenericValue> & Kind & Kind); export interface BoolFalsy extends _BoolFalsy { } /** * @deprecated use BoolFalsy */ export type EitherBoolFalsy = BoolFalsy; /** * Builds an Left<"bool"> for an explicitly falsy value (0, "", null, undefined, false). * * Signature: `boolFalsy(value)` → returns a value * * The input value is not mutated. * * ```ts * const input = "word" as string; * * const result = pipe( * input, * when( * equal(""), * E.boolFalsy, * ), * ); * * // type: string | E.BoolFalsy<""> * ``` * * @see https://utils.duplojs.dev/en/v1/api/either/boolFalsy * * @namespace E * */ /** * Type guard that detects an BoolFalsy. * * Signature: `isBoolFalsy(input)` → returns a value * * Acts as a type guard and narrows the input type when true. * * ```ts * const maybeInput = E.bool(true ? true : null); * * if (E.isBoolFalsy(maybeInput)) { * // type: E.BoolFalsy * } * ``` * * @see https://utils.duplojs.dev/en/v1/api/either/isBoolFalsy * * @namespace E * */ /** * Applies a callback only when the boolean value is falsy. * * **Supported call styles:** * - Classic: `whenIsBoolFalsy(input, theFunction)` → returns a value * - Curried: `whenIsBoolFalsy(theFunction)` → returns a function waiting for the input * * If the condition matches, the callback runs; otherwise the original value is returned. * * ```ts * const result = pipe( * E.bool(true ? "value" : null), * E.whenIsBoolFalsy(() => "falsy"), * ); * * // type: E.BoolTruthy<"value"> | "falsy" * ``` * * @see https://utils.duplojs.dev/en/v1/api/either/whenIsBoolFalsy * * @namespace E * */ export declare function boolFalsy(value?: GenericValue): BoolFalsy; type Either = Right | Left; export declare function isBoolFalsy(input: GenericInput): input is Extract; type ToEither = GenericValue extends Either ? GenericValue : ReturnType>; export declare function whenIsBoolFalsy(theFunction: (eitherValue: Unwrap>, BoolFalsy>>) => GenericOutput): (input: GenericInput) => GenericOutput | Exclude>, BoolFalsy>; export declare function whenIsBoolFalsy(input: GenericInput, theFunction: (eitherValue: Unwrap>, BoolFalsy>>) => GenericOutput): GenericOutput | Exclude, BoolFalsy>; export {};