/** * Used to describe the outcome of operations where failure is not an * exceptional circumstance and hence does not warrant the use of * language-level exception handling. */ export type Result = { readonly value: T; readonly err?: never; } | { readonly err: E; readonly value?: never; }; /** * Return the result's value or throw its error. * * @param result A result to unwrap * @returns The result's value */ export declare function unwrapResult(result: Result): T; /** * Wrap a function that returns the result value instead of the original * function's result and throws the error if the function did not succeed. * * @param fn function that returns a result * @returns the result's value, otherwise throws the result's error */ export declare function unwrapResultFunctor(fn: (...args: Args) => Result): (...args: Args) => T;