DefinitelyTyped/types/knockout.rx/index.d.ts
Mathias Lykkegaard Lorenzen d7b5cd9707 knockout.mapping better strong typing when mapping objects back and forth (#19119)
* Update index.d.ts

removed fromjs overload that no longer exists in latest knockout.mapping, and added much better type safety for "fromJS".

* Update index.d.ts

* Update index.d.ts

* Update index.d.ts

* Update index.d.ts

* Update index.d.ts

* Update index.d.ts

* Update index.d.ts

* Update index.d.ts

* Update index.d.ts

* Update index.d.ts

* Update index.d.ts

* Update index.d.ts

* Update index.d.ts

* Update index.d.ts

* Update index.d.ts

* Update index.d.ts

* Update index.d.ts

* Update index.d.ts

* fix for typescript version.

* more typescript versioning fixes.

* fix for minor bug.

* yet another test fix.

* yet another test fix.
2017-11-15 11:12:34 +00:00

34 lines
938 B
TypeScript

// 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/DefinitelyTyped/DefinitelyTyped
// TypeScript Version: 2.3
/// <reference types="knockout"/>
/// <reference types="rx"/>
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 namespace Rx {
interface Observable<T> {
toKoSubscribable(): KnockoutSubscribable<T>;
toKoObservable(initialValue?: T): KnockoutObservable<T>;
}
interface Subject<T> {
toKoObservable(initialValue?: T): KnockoutObservable<T>;
}
}