// Type definitions for rx-core-binding 4.0 // Project: https://github.com/Reactive-Extensions/RxJS // Definitions by: Carl de Billy , Igor Oleinikov // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped /// declare namespace Rx { interface ISubject extends Observable, Observer, IDisposable { hasObservers(): boolean; } interface Subject extends ISubject { } interface SubjectStatic { new (): Subject; create(observer?: Observer, observable?: Observable): ISubject; } const Subject: SubjectStatic; interface AsyncSubject extends Subject { } interface AsyncSubjectStatic { new (): AsyncSubject; } const AsyncSubject: AsyncSubjectStatic; interface BehaviorSubject extends Subject { getValue(): T; } interface BehaviorSubjectStatic { new (initialValue: T): BehaviorSubject; } const BehaviorSubject: BehaviorSubjectStatic; interface ReplaySubject extends Subject { } interface ReplaySubjectStatic { new (bufferSize?: number, window?: number, scheduler?: IScheduler): ReplaySubject; } const ReplaySubject: ReplaySubjectStatic; interface ConnectableObservable extends Observable { connect(): IDisposable; refCount(): Observable; } interface ConnectableObservableStatic { new (): ConnectableObservable; } const ConnectableObservable: ConnectableObservableStatic; interface Observable { multicast(subject: Observable): ConnectableObservable; multicast(subjectSelector: () => ISubject, selector: (source: ConnectableObservable) => Observable): Observable; publish(): ConnectableObservable; publish(selector: (source: ConnectableObservable) => Observable): Observable; /** * Returns an observable sequence that shares a single subscription to the underlying sequence. * This operator is a specialization of publish which creates a subscription when the number of observers goes from zero to one, * then shares that subscription with all subsequent observers until the number of observers returns to zero, at which point the subscription is disposed. * * @example * var res = source.share(); * * @returns An observable sequence that contains the elements of a sequence produced by multicasting the source sequence. */ share(): Observable; publishLast(): ConnectableObservable; publishLast(selector: (source: ConnectableObservable) => Observable): Observable; publishValue(initialValue: T): ConnectableObservable; publishValue(selector: (source: ConnectableObservable) => Observable, initialValue: T): Observable; /** * Returns an observable sequence that shares a single subscription to the underlying sequence and starts with an initialValue. * This operator is a specialization of publishValue which creates a subscription when the number of observers goes from zero to one, * then shares that subscription with all subsequent observers until the number of observers returns to zero, at which point the subscription is disposed. * * @example * var res = source.shareValue(42); * * @param initialValue Initial value received by observers upon subscription. * @returns An observable sequence that contains the elements of a sequence produced by multicasting the source sequence. */ shareValue(initialValue: T): Observable; replay(selector?: boolean, bufferSize?: number, window?: number, scheduler?: IScheduler): ConnectableObservable; // hack to catch first omitted parameter replay(selector: (source: ConnectableObservable) => Observable, bufferSize?: number, window?: number, scheduler?: IScheduler): Observable; shareReplay(bufferSize?: number, window?: number, scheduler?: IScheduler): Observable; } } declare module "rx-core-binding" { export = Rx; }