UNPKG

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>`.

9 lines (8 loc) 444 B
import type { AsyncRecoveryFn } from '../internal/function.js'; import { type Nullable } from './nullable.js'; export type NullableAsyncTryRecoveryFn<out T> = AsyncRecoveryFn<Nullable<T>>; /** * Return _input_ as `T` if the passed _input_ is not `null`. * Otherwise, return the result of _recoverer_. */ export declare function orElseAsyncForNullable<T>(input: Nullable<T>, recoverer: NullableAsyncTryRecoveryFn<T>): Promise<Nullable<T>>;