/** * Represents a successful execution result containing a value * @template V The type of the success value */ export interface SuccessType { type: "success"; value: V; } /** * Represents an error result containing an error object * @template E The type of the error */ export interface ErrorType { type: "error"; error: E; } /** * Union type representing either a successful result or an error result * @template V The type of the success value * @template E The type of the error */ export type Result = SuccessType | ErrorType; /** * Creates an error result * @template E The type of the error * @param error The error object * @returns An ErrorType containing the error */ export declare const errorFunction: (error: E) => ErrorType; /** * Creates a success result * @template V The type of the success value * @param value The success value * @returns A SuccessType containing the value */ export declare const successFunction: (value: V) => SuccessType; /** * Safely executes a callback function and returns a Result type * Catches any errors and wraps them in a Result type * @template V The type of the success value * @template E The type of the error (defaults to Error) * @param callback The function to execute safely * @returns A Result containing either the successful value or the caught error */ export declare const safeExecute: (callback: () => V) => Result;