import { type EscapeVoid, type AnyValue, type Unwrap, type BreakGenericLink } from "../../common"; import { type Kind } from "../../common/kind"; import { type Left } from "../left"; import { type Right } from "../right"; import { nullish } from "./create"; import { nullishKind } from "./base"; export type NullishValue = null | undefined; export declare const nullishEmptyKind: import("../../common").KindHandler>; /** * @deprecated use nullishEmptyKind */ export declare const eitherNullishEmptyKind: import("../../common").KindHandler>; type _NullishEmpty = (Left<"nullish", GenericValue> & Kind & Kind); export interface NullishEmpty extends _NullishEmpty { } /** * @deprecated use NullishEmpty */ export type EitherNullishEmpty = NullishEmpty; /** * Type guard detecting an NullishEmpty. * * Signature: `isNullishEmpty(input)` → returns a value * * Acts as a type guard and narrows the input type when true. * * ```ts * const maybeValue = E.nullish(true ? "value" : null); * * if (E.isNullishEmpty(maybeValue)) { * // type: E.NullishEmpty * } * ``` * * @see https://utils.duplojs.dev/en/v1/api/either/isNullishEmpty * * @namespace E * */ /** * Explicitly builds an Left<"nullish"> with null or undefined. * * Signature: `nullishEmpty(value)` → returns a value * * The input value is not mutated. * * ```ts * const result = E.nullishEmpty(); * * // type: E.NullishEmpty * ``` * * @see https://utils.duplojs.dev/en/v1/api/either/nullishEmpty * * @namespace E * */ /** * Applies a callback only when the Either is NullishEmpty. * * **Supported call styles:** * - Classic: `whenIsNullishEmpty(input, theFunction)` → returns a value * - Curried: `whenIsNullishEmpty(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.nullish(true ? "value" : null), * E.whenIsNullishEmpty(() => "nullish"), * ); * * // type: "nullish" | E.NullishFilled<"value"> * ``` * * @see https://utils.duplojs.dev/en/v1/api/either/whenIsNullishEmpty * * @namespace E * */ export declare function nullishEmpty(value?: GenericValue): NullishEmpty; type Either = Right | Left; export declare function isNullishEmpty(input: GenericInput): input is Extract; type ToEither = GenericValue extends Either ? GenericValue : ReturnType>; export declare function whenIsNullishEmpty(theFunction: (eitherValue: Unwrap>, NullishEmpty>>) => GenericOutput): (input: GenericInput) => GenericOutput | Exclude>, NullishEmpty>; export declare function whenIsNullishEmpty(input: GenericInput, theFunction: (eitherValue: Unwrap>, NullishEmpty>>) => GenericOutput): GenericOutput | Exclude, NullishEmpty>; export {};