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) • 614 B
TypeScript
import type { AsyncZipTransformerFn } from '../../internal/function.js';
import { type Maybe, type NotNullOrUndefined } from '../core/maybe.js';
/**
* Zips _self_ and another `Maybe` with function _transformer_.
* If _self_ is `T` and _other_ is `U`, this method returns the result of _transformer_.
* Otherwise, `undefined` is returned.
*
* @throws {TypeError}
* Throws if the _transformer_ returns `null` or `undefined`.
*/
export declare function zipWithAsyncForMaybe<T, U, R>(self: Maybe<T>, other: Maybe<U>, transformer: AsyncZipTransformerFn<T, U, NotNullOrUndefined<R>>): Promise<Maybe<R>>;