Skip to content

Commit

Permalink
Added new RxJS-BackPressure module defintion.
Browse files Browse the repository at this point in the history
Fixed .gitignore to exclude rx.js from ignoring.
  • Loading branch information
Igorbek committed Mar 18, 2014
1 parent 7ae46cf commit 3a27247
Show file tree
Hide file tree
Showing 2 changed files with 46 additions and 0 deletions.
3 changes: 3 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -34,4 +34,7 @@ Properties
*.iml
*.js.map

#rx.js
!rx.js

node_modules
43 changes: 43 additions & 0 deletions rx.js/rx.backpressure.d.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@
// Type definitions for RxJS-BackPressure v2.2.15
// Project: http://rx.codeplex.com/
// Definitions by: Igor Oleinikov <https://github.com/Igorbek>
// Definitions: https://github.com/borisyankov/DefinitelyTyped

///<reference path="rx.d.ts" />

declare module Rx {
export interface Observable<T> {
/**
* Pauses the underlying observable sequence based upon the observable sequence which yields true/false.
* @example
* var pauser = new Rx.Subject();
* var source = Rx.Observable.interval(100).pausable(pauser);
* @param pauser The observable sequence used to pause the underlying sequence.
* @returns The observable sequence which is paused based upon the pauser.
*/
pausable(pauser: Observable<boolean>): Observable<T>;

/**
* Pauses the underlying observable sequence based upon the observable sequence which yields true/false,
* and yields the values that were buffered while paused.
* @example
* var pauser = new Rx.Subject();
* var source = Rx.Observable.interval(100).pausableBuffered(pauser);
* @param pauser The observable sequence used to pause the underlying sequence.
* @returns The observable sequence which is paused based upon the pauser.
*/
pausableBuffered(pauser: Observable<boolean>): Observable<T>;

/**
* Attaches a controller to the observable sequence with the ability to queue.
* @example
* var source = Rx.Observable.interval(100).controlled();
* source.request(3); // Reads 3 values
*/
controlled(enableQueue?: boolean): ControlledObservable<T>;
}

export interface ControlledObservable<T> extends Observable<T> {
request(numberOfItems?: number): IDisposable;
}
}

0 comments on commit 3a27247

Please sign in to comment.