import { type Kind } from "../../common"; import { type Right } from "./create"; export declare const resultKind: import("../../common").KindHandler>; type _Result = (Right & Kind); export interface Result extends _Result { } /** * Builds a `Right` tagged as a neutral result: neither positive nor negative, just a result associated with business information and a payload. * * **Supported call styles:** * - Classic: `result(information, value)` → returns a result value * - Curried: `result(information)` → returns a function waiting for the value * * Use `result` when you want to express that an operation produced a result without marking it as a success, an error, or a failure. The returned value keeps the provided information string and embeds the provided payload. Pass `undefined` explicitly when the result has no payload. * * ```ts * const created = E.result( * "user.created", * { * id: 1, * name: "Ada", * }, * ); * // type: E.Result<"user.created", { readonly id: 1; readonly name: "Ada"; }> * * const skipped = E.result( * "user.skipped", * undefined, * ); * // type: E.Result<"user.skipped", undefined> * * const computed = E.result( * "invoice.total", * 1250, * ); * // type: E.Result<"invoice.total", 1250> * * const piped = pipe( * 1250, * E.result("invoice.total"), * ); * * type checkPiped = ExpectType< * typeof piped, * E.Result<"invoice.total", 1250>, * "strict" * >; * ``` * * @see [`E.right`](https://utils.duplojs.dev/en/v1/api/either/right) * @see [`E.success`](https://utils.duplojs.dev/en/v1/api/either/success) * @see https://utils.duplojs.dev/en/v1/api/either/result * * @namespace E * */ export declare function result(information: GenericInformation): (value: GenericValue) => Result; export declare function result(information: GenericInformation, value: GenericValue): Result; export {};