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 { nullable } from "./create"; import { nullableKind } from "./base"; export declare const nullableEmptyKind: import("../../common").KindHandler>; /** * @deprecated use nullableEmptyKind */ export declare const eitherNullableEmptyKind: import("../../common").KindHandler>; type _NullableEmpty = (Left<"nullable", null> & Kind & Kind); export interface NullableEmpty extends _NullableEmpty { } /** * @deprecated use NullableEmpty */ export type EitherNullableEmpty = NullableEmpty; type Either = Right | Left; /** * Type guard that detects an NullableEmpty. * * Signature: `isNullableEmpty(input)` → returns a value * * Acts as a type guard and narrows the input type when true. * * ```ts * const maybeValue = E.nullable(true ? "value" : null); * * if (E.isNullableEmpty(maybeValue)) { * // type: E.NullableEmpty * } * ``` * * @see https://utils.duplojs.dev/en/v1/api/either/isNullableEmpty * * @namespace E * */ /** * Explicitly builds an Left<"nullable"> containing null. * * Signature: `nullableEmpty()` → returns a value * * ```ts * const result = E.nullableEmpty(); * * // type: E.NullableEmpty * ``` * * @see https://utils.duplojs.dev/en/v1/api/either/nullableEmpty * * @namespace E * */ /** * Executes a callback only when the Either is NullableEmpty. * * **Supported call styles:** * - Classic: `whenIsNullableEmpty(input, theFunction)` → returns a value * - Curried: `whenIsNullableEmpty(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.nullable(true ? "value" : null), * E.whenIsNullableEmpty(() => "nullable"), * ); * * // type: "nullable" | E.NullableFilled<"value"> * ``` * * @see https://utils.duplojs.dev/en/v1/api/either/whenIsNullableEmpty * * @namespace E * */ export declare function nullableEmpty(): NullableEmpty; export declare function isNullableEmpty(input: GenericInput): input is Extract; type ToEither = GenericValue extends Either ? GenericValue : ReturnType>; export declare function whenIsNullableEmpty(theFunction: (eitherValue: Unwrap>, NullableEmpty>>) => GenericOutput): (input: GenericInput) => GenericOutput | Exclude, NullableEmpty>; export declare function whenIsNullableEmpty(input: GenericInput, theFunction: (eitherValue: Unwrap>, NullableEmpty>>) => GenericOutput): GenericOutput | Exclude>, NullableEmpty>; export {};