diff --git a/rx.js/rx.binding-lite.d.ts b/rx.js/rx.binding-lite.d.ts new file mode 100644 index 000000000..1ce2b00b9 --- /dev/null +++ b/rx.js/rx.binding-lite.d.ts @@ -0,0 +1,67 @@ +// This file contains common part of defintions for rx.binding.d.ts and rx.lite.d.ts +// Do not include the file separately. + +declare module Rx { + export interface BehaviorSubject extends Subject { + } + + interface BehaviorSubjectStatic { + new (initialValue: T): BehaviorSubject; + } + + export var BehaviorSubject: BehaviorSubjectStatic; + + export interface ReplaySubject extends Subject { + } + + interface ReplaySubjectStatic { + new (bufferSize?: number, window?: number, scheduler?: IScheduler): ReplaySubject; + } + + export var ReplaySubject: ReplaySubjectStatic; + + interface ConnectableObservable extends Observable { + connect(): IDisposable; + refCount(): Observable; + } + + interface ConnectableObservableStatic { + new (): ConnectableObservable; + } + + export var ConnectableObservable: ConnectableObservableStatic; + + export 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; + } +} diff --git a/rx.js/rx.binding.d.ts b/rx.js/rx.binding.d.ts index 9fd94191a..d98653719 100644 --- a/rx.js/rx.binding.d.ts +++ b/rx.js/rx.binding.d.ts @@ -1,73 +1,14 @@ -// Type definitions for RxJS-Binding package +// Type definitions for RxJS-Binding v2.2.17 // Project: http://rx.codeplex.com/ // Definitions by: Carl de Billy // Definitions by: Igor Oleinikov // Definitions: https://github.com/borisyankov/DefinitelyTyped /// +/// declare module Rx { - export interface BehaviorSubject extends Subject { - } - - interface BehaviorSubjectStatic { - new (initialValue: T): BehaviorSubject; - } - - export var BehaviorSubject: BehaviorSubjectStatic; - - export interface ReplaySubject extends Subject { - } - - interface ReplaySubjectStatic { - new (bufferSize?: number, window?: number, scheduler?: IScheduler): ReplaySubject; - } - - export var ReplaySubject: ReplaySubjectStatic; - - interface ConnectableObservable extends Observable { - connect(): IDisposable; - refCount(): Observable; - } - - interface ConnectableObservableStatic { - new (source: Observable, subject: ISubject): ConnectableObservable; - } - - export var ConnectableObservable: ConnectableObservableStatic; - export 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; replayWhileObserved(bufferSize?: number, window?: number, scheduler?: IScheduler): Observable; } }