-
Notifications
You must be signed in to change notification settings - Fork 2
/
index.d.ts
26 lines (22 loc) · 1002 Bytes
/
index.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
type Callback = (...args: any[]) => any
export declare function cancel(): symbol
export declare function off(): symbol
export declare function install(name: string, fn: Callback): any
export type ErreStream<T = unknown, TReturn = any, TNext = unknown> = {
on: {
value: (fn: Callback) => ErreStream<T, TReturn, TNext>
error: (fn: Callback) => ErreStream<T, TReturn, TNext>
end: (fn: Callback) => ErreStream<T, TReturn, TNext>
}
off: {
value: (fn: Callback) => ErreStream<T, TReturn, TNext>
error: (fn: Callback) => ErreStream<T, TReturn, TNext>
end: (fn: Callback) => ErreStream<T, TReturn, TNext>
}
connect: (fn: Callback) => ErreStream<T, TReturn, TNext>
push: (value: any) => ErreStream<T, TReturn, TNext>
end: () => ErreStream<T, TReturn, TNext>
fork: () => ErreStream<T, TReturn, TNext>
} & Generator<T, TReturn, TNext>
declare const erre: <T = unknown, TReturn = any, TNext = unknown>(...fns: any[]) => ErreStream<T, TReturn, TNext>
export default erre