forked from DefinitelyTyped/DefinitelyTyped
-
Notifications
You must be signed in to change notification settings - Fork 0
/
node-fibers.d.ts
45 lines (37 loc) · 1.09 KB
/
node-fibers.d.ts
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
32
33
34
35
36
37
38
39
40
41
42
43
44
45
// Type definitions for node-fibers
// Project: https://github.com/laverdet/node-fibers
// Definitions by: Cary Haynie <https://github.com/caryhaynie>
// Definitions: https://github.com/borisyankov/DefinitelyTyped
interface Fiber {
reset: () => any;
run: (param?: any) => any;
throwInto: (ex: any) => any;
}
declare module "fibers" {
function Fiber(fn: Function): Fiber;
module Fiber {
export var current: Fiber;
export function yield(value?: any): any
}
export = Fiber;
}
declare module "fibers/future" {
class Future {
constructor();
detach(): void;
get(): any;
isResolved (): boolean;
proxy(future: Future): void;
proxyErrors(futureOrList: any): Future;
resolver(): Function;
resolve(fn: Function): void;
resolveSuccess(fn: Function): void;
return(result?: any): void;
throw (error: any): void;
wait (): void;
static wait(future: Future);
static wait(future_list: Future[]);
static wrap(fn: Function): Future
}
export = Future;
}