source: imaps-frontend/node_modules/gensync/index.js.flow@ d565449

main
Last change on this file since d565449 was d565449, checked in by stefan toskovski <stefantoska84@…>, 4 weeks ago

Update repo after prototype presentation

  • Property mode set to 100644
File size: 846 bytes
Line 
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.