-
Notifications
You must be signed in to change notification settings - Fork 3
/
Copy pathenv.d.ts
39 lines (31 loc) · 992 Bytes
/
env.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
// Source: https://github.com/zenparsing/es-observable
declare class Observable<T> {
constructor (subscriber: SubscriberFn<T>)
subscribe (observer: Observer<T>): Subscription
subscribe (
onNext: (value: T) => void,
onError?: (error: Error) => void,
onComplete?: (value?: any) => void
): Subscription
static of <T>(...items: T[]): Observable<T>
static from <T>(observable: Observable<T>): Observable<T>
static from <T>(observable: Iterable<T>): Iterable<T>
static from (observable: any): Observable<any>
}
interface Observer<T> {
start (subscription: Subscription): void
next (value: T): void
error (error: Error): void
complete (value?: any): void
}
interface Subscription {
unsubscribe (): void
closed: boolean
}
interface SubscriptionObserver<T> {
next (value: T): void
error (error: Error): void
complete (value?: any): void
closed: boolean
}
type SubscriberFn<T> = (observer: SubscriptionObserver<T>) => (() => void) | Subscription