Skip to content

Commit 96b9675

Browse files
fix: update flow bindings to match flow lib
1 parent d980ed0 commit 96b9675

1 file changed

Lines changed: 13 additions & 5 deletions

File tree

index.js.flow

Lines changed: 13 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -6,13 +6,21 @@ declare class ThenPromise<+R> extends Promise<R> {
66
reject: (error: any) => void
77
) => mixed): void;
88

9+
10+
then(onFulfill: null | void, onReject: null | void): ThenPromise<R>;
11+
then<U>(
12+
onFulfill: null | void,
13+
onReject: (error: any) => Promise<U> | U
14+
): ThenPromise<R | U>;
915
then<U>(
10-
onFulfill?: (value: R) => Promise<U> | U,
11-
onReject?: (error: any) => Promise<U> | U
16+
onFulfill: (value: R) => Promise<U> | U,
17+
onReject: null | void | ((error: any) => Promise<U> | U)
1218
): ThenPromise<U>;
1319

20+
21+
catch(onReject: null | void): ThenPromise<R>;
1422
catch<U>(
15-
onReject?: (error: any) => Promise<U> | U
23+
onReject: (error: any) => Promise<U> | U
1624
): ThenPromise<R | U>;
1725

1826
// Extensions specific to then/promise
@@ -33,8 +41,8 @@ declare class ThenPromise<+R> extends Promise<R> {
3341

3442
static resolve<T>(object: Promise<T> | T): ThenPromise<T>;
3543
static reject<T>(error?: any): ThenPromise<T>;
36-
static all<Elem, T:Iterable<Elem>>(promises: T): ThenPromise<$TupleMap<T, typeof $await>>;
37-
static race<T, Elem: Promise<T> | T>(promises: Array<Elem>): ThenPromise<T>;
44+
static all<T: Iterable<mixed>>(promises: T): ThenPromise<$TupleMap<T, typeof $await>>;
45+
static race<T, Elem: Promise<T> | T>(promises: Iterable<Elem>): ThenPromise<T>;
3846

3947
// Extensions specific to then/promise
4048

0 commit comments

Comments
 (0)