option-t
Version:
A toolkit of Nullable/Option/Result type implementation in ECMAScript. Their APIs are inspired by Rust's `Option<T>` and `Result<T, E>`.
8 lines (7 loc) • 388 B
TypeScript
import type { AsyncRecoveryFromErrorFn } from '../internal/function.js';
import { type Result } from './result.js';
/**
* Unwraps _input_, returns the content of an `Ok(T)`.
* If the value is an `Err(E)` then it calls `recoverer` with its value.
*/
export declare function unwrapOrElseAsyncForResult<T, E>(input: Result<T, E>, recoverer: AsyncRecoveryFromErrorFn<E, T>): Promise<T>;