export type ResultValue = ResultSuccess | ResultFailure;
export type ResultSuccess = {
    __type: "resultType";
    success: true;
    value: any;
};
export type FailureOpts = {
    checkpoint?: any;
    retryable?: boolean;
    functionName?: string;
    args?: Record<string, any>;
};
export type ResultFailure = {
    __type: "resultType";
    success: false;
    error: any;
    checkpoint: any;
    retryable: boolean;
    functionName: string | null;
    args: Record<string, any> | null;
};
export declare function success(value: any): ResultSuccess;
export declare function failure(error: any, opts?: FailureOpts): ResultFailure;
export declare function isSuccess(result: unknown): result is ResultSuccess;
export declare function isFailure(result: unknown): result is ResultFailure;
/** Wrap a function call in try-catch, returning a Result.
 * If the function already returns a Result, pass it through (no double-wrapping). */
export declare function __tryCall(fn: () => any, opts?: FailureOpts): Promise<ResultValue>;
/** Unwrap a Result: return value on success, evaluate fallback on failure.
 * If the input is not a valid Result, returns it as-is. */
export declare function __catchResult(result: any, fallback: () => any): any;
export declare function __pipeBind(result: any, fn: (value: any) => any): Promise<any>;
