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

12 lines (11 loc) 593 B
import type { AsyncZipTransformerFn } from '../../internal/function.js'; import { type Nullable, type NotNull } from '../core/nullable.js'; /** * Zips _self_ and another `Nullable` with function _transformer_. * If _self_ is `T` and _other_ is `U`, this method returns the result of _transformer_. * Otherwise, `null` is returned. * * @throws {TypeError} * Throws if the _transformer_ returns `null`. */ export declare function zipWithAsyncForNullable<T, U, R>(self: Nullable<T>, other: Nullable<U>, transformer: AsyncZipTransformerFn<T, U, NotNull<R>>): Promise<Nullable<R>>;