UNPKG

@typed/future

Version:
12 lines 641 B
import { Disposable } from '@typed/disposable'; import { Either } from '@typed/either'; import { Env, Pure } from '@typed/env'; import { Arity1 } from '@typed/lambda'; export declare type Future<E, A, B> = Env<E, Either<A, B>>; export declare type PureFuture<A, B> = Pure<Either<A, B>>; export declare namespace Future { const of: <A, B>(value: B) => PureFuture<A, B>; const create: <E, A, B>(fn: (reject: Arity1<A, Disposable>, resolve: Arity1<B, Disposable>, environment: E) => Disposable) => Future<E, A, B>; const fromPromise: <A>(promise: () => PromiseLike<A>) => PureFuture<Error, A>; } //# sourceMappingURL=Future.d.ts.map