import type { AppError, Result } from './types.mjs'; /** * Unwraps a Result, returning the value if ok, or throwing the error * Use within try/catch blocks in command functions for clean error handling */ export declare const unwrap: (result: Result) => T; /** * Unwraps a Result that may contain null, providing a custom error if null or not ok * Useful for "not found" scenarios where you want to return a specific error */ export declare const unwrapOr: (result: Result, error: AppError) => T; /** * Pattern matching for Result types * Provides a clean way to handle both success and error cases */ export declare const match: (result: Result, handlers: { ok: (value: T) => U; err: (error: AppError) => U; }) => U; /** * Maps the value of a successful Result to a new value * If the Result is an error, returns the error unchanged */ export declare const mapResult: (result: Result, fn: (value: T) => U) => Result; /** * Maps the error of a failed Result to a new error * If the Result is successful, returns the success unchanged */ export declare const mapError: (result: Result, fn: (error: AppError) => AppError) => Result; /** * Chains Result-returning operations together * If the first Result is an error, returns that error * Otherwise, applies the function to the value */ export declare const flatMap: (result: Result, fn: (value: T) => Result) => Result;