Added knockout.rx definitions

RxJS-Knockout binding <https://github.com/Igorbek/knockout.rx>
This commit is contained in:
Igor Oleinikov
2013-10-28 23:29:01 +04:00
parent d0c36de348
commit 35f2f6c2ee
2 changed files with 26 additions and 0 deletions

View File

@@ -0,0 +1,12 @@
/// <reference path="knockout.rx.d.ts"/>
var ax: Rx.IObservable<number>;
var ao = ax.toKoObservable();
ao(100);
ao.getSubscriptionsCount();
ao.toObservable();
ao.toObservable("change");
ao.toObservable<Error>("error");

14
knockout.rx/knockout.rx.d.ts vendored Normal file
View File

@@ -0,0 +1,14 @@
/// <reference path="../knockout/knockout.d.ts"/>
/// <reference path="../rx.js/rx.js.d.ts"/>
interface KnockoutSubscribableFunctions<T> {
toObservable(event?: string): Rx.IObservable<T>;
toObservable<TEvent>(event: string): Rx.IObservable<TEvent>;
}
declare module Rx {
interface IObservable<T> {
toKoSubscribable(): KnockoutSubscribable<T>;
toKoObservable(initialValue?: T): KnockoutObservable<T>;
}
}