forked from DefinitelyTyped/DefinitelyTyped
-
Notifications
You must be signed in to change notification settings - Fork 0
/
oboe.d.ts
63 lines (45 loc) · 1.53 KB
/
oboe.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
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
// Type definitions for oboe v2.0.3
// Project: https://github.com/jimhigson/oboe.js
// Definitions by: Jared Klopper <https://github.com/optical>
// Definitions: https://github.com/borisyankov/DefinitelyTyped
/// <reference path="../node/node.d.ts" />
declare module "oboe" {
import stream = require('stream');
function oboe(url: string): oboe.Oboe;
function oboe(options: oboe.Options): oboe.Oboe;
function oboe(stream: stream.Readable) : oboe.Oboe;
module oboe {
var drop: {};
interface Oboe {
done(callback: (result: any) => void): Oboe;
fail(callback: (result: FailReason) => void): Oboe;
node(pattern: string, callback: CallbackSignature): Oboe;
on(event: string, pattern: string, callback: CallbackSignature): Oboe;
on(eventPattern: string, callback: CallbackSignature): Oboe;
path(pattern: string, callback: CallbackSignature): Oboe;
path(listeners: any): Oboe;
removeListener(eventPattern: string, callback: CallbackSignature): Oboe;
removeListener(event: string, pattern: string, callback: CallbackSignature): Oboe;
start(callback: (status: number, headers: Object) => void): Oboe;
source: string;
}
interface CallbackSignature {
(node: any, pathOrHeaders: any, ancestors: Object[]): any;
}
interface Options {
url: string;
method?: string;
headers?: Object;
body?: any;
cached?: boolean;
withCredentials?: boolean;
}
interface FailReason {
thrown?: Error;
statusCode?: number;
body?: string;
jsonBody?: Object;
}
}
export = oboe;
}