UNPKG

1.48 kBTypeScriptView Raw
1import type { Fn, Fn0, Fn10, Fn2, Fn3, Fn4, Fn5, Fn6, Fn7, Fn8, Fn9, FnAny } from "./fn.js";
2export type MaybePromise<T> = T | Promise<T>;
3export type MaybeAsyncIterable<T> = Iterable<T> | AsyncIterable<T>;
4export type MaybeAsyncGenerator<T> = IterableIterator<T> | AsyncIterableIterator<T>;
5export type AsyncPredicate<T> = FnA<T, boolean>;
6export type AsyncPredicate2<T> = FnA2<T, T, boolean>;
7export type AsyncStatefulPredicate<T> = Fn0<AsyncPredicate<T>>;
8export type AsyncStatefulPredicate2<T> = Fn0<AsyncPredicate2<T>>;
9export type Fn0A<A> = Fn0<Promise<A>>;
10export type FnA<A, B> = Fn<A, Promise<B>>;
11export type FnA2<A, B, C> = Fn2<A, B, Promise<C>>;
12export type FnA3<A, B, C, D> = Fn3<A, B, C, Promise<D>>;
13export type FnA4<A, B, C, D, E> = Fn4<A, B, C, D, Promise<E>>;
14export type FnA5<A, B, C, D, E, F> = Fn5<A, B, C, D, E, Promise<F>>;
15export type FnA6<A, B, C, D, E, F, G> = Fn6<A, B, C, D, E, F, Promise<G>>;
16export type FnA7<A, B, C, D, E, F, G, H> = Fn7<A, B, C, D, E, F, G, Promise<H>>;
17export type FnA8<A, B, C, D, E, F, G, H, I> = Fn8<A, B, C, D, E, F, G, H, Promise<I>>;
18export type FnA9<A, B, C, D, E, F, G, H, I, J> = Fn9<A, B, C, D, E, F, G, H, I, Promise<J>>;
19export type FnA10<A, B, C, D, E, F, G, H, I, J, K> = Fn10<A, B, C, D, E, F, G, H, I, J, Promise<K>>;
20export type FnAnyA<T> = FnAny<Promise<T>>;
21/**
22 * Async version of {@link identity}.
23 *
24 * @param x
25 */
26export declare const asyncIdentity: <T>(x: T) => Promise<T>;
27//# sourceMappingURL=async.d.ts.map
\No newline at end of file