0.5.9 • Published 6 months ago

@types/rx.wamp v0.5.9

Weekly downloads
6
License
MIT
Repository
github
Last release
6 months ago

Installation

npm install --save @types/rx.wamp

Summary

This package contains type definitions for rx.wamp (https://github.com/paulpdaniels/rx.wamp/).

Details

Files were exported from https://github.com/DefinitelyTyped/DefinitelyTyped/tree/master/types/rx.wamp.

index.d.ts

// Type definitions for rx.wamp 0.5.0
// Project: https://github.com/paulpdaniels/rx.wamp/
// Definitions by: Elad Zelingher <https://github.com/darkl>
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped

import autobahn = require("autobahn");
import * as Rx from "rx";

interface IWampEvent {
    args?: any[] | undefined;
    kwargs?: any;
    details?: autobahn.IEvent | undefined;
}

interface IObservableWampStatic {
    fromConnection(options: autobahn.IConnectionOptions, keepReconnecting?: boolean, factory?: (options?: autobahn.IConnectionOptions) => autobahn.Connection): Rx.Observable<autobahn.Session>;
    fromPubSubPattern(session: autobahn.Session, topic: string, options: autobahn.ISubscribeOptions, openObserver?: Rx.IObserver<autobahn.ISubscription>): IPubSubSubject;

    subscriber(sessionOrObservable: autobahn.Session | Rx.Observable<any>): Subscriber;
    subscribeAsObservable(sessionOrObservable: autobahn.Session | Rx.Observable<autobahn.Session>, topic: string, options?: autobahn.ISubscribeOptions, openObserver?: Rx.IObserver<autobahn.ISubscription>): Rx.Observable<IWampEvent>;
    publishAsObservable(session: autobahn.Session, topic: string, args?: any[], kwargs?: any, options?: autobahn.IPublishOptions): Rx.Observable<autobahn.IPublication>;
    registerAsObservable(sessionOrObservable: autobahn.Session | Rx.Observable<autobahn.Session>, procedure: string, endpoint: autobahn.RegisterEndpoint, options: autobahn.IRegisterOptions): Rx.Observable<autobahn.IRegistration>;
    callAsObservable<TResult>(session: autobahn.Session, procedure: string, options?: autobahn.ICallOptions): (args?: any[], kwargs?: any) => Rx.Observable<TResult>;
}

declare class Subscriber {
    to(topic: string,
        options: autobahn.ISubscribeOptions,
        observerOrOnNext?: Rx.IObserver<IWampEvent> | ((value: IWampEvent) => void),
        onError?: (exception: any) => void,
        onCompleted?: () => void): Subscriber;

    dispose(): void;
}

interface IPubSubSubject extends Rx.Observable<IWampEvent>, Rx.Observer<IWampEvent> {
    observable: Rx.Observable<IWampEvent>;
    observer: Rx.Observer<IWampEvent>;
    errors: Rx.IObservable<autobahn.IError>;
    opened: Rx.IObservable<autobahn.ISubscription>;
}

export as namespace RxWamp;

declare module "rx" {
    // Patch ObservableStatic to contain observableWamp methods.
    interface ObservableStatic extends IObservableWampStatic {}
}

Additional Details

Credits

These definitions were written by Elad Zelingher.

0.5.8

7 months ago

0.5.7

7 months ago

0.5.9

6 months ago

0.5.6

3 years ago

0.5.5

7 years ago

0.5.4

8 years ago

0.5.3

8 years ago

0.5.2

8 years ago

0.5.1

8 years ago