import { type Right } from "../right"; import { type Left } from "../left"; import { nullish } from "./create"; import { type Kind } from "../../common/kind"; import { type EscapeVoid, type AnyValue, type Unwrap, type BreakGenericLink } from "../../common"; import { nullishKind } from "./base"; export declare const nullishFilledKind: import("../../common").KindHandler>; /** * @deprecated use nullishFilledKind */ export declare const eitherNullishFilledKind: import("../../common").KindHandler>; type _NullishFilled = (Right<"nullish", GenericValue> & Kind & Kind); export interface NullishFilled extends _NullishFilled { } /** * @deprecated use NullishFilled */ export type EitherNullishFilled = NullishFilled; /** * Type guard that detects an NullishFilled. * * Signature: `isNullishFilled(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.isNullishFilled(maybeValue)) { * // type: E.NullishFilled<"value"> * } * ``` * * @see https://utils.duplojs.dev/en/v1/api/either/isNullishFilled * * @namespace E * */ /** * Builds an Right<"nullish"> with a non-null/non-undefined value. * * Signature: `nullishFilled(value)` → returns a value * * The input value is not mutated. * * ```ts * const result = E.nullishFilled("string"); * * // type: E.NullishFilled<"string"> * ``` * * @see https://utils.duplojs.dev/en/v1/api/either/nullishFilled * * @namespace E * */ /** * Executes a callback only when the Either contains a defined value (NullishFilled). * * **Supported call styles:** * - Classic: `whenIsNullishFilled(input, theFunction)` → returns a value * - Curried: `whenIsNullishFilled(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.whenIsNullishFilled(S.toUpperCase), * ); * * // type: E.NullishEmpty | "VALUE" * ``` * * @see https://utils.duplojs.dev/en/v1/api/either/whenIsNullishFilled * * @namespace E * */ export declare function nullishFilled(value: GenericValue): NullishFilled; type Either = Right | Left; export declare function isNullishFilled(input: GenericInput): input is Extract; type ToEither = GenericValue extends Either ? GenericValue : ReturnType>; export declare function whenIsNullishFilled(theFunction: (eitherValue: Unwrap>, NullishFilled>>) => GenericOutput): (input: GenericInput) => GenericOutput | Exclude>, NullishFilled>; export declare function whenIsNullishFilled(input: GenericInput, theFunction: (eitherValue: Unwrap>, NullishFilled>>) => GenericOutput): GenericOutput | Exclude, NullishFilled>; export {};