import { type FalsyValue, type IsEqual } from "../../common"; import { type BoolFalsy } from "./falsy"; import { type BoolTruthy } from "./truthy"; /** * Converts any value into a boolean monad (BoolTruthy or BoolFalsy). Handy to keep track of the test while benefiting from the whenIsBoolTruthy/whenIsBoolFalsy helpers. * * Signature: `bool(value)` → returns a value * * The input value is not mutated. * * ```ts * const input = ["duplo"]; * const result = pipe( * input, * A.find(equal("duplo")), * E.bool, * ); * * // type: E.BoolFalsy | E.BoolTruthy<"duplo"> * ``` * * @see https://utils.duplojs.dev/en/v1/api/either/bool * * @namespace E * */ export declare function bool(value: GenericValue): GenericValue extends FalsyValue ? BoolFalsy : IsEqual extends true ? BoolTruthy | BoolFalsy<0> : IsEqual extends true ? BoolTruthy | BoolFalsy<0n> : IsEqual extends true ? BoolTruthy | BoolFalsy<""> : BoolTruthy; export type Bool = BoolTruthy | BoolFalsy;