forked from DefinitelyTyped/DefinitelyTyped
-
Notifications
You must be signed in to change notification settings - Fork 0
/
knockout.rx.d.ts
32 lines (26 loc) · 930 Bytes
/
knockout.rx.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
// Type definitions for knockout.rx 1.0
// Project: https://github.com/Igorbek/knockout.rx
// Definitions by: Igor Oleinikov <https://github.com/Igorbek>
// Definitions: https://github.com/borisyankov/DefinitelyTyped
/// <reference path="../knockout/knockout.d.ts"/>
/// <reference path="../rx/rx.d.ts"/>
interface KnockoutSubscribableFunctions<T> {
toObservable(event?: string): Rx.Observable<T>;
toObservable<TEvent>(event: string): Rx.Observable<TEvent>;
}
interface KnockoutObservableFunctions<T> {
toObservableWithReplyLatest(): Rx.Observable<T>;
toSubject(): Rx.ISubject<T>;
}
interface KnockoutComputedFunctions<T> {
toObservableWithReplyLatest(): Rx.Observable<T>;
}
declare module Rx {
interface Observable<T> {
toKoSubscribable(): KnockoutSubscribable<T>;
toKoObservable(initialValue?: T): KnockoutObservable<T>;
}
interface Subject<T> {
toKoObservable(initialValue?: T): KnockoutObservable<T>;
}
}