Debian Codegraph @

gensync/index.js.flow

raw ◀ ▶
Source reconstructed at patch state 0 of 1 — not the installed (fully patched) source.
1 Debian patch touch this file
1 // @flow
2
3 opaque type Next = Function | void;
4 opaque type Yield = mixed;
5
6 export type Gensync<T> = {
7 (...args: Array<mixed>): Handler<T>,
8 sync(...args: Array<mixed>): T,
9 async(...args: Array<mixed>): Promise<T>,
10 errback(...args: Array<mixed>): void,
11 };
12
13 export type Handler<T> = Generator<Yield, T, Next>;
14 export type Options<T> = {
15 sync: (...args: Array<mixed>) => T,
16 async: (...args: Array<mixed>) => Promise<T>,
17 errback: (...args: Array<mixed>) => void,
18 arity?: number,
19 name?: string,
20 };
21
22 declare module.exports: {
23 <T>(Options<T> | Handler<T>): Gensync<T>,
24 };