source: trip-planner-front/node_modules/gensync/index.js.flow@ 76712b2

Last change on this file since 76712b2 was 6a3a178, checked in by Ema <ema_spirova@…>, 3 years ago

initial commit

  • Property mode set to 100644
File size: 846 bytes
RevLine 
[6a3a178]1// @flow
2
3opaque type Next = Function | void;
4opaque type Yield = mixed;
5
6export type Gensync<Args, Return> = {
7 (...args: Args): Handler<Return>,
8 sync(...args: Args): Return,
9 async(...args: Args): Promise<Return>,
10 // ...args: [...Args, Callback]
11 errback(...args: any[]): void,
12};
13
14export type Handler<Return> = Generator<Yield, Return, Next>;
15export type Options<Args, Return> = {
16 sync(...args: Args): Return,
17 arity?: number,
18 name?: string,
19} & (
20 | { async?: (...args: Args) => Promise<Return> }
21 // ...args: [...Args, Callback]
22 | { errback(...args: any[]): void }
23);
24
25declare module.exports: {
26 <Args, Return>(
27 Options<Args, Return> | ((...args: Args) => Handler<Return>)
28 ): Gensync<Args, Return>,
29
30 all<Return>(Array<Handler<Return>>): Handler<Return[]>,
31 race<Return>(Array<Handler<Return>>): Handler<Return>,
32};
Note: See TracBrowser for help on using the repository browser.