-
Notifications
You must be signed in to change notification settings - Fork 4
/
index.js.flow
31 lines (26 loc) · 3.04 KB
/
index.js.flow
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
import type { Bluebird$Promise } from 'bluebird';
type Promise<R> = Bluebird$Promise<R>
declare module "bluebird-promisell" {
declare export function purep <A>(a: A): Promise<A>;
declare export function fmapp <A,B>(fn: (a: A) => B): (pa: Promise<A>) => Promise<B>;
declare export function sequencep <A>(arr: Array<Promise<A>>): Promise<Array<A>>;
declare export function traversep <A,B>(fn: (a: A) => Promise<B>): (arr: Array<A>) => Promise<Array<B>>;
declare export function liftp1 <A,B>(fn: (a: A) => Promise<B> | B): (pa: Promise<A>) => Promise<B>;
declare export function liftp2 <A,B,C>(fn: (a: A, b: B, ...rest: Array<void>) => Promise<C> | C): (pa: Promise<A>, pb: Promise<B>, ...rest: Array<void>) => Promise<C>
declare export function liftp3 <A,B,C,D>(fn: (a: A, b: B, c: C, ...rest: Array<void>) => Promise<D> | D): (pa: Promise<A>, pb: Promise<B>, pc: Promise<C>, ...rest: Array<void>) => Promise<D>;
declare export function liftp4 <A,B,C,D,E>(fn: (a: A, b: B, c: C, d: D, ...rest: Array<void>) => Promise<E> | E): (pa: Promise<A>, pb: Promise<B>, pc: Promise<C>, pd: Promise<D>, ...rest: Array<void>) => Promise<E>;
declare export function liftp5 <A,B,C,D,E,F>(fn: (a: A, b: B, c: C, d: D, e: E, ...rest: Array<void>) => Promise<F> | F): (pa: Promise<A>, pb: Promise<B>, pc: Promise<C>, pd: Promise<D>, pe: Promise<E>, ...rest: Array<void>) => Promise<F>;
declare export function liftp <A,B>(fn: (a: A, ...rest: Array<void>) => Promise<B> | B): (pa: Promise<A>, ...rest: Array<void>) => Promise<B>
declare export function liftp <A,B,C>(fn: (a: A, b: B, ...rest: Array<void>) => Promise<C> | C): (pa: Promise<A>, pb: Promise<B>, ...rest: Array<void>) => Promise<C>
declare export function liftp <A,B,C,D>(fn: (a: A, b: B, c: C, ...rest: Array<void>) => Promise<D> | D): (pa: Promise<A>, pb: Promise<B>, pc: Promise<C>, ...rest: Array<void>) => Promise<D>;
declare export function liftp <A,B,C,D,E>(fn: (a: A, b: B, c: C, d: D, ...rest: Array<void>) => Promise<E> | E): (pa: Promise<A>, pb: Promise<B>, pc: Promise<C>, pd: Promise<D>, ...rest: Array<void>) => Promise<E>;
declare export function liftp <A,B,C,D,E,F>(fn: (a: A, b: B, c: C, d: D, e: E, ...rest: Array<void>) => Promise<F> | F): (pa: Promise<A>, pb: Promise<B>, pc: Promise<C>, pd: Promise<D>, pe: Promise<E>, ...rest: Array<void>) => Promise<F>;
declare export function firstp <A,B>(pa: Promise<A>, pb: Promise<B>): Promise<A>;
declare export function secondp <A,B>(pa: Promise<A>, pb: Promise<B>): Promise<B>;
declare export function filterp <A>(fn: (a :A) => bool): (arr: Array<Promise<A>>) => Promise<Array<A>>;
declare export function foldp <A,B>(fn: (b: B, a: A) => Promise<B>): (b: B) => (arr: Array<A>) => Promise<B>;
declare export function mapError <ERROR,A>(fn: (e: ERROR) => ERROR): (a: Promise<A>) => Promise<A>;
declare export function resolveError <ERROR,B,A>(fn: (e: ERROR) => B): (pa: Promise<A>) => Promise<B>;
declare export function toPromise <A,ERROR>(predict: (a: A) => bool, toError: (a: A) => ERROR): (a: A) => Promise<A>;
declare export function pipep (fn: any): any;
}