// Type definitions for rx.wamp 0.5.0 // Project: https://github.com/paulpdaniels/rx.wamp/ // Definitions by: Elad Zelingher // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped /// /// interface IWampEvent { args?: any[]; kwargs?: any; details?: autobahn.IEvent; } interface IObservableWampStatic { fromConnection(options: autobahn.IConnectionOptions, keepReconnecting?: boolean, factory?: (options?: autobahn.IConnectionOptions) => autobahn.Connection): Rx.Observable; fromPubSubPattern(session: autobahn.Session, topic: string, options: autobahn.ISubscribeOptions, openObserver?: Rx.IObserver): IPubSubSubject; subscriber(sessionOrObservable: autobahn.Session | Rx.Observable): Subscriber; subscribeAsObservable(sessionOrObservable: autobahn.Session | Rx.Observable, topic: string, options?: autobahn.ISubscribeOptions, openObserver?: Rx.IObserver): Rx.Observable; publishAsObservable(session: autobahn.Session, topic: string, args?: any[], kwargs?: any, options?: autobahn.IPublishOptions): Rx.Observable; registerAsObservable(sessionOrObservable: autobahn.Session | Rx.Observable, procedure: string, endpoint: autobahn.RegisterEndpoint, options: autobahn.IRegisterOptions): Rx.Observable; callAsObservable(session: autobahn.Session, procedure: string, options?: autobahn.ICallOptions): (args?: any[], kwargs?: any) => Rx.Observable; } declare class Subscriber { to(topic: string, options: autobahn.ISubscribeOptions, observerOrOnNext?: Rx.IObserver | ((value: IWampEvent) => void), onError?: (exception: any) => void, onCompleted?: () => void): Subscriber; dispose(): void; } interface IPubSubSubject extends Rx.Observable, Rx.Observer { observable: Rx.Observable; observer: Rx.Observer; errors: Rx.IObservable; opened: Rx.IObservable; } // Patch ObservableStatic to contain observableWamp methods. declare namespace Rx { interface ObservableStatic extends IObservableWampStatic { } }