import { type Kind } from "../../common/kind"; import { type WrappedValue } from "../../common/wrapValue"; import { informationKind } from "../kind"; export declare const rightKind: import("../../common/kind").KindHandler>; /** * @deprecated use rightKind */ export declare const eitherRightKind: import("../../common/kind").KindHandler>; type _Right = (Kind & Kind & WrappedValue); export interface Right extends _Right { } /** * @deprecated use Right */ export type EitherRight = Right; /** * Builds an Right by associating mandatory business information (literal string) and an optional payload. This is the basic brick to signal a contextualized success. * * Signature: `right(information, value)` → returns a value * * The input value is not mutated. * * ```ts * const input = "SAVE-15" as string; * * const result = pipe( * input, * P.when( * S.startsWith("SAVE"), * (code) => E.right( * "coupon.applied", * { * code, * percent: 15, * }, * ), * ), * P.otherwise( * (value) => E.left("coupon.invalid", value), * ), * ); * * // type: E.Right< "coupon.applied", { readonly code: `SAVE${string}`; readonly percent: 15; } > * // | E.Left< "coupon.invalid", string > * ``` * * @see https://utils.duplojs.dev/en/v1/api/either/right * * @namespace E * */ export declare function right(information: GenericInformation, value?: GenericValue): Right; export {};