前端代码
This commit is contained in:
14
node_modules/rx/ts/core/linq/connectableobservable.ts
generated
vendored
Normal file
14
node_modules/rx/ts/core/linq/connectableobservable.ts
generated
vendored
Normal file
@ -0,0 +1,14 @@
|
||||
/// <reference path="../observable.ts" />
|
||||
module Rx {
|
||||
export interface ConnectableObservable<T> extends Observable<T> {
|
||||
connect(): IDisposable;
|
||||
refCount(): Observable<T>;
|
||||
}
|
||||
}
|
||||
|
||||
(function() {
|
||||
var co: Rx.ConnectableObservable<boolean>;
|
||||
|
||||
var d : Rx.IDisposable = co.connect();
|
||||
var o : Rx.Observable<boolean> = co.refCount();
|
||||
});
|
14
node_modules/rx/ts/core/linq/groupedobservable.ts
generated
vendored
Normal file
14
node_modules/rx/ts/core/linq/groupedobservable.ts
generated
vendored
Normal file
@ -0,0 +1,14 @@
|
||||
/// <reference path="../observable.ts" />
|
||||
module Rx {
|
||||
export interface GroupedObservable<TKey, TElement> extends Observable<TElement> {
|
||||
key: TKey;
|
||||
underlyingObservable: Observable<TElement>;
|
||||
}
|
||||
}
|
||||
|
||||
(function() {
|
||||
var go: Rx.GroupedObservable<string, boolean>;
|
||||
|
||||
var k: string = go.key;
|
||||
var o : Rx.Observable<boolean> = go.underlyingObservable;
|
||||
});
|
26
node_modules/rx/ts/core/linq/observable/amb.ts
generated
vendored
Normal file
26
node_modules/rx/ts/core/linq/observable/amb.ts
generated
vendored
Normal file
@ -0,0 +1,26 @@
|
||||
/// <reference path="../../observable.ts" />
|
||||
module Rx {
|
||||
export interface ObservableStatic {
|
||||
/**
|
||||
* Propagates the observable sequence or Promise that reacts first.
|
||||
* @returns {Observable} An observable sequence that surfaces any of the given sequences, whichever reacted first.
|
||||
*/
|
||||
amb<T>(observables: ObservableOrPromise<T>[]): Observable<T>;
|
||||
/**
|
||||
* Propagates the observable sequence or Promise that reacts first.
|
||||
* @returns {Observable} An observable sequence that surfaces any of the given sequences, whichever reacted first.
|
||||
*/
|
||||
amb<T>(...observables: ObservableOrPromise<T>[]): Observable<T>;
|
||||
}
|
||||
}
|
||||
|
||||
(function() {
|
||||
var p : Rx.Promise<boolean>;
|
||||
var o : Rx.Observable<boolean>;
|
||||
var io : Rx.IObservable<boolean>;
|
||||
|
||||
var any: Rx.Observable<boolean> = Rx.Observable.amb(p, o, io, p, o, io);
|
||||
var any: Rx.Observable<boolean> = Rx.Observable.amb(p, p);
|
||||
var any: Rx.Observable<boolean> = Rx.Observable.amb(o, o);
|
||||
var any: Rx.Observable<boolean> = Rx.Observable.amb(io, io);
|
||||
});
|
22
node_modules/rx/ts/core/linq/observable/ambproto.ts
generated
vendored
Normal file
22
node_modules/rx/ts/core/linq/observable/ambproto.ts
generated
vendored
Normal file
@ -0,0 +1,22 @@
|
||||
/// <reference path="../../observable.ts" />
|
||||
module Rx {
|
||||
export interface Observable<T> {
|
||||
/**
|
||||
* Propagates the observable sequence or Promise that reacts first.
|
||||
* @param {Observable} rightSource Second observable sequence or Promise.
|
||||
* @returns {Observable} {Observable} An observable sequence that surfaces either of the given sequences, whichever reacted first.
|
||||
*/
|
||||
amb(observable: ObservableOrPromise<T>): Observable<T>;
|
||||
}
|
||||
}
|
||||
|
||||
(function() {
|
||||
var r : Rx.Observable<string>;
|
||||
var o : Rx.Observable<string>;
|
||||
var io : Rx.IObservable<string>;
|
||||
var p : Rx.Promise<string>;
|
||||
|
||||
r = r.amb(o);
|
||||
r = r.amb(io);
|
||||
r = r.amb(p);
|
||||
});
|
31
node_modules/rx/ts/core/linq/observable/and.ts
generated
vendored
Normal file
31
node_modules/rx/ts/core/linq/observable/and.ts
generated
vendored
Normal file
@ -0,0 +1,31 @@
|
||||
/// <reference path="../../observable.ts" />
|
||||
/// <reference path="../../joins/pattern.ts" />
|
||||
module Rx {
|
||||
export interface Observable<T> {
|
||||
/**
|
||||
* Creates a pattern that matches when both observable sequences have an available value.
|
||||
*
|
||||
* @param right Observable sequence to match with the current sequence.
|
||||
* @return {Pattern} Pattern object that matches when both observable sequences have an available value.
|
||||
*/
|
||||
and<T2>(right: Observable<T2>): Pattern2<T, T2>;
|
||||
}
|
||||
}
|
||||
|
||||
(function() {
|
||||
var r: Rx.Observable<string>;
|
||||
interface A { }
|
||||
var a: Rx.Observable<A>;
|
||||
|
||||
interface B { }
|
||||
var b: Rx.Observable<B>;
|
||||
|
||||
interface C { }
|
||||
var c: Rx.Observable<C>;
|
||||
|
||||
var n: Rx.Observable<number> = Rx.Observable.when(
|
||||
r.and(a).and(b).and(c).thenDo((r, a, b, c) => {
|
||||
return 123;
|
||||
})
|
||||
);
|
||||
});
|
16
node_modules/rx/ts/core/linq/observable/asobservable.ts
generated
vendored
Normal file
16
node_modules/rx/ts/core/linq/observable/asobservable.ts
generated
vendored
Normal file
@ -0,0 +1,16 @@
|
||||
/// <reference path="../../observable.ts" />
|
||||
module Rx {
|
||||
export interface Observable<T> {
|
||||
/**
|
||||
* Hides the identity of an observable sequence.
|
||||
* @returns {Observable} An observable sequence that hides the identity of the source sequence.
|
||||
*/
|
||||
asObservable(): Observable<T>;
|
||||
}
|
||||
}
|
||||
|
||||
(function() {
|
||||
var s : Rx.Subject<boolean>;
|
||||
|
||||
var o : Rx.Observable<boolean> = s.asObservable();
|
||||
});
|
21
node_modules/rx/ts/core/linq/observable/average.ts
generated
vendored
Normal file
21
node_modules/rx/ts/core/linq/observable/average.ts
generated
vendored
Normal file
@ -0,0 +1,21 @@
|
||||
/// <reference path="../../observable.ts" />
|
||||
module Rx {
|
||||
export interface Observable<T> {
|
||||
/**
|
||||
* Computes the average of an observable sequence of values that are in the sequence or obtained by invoking a transform function on each element of the input sequence if present.
|
||||
* @param {Function} [selector] A transform function to apply to each element.
|
||||
* @param {Any} [thisArg] Object to use as this when executing callback.
|
||||
* @returns {Observable} An observable sequence containing a single element with the average of the sequence of values.
|
||||
*/
|
||||
average(keySelector?: _Selector<T, number>, thisArg?: any): Observable<number>;
|
||||
}
|
||||
}
|
||||
|
||||
(function () {
|
||||
var os : Rx.Observable<string>;
|
||||
var on : Rx.Observable<number>;
|
||||
|
||||
on.average();
|
||||
os.average((v, i, s) => v.length + i);
|
||||
os.average((v, i, s) => v.length + i, {});
|
||||
});
|
35
node_modules/rx/ts/core/linq/observable/buffer.ts
generated
vendored
Normal file
35
node_modules/rx/ts/core/linq/observable/buffer.ts
generated
vendored
Normal file
@ -0,0 +1,35 @@
|
||||
/// <reference path="../../observable.ts" />
|
||||
module Rx {
|
||||
export interface Observable<T> {
|
||||
/**
|
||||
* Projects each element of an observable sequence into zero or more buffers.
|
||||
* @param {Mixed} bufferOpeningsOrClosingSelector Observable sequence whose elements denote the creation of new windows, or, a function invoked to define the boundaries of the produced windows (a new window is started when the previous one is closed, resulting in non-overlapping windows).
|
||||
* @param {Function} [bufferClosingSelector] A function invoked to define the closing of each produced window. If a closing selector function is specified for the first parameter, this parameter is ignored.
|
||||
* @returns {Observable} An observable sequence of windows.
|
||||
*/
|
||||
buffer<TBufferOpening>(bufferOpenings: Observable<TBufferOpening>): Observable<T[]>;
|
||||
/**
|
||||
* Projects each element of an observable sequence into zero or more buffers.
|
||||
* @param {Mixed} bufferOpeningsOrClosingSelector Observable sequence whose elements denote the creation of new windows, or, a function invoked to define the boundaries of the produced windows (a new window is started when the previous one is closed, resulting in non-overlapping windows).
|
||||
* @param {Function} [bufferClosingSelector] A function invoked to define the closing of each produced window. If a closing selector function is specified for the first parameter, this parameter is ignored.
|
||||
* @returns {Observable} An observable sequence of windows.
|
||||
*/
|
||||
buffer<TBufferClosing>(bufferClosingSelector: () => Observable<TBufferClosing>): Observable<T[]>;
|
||||
/**
|
||||
* Projects each element of an observable sequence into zero or more buffers.
|
||||
* @param {Mixed} bufferOpeningsOrClosingSelector Observable sequence whose elements denote the creation of new windows, or, a function invoked to define the boundaries of the produced windows (a new window is started when the previous one is closed, resulting in non-overlapping windows).
|
||||
* @param {Function} [bufferClosingSelector] A function invoked to define the closing of each produced window. If a closing selector function is specified for the first parameter, this parameter is ignored.
|
||||
* @returns {Observable} An observable sequence of windows.
|
||||
*/
|
||||
buffer<TBufferOpening, TBufferClosing>(bufferOpenings: Observable<TBufferOpening>, bufferClosingSelector: () => Observable<TBufferClosing>): Observable<T[]>;
|
||||
}
|
||||
}
|
||||
|
||||
(function() {
|
||||
var o : Rx.Observable<string>;
|
||||
var open : Rx.Observable<boolean>;
|
||||
|
||||
var so : Rx.Observable<string[]> = o.buffer(open);
|
||||
so = o.buffer(() => Rx.Observable.timer(100));
|
||||
so = o.buffer(open, () => Rx.Observable.timer(100));
|
||||
});
|
19
node_modules/rx/ts/core/linq/observable/bufferwithcount.ts
generated
vendored
Normal file
19
node_modules/rx/ts/core/linq/observable/bufferwithcount.ts
generated
vendored
Normal file
@ -0,0 +1,19 @@
|
||||
/// <reference path="../../observable.ts" />
|
||||
module Rx {
|
||||
export interface Observable<T> {
|
||||
/**
|
||||
* Projects each element of an observable sequence into zero or more buffers which are produced based on element count information.
|
||||
* @param {Number} count Length of each buffer.
|
||||
* @param {Number} [skip] Number of elements to skip between creation of consecutive buffers. If not provided, defaults to the count.
|
||||
* @returns {Observable} An observable sequence of buffers.
|
||||
*/
|
||||
bufferWithCount(count: number, skip?: number): Observable<T[]>;
|
||||
}
|
||||
}
|
||||
|
||||
(function() {
|
||||
var o : Rx.Observable<string>;
|
||||
|
||||
var so : Rx.Observable<string[]> = o.bufferWithCount(100);
|
||||
so = o.bufferWithCount(100, 5);
|
||||
});
|
31
node_modules/rx/ts/core/linq/observable/bufferwithtime.ts
generated
vendored
Normal file
31
node_modules/rx/ts/core/linq/observable/bufferwithtime.ts
generated
vendored
Normal file
@ -0,0 +1,31 @@
|
||||
/// <reference path="../../observable.ts" />
|
||||
/// <reference path="../../concurrency/scheduler.ts" />
|
||||
module Rx {
|
||||
export interface Observable<T> {
|
||||
/**
|
||||
* Projects each element of an observable sequence into zero or more buffers which are produced based on timing information.
|
||||
* @param {Number} timeSpan Length of each buffer (specified as an integer denoting milliseconds).
|
||||
* @param {Mixed} [timeShiftOrScheduler] Interval between creation of consecutive buffers (specified as an integer denoting milliseconds), or an optional scheduler parameter. If not specified, the time shift corresponds to the timeSpan parameter, resulting in non-overlapping adjacent buffers.
|
||||
* @param {Scheduler} [scheduler] Scheduler to run buffer timers on. If not specified, the timeout scheduler is used.
|
||||
* @returns {Observable} An observable sequence of buffers.
|
||||
*/
|
||||
bufferWithTime(timeSpan: number, timeShift: number, scheduler?: IScheduler): Observable<T[]>;
|
||||
/**
|
||||
* Projects each element of an observable sequence into zero or more buffers which are produced based on timing information.
|
||||
* @param {Number} timeSpan Length of each buffer (specified as an integer denoting milliseconds).
|
||||
* @param {Mixed} [timeShiftOrScheduler] Interval between creation of consecutive buffers (specified as an integer denoting milliseconds), or an optional scheduler parameter. If not specified, the time shift corresponds to the timeSpan parameter, resulting in non-overlapping adjacent buffers.
|
||||
* @param {Scheduler} [scheduler] Scheduler to run buffer timers on. If not specified, the timeout scheduler is used.
|
||||
* @returns {Observable} An observable sequence of buffers.
|
||||
*/
|
||||
bufferWithTime(timeSpan: number, scheduler?: IScheduler): Observable<T[]>;
|
||||
}
|
||||
}
|
||||
|
||||
(function() {
|
||||
var o: Rx.Observable<string>;
|
||||
|
||||
var so: Rx.Observable<string[]> = o.bufferWithTime(100);
|
||||
so = o.bufferWithTime(100, 5);
|
||||
var so: Rx.Observable<string[]> = o.bufferWithTime(100, Rx.Scheduler.async);
|
||||
so = o.bufferWithTime(100, 5, Rx.Scheduler.async);
|
||||
});
|
20
node_modules/rx/ts/core/linq/observable/bufferwithtimeorcount.ts
generated
vendored
Normal file
20
node_modules/rx/ts/core/linq/observable/bufferwithtimeorcount.ts
generated
vendored
Normal file
@ -0,0 +1,20 @@
|
||||
/// <reference path="../../observable.ts" />
|
||||
/// <reference path="../../concurrency/scheduler.ts" />
|
||||
module Rx {
|
||||
export interface Observable<T> {
|
||||
/**
|
||||
* Projects each element of an observable sequence into a buffer that is completed when either it's full or a given amount of time has elapsed.
|
||||
* @param {Number} timeSpan Maximum time length of a buffer.
|
||||
* @param {Number} count Maximum element count of a buffer.
|
||||
* @param {Scheduler} [scheduler] Scheduler to run bufferin timers on. If not specified, the timeout scheduler is used.
|
||||
* @returns {Observable} An observable sequence of buffers.
|
||||
*/
|
||||
bufferWithTimeOrCount(timeSpan: number, count: number, scheduler?: IScheduler): Observable<T[]>;
|
||||
}
|
||||
}
|
||||
|
||||
(function() {
|
||||
var o: Rx.Observable<string>;
|
||||
var so: Rx.Observable<string[]> = o.bufferWithTimeOrCount(100, 200);
|
||||
var so: Rx.Observable<string[]> = o.bufferWithTimeOrCount(100, 200, Rx.Scheduler.default);
|
||||
})
|
51
node_modules/rx/ts/core/linq/observable/case.ts
generated
vendored
Normal file
51
node_modules/rx/ts/core/linq/observable/case.ts
generated
vendored
Normal file
@ -0,0 +1,51 @@
|
||||
/// <reference path="../../observable.ts" />
|
||||
/// <reference path="../../concurrency/scheduler.ts" />
|
||||
module Rx {
|
||||
export interface ObservableStatic {
|
||||
/**
|
||||
* Uses selector to determine which source in sources to use.
|
||||
* @param {Function} selector The function which extracts the value for to test in a case statement.
|
||||
* @param {Array} sources A object which has keys which correspond to the case statement labels.
|
||||
* @param {Observable} [elseSource] The observable sequence or Promise that will be run if the sources are not matched. If this is not provided, it defaults to Rx.Observabe.empty with the specified scheduler.
|
||||
*
|
||||
* @returns {Observable} An observable sequence which is determined by a case statement.
|
||||
*/
|
||||
case<T>(selector: () => string, sources: { [key: string]: ObservableOrPromise<T>; }, schedulerOrElseSource?: IScheduler | ObservableOrPromise<T>): Observable<T>;
|
||||
/**
|
||||
* Uses selector to determine which source in sources to use.
|
||||
* @param {Function} selector The function which extracts the value for to test in a case statement.
|
||||
* @param {Array} sources A object which has keys which correspond to the case statement labels.
|
||||
* @param {Observable} [elseSource] The observable sequence or Promise that will be run if the sources are not matched. If this is not provided, it defaults to Rx.Observabe.empty with the specified scheduler.
|
||||
*
|
||||
* @returns {Observable} An observable sequence which is determined by a case statement.
|
||||
*/
|
||||
case<T>(selector: () => number, sources: { [key: number]: ObservableOrPromise<T>; }, schedulerOrElseSource?: IScheduler | ObservableOrPromise<T>): Observable<T>;
|
||||
}
|
||||
}
|
||||
|
||||
(function() {
|
||||
var o: Rx.Observable<string>;
|
||||
var p: Rx.Promise<string>;
|
||||
var e: Rx.Observable<string>;
|
||||
var on: Rx.Observable<number>;
|
||||
var pn: Rx.Promise<number>;
|
||||
var en: Rx.Observable<number>;
|
||||
|
||||
var so : { [key: string]: Rx.ObservableOrPromise<string>; } = {};
|
||||
so['abc'] = p;
|
||||
so['def'] = e;
|
||||
so['xyz'] = o;
|
||||
|
||||
var no : { [key: number]: Rx.ObservableOrPromise<number>; } = {}
|
||||
no[1] = pn;
|
||||
no[2] = en;
|
||||
no[3] = on;
|
||||
|
||||
o = Rx.Observable.case(() => 'abc', so)
|
||||
o = Rx.Observable.case(() => 'abc', so, e)
|
||||
o = Rx.Observable.case(() => 'abc', so, Rx.Scheduler.async);
|
||||
|
||||
on = Rx.Observable.case(() => 1, no)
|
||||
on = Rx.Observable.case(() => 2, no, en);
|
||||
on = Rx.Observable.case(() => 3, no, Rx.Scheduler.async);
|
||||
});
|
28
node_modules/rx/ts/core/linq/observable/catch.ts
generated
vendored
Normal file
28
node_modules/rx/ts/core/linq/observable/catch.ts
generated
vendored
Normal file
@ -0,0 +1,28 @@
|
||||
/// <reference path="../../observable.ts" />
|
||||
module Rx {
|
||||
export interface ObservableStatic {
|
||||
/**
|
||||
* Continues an observable sequence that is terminated by an exception with the next observable sequence.
|
||||
* @param {Array | Arguments} args Arguments or an array to use as the next sequence if an error occurs.
|
||||
* @returns {Observable} An observable sequence containing elements from consecutive source sequences until a source sequence terminates successfully.
|
||||
*/
|
||||
catch<T>(sources: ObservableOrPromise<T>[]): Observable<T>;
|
||||
/**
|
||||
* Continues an observable sequence that is terminated by an exception with the next observable sequence.
|
||||
* @param {Array | Arguments} args Arguments or an array to use as the next sequence if an error occurs.
|
||||
* @returns {Observable} An observable sequence containing elements from consecutive source sequences until a source sequence terminates successfully.
|
||||
*/
|
||||
catch<T>(...sources: ObservableOrPromise<T>[]): Observable<T>;
|
||||
}
|
||||
}
|
||||
|
||||
(function() {
|
||||
var o : Rx.Observable<string>;
|
||||
var io : Rx.IObservable<string>;
|
||||
var p : Rx.Promise<string>;
|
||||
|
||||
var t = [o, p, o, p, io];
|
||||
o = Rx.Observable.catch(o, p, o, p, io);
|
||||
o = Rx.Observable.catch(...t);
|
||||
o = Rx.Observable.catch(t);
|
||||
});
|
32
node_modules/rx/ts/core/linq/observable/catchproto.ts
generated
vendored
Normal file
32
node_modules/rx/ts/core/linq/observable/catchproto.ts
generated
vendored
Normal file
@ -0,0 +1,32 @@
|
||||
/// <reference path="../../observable.ts" />
|
||||
module Rx {
|
||||
export interface Observable<T> {
|
||||
/**
|
||||
* Continues an observable sequence that is terminated by an exception with the next observable sequence.
|
||||
* @param {Mixed} handlerOrSecond Exception handler function that returns an observable sequence given the error that occurred in the first sequence, or a second observable sequence used to produce results when an error occurred in the first sequence.
|
||||
* @returns {Observable} An observable sequence containing the first sequence's elements, followed by the elements of the handler sequence in case an exception occurred.
|
||||
*/
|
||||
catch(handler: (exception: any) => ObservableOrPromise<T>): Observable<T>;
|
||||
/**
|
||||
* Continues an observable sequence that is terminated by an exception with the next observable sequence.
|
||||
* @param {Mixed} handlerOrSecond Exception handler function that returns an observable sequence given the error that occurred in the first sequence, or a second observable sequence used to produce results when an error occurred in the first sequence.
|
||||
* @returns {Observable} An observable sequence containing the first sequence's elements, followed by the elements of the handler sequence in case an exception occurred.
|
||||
*/
|
||||
catch(second: ObservableOrPromise<T>): Observable<T>;
|
||||
}
|
||||
}
|
||||
|
||||
(function() {
|
||||
|
||||
var o: Rx.Observable<string>;
|
||||
var io: Rx.IObservable<string>;
|
||||
var p: Rx.Promise<string>;
|
||||
|
||||
o = o.catch((e) => o);
|
||||
o = o.catch((e) => io);
|
||||
o = o.catch((e) => p);
|
||||
|
||||
o = o.catch(o);
|
||||
o = o.catch(io);
|
||||
o = o.catch(p);
|
||||
});
|
97
node_modules/rx/ts/core/linq/observable/combinelatest.ts
generated
vendored
Normal file
97
node_modules/rx/ts/core/linq/observable/combinelatest.ts
generated
vendored
Normal file
@ -0,0 +1,97 @@
|
||||
/// <reference path="../../observable.ts" />
|
||||
module Rx {
|
||||
export interface ObservableStatic {
|
||||
/**
|
||||
* Merges the specified observable sequences into one observable sequence by using the selector function whenever any of the observable sequences or Promises produces an element.
|
||||
*
|
||||
* @example
|
||||
* 1 - obs = Rx.Observable.combineLatest(obs1, obs2, obs3, function (o1, o2, o3) { return o1 + o2 + o3; });
|
||||
* 2 - obs = Rx.Observable.combineLatest([obs1, obs2, obs3], function (o1, o2, o3) { return o1 + o2 + o3; });
|
||||
* @returns {Observable} An observable sequence containing the result of combining elements of the sources using the specified result selector function.
|
||||
*/
|
||||
combineLatest<T, T2, TResult>(first: ObservableOrPromise<T>, second: ObservableOrPromise<T2>, resultSelector: (v1: T, v2: T2) => TResult): Observable<TResult>;
|
||||
/**
|
||||
* Merges the specified observable sequences into one observable sequence by using the selector function whenever any of the observable sequences or Promises produces an element.
|
||||
*
|
||||
* @example
|
||||
* 1 - obs = Rx.Observable.combineLatest(obs1, obs2, obs3, function (o1, o2, o3) { return o1 + o2 + o3; });
|
||||
* 2 - obs = Rx.Observable.combineLatest([obs1, obs2, obs3], function (o1, o2, o3) { return o1 + o2 + o3; });
|
||||
* @returns {Observable} An observable sequence containing the result of combining elements of the sources using the specified result selector function.
|
||||
*/
|
||||
combineLatest<T, T2, T3, TResult>(first: ObservableOrPromise<T>, second: ObservableOrPromise<T2>, third: ObservableOrPromise<T3>, resultSelector: (v1: T, v2: T2, v3: T3) => TResult): Observable<TResult>;
|
||||
/**
|
||||
* Merges the specified observable sequences into one observable sequence by using the selector function whenever any of the observable sequences or Promises produces an element.
|
||||
*
|
||||
* @example
|
||||
* 1 - obs = Rx.Observable.combineLatest(obs1, obs2, obs3, function (o1, o2, o3) { return o1 + o2 + o3; });
|
||||
* 2 - obs = Rx.Observable.combineLatest([obs1, obs2, obs3], function (o1, o2, o3) { return o1 + o2 + o3; });
|
||||
* @returns {Observable} An observable sequence containing the result of combining elements of the sources using the specified result selector function.
|
||||
*/
|
||||
combineLatest<T, T2, T3, T4, TResult>(first: ObservableOrPromise<T>, second: ObservableOrPromise<T2>, third: ObservableOrPromise<T3>, fourth: ObservableOrPromise<T4>, resultSelector: (v1: T, v2: T2, v3: T3, v4: T4) => TResult): Observable<TResult>;
|
||||
/**
|
||||
* Merges the specified observable sequences into one observable sequence by using the selector function whenever any of the observable sequences or Promises produces an element.
|
||||
*
|
||||
* @example
|
||||
* 1 - obs = Rx.Observable.combineLatest(obs1, obs2, obs3, function (o1, o2, o3) { return o1 + o2 + o3; });
|
||||
* 2 - obs = Rx.Observable.combineLatest([obs1, obs2, obs3], function (o1, o2, o3) { return o1 + o2 + o3; });
|
||||
* @returns {Observable} An observable sequence containing the result of combining elements of the sources using the specified result selector function.
|
||||
*/
|
||||
combineLatest<T, T2, T3, T4, T5, TResult>(first: ObservableOrPromise<T>, second: ObservableOrPromise<T2>, third: ObservableOrPromise<T3>, fourth: ObservableOrPromise<T4>, fifth: ObservableOrPromise<T5>, resultSelector: (v1: T, v2: T2, v3: T3, v4: T4, v5: T5) => TResult): Observable<TResult>;
|
||||
/**
|
||||
* Merges the specified observable sequences into one observable sequence by using the selector function whenever any of the observable sequences or Promises produces an element.
|
||||
*
|
||||
* @example
|
||||
* 1 - obs = Rx.Observable.combineLatest(obs1, obs2, obs3, function (o1, o2, o3) { return o1 + o2 + o3; });
|
||||
* 2 - obs = Rx.Observable.combineLatest([obs1, obs2, obs3], function (o1, o2, o3) { return o1 + o2 + o3; });
|
||||
* @returns {Observable} An observable sequence containing the result of combining elements of the sources using the specified result selector function.
|
||||
*/
|
||||
combineLatest<T, T2, T3, T4, T5, T6, TResult>(first: ObservableOrPromise<T>, second: ObservableOrPromise<T2>, third: ObservableOrPromise<T3>, fourth: ObservableOrPromise<T4>, fifth: ObservableOrPromise<T5>, sixth: ObservableOrPromise<T6>, resultSelector: (v1: T, v2: T2, v3: T3, v4: T4, v5: T5, v6: T6) => TResult): Observable<TResult>;
|
||||
/**
|
||||
* Merges the specified observable sequences into one observable sequence by using the selector function whenever any of the observable sequences or Promises produces an element.
|
||||
*
|
||||
* @example
|
||||
* 1 - obs = Rx.Observable.combineLatest(obs1, obs2, obs3, function (o1, o2, o3) { return o1 + o2 + o3; });
|
||||
* 2 - obs = Rx.Observable.combineLatest([obs1, obs2, obs3], function (o1, o2, o3) { return o1 + o2 + o3; });
|
||||
* @returns {Observable} An observable sequence containing the result of combining elements of the sources using the specified result selector function.
|
||||
*/
|
||||
combineLatest<T, T2, T3, T4, T5, T6, T7, TResult>(first: ObservableOrPromise<T>, second: ObservableOrPromise<T2>, third: ObservableOrPromise<T3>, fourth: ObservableOrPromise<T4>, fifth: ObservableOrPromise<T5>, sixth: ObservableOrPromise<T6>, eventh: ObservableOrPromise<T7>, resultSelector: (v1: T, v2: T2, v3: T3, v4: T4, v5: T5, v6: T6, v7: T7) => TResult): Observable<TResult>;
|
||||
/**
|
||||
* Merges the specified observable sequences into one observable sequence by using the selector function whenever any of the observable sequences or Promises produces an element.
|
||||
*
|
||||
* @example
|
||||
* 1 - obs = Rx.Observable.combineLatest(obs1, obs2, obs3, function (o1, o2, o3) { return o1 + o2 + o3; });
|
||||
* 2 - obs = Rx.Observable.combineLatest([obs1, obs2, obs3], function (o1, o2, o3) { return o1 + o2 + o3; });
|
||||
* @returns {Observable} An observable sequence containing the result of combining elements of the sources using the specified result selector function.
|
||||
*/
|
||||
combineLatest<T, T2, T3, T4, T5, T6, T7, T8, TResult>(first: ObservableOrPromise<T>, second: ObservableOrPromise<T2>, third: ObservableOrPromise<T3>, fourth: ObservableOrPromise<T4>, fifth: ObservableOrPromise<T5>, sixth: ObservableOrPromise<T6>, seventh: ObservableOrPromise<T7>, eighth: ObservableOrPromise<T8>, resultSelector: (v1: T, v2: T2, v3: T3, v4: T4, v5: T5, v6: T6, v7: T7, v8: T8) => TResult): Observable<TResult>;
|
||||
/**
|
||||
* Merges the specified observable sequences into one observable sequence by using the selector function whenever any of the observable sequences or Promises produces an element.
|
||||
*
|
||||
* @example
|
||||
* 1 - obs = Rx.Observable.combineLatest(obs1, obs2, obs3, function (o1, o2, o3) { return o1 + o2 + o3; });
|
||||
* 2 - obs = Rx.Observable.combineLatest([obs1, obs2, obs3], function (o1, o2, o3) { return o1 + o2 + o3; });
|
||||
* @returns {Observable} An observable sequence containing the result of combining elements of the sources using the specified result selector function.
|
||||
*/
|
||||
combineLatest<T, T2, T3, T4, T5, T6, T7, T8, T9, TResult>(first: ObservableOrPromise<T>, second: ObservableOrPromise<T2>, third: ObservableOrPromise<T3>, fourth: ObservableOrPromise<T4>, fifth: ObservableOrPromise<T5>, sixth: ObservableOrPromise<T6>, seventh: ObservableOrPromise<T7>, eighth: ObservableOrPromise<T8>, ninth: ObservableOrPromise<T9>, resultSelector: (v1: T, v2: T2, v3: T3, v4: T4, v5: T5, v6: T6, v7: T7, v8: T8, v9: T9) => TResult): Observable<TResult>;
|
||||
/**
|
||||
* Merges the specified observable sequences into one observable sequence by using the selector function whenever any of the observable sequences or Promises produces an element.
|
||||
*
|
||||
* @example
|
||||
* 1 - obs = Rx.Observable.combineLatest(obs1, obs2, obs3, function (o1, o2, o3) { return o1 + o2 + o3; });
|
||||
* 2 - obs = Rx.Observable.combineLatest([obs1, obs2, obs3], function (o1, o2, o3) { return o1 + o2 + o3; });
|
||||
* @returns {Observable} An observable sequence containing the result of combining elements of the sources using the specified result selector function.
|
||||
*/
|
||||
combineLatest<TOther, TResult>(souces: ObservableOrPromise<TOther>[], resultSelector: (...otherValues: TOther[]) => TResult): Observable<TResult>;
|
||||
}
|
||||
}
|
||||
|
||||
(function() {
|
||||
var o: Rx.Observable<boolean>;
|
||||
var io: Rx.IObservable<string>;
|
||||
var so: Rx.Subject<number>;
|
||||
var p: Rx.Promise<{ a: string }>;
|
||||
|
||||
var r: Rx.Observable<{ vo: boolean, vio: string, vp: { a: string }, vso: number }> = Rx.Observable.combineLatest(o, io, p, so, (vo, vio, vp, vso) => ({ vo, vio, vp, vso }));
|
||||
|
||||
var rr : Rx.Observable<number> = Rx.Observable.combineLatest(<any[]>[o, io, so, p], (items) => 5);
|
||||
});
|
106
node_modules/rx/ts/core/linq/observable/combinelatestproto.ts
generated
vendored
Normal file
106
node_modules/rx/ts/core/linq/observable/combinelatestproto.ts
generated
vendored
Normal file
@ -0,0 +1,106 @@
|
||||
/// <reference path="../../observable.ts" />
|
||||
module Rx {
|
||||
export interface Observable<T> {
|
||||
/**
|
||||
* Merges the specified observable sequences into one observable sequence by using the selector function whenever any of the observable sequences or Promises produces an element.
|
||||
* This can be in the form of an argument list of observables or an array.
|
||||
*
|
||||
* @example
|
||||
* 1 - obs = observable.combineLatest(obs1, obs2, obs3, function (o1, o2, o3) { return o1 + o2 + o3; });
|
||||
* 2 - obs = observable.combineLatest([obs1, obs2, obs3], function (o1, o2, o3) { return o1 + o2 + o3; });
|
||||
* @returns {Observable} An observable sequence containing the result of combining elements of the sources using the specified result selector function.
|
||||
*/
|
||||
combineLatest<T2, TResult>(second: ObservableOrPromise<T2>, resultSelector: (v1: T, v2: T2) => TResult): Observable<TResult>;
|
||||
/**
|
||||
* Merges the specified observable sequences into one observable sequence by using the selector function whenever any of the observable sequences or Promises produces an element.
|
||||
* This can be in the form of an argument list of observables or an array.
|
||||
*
|
||||
* @example
|
||||
* 1 - obs = observable.combineLatest(obs1, obs2, obs3, function (o1, o2, o3) { return o1 + o2 + o3; });
|
||||
* 2 - obs = observable.combineLatest([obs1, obs2, obs3], function (o1, o2, o3) { return o1 + o2 + o3; });
|
||||
* @returns {Observable} An observable sequence containing the result of combining elements of the sources using the specified result selector function.
|
||||
*/
|
||||
combineLatest<T2, T3, TResult>(second: ObservableOrPromise<T2>, third: ObservableOrPromise<T3>, resultSelector: (v1: T, v2: T2, v3: T3) => TResult): Observable<TResult>;
|
||||
/**
|
||||
* Merges the specified observable sequences into one observable sequence by using the selector function whenever any of the observable sequences or Promises produces an element.
|
||||
* This can be in the form of an argument list of observables or an array.
|
||||
*
|
||||
* @example
|
||||
* 1 - obs = observable.combineLatest(obs1, obs2, obs3, function (o1, o2, o3) { return o1 + o2 + o3; });
|
||||
* 2 - obs = observable.combineLatest([obs1, obs2, obs3], function (o1, o2, o3) { return o1 + o2 + o3; });
|
||||
* @returns {Observable} An observable sequence containing the result of combining elements of the sources using the specified result selector function.
|
||||
*/
|
||||
combineLatest<T2, T3, T4, TResult>(second: ObservableOrPromise<T2>, third: ObservableOrPromise<T3>, fourth: ObservableOrPromise<T4>, resultSelector: (v1: T, v2: T2, v3: T3, v4: T4) => TResult): Observable<TResult>;
|
||||
/**
|
||||
* Merges the specified observable sequences into one observable sequence by using the selector function whenever any of the observable sequences or Promises produces an element.
|
||||
* This can be in the form of an argument list of observables or an array.
|
||||
*
|
||||
* @example
|
||||
* 1 - obs = observable.combineLatest(obs1, obs2, obs3, function (o1, o2, o3) { return o1 + o2 + o3; });
|
||||
* 2 - obs = observable.combineLatest([obs1, obs2, obs3], function (o1, o2, o3) { return o1 + o2 + o3; });
|
||||
* @returns {Observable} An observable sequence containing the result of combining elements of the sources using the specified result selector function.
|
||||
*/
|
||||
combineLatest<T2, T3, T4, T5, TResult>(second: ObservableOrPromise<T2>, third: ObservableOrPromise<T3>, fourth: ObservableOrPromise<T4>, fifth: ObservableOrPromise<T5>, resultSelector: (v1: T, v2: T2, v3: T3, v4: T4, v5: T5) => TResult): Observable<TResult>;
|
||||
/**
|
||||
* Merges the specified observable sequences into one observable sequence by using the selector function whenever any of the observable sequences or Promises produces an element.
|
||||
* This can be in the form of an argument list of observables or an array.
|
||||
*
|
||||
* @example
|
||||
* 1 - obs = observable.combineLatest(obs1, obs2, obs3, function (o1, o2, o3) { return o1 + o2 + o3; });
|
||||
* 2 - obs = observable.combineLatest([obs1, obs2, obs3], function (o1, o2, o3) { return o1 + o2 + o3; });
|
||||
* @returns {Observable} An observable sequence containing the result of combining elements of the sources using the specified result selector function.
|
||||
*/
|
||||
combineLatest<T2, T3, T4, T5, T6, TResult>(second: ObservableOrPromise<T2>, third: ObservableOrPromise<T3>, fourth: ObservableOrPromise<T4>, fifth: ObservableOrPromise<T5>, sixth: ObservableOrPromise<T6>, resultSelector: (v1: T, v2: T2, v3: T3, v4: T4, v5: T5, v6: T6) => TResult): Observable<TResult>;
|
||||
/**
|
||||
* Merges the specified observable sequences into one observable sequence by using the selector function whenever any of the observable sequences or Promises produces an element.
|
||||
* This can be in the form of an argument list of observables or an array.
|
||||
*
|
||||
* @example
|
||||
* 1 - obs = observable.combineLatest(obs1, obs2, obs3, function (o1, o2, o3) { return o1 + o2 + o3; });
|
||||
* 2 - obs = observable.combineLatest([obs1, obs2, obs3], function (o1, o2, o3) { return o1 + o2 + o3; });
|
||||
* @returns {Observable} An observable sequence containing the result of combining elements of the sources using the specified result selector function.
|
||||
*/
|
||||
combineLatest<T2, T3, T4, T5, T6, T7, TResult>(second: ObservableOrPromise<T2>, third: ObservableOrPromise<T3>, fourth: ObservableOrPromise<T4>, fifth: ObservableOrPromise<T5>, sixth: ObservableOrPromise<T6>, seventh: ObservableOrPromise<T7>, resultSelector: (v1: T, v2: T2, v3: T3, v4: T4, v5: T5, v6: T6, v7: T7) => TResult): Observable<TResult>;
|
||||
/**
|
||||
* Merges the specified observable sequences into one observable sequence by using the selector function whenever any of the observable sequences or Promises produces an element.
|
||||
* This can be in the form of an argument list of observables or an array.
|
||||
*
|
||||
* @example
|
||||
* 1 - obs = observable.combineLatest(obs1, obs2, obs3, function (o1, o2, o3) { return o1 + o2 + o3; });
|
||||
* 2 - obs = observable.combineLatest([obs1, obs2, obs3], function (o1, o2, o3) { return o1 + o2 + o3; });
|
||||
* @returns {Observable} An observable sequence containing the result of combining elements of the sources using the specified result selector function.
|
||||
*/
|
||||
combineLatest<T2, T3, T4, T5, T6, T7, T8, TResult>(second: ObservableOrPromise<T2>, third: ObservableOrPromise<T3>, fourth: ObservableOrPromise<T4>, fifth: ObservableOrPromise<T5>, sixth: ObservableOrPromise<T6>, seventh: ObservableOrPromise<T7>, eighth: ObservableOrPromise<T8>, resultSelector: (v1: T, v2: T2, v3: T3, v4: T4, v5: T5, v6: T6, v7: T7, v8: T8) => TResult): Observable<TResult>;
|
||||
/**
|
||||
* Merges the specified observable sequences into one observable sequence by using the selector function whenever any of the observable sequences or Promises produces an element.
|
||||
* This can be in the form of an argument list of observables or an array.
|
||||
*
|
||||
* @example
|
||||
* 1 - obs = observable.combineLatest(obs1, obs2, obs3, function (o1, o2, o3) { return o1 + o2 + o3; });
|
||||
* 2 - obs = observable.combineLatest([obs1, obs2, obs3], function (o1, o2, o3) { return o1 + o2 + o3; });
|
||||
* @returns {Observable} An observable sequence containing the result of combining elements of the sources using the specified result selector function.
|
||||
*/
|
||||
combineLatest<T2, T3, T4, T5, T6, T7, T8, T9, TResult>(second: ObservableOrPromise<T2>, third: ObservableOrPromise<T3>, fourth: ObservableOrPromise<T4>, fifth: ObservableOrPromise<T5>, sixth: ObservableOrPromise<T6>, seventh: ObservableOrPromise<T7>, eighth: ObservableOrPromise<T8>, ninth: ObservableOrPromise<T9>, resultSelector: (v1: T, v2: T2, v3: T3, v4: T4, v5: T5, v6: T6, v7: T7, v8: T8, v9: T9) => TResult): Observable<TResult>;
|
||||
/**
|
||||
* Merges the specified observable sequences into one observable sequence by using the selector function whenever any of the observable sequences or Promises produces an element.
|
||||
* This can be in the form of an argument list of observables or an array.
|
||||
*
|
||||
* @example
|
||||
* 1 - obs = observable.combineLatest(obs1, obs2, obs3, function (o1, o2, o3) { return o1 + o2 + o3; });
|
||||
* 2 - obs = observable.combineLatest([obs1, obs2, obs3], function (o1, o2, o3) { return o1 + o2 + o3; });
|
||||
* @returns {Observable} An observable sequence containing the result of combining elements of the sources using the specified result selector function.
|
||||
*/
|
||||
combineLatest<TOther, TResult>(souces: ObservableOrPromise<TOther>[], resultSelector: (firstValue: T, ...otherValues: TOther[]) => TResult): Observable<TResult>;
|
||||
}
|
||||
}
|
||||
|
||||
(function() {
|
||||
var o: Rx.Observable<boolean>;
|
||||
var io: Rx.IObservable<string>;
|
||||
var so: Rx.Subject<number>;
|
||||
var p: Rx.Promise<{ a: string }>;
|
||||
|
||||
var r: Rx.Observable<{ vo: boolean, vio: string, vp: { a: string }, vso: number }> = o.combineLatest(io, p, so, (vo, vio, vp, vso) => ({ vo, vio, vp, vso }));
|
||||
|
||||
var rr : Rx.Observable<number> = o.combineLatest(<any[]>[io, so, p], (v1, items) => 5);
|
||||
});
|
28
node_modules/rx/ts/core/linq/observable/concat.ts
generated
vendored
Normal file
28
node_modules/rx/ts/core/linq/observable/concat.ts
generated
vendored
Normal file
@ -0,0 +1,28 @@
|
||||
/// <reference path="../../observable.ts" />
|
||||
module Rx {
|
||||
export interface ObservableStatic {
|
||||
/**
|
||||
* Concatenates all the observable sequences.
|
||||
* @param {Array | Arguments} args Arguments or an array to concat to the observable sequence.
|
||||
* @returns {Observable} An observable sequence that contains the elements of each given sequence, in sequential order.
|
||||
*/
|
||||
concat<T>(...sources: ObservableOrPromise<T>[]): Observable<T>;
|
||||
/**
|
||||
* Concatenates all the observable sequences.
|
||||
* @param {Array | Arguments} args Arguments or an array to concat to the observable sequence.
|
||||
* @returns {Observable} An observable sequence that contains the elements of each given sequence, in sequential order.
|
||||
*/
|
||||
concat<T>(sources: ObservableOrPromise<T>[]): Observable<T>;
|
||||
}
|
||||
}
|
||||
|
||||
(function() {
|
||||
|
||||
var o: Rx.Observable<string>;
|
||||
var io: Rx.IObservable<string>;
|
||||
var so: Rx.Subject<string>;
|
||||
var p: Rx.Promise<string>;
|
||||
|
||||
var o: Rx.Observable<string> = Rx.Observable.concat(o, io, so, p);
|
||||
var o: Rx.Observable<string> = Rx.Observable.concat([o, io, so, p]);
|
||||
});
|
16
node_modules/rx/ts/core/linq/observable/concatall.ts
generated
vendored
Normal file
16
node_modules/rx/ts/core/linq/observable/concatall.ts
generated
vendored
Normal file
@ -0,0 +1,16 @@
|
||||
/// <reference path="../../observable.ts" />
|
||||
module Rx {
|
||||
export interface Observable<T> {
|
||||
/**
|
||||
* Concatenates an observable sequence of observable sequences.
|
||||
* @returns {Observable} An observable sequence that contains the elements of each observed inner sequence, in sequential order.
|
||||
*/
|
||||
concatAll(): T;
|
||||
}
|
||||
}
|
||||
|
||||
(function() {
|
||||
var o: Rx.Observable<Rx.Observable<string>>;
|
||||
|
||||
var oo : Rx.Observable<string> = o.concatAll();
|
||||
});
|
199
node_modules/rx/ts/core/linq/observable/concatmap.ts
generated
vendored
Normal file
199
node_modules/rx/ts/core/linq/observable/concatmap.ts
generated
vendored
Normal file
@ -0,0 +1,199 @@
|
||||
/// <reference path="../../observable.ts" />
|
||||
module Rx {
|
||||
export interface Observable<T> {
|
||||
/**
|
||||
* One of the Following:
|
||||
* Projects each element of an observable sequence to an observable sequence and merges the resulting observable sequences into one observable sequence.
|
||||
*
|
||||
* @example
|
||||
* var res = source.concatMap(function (x) { return Rx.Observable.range(0, x); });
|
||||
* Or:
|
||||
* Projects each element of an observable sequence to an observable sequence, invokes the result selector for the source element and each of the corresponding inner sequence's elements, and merges the results into one observable sequence.
|
||||
*
|
||||
* var res = source.concatMap(function (x) { return Rx.Observable.range(0, x); }, function (x, y) { return x + y; });
|
||||
* Or:
|
||||
* Projects each element of the source observable sequence to the other observable sequence and merges the resulting observable sequences into one observable sequence.
|
||||
*
|
||||
* var res = source.concatMap(Rx.Observable.fromArray([1,2,3]));
|
||||
* @param {Function} selector A transform function to apply to each element or an observable sequence to project each element from the
|
||||
* source sequence onto which could be either an observable or Promise.
|
||||
* @param {Function} [resultSelector] A transform function to apply to each element of the intermediate sequence.
|
||||
* @returns {Observable} An observable sequence whose elements are the result of invoking the one-to-many transform function collectionSelector on each element of the input sequence and then mapping each of those sequence elements and their corresponding source element to a result element.
|
||||
*/
|
||||
concatMap<TResult>(selector: _ValueOrSelector<T, ObservableOrPromise<TResult>>): Observable<TResult>;
|
||||
/**
|
||||
* One of the Following:
|
||||
* Projects each element of an observable sequence to an observable sequence and merges the resulting observable sequences into one observable sequence.
|
||||
*
|
||||
* @example
|
||||
* var res = source.concatMap(function (x) { return Rx.Observable.range(0, x); });
|
||||
* Or:
|
||||
* Projects each element of an observable sequence to an observable sequence, invokes the result selector for the source element and each of the corresponding inner sequence's elements, and merges the results into one observable sequence.
|
||||
*
|
||||
* var res = source.concatMap(function (x) { return Rx.Observable.range(0, x); }, function (x, y) { return x + y; });
|
||||
* Or:
|
||||
* Projects each element of the source observable sequence to the other observable sequence and merges the resulting observable sequences into one observable sequence.
|
||||
*
|
||||
* var res = source.concatMap(Rx.Observable.fromArray([1,2,3]));
|
||||
* @param {Function} selector A transform function to apply to each element or an observable sequence to project each element from the
|
||||
* source sequence onto which could be either an observable or Promise.
|
||||
* @param {Function} [resultSelector] A transform function to apply to each element of the intermediate sequence.
|
||||
* @returns {Observable} An observable sequence whose elements are the result of invoking the one-to-many transform function collectionSelector on each element of the input sequence and then mapping each of those sequence elements and their corresponding source element to a result element.
|
||||
*/
|
||||
concatMap<TResult>(selector: _ValueOrSelector<T, ArrayOrIterable<TResult>>): Observable<TResult>;
|
||||
/**
|
||||
* One of the Following:
|
||||
* Projects each element of an observable sequence to an observable sequence and merges the resulting observable sequences into one observable sequence.
|
||||
*
|
||||
* @example
|
||||
* var res = source.concatMap(function (x) { return Rx.Observable.range(0, x); });
|
||||
* Or:
|
||||
* Projects each element of an observable sequence to an observable sequence, invokes the result selector for the source element and each of the corresponding inner sequence's elements, and merges the results into one observable sequence.
|
||||
*
|
||||
* var res = source.concatMap(function (x) { return Rx.Observable.range(0, x); }, function (x, y) { return x + y; });
|
||||
* Or:
|
||||
* Projects each element of the source observable sequence to the other observable sequence and merges the resulting observable sequences into one observable sequence.
|
||||
*
|
||||
* var res = source.concatMap(Rx.Observable.fromArray([1,2,3]));
|
||||
* @param {Function} selector A transform function to apply to each element or an observable sequence to project each element from the
|
||||
* source sequence onto which could be either an observable or Promise.
|
||||
* @param {Function} [resultSelector] A transform function to apply to each element of the intermediate sequence.
|
||||
* @returns {Observable} An observable sequence whose elements are the result of invoking the one-to-many transform function collectionSelector on each element of the input sequence and then mapping each of those sequence elements and their corresponding source element to a result element.
|
||||
*/
|
||||
concatMap<TOther, TResult>(selector: _ValueOrSelector<T, ObservableOrPromise<TOther>>, resultSelector: special._FlatMapResultSelector<T, TOther, TResult>, thisArg?: any): Observable<TResult>;
|
||||
/**
|
||||
* One of the Following:
|
||||
* Projects each element of an observable sequence to an observable sequence and merges the resulting observable sequences into one observable sequence.
|
||||
*
|
||||
* @example
|
||||
* var res = source.concatMap(function (x) { return Rx.Observable.range(0, x); });
|
||||
* Or:
|
||||
* Projects each element of an observable sequence to an observable sequence, invokes the result selector for the source element and each of the corresponding inner sequence's elements, and merges the results into one observable sequence.
|
||||
*
|
||||
* var res = source.concatMap(function (x) { return Rx.Observable.range(0, x); }, function (x, y) { return x + y; });
|
||||
* Or:
|
||||
* Projects each element of the source observable sequence to the other observable sequence and merges the resulting observable sequences into one observable sequence.
|
||||
*
|
||||
* var res = source.concatMap(Rx.Observable.fromArray([1,2,3]));
|
||||
* @param {Function} selector A transform function to apply to each element or an observable sequence to project each element from the
|
||||
* source sequence onto which could be either an observable or Promise.
|
||||
* @param {Function} [resultSelector] A transform function to apply to each element of the intermediate sequence.
|
||||
* @returns {Observable} An observable sequence whose elements are the result of invoking the one-to-many transform function collectionSelector on each element of the input sequence and then mapping each of those sequence elements and their corresponding source element to a result element.
|
||||
*/
|
||||
concatMap<TOther, TResult>(selector: _ValueOrSelector<T, ArrayOrIterable<TOther>>, resultSelector: special._FlatMapResultSelector<T, TOther, TResult>, thisArg?: any): Observable<TResult>;
|
||||
/**
|
||||
* One of the Following:
|
||||
* Projects each element of an observable sequence to an observable sequence and merges the resulting observable sequences into one observable sequence.
|
||||
*
|
||||
* @example
|
||||
* var res = source.concatMap(function (x) { return Rx.Observable.range(0, x); });
|
||||
* Or:
|
||||
* Projects each element of an observable sequence to an observable sequence, invokes the result selector for the source element and each of the corresponding inner sequence's elements, and merges the results into one observable sequence.
|
||||
*
|
||||
* var res = source.concatMap(function (x) { return Rx.Observable.range(0, x); }, function (x, y) { return x + y; });
|
||||
* Or:
|
||||
* Projects each element of the source observable sequence to the other observable sequence and merges the resulting observable sequences into one observable sequence.
|
||||
*
|
||||
* var res = source.concatMap(Rx.Observable.fromArray([1,2,3]));
|
||||
* @param {Function} selector A transform function to apply to each element or an observable sequence to project each element from the
|
||||
* source sequence onto which could be either an observable or Promise.
|
||||
* @param {Function} [resultSelector] A transform function to apply to each element of the intermediate sequence.
|
||||
* @returns {Observable} An observable sequence whose elements are the result of invoking the one-to-many transform function collectionSelector on each element of the input sequence and then mapping each of those sequence elements and their corresponding source element to a result element.
|
||||
*/
|
||||
selectConcat<TResult>(selector: _ValueOrSelector<T, ObservableOrPromise<TResult>>): Observable<TResult>;
|
||||
/**
|
||||
* One of the Following:
|
||||
* Projects each element of an observable sequence to an observable sequence and merges the resulting observable sequences into one observable sequence.
|
||||
*
|
||||
* @example
|
||||
* var res = source.concatMap(function (x) { return Rx.Observable.range(0, x); });
|
||||
* Or:
|
||||
* Projects each element of an observable sequence to an observable sequence, invokes the result selector for the source element and each of the corresponding inner sequence's elements, and merges the results into one observable sequence.
|
||||
*
|
||||
* var res = source.concatMap(function (x) { return Rx.Observable.range(0, x); }, function (x, y) { return x + y; });
|
||||
* Or:
|
||||
* Projects each element of the source observable sequence to the other observable sequence and merges the resulting observable sequences into one observable sequence.
|
||||
*
|
||||
* var res = source.concatMap(Rx.Observable.fromArray([1,2,3]));
|
||||
* @param {Function} selector A transform function to apply to each element or an observable sequence to project each element from the
|
||||
* source sequence onto which could be either an observable or Promise.
|
||||
* @param {Function} [resultSelector] A transform function to apply to each element of the intermediate sequence.
|
||||
* @returns {Observable} An observable sequence whose elements are the result of invoking the one-to-many transform function collectionSelector on each element of the input sequence and then mapping each of those sequence elements and their corresponding source element to a result element.
|
||||
*/
|
||||
selectConcat<TResult>(selector: _ValueOrSelector<T, ArrayOrIterable<TResult>>): Observable<TResult>;
|
||||
/**
|
||||
* One of the Following:
|
||||
* Projects each element of an observable sequence to an observable sequence and merges the resulting observable sequences into one observable sequence.
|
||||
*
|
||||
* @example
|
||||
* var res = source.concatMap(function (x) { return Rx.Observable.range(0, x); });
|
||||
* Or:
|
||||
* Projects each element of an observable sequence to an observable sequence, invokes the result selector for the source element and each of the corresponding inner sequence's elements, and merges the results into one observable sequence.
|
||||
*
|
||||
* var res = source.concatMap(function (x) { return Rx.Observable.range(0, x); }, function (x, y) { return x + y; });
|
||||
* Or:
|
||||
* Projects each element of the source observable sequence to the other observable sequence and merges the resulting observable sequences into one observable sequence.
|
||||
*
|
||||
* var res = source.concatMap(Rx.Observable.fromArray([1,2,3]));
|
||||
* @param {Function} selector A transform function to apply to each element or an observable sequence to project each element from the
|
||||
* source sequence onto which could be either an observable or Promise.
|
||||
* @param {Function} [resultSelector] A transform function to apply to each element of the intermediate sequence.
|
||||
* @returns {Observable} An observable sequence whose elements are the result of invoking the one-to-many transform function collectionSelector on each element of the input sequence and then mapping each of those sequence elements and their corresponding source element to a result element.
|
||||
*/
|
||||
selectConcat<TOther, TResult>(selector: _ValueOrSelector<T, ObservableOrPromise<TOther>>, resultSelector: special._FlatMapResultSelector<T, TOther, TResult>, thisArg?: any): Observable<TResult>;
|
||||
/**
|
||||
* One of the Following:
|
||||
* Projects each element of an observable sequence to an observable sequence and merges the resulting observable sequences into one observable sequence.
|
||||
*
|
||||
* @example
|
||||
* var res = source.concatMap(function (x) { return Rx.Observable.range(0, x); });
|
||||
* Or:
|
||||
* Projects each element of an observable sequence to an observable sequence, invokes the result selector for the source element and each of the corresponding inner sequence's elements, and merges the results into one observable sequence.
|
||||
*
|
||||
* var res = source.concatMap(function (x) { return Rx.Observable.range(0, x); }, function (x, y) { return x + y; });
|
||||
* Or:
|
||||
* Projects each element of the source observable sequence to the other observable sequence and merges the resulting observable sequences into one observable sequence.
|
||||
*
|
||||
* var res = source.concatMap(Rx.Observable.fromArray([1,2,3]));
|
||||
* @param {Function} selector A transform function to apply to each element or an observable sequence to project each element from the
|
||||
* source sequence onto which could be either an observable or Promise.
|
||||
* @param {Function} [resultSelector] A transform function to apply to each element of the intermediate sequence.
|
||||
* @returns {Observable} An observable sequence whose elements are the result of invoking the one-to-many transform function collectionSelector on each element of the input sequence and then mapping each of those sequence elements and their corresponding source element to a result element.
|
||||
*/
|
||||
selectConcat<TOther, TResult>(selector: _ValueOrSelector<T, ArrayOrIterable<TOther>>, resultSelector: special._FlatMapResultSelector<T, TOther, TResult>, thisArg?: any): Observable<TResult>;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
(function() {
|
||||
var os: Rx.Observable<string>;
|
||||
var on: Rx.Observable<number>;
|
||||
|
||||
on = os.concatMap((v, i) => Rx.Observable.range(0, i));
|
||||
os = os.concatMap(z => Rx.Observable.just('abc').toPromise());
|
||||
on = os.concatMap(z => [1, 2, 3]);
|
||||
|
||||
os = os.concatMap((v, i) => Rx.Observable.range(0, i), (v1, v2, i) => v2.toString());
|
||||
on = os.concatMap(z => Rx.Observable.just('abc').toPromise(), (v1, v2, i) => i);
|
||||
on = os.concatMap(z => [1, 2, 3], (v1, v2, i) => i);
|
||||
|
||||
os.concatMap(on);
|
||||
os = os.concatMap(Rx.Observable.range(0, 5), (v1, v2, i) => v2.toString());
|
||||
on = os.concatMap(Rx.Observable.just('abc').toPromise(), (v1, v2, i) => i);
|
||||
on = os.concatMap([1, 2, 3], (v1, v2, i) => i);
|
||||
|
||||
on = os.selectConcat((v, i) => Rx.Observable.range(0, i));
|
||||
|
||||
on = os.selectConcat((v, i) => Rx.Observable.range(0, i));
|
||||
os = os.selectConcat(z => Rx.Observable.just('abc').toPromise());
|
||||
on = os.selectConcat(z => [1, 2, 3]);
|
||||
|
||||
os = os.selectConcat((v, i) => Rx.Observable.range(0, i), (v1, v2, i) => v2.toString());
|
||||
on = os.selectConcat(z => Rx.Observable.just('abc').toPromise(), (v1, v2, i) => i);
|
||||
on = os.selectConcat(z => [1, 2, 3], (v1, v2, i) => i);
|
||||
|
||||
os.selectConcat(on);
|
||||
os = os.selectConcat(Rx.Observable.range(0, 5), (v1, v2, i) => v2.toString());
|
||||
on = os.selectConcat(Rx.Observable.just('abc').toPromise(), (v1, v2, i) => i);
|
||||
on = os.selectConcat([1, 2, 3], (v1, v2, i) => i);
|
||||
});
|
35
node_modules/rx/ts/core/linq/observable/concatmapobserver.ts
generated
vendored
Normal file
35
node_modules/rx/ts/core/linq/observable/concatmapobserver.ts
generated
vendored
Normal file
@ -0,0 +1,35 @@
|
||||
/// <reference path="../../observable.ts" />
|
||||
module Rx {
|
||||
export interface Observable<T> {
|
||||
/**
|
||||
* Projects each notification of an observable sequence to an observable sequence and concats the resulting observable sequences into one observable sequence.
|
||||
* @param {Function} onNext A transform function to apply to each element; the second parameter of the function represents the index of the source element.
|
||||
* @param {Function} onError A transform function to apply when an error occurs in the source sequence.
|
||||
* @param {Function} onCompleted A transform function to apply when the end of the source sequence is reached.
|
||||
* @param {Any} [thisArg] An optional "this" to use to invoke each transform.
|
||||
* @returns {Observable} An observable sequence whose elements are the result of invoking the one-to-many transform function corresponding to each notification in the input sequence.
|
||||
*/
|
||||
concatMapObserver<T, TResult>(onNext: (value: T, i: number) => ObservableOrPromise<TResult>, onError: (error: any) => ObservableOrPromise<any>, onCompleted: () => ObservableOrPromise<any>, thisArg?: any): Observable<TResult>;
|
||||
/**
|
||||
* Projects each notification of an observable sequence to an observable sequence and concats the resulting observable sequences into one observable sequence.
|
||||
* @param {Function} onNext A transform function to apply to each element; the second parameter of the function represents the index of the source element.
|
||||
* @param {Function} onError A transform function to apply when an error occurs in the source sequence.
|
||||
* @param {Function} onCompleted A transform function to apply when the end of the source sequence is reached.
|
||||
* @param {Any} [thisArg] An optional "this" to use to invoke each transform.
|
||||
* @returns {Observable} An observable sequence whose elements are the result of invoking the one-to-many transform function corresponding to each notification in the input sequence.
|
||||
*/
|
||||
selectConcatObserver<T, TResult>(onNext: (value: T, i: number) => ObservableOrPromise<TResult>, onError: (error: any) => ObservableOrPromise<any>, onCompleted: () => ObservableOrPromise<any>, thisArg?: any): Observable<TResult>;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
(function() {
|
||||
var os: Rx.Observable<string>;
|
||||
var on: Rx.Observable<number>;
|
||||
|
||||
os.concatMapObserver((v, i) => Rx.Observable.just(i), (e) => Rx.Observable.just(e), () => Rx.Observable.empty());
|
||||
os.selectConcatObserver((v, i) => Rx.Observable.just(i), (e) => Rx.Observable.just(e), () => Rx.Observable.empty());
|
||||
|
||||
os.concatMapObserver((v, i) => Rx.Observable.just(i), (e) => Rx.Observable.just(e), () => Rx.Observable.empty(), {});
|
||||
os.selectConcatObserver((v, i) => Rx.Observable.just(i), (e) => Rx.Observable.just(e), () => Rx.Observable.empty(), {});
|
||||
});
|
19
node_modules/rx/ts/core/linq/observable/concatproto.ts
generated
vendored
Normal file
19
node_modules/rx/ts/core/linq/observable/concatproto.ts
generated
vendored
Normal file
@ -0,0 +1,19 @@
|
||||
/// <reference path="../../observable.ts" />
|
||||
module Rx {
|
||||
export interface Observable<T> {
|
||||
/**
|
||||
* Concatenates all the observable sequences. This takes in either an array or variable arguments to concatenate.
|
||||
* @returns {Observable} An observable sequence that contains the elements of each given sequence, in sequential order.
|
||||
*/
|
||||
concat(...sources: ObservableOrPromise<T>[]): Observable<T>;
|
||||
}
|
||||
}
|
||||
|
||||
(function() {
|
||||
var o: Rx.Observable<string>;
|
||||
var io: Rx.IObservable<string>;
|
||||
var so: Rx.Subject<string>;
|
||||
var p: Rx.Promise<string>;
|
||||
|
||||
var o: Rx.Observable<string> = o.concat(o, io, so, p);
|
||||
});
|
25
node_modules/rx/ts/core/linq/observable/count.ts
generated
vendored
Normal file
25
node_modules/rx/ts/core/linq/observable/count.ts
generated
vendored
Normal file
@ -0,0 +1,25 @@
|
||||
/// <reference path="../../observable.ts" />
|
||||
module Rx {
|
||||
export interface Observable<T> {
|
||||
/**
|
||||
* Returns an observable sequence containing a value that represents how many elements in the specified observable sequence satisfy a condition if provided, else the count of items.
|
||||
* @example
|
||||
* res = source.count();
|
||||
* res = source.count(function (x) { return x > 3; });
|
||||
* @param {Function} [predicate]A function to test each element for a condition.
|
||||
* @param {Any} [thisArg] Object to use as this when executing callback.
|
||||
* @returns {Observable} An observable sequence containing a single element with a number that represents how many elements in the input sequence satisfy the condition in the predicate function if provided, else the count of items in the sequence.
|
||||
*/
|
||||
count(predicate?: _Predicate<T>, thisArg?: any): Observable<number>;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
(function () {
|
||||
var os : Rx.Observable<string>;
|
||||
var on : Rx.Observable<number>;
|
||||
|
||||
on.count();
|
||||
os.count((v, i, s) => false);
|
||||
os.count((v, i, s) => true, {});
|
||||
});
|
23
node_modules/rx/ts/core/linq/observable/create.ts
generated
vendored
Normal file
23
node_modules/rx/ts/core/linq/observable/create.ts
generated
vendored
Normal file
@ -0,0 +1,23 @@
|
||||
/// <reference path="../../observable.ts" />
|
||||
/// <reference path="../../observer-lite.ts" />
|
||||
module Rx {
|
||||
export interface ObservableStatic {
|
||||
/**
|
||||
* Creates an observable sequence from a specified subscribe method implementation.
|
||||
* @example
|
||||
* var res = Rx.Observable.create(function (observer) { return function () { } );
|
||||
* var res = Rx.Observable.create(function (observer) { return Rx.Disposable.empty; } );
|
||||
* var res = Rx.Observable.create(function (observer) { } );
|
||||
* @param {Function} subscribe Implementation of the resulting observable sequence's subscribe method, returning a function that will be wrapped in a Disposable.
|
||||
* @returns {Observable} The observable sequence with the specified implementation for the Subscribe method.
|
||||
*/
|
||||
create<T>(subscribe: (observer: Observer<T>) => IDisposable | Function | void): Observable<T>;
|
||||
}
|
||||
}
|
||||
|
||||
(function () {
|
||||
var o : Rx.Observable<string>;
|
||||
o = Rx.Observable.create<string>(o => {});
|
||||
o = Rx.Observable.create<string>(o => Rx.Disposable.empty);
|
||||
o = Rx.Observable.create<string>(o => () => {});
|
||||
});
|
27
node_modules/rx/ts/core/linq/observable/debounce.ts
generated
vendored
Normal file
27
node_modules/rx/ts/core/linq/observable/debounce.ts
generated
vendored
Normal file
@ -0,0 +1,27 @@
|
||||
/// <reference path="../../observable.ts" />
|
||||
/// <reference path="../../concurrency/scheduler.ts" />
|
||||
module Rx {
|
||||
export interface Observable<T> {
|
||||
/**
|
||||
* Ignores values from an observable sequence which are followed by another value before dueTime.
|
||||
* @param {Number} dueTime Duration of the debounce period for each value (specified as an integer denoting milliseconds).
|
||||
* @param {Scheduler} [scheduler] Scheduler to run the debounce timers on. If not specified, the timeout scheduler is used.
|
||||
* @returns {Observable} The debounced sequence.
|
||||
*/
|
||||
debounce(dueTime: number, scheduler?: IScheduler): Observable<T>;
|
||||
|
||||
/**
|
||||
* Ignores values from an observable sequence which are followed by another value within a computed throttle duration.
|
||||
* @param {Function} durationSelector Selector function to retrieve a sequence indicating the throttle duration for each given element.
|
||||
* @returns {Observable} The debounced sequence.
|
||||
*/
|
||||
debounce(debounceDurationSelector: (item: T) => ObservableOrPromise<any>): Observable<T>;
|
||||
}
|
||||
}
|
||||
|
||||
(function () {
|
||||
var o: Rx.Observable<string>;
|
||||
o.debounce(100);
|
||||
o.debounce(100, Rx.Scheduler.async);
|
||||
o.debounce(x => Rx.Observable.just(x.length));
|
||||
});
|
23
node_modules/rx/ts/core/linq/observable/defaultifempty.ts
generated
vendored
Normal file
23
node_modules/rx/ts/core/linq/observable/defaultifempty.ts
generated
vendored
Normal file
@ -0,0 +1,23 @@
|
||||
/// <reference path="../../observable.ts" />
|
||||
module Rx {
|
||||
export interface Observable<T> {
|
||||
/**
|
||||
* Returns the elements of the specified sequence or the specified value in a singleton sequence if the sequence is empty.
|
||||
*
|
||||
* var res = obs = xs.defaultIfEmpty();
|
||||
* 2 - obs = xs.defaultIfEmpty(false);
|
||||
*
|
||||
* @memberOf Observable#
|
||||
* @param defaultValue The value to return if the sequence is empty. If not provided, this defaults to null.
|
||||
* @returns {Observable} An observable sequence that contains the specified default value if the source is empty; otherwise, the elements of the source itself.
|
||||
*/
|
||||
defaultIfEmpty(defaultValue?: T): Observable<T>;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
(function () {
|
||||
var o: Rx.Observable<string>;
|
||||
o.defaultIfEmpty();
|
||||
o.defaultIfEmpty('default');
|
||||
});
|
20
node_modules/rx/ts/core/linq/observable/defer.ts
generated
vendored
Normal file
20
node_modules/rx/ts/core/linq/observable/defer.ts
generated
vendored
Normal file
@ -0,0 +1,20 @@
|
||||
/// <reference path="../../observable.ts" />
|
||||
module Rx {
|
||||
export interface ObservableStatic {
|
||||
/**
|
||||
* Returns an observable sequence that invokes the specified factory function whenever a new observer subscribes.
|
||||
*
|
||||
* @example
|
||||
* var res = Rx.Observable.defer(function () { return Rx.Observable.fromArray([1,2,3]); });
|
||||
* @param {Function} observableFactory Observable factory function to invoke for each observer that subscribes to the resulting sequence or Promise.
|
||||
* @returns {Observable} An observable sequence whose observers trigger an invocation of the given observable factory function.
|
||||
*/
|
||||
defer<T>(observableFactory: () => ObservableOrPromise<T>): Observable<T>;
|
||||
}
|
||||
}
|
||||
|
||||
(function () {
|
||||
var o: Rx.Observable<string>;
|
||||
Rx.Observable.defer(() => o);
|
||||
Rx.Observable.defer(() => o.toPromise());
|
||||
});
|
74
node_modules/rx/ts/core/linq/observable/delay.ts
generated
vendored
Normal file
74
node_modules/rx/ts/core/linq/observable/delay.ts
generated
vendored
Normal file
@ -0,0 +1,74 @@
|
||||
/// <reference path="../../observable.ts" />
|
||||
/// <reference path="../../concurrency/scheduler.ts" />
|
||||
module Rx {
|
||||
export interface Observable<T> {
|
||||
/**
|
||||
* Time shifts the observable sequence by dueTime. The relative time intervals between the values are preserved.
|
||||
*
|
||||
* @example
|
||||
* 1 - res = Rx.Observable.delay(new Date());
|
||||
* 2 - res = Rx.Observable.delay(new Date(), Rx.Scheduler.timeout);
|
||||
*
|
||||
* 3 - res = Rx.Observable.delay(5000);
|
||||
* 4 - res = Rx.Observable.delay(5000, 1000, Rx.Scheduler.timeout);
|
||||
* @memberOf Observable#
|
||||
* @param {Number} dueTime Absolute (specified as a Date object) or relative time (specified as an integer denoting milliseconds) by which to shift the observable sequence.
|
||||
* @param {Scheduler} [scheduler] Scheduler to run the delay timers on. If not specified, the timeout scheduler is used.
|
||||
* @returns {Observable} Time-shifted sequence.
|
||||
*/
|
||||
delay(dueTime: Date, scheduler?: IScheduler): Observable<T>;
|
||||
/**
|
||||
* Time shifts the observable sequence by dueTime. The relative time intervals between the values are preserved.
|
||||
*
|
||||
* @example
|
||||
* 1 - res = Rx.Observable.delay(new Date());
|
||||
* 2 - res = Rx.Observable.delay(new Date(), Rx.Scheduler.timeout);
|
||||
*
|
||||
* 3 - res = Rx.Observable.delay(5000);
|
||||
* 4 - res = Rx.Observable.delay(5000, 1000, Rx.Scheduler.timeout);
|
||||
* @memberOf Observable#
|
||||
* @param {Number} dueTime Absolute (specified as a Date object) or relative time (specified as an integer denoting milliseconds) by which to shift the observable sequence.
|
||||
* @param {Scheduler} [scheduler] Scheduler to run the delay timers on. If not specified, the timeout scheduler is used.
|
||||
* @returns {Observable} Time-shifted sequence.
|
||||
*/
|
||||
delay(dueTime: number, scheduler?: IScheduler): Observable<T>;
|
||||
|
||||
/**
|
||||
* Time shifts the observable sequence based on a subscription delay and a delay selector function for each element.
|
||||
*
|
||||
* @example
|
||||
* 1 - res = source.delayWithSelector(function (x) { return Rx.Scheduler.timer(5000); }); // with selector only
|
||||
* 1 - res = source.delayWithSelector(Rx.Observable.timer(2000), function (x) { return Rx.Observable.timer(x); }); // with delay and selector
|
||||
*
|
||||
* @param {Observable} [subscriptionDelay] Sequence indicating the delay for the subscription to the source.
|
||||
* @param {Function} delayDurationSelector Selector function to retrieve a sequence indicating the delay for each given element.
|
||||
* @returns {Observable} Time-shifted sequence.
|
||||
*/
|
||||
delay(delayDurationSelector: (item: T) => ObservableOrPromise<number>): Observable<T>;
|
||||
|
||||
/**
|
||||
* Time shifts the observable sequence based on a subscription delay and a delay selector function for each element.
|
||||
*
|
||||
* @example
|
||||
* 1 - res = source.delayWithSelector(function (x) { return Rx.Scheduler.timer(5000); }); // with selector only
|
||||
* 1 - res = source.delayWithSelector(Rx.Observable.timer(2000), function (x) { return Rx.Observable.timer(x); }); // with delay and selector
|
||||
*
|
||||
* @param {Observable} [subscriptionDelay] Sequence indicating the delay for the subscription to the source.
|
||||
* @param {Function} delayDurationSelector Selector function to retrieve a sequence indicating the delay for each given element.
|
||||
* @returns {Observable} Time-shifted sequence.
|
||||
*/
|
||||
delay(subscriptionDelay: Observable<number>, delayDurationSelector: (item: T) => ObservableOrPromise<number>): Observable<T>;
|
||||
}
|
||||
}
|
||||
|
||||
(function () {
|
||||
var o: Rx.Observable<string>;
|
||||
o.delay(1000);
|
||||
o.delay(new Date());
|
||||
o.delay(1000, Rx.Scheduler.async);
|
||||
o.delay(new Date(), Rx.Scheduler.async);
|
||||
|
||||
o.delay(x => Rx.Observable.timer(x.length));
|
||||
o.delay(Rx.Observable.timer(1000), x => Rx.Observable.timer(x.length));
|
||||
o.delay(x => Rx.Observable.timer(x.length).toPromise());
|
||||
});
|
24
node_modules/rx/ts/core/linq/observable/delaysubscription.ts
generated
vendored
Normal file
24
node_modules/rx/ts/core/linq/observable/delaysubscription.ts
generated
vendored
Normal file
@ -0,0 +1,24 @@
|
||||
/// <reference path="../../observable.ts" />
|
||||
/// <reference path="../../concurrency/scheduler.ts" />
|
||||
module Rx {
|
||||
export interface Observable<T> {
|
||||
/**
|
||||
* Time shifts the observable sequence by delaying the subscription with the specified relative time duration, using the specified scheduler to run timers.
|
||||
*
|
||||
* @example
|
||||
* 1 - res = source.delaySubscription(5000); // 5s
|
||||
* 2 - res = source.delaySubscription(5000, Rx.Scheduler.default); // 5 seconds
|
||||
*
|
||||
* @param {Number} dueTime Relative or absolute time shift of the subscription.
|
||||
* @param {Scheduler} [scheduler] Scheduler to run the subscription delay timer on. If not specified, the timeout scheduler is used.
|
||||
* @returns {Observable} Time-shifted sequence.
|
||||
*/
|
||||
delaySubscription(dueTime: number, scheduler?: IScheduler): Observable<T>;
|
||||
}
|
||||
}
|
||||
|
||||
(function () {
|
||||
var o: Rx.Observable<string>;
|
||||
o.delaySubscription(1000);
|
||||
o.delaySubscription(1000, Rx.Scheduler.async);
|
||||
});
|
15
node_modules/rx/ts/core/linq/observable/dematerialize.ts
generated
vendored
Normal file
15
node_modules/rx/ts/core/linq/observable/dematerialize.ts
generated
vendored
Normal file
@ -0,0 +1,15 @@
|
||||
/// <reference path="../../observable.ts" />
|
||||
module Rx {
|
||||
export interface Observable<T> {
|
||||
/**
|
||||
* Dematerializes the explicit notification values of an observable sequence as implicit notifications.
|
||||
* @returns {Observable} An observable sequence exhibiting the behavior corresponding to the source sequence's notification values.
|
||||
*/
|
||||
dematerialize<TOrigin>(): Observable<TOrigin>;
|
||||
}
|
||||
}
|
||||
|
||||
(function () {
|
||||
var o : Rx.Observable<any>;
|
||||
o.dematerialize();
|
||||
});
|
25
node_modules/rx/ts/core/linq/observable/distinct.ts
generated
vendored
Normal file
25
node_modules/rx/ts/core/linq/observable/distinct.ts
generated
vendored
Normal file
@ -0,0 +1,25 @@
|
||||
/// <reference path="../../observable.ts" />
|
||||
module Rx {
|
||||
export interface Observable<T> {
|
||||
/**
|
||||
* Returns an observable sequence that contains only distinct elements according to the keySelector and the comparer.
|
||||
* Usage of this operator should be considered carefully due to the maintenance of an internal lookup structure which can grow large.
|
||||
*
|
||||
* @example
|
||||
* var res = obs = xs.distinct();
|
||||
* 2 - obs = xs.distinct(function (x) { return x.id; });
|
||||
* 2 - obs = xs.distinct(function (x) { return x.id; }, function (a,b) { return a === b; });
|
||||
* @param {Function} [keySelector] A function to compute the comparison key for each element.
|
||||
* @param {Function} [comparer] Used to compare items in the collection.
|
||||
* @returns {Observable} An observable sequence only containing the distinct elements, based on a computed key value, from the source sequence.
|
||||
*/
|
||||
distinct<TKey>(keySelector?: (value: T) => TKey, keySerializer?: (key: TKey) => string): Observable<T>;
|
||||
}
|
||||
}
|
||||
|
||||
(function () {
|
||||
var o : Rx.Observable<string>;
|
||||
o = o.distinct();
|
||||
o = o.distinct(x => x.length);
|
||||
o = o.distinct(x => x.length, x => x.toString() + '' + x);
|
||||
});
|
24
node_modules/rx/ts/core/linq/observable/distinctuntilchanged.ts
generated
vendored
Normal file
24
node_modules/rx/ts/core/linq/observable/distinctuntilchanged.ts
generated
vendored
Normal file
@ -0,0 +1,24 @@
|
||||
/// <reference path="../../observable.ts" />
|
||||
module Rx {
|
||||
export interface Observable<T> {
|
||||
/**
|
||||
* Returns an observable sequence that contains only distinct contiguous elements according to the keySelector and the comparer.
|
||||
*
|
||||
* var obs = observable.distinctUntilChanged();
|
||||
* var obs = observable.distinctUntilChanged(function (x) { return x.id; });
|
||||
* var obs = observable.distinctUntilChanged(function (x) { return x.id; }, function (x, y) { return x === y; });
|
||||
*
|
||||
* @param {Function} [keySelector] A function to compute the comparison key for each element. If not provided, it projects the value.
|
||||
* @param {Function} [comparer] Equality comparer for computed key values. If not provided, defaults to an equality comparer function.
|
||||
* @returns {Observable} An observable sequence only containing the distinct contiguous elements, based on a computed key value, from the source sequence.
|
||||
*/
|
||||
distinctUntilChanged<TValue>(keySelector?: (value: T) => TValue, comparer?: _Comparer<TValue, boolean>): Observable<T>;
|
||||
}
|
||||
}
|
||||
|
||||
(function () {
|
||||
var o : Rx.Observable<string>;
|
||||
o = o.distinctUntilChanged();
|
||||
o = o.distinctUntilChanged(x => x.length);
|
||||
o = o.distinctUntilChanged(x => x.length, (x, y) => true);
|
||||
});
|
18
node_modules/rx/ts/core/linq/observable/dowhile.ts
generated
vendored
Normal file
18
node_modules/rx/ts/core/linq/observable/dowhile.ts
generated
vendored
Normal file
@ -0,0 +1,18 @@
|
||||
/// <reference path="../../observable.ts" />
|
||||
module Rx {
|
||||
export interface Observable<T> {
|
||||
/**
|
||||
* Repeats source as long as condition holds emulating a do while loop.
|
||||
*
|
||||
* @param {Function} condition The condition which determines if the source will be repeated.
|
||||
* @param {Observable} source The observable sequence that will be run if the condition function returns true.
|
||||
* @returns {Observable} An observable sequence which is repeated as long as the condition holds.
|
||||
*/
|
||||
doWhile(condition: () => boolean): Observable<T>;
|
||||
}
|
||||
}
|
||||
|
||||
(function () {
|
||||
var o : Rx.Observable<string>;
|
||||
o = o.doWhile(() => false);
|
||||
});
|
17
node_modules/rx/ts/core/linq/observable/elementat.ts
generated
vendored
Normal file
17
node_modules/rx/ts/core/linq/observable/elementat.ts
generated
vendored
Normal file
@ -0,0 +1,17 @@
|
||||
/// <reference path="../../observable.ts" />
|
||||
module Rx {
|
||||
export interface Observable<T> {
|
||||
/**
|
||||
* Returns the element at a specified index in a sequence or default value if not found.
|
||||
* @param {Number} index The zero-based index of the element to retrieve.
|
||||
* @param {Any} [defaultValue] The default value to use if elementAt does not find a value.
|
||||
* @returns {Observable} An observable sequence that produces the element at the specified position in the source sequence.
|
||||
*/
|
||||
elementAt(index: number): Observable<T>;
|
||||
}
|
||||
}
|
||||
|
||||
(function () {
|
||||
var o : Rx.Observable<string>;
|
||||
o = o.elementAt(5);
|
||||
});
|
22
node_modules/rx/ts/core/linq/observable/empty.ts
generated
vendored
Normal file
22
node_modules/rx/ts/core/linq/observable/empty.ts
generated
vendored
Normal file
@ -0,0 +1,22 @@
|
||||
/// <reference path="../../observable.ts" />
|
||||
/// <reference path="../../concurrency/scheduler.ts" />
|
||||
module Rx {
|
||||
export interface ObservableStatic {
|
||||
/**
|
||||
* Returns an empty observable sequence, using the specified scheduler to send out the single OnCompleted message.
|
||||
*
|
||||
* @example
|
||||
* var res = Rx.Observable.empty();
|
||||
* var res = Rx.Observable.empty(Rx.Scheduler.timeout);
|
||||
* @param {Scheduler} [scheduler] Scheduler to send the termination call on.
|
||||
* @returns {Observable} An observable sequence with no elements.
|
||||
*/
|
||||
empty<T>(scheduler?: IScheduler): Observable<T>;
|
||||
}
|
||||
}
|
||||
|
||||
(function () {
|
||||
var o : Rx.Observable<string>;
|
||||
o = Rx.Observable.empty<string>();
|
||||
o = Rx.Observable.empty<string>(Rx.Scheduler.async);
|
||||
});
|
20
node_modules/rx/ts/core/linq/observable/every.ts
generated
vendored
Normal file
20
node_modules/rx/ts/core/linq/observable/every.ts
generated
vendored
Normal file
@ -0,0 +1,20 @@
|
||||
/// <reference path="../../observable.ts" />
|
||||
module Rx {
|
||||
export interface Observable<T> {
|
||||
/**
|
||||
* Determines whether all elements of an observable sequence satisfy a condition.
|
||||
* @param {Function} [predicate] A function to test each element for a condition.
|
||||
* @param {Any} [thisArg] Object to use as this when executing callback.
|
||||
* @returns {Observable} An observable sequence containing a single element determining whether all elements in the source sequence pass the test in the specified predicate.
|
||||
*/
|
||||
every(predicate?: _Predicate<T>, thisArg?: any): Observable<boolean>; // alias for all
|
||||
}
|
||||
}
|
||||
|
||||
(function () {
|
||||
var o : Rx.Observable<string>;
|
||||
var b : Rx.Observable<boolean>;
|
||||
b = o.every();
|
||||
b = o.every(() => true);
|
||||
b = o.every(() => true, {});
|
||||
});
|
20
node_modules/rx/ts/core/linq/observable/expand.ts
generated
vendored
Normal file
20
node_modules/rx/ts/core/linq/observable/expand.ts
generated
vendored
Normal file
@ -0,0 +1,20 @@
|
||||
/// <reference path="../../observable.ts" />
|
||||
/// <reference path="../../concurrency/scheduler.ts" />
|
||||
module Rx {
|
||||
export interface Observable<T> {
|
||||
/**
|
||||
* Expands an observable sequence by recursively invoking selector.
|
||||
*
|
||||
* @param {Function} selector Selector function to invoke for each produced element, resulting in another sequence to which the selector will be invoked recursively again.
|
||||
* @param {Scheduler} [scheduler] Scheduler on which to perform the expansion. If not provided, this defaults to the current thread scheduler.
|
||||
* @returns {Observable} An observable sequence containing all the elements produced by the recursive expansion.
|
||||
*/
|
||||
expand(selector: (item: T) => Observable<T>, scheduler?: IScheduler): Observable<T>;
|
||||
}
|
||||
}
|
||||
|
||||
(function () {
|
||||
var o : Rx.Observable<number>;
|
||||
o = o.expand(i => Rx.Observable.return(i + 1));
|
||||
o = o.expand(i => Rx.Observable.return(i + 1), Rx.Scheduler.async);
|
||||
});
|
36
node_modules/rx/ts/core/linq/observable/filter.ts
generated
vendored
Normal file
36
node_modules/rx/ts/core/linq/observable/filter.ts
generated
vendored
Normal file
@ -0,0 +1,36 @@
|
||||
/// <reference path="../../concurrency/scheduler.ts" />
|
||||
module Rx {
|
||||
export interface Observable<T> {
|
||||
/**
|
||||
* Filters the elements of an observable sequence based on a predicate by incorporating the element's index.
|
||||
*
|
||||
* @example
|
||||
* var res = source.where(function (value) { return value < 10; });
|
||||
* var res = source.where(function (value, index) { return value < 10 || index < 10; });
|
||||
* @param {Function} predicate A function to test each source element for a condition; the second parameter of the function represents the index of the source element.
|
||||
* @param {Any} [thisArg] Object to use as this when executing callback.
|
||||
* @returns {Observable} An observable sequence that contains elements from the input sequence that satisfy the condition.
|
||||
*/
|
||||
where(predicate: _Predicate<T>, thisArg?: any): Observable<T>;
|
||||
/**
|
||||
* Filters the elements of an observable sequence based on a predicate by incorporating the element's index.
|
||||
*
|
||||
* @example
|
||||
* var res = source.where(function (value) { return value < 10; });
|
||||
* var res = source.where(function (value, index) { return value < 10 || index < 10; });
|
||||
* @param {Function} predicate A function to test each source element for a condition; the second parameter of the function represents the index of the source element.
|
||||
* @param {Any} [thisArg] Object to use as this when executing callback.
|
||||
* @returns {Observable} An observable sequence that contains elements from the input sequence that satisfy the condition.
|
||||
*/
|
||||
filter(predicate: _Predicate<T>, thisArg?: any): Observable<T>;
|
||||
}
|
||||
}
|
||||
|
||||
(function () {
|
||||
var o : Rx.Observable<number>;
|
||||
o = o.where(i => true);
|
||||
o = o.where(i => true, {});
|
||||
o = o.filter(i => true);
|
||||
o = o.filter(i => true, {});
|
||||
|
||||
});
|
24
node_modules/rx/ts/core/linq/observable/finally.ts
generated
vendored
Normal file
24
node_modules/rx/ts/core/linq/observable/finally.ts
generated
vendored
Normal file
@ -0,0 +1,24 @@
|
||||
/// <reference path="../../observable.ts" />
|
||||
module Rx {
|
||||
export interface Observable<T> {
|
||||
/**
|
||||
* Invokes a specified action after the source observable sequence terminates gracefully or exceptionally.
|
||||
* @param {Function} finallyAction Action to invoke after the source observable sequence terminates.
|
||||
* @returns {Observable} Source sequence with the action-invoking termination behavior applied.
|
||||
*/
|
||||
finally(action: () => void): Observable<T>;
|
||||
|
||||
/**
|
||||
* Invokes a specified action after the source observable sequence terminates gracefully or exceptionally.
|
||||
* @param {Function} finallyAction Action to invoke after the source observable sequence terminates.
|
||||
* @returns {Observable} Source sequence with the action-invoking termination behavior applied.
|
||||
*/
|
||||
ensure(action: () => void): Observable<T>;
|
||||
}
|
||||
}
|
||||
|
||||
(function () {
|
||||
var o : Rx.Observable<number>;
|
||||
o = o.finally(() => {});
|
||||
o = o.ensure(() => {});
|
||||
});
|
18
node_modules/rx/ts/core/linq/observable/find.ts
generated
vendored
Normal file
18
node_modules/rx/ts/core/linq/observable/find.ts
generated
vendored
Normal file
@ -0,0 +1,18 @@
|
||||
/// <reference path="../../observable.ts" />
|
||||
module Rx {
|
||||
export interface Observable<T> {
|
||||
/**
|
||||
* Searches for an element that matches the conditions defined by the specified predicate, and returns the first occurrence within the entire Observable sequence.
|
||||
* @param {Function} predicate The predicate that defines the conditions of the element to search for.
|
||||
* @param {Any} [thisArg] Object to use as `this` when executing the predicate.
|
||||
* @returns {Observable} An Observable sequence with the first element that matches the conditions defined by the specified predicate, if found; otherwise, undefined.
|
||||
*/
|
||||
find(predicate: _Predicate<T>, thisArg?: any): Observable<T>;
|
||||
}
|
||||
}
|
||||
|
||||
(function () {
|
||||
var o : Rx.Observable<number>;
|
||||
o = o.find((x) => true);
|
||||
o = o.find((x) => true, {});
|
||||
});
|
19
node_modules/rx/ts/core/linq/observable/findindex.ts
generated
vendored
Normal file
19
node_modules/rx/ts/core/linq/observable/findindex.ts
generated
vendored
Normal file
@ -0,0 +1,19 @@
|
||||
/// <reference path="../../observable.ts" />
|
||||
module Rx {
|
||||
export interface Observable<T> {
|
||||
/**
|
||||
* Searches for an element that matches the conditions defined by the specified predicate, and returns
|
||||
* an Observable sequence with the zero-based index of the first occurrence within the entire Observable sequence.
|
||||
* @param {Function} predicate The predicate that defines the conditions of the element to search for.
|
||||
* @param {Any} [thisArg] Object to use as `this` when executing the predicate.
|
||||
* @returns {Observable} An Observable sequence with the zero-based index of the first occurrence of an element that matches the conditions defined by match, if found; otherwise, –1.
|
||||
*/
|
||||
findIndex(predicate: _Predicate<T>, thisArg?: any): Observable<number>;
|
||||
}
|
||||
}
|
||||
|
||||
(function () {
|
||||
var o : Rx.Observable<number>;
|
||||
o = o.findIndex((x) => true);
|
||||
o = o.findIndex((x) => true, {});
|
||||
});
|
16
node_modules/rx/ts/core/linq/observable/first.ts
generated
vendored
Normal file
16
node_modules/rx/ts/core/linq/observable/first.ts
generated
vendored
Normal file
@ -0,0 +1,16 @@
|
||||
/// <reference path="../../observable.ts" />
|
||||
module Rx {
|
||||
export interface Observable<T> {
|
||||
/**
|
||||
* Returns the first element of an observable sequence that satisfies the condition in the predicate if present else the first item in the sequence.
|
||||
* @returns {Observable} Sequence containing the first element in the observable sequence that satisfies the condition in the predicate if provided, else the first item in the sequence.
|
||||
*/
|
||||
first(predicate?: _Predicate<T>, thisArg?: any): Observable<T>;
|
||||
}
|
||||
}
|
||||
|
||||
(function () {
|
||||
var o : Rx.Observable<number>;
|
||||
o = o.first((x) => true);
|
||||
o = o.first((x) => true, {});
|
||||
});
|
196
node_modules/rx/ts/core/linq/observable/flatmap.ts
generated
vendored
Normal file
196
node_modules/rx/ts/core/linq/observable/flatmap.ts
generated
vendored
Normal file
@ -0,0 +1,196 @@
|
||||
/// <reference path="../../observable.ts"/>
|
||||
module Rx {
|
||||
|
||||
export interface Observable<T> {
|
||||
/**
|
||||
* One of the Following:
|
||||
* Projects each element of an observable sequence to an observable sequence and merges the resulting observable sequences into one observable sequence.
|
||||
*
|
||||
* @example
|
||||
* var res = source.selectMany(function (x) { return Rx.Observable.range(0, x); });
|
||||
* Or:
|
||||
* Projects each element of an observable sequence to an observable sequence, invokes the result selector for the source element and each of the corresponding inner sequence's elements, and merges the results into one observable sequence.
|
||||
*
|
||||
* var res = source.selectMany(function (x) { return Rx.Observable.range(0, x); }, function (x, y) { return x + y; });
|
||||
* Or:
|
||||
* Projects each element of the source observable sequence to the other observable sequence and merges the resulting observable sequences into one observable sequence.
|
||||
*
|
||||
* var res = source.selectMany(Rx.Observable.fromArray([1,2,3]));
|
||||
* @param {Function} selector A transform function to apply to each element or an observable sequence to project each element from the source sequence onto which could be either an observable or Promise.
|
||||
* @param {Function} [resultSelector] A transform function to apply to each element of the intermediate sequence.
|
||||
* @param {Any} [thisArg] Object to use as this when executing callback.
|
||||
* @returns {Observable} An observable sequence whose elements are the result of invoking the one-to-many transform function collectionSelector on each element of the input sequence and then mapping each of those sequence elements and their corresponding source element to a result element.
|
||||
*/
|
||||
flatMap<TResult>(selector: _ValueOrSelector<T, ObservableOrPromise<TResult>>): Observable<TResult>;
|
||||
/**
|
||||
* One of the Following:
|
||||
* Projects each element of an observable sequence to an observable sequence and merges the resulting observable sequences into one observable sequence.
|
||||
*
|
||||
* @example
|
||||
* var res = source.selectMany(function (x) { return Rx.Observable.range(0, x); });
|
||||
* Or:
|
||||
* Projects each element of an observable sequence to an observable sequence, invokes the result selector for the source element and each of the corresponding inner sequence's elements, and merges the results into one observable sequence.
|
||||
*
|
||||
* var res = source.selectMany(function (x) { return Rx.Observable.range(0, x); }, function (x, y) { return x + y; });
|
||||
* Or:
|
||||
* Projects each element of the source observable sequence to the other observable sequence and merges the resulting observable sequences into one observable sequence.
|
||||
*
|
||||
* var res = source.selectMany(Rx.Observable.fromArray([1,2,3]));
|
||||
* @param {Function} selector A transform function to apply to each element or an observable sequence to project each element from the source sequence onto which could be either an observable or Promise.
|
||||
* @param {Function} [resultSelector] A transform function to apply to each element of the intermediate sequence.
|
||||
* @param {Any} [thisArg] Object to use as this when executing callback.
|
||||
* @returns {Observable} An observable sequence whose elements are the result of invoking the one-to-many transform function collectionSelector on each element of the input sequence and then mapping each of those sequence elements and their corresponding source element to a result element.
|
||||
*/
|
||||
flatMap<TResult>(selector: _ValueOrSelector<T, ArrayOrIterable<TResult>>): Observable<TResult>;
|
||||
/**
|
||||
* One of the Following:
|
||||
* Projects each element of an observable sequence to an observable sequence and merges the resulting observable sequences into one observable sequence.
|
||||
*
|
||||
* @example
|
||||
* var res = source.selectMany(function (x) { return Rx.Observable.range(0, x); });
|
||||
* Or:
|
||||
* Projects each element of an observable sequence to an observable sequence, invokes the result selector for the source element and each of the corresponding inner sequence's elements, and merges the results into one observable sequence.
|
||||
*
|
||||
* var res = source.selectMany(function (x) { return Rx.Observable.range(0, x); }, function (x, y) { return x + y; });
|
||||
* Or:
|
||||
* Projects each element of the source observable sequence to the other observable sequence and merges the resulting observable sequences into one observable sequence.
|
||||
*
|
||||
* var res = source.selectMany(Rx.Observable.fromArray([1,2,3]));
|
||||
* @param {Function} selector A transform function to apply to each element or an observable sequence to project each element from the source sequence onto which could be either an observable or Promise.
|
||||
* @param {Function} [resultSelector] A transform function to apply to each element of the intermediate sequence.
|
||||
* @param {Any} [thisArg] Object to use as this when executing callback.
|
||||
* @returns {Observable} An observable sequence whose elements are the result of invoking the one-to-many transform function collectionSelector on each element of the input sequence and then mapping each of those sequence elements and their corresponding source element to a result element.
|
||||
*/
|
||||
flatMap<TOther, TResult>(selector: _ValueOrSelector<T, ObservableOrPromise<TOther>>, resultSelector: special._FlatMapResultSelector<T, TOther, TResult>, thisArg?: any): Observable<TResult>;
|
||||
/**
|
||||
* One of the Following:
|
||||
* Projects each element of an observable sequence to an observable sequence and merges the resulting observable sequences into one observable sequence.
|
||||
*
|
||||
* @example
|
||||
* var res = source.selectMany(function (x) { return Rx.Observable.range(0, x); });
|
||||
* Or:
|
||||
* Projects each element of an observable sequence to an observable sequence, invokes the result selector for the source element and each of the corresponding inner sequence's elements, and merges the results into one observable sequence.
|
||||
*
|
||||
* var res = source.selectMany(function (x) { return Rx.Observable.range(0, x); }, function (x, y) { return x + y; });
|
||||
* Or:
|
||||
* Projects each element of the source observable sequence to the other observable sequence and merges the resulting observable sequences into one observable sequence.
|
||||
*
|
||||
* var res = source.selectMany(Rx.Observable.fromArray([1,2,3]));
|
||||
* @param {Function} selector A transform function to apply to each element or an observable sequence to project each element from the source sequence onto which could be either an observable or Promise.
|
||||
* @param {Function} [resultSelector] A transform function to apply to each element of the intermediate sequence.
|
||||
* @param {Any} [thisArg] Object to use as this when executing callback.
|
||||
* @returns {Observable} An observable sequence whose elements are the result of invoking the one-to-many transform function collectionSelector on each element of the input sequence and then mapping each of those sequence elements and their corresponding source element to a result element.
|
||||
*/
|
||||
flatMap<TOther, TResult>(selector: _ValueOrSelector<T, ArrayOrIterable<TOther>>, resultSelector: special._FlatMapResultSelector<T, TOther, TResult>, thisArg?: any): Observable<TResult>;
|
||||
/**
|
||||
* One of the Following:
|
||||
* Projects each element of an observable sequence to an observable sequence and merges the resulting observable sequences into one observable sequence.
|
||||
*
|
||||
* @example
|
||||
* var res = source.selectMany(function (x) { return Rx.Observable.range(0, x); });
|
||||
* Or:
|
||||
* Projects each element of an observable sequence to an observable sequence, invokes the result selector for the source element and each of the corresponding inner sequence's elements, and merges the results into one observable sequence.
|
||||
*
|
||||
* var res = source.selectMany(function (x) { return Rx.Observable.range(0, x); }, function (x, y) { return x + y; });
|
||||
* Or:
|
||||
* Projects each element of the source observable sequence to the other observable sequence and merges the resulting observable sequences into one observable sequence.
|
||||
*
|
||||
* var res = source.selectMany(Rx.Observable.fromArray([1,2,3]));
|
||||
* @param {Function} selector A transform function to apply to each element or an observable sequence to project each element from the source sequence onto which could be either an observable or Promise.
|
||||
* @param {Function} [resultSelector] A transform function to apply to each element of the intermediate sequence.
|
||||
* @param {Any} [thisArg] Object to use as this when executing callback.
|
||||
* @returns {Observable} An observable sequence whose elements are the result of invoking the one-to-many transform function collectionSelector on each element of the input sequence and then mapping each of those sequence elements and their corresponding source element to a result element.
|
||||
*/
|
||||
selectMany<TResult>(selector: _ValueOrSelector<T, ObservableOrPromise<TResult>>): Observable<TResult>;
|
||||
/**
|
||||
* One of the Following:
|
||||
* Projects each element of an observable sequence to an observable sequence and merges the resulting observable sequences into one observable sequence.
|
||||
*
|
||||
* @example
|
||||
* var res = source.selectMany(function (x) { return Rx.Observable.range(0, x); });
|
||||
* Or:
|
||||
* Projects each element of an observable sequence to an observable sequence, invokes the result selector for the source element and each of the corresponding inner sequence's elements, and merges the results into one observable sequence.
|
||||
*
|
||||
* var res = source.selectMany(function (x) { return Rx.Observable.range(0, x); }, function (x, y) { return x + y; });
|
||||
* Or:
|
||||
* Projects each element of the source observable sequence to the other observable sequence and merges the resulting observable sequences into one observable sequence.
|
||||
*
|
||||
* var res = source.selectMany(Rx.Observable.fromArray([1,2,3]));
|
||||
* @param {Function} selector A transform function to apply to each element or an observable sequence to project each element from the source sequence onto which could be either an observable or Promise.
|
||||
* @param {Function} [resultSelector] A transform function to apply to each element of the intermediate sequence.
|
||||
* @param {Any} [thisArg] Object to use as this when executing callback.
|
||||
* @returns {Observable} An observable sequence whose elements are the result of invoking the one-to-many transform function collectionSelector on each element of the input sequence and then mapping each of those sequence elements and their corresponding source element to a result element.
|
||||
*/
|
||||
selectMany<TResult>(selector: _ValueOrSelector<T, ArrayOrIterable<TResult>>): Observable<TResult>;
|
||||
/**
|
||||
* One of the Following:
|
||||
* Projects each element of an observable sequence to an observable sequence and merges the resulting observable sequences into one observable sequence.
|
||||
*
|
||||
* @example
|
||||
* var res = source.selectMany(function (x) { return Rx.Observable.range(0, x); });
|
||||
* Or:
|
||||
* Projects each element of an observable sequence to an observable sequence, invokes the result selector for the source element and each of the corresponding inner sequence's elements, and merges the results into one observable sequence.
|
||||
*
|
||||
* var res = source.selectMany(function (x) { return Rx.Observable.range(0, x); }, function (x, y) { return x + y; });
|
||||
* Or:
|
||||
* Projects each element of the source observable sequence to the other observable sequence and merges the resulting observable sequences into one observable sequence.
|
||||
*
|
||||
* var res = source.selectMany(Rx.Observable.fromArray([1,2,3]));
|
||||
* @param {Function} selector A transform function to apply to each element or an observable sequence to project each element from the source sequence onto which could be either an observable or Promise.
|
||||
* @param {Function} [resultSelector] A transform function to apply to each element of the intermediate sequence.
|
||||
* @param {Any} [thisArg] Object to use as this when executing callback.
|
||||
* @returns {Observable} An observable sequence whose elements are the result of invoking the one-to-many transform function collectionSelector on each element of the input sequence and then mapping each of those sequence elements and their corresponding source element to a result element.
|
||||
*/
|
||||
selectMany<TOther, TResult>(selector: _ValueOrSelector<T, ObservableOrPromise<TOther>>, resultSelector: special._FlatMapResultSelector<T, TOther, TResult>, thisArg?: any): Observable<TResult>;
|
||||
/**
|
||||
* One of the Following:
|
||||
* Projects each element of an observable sequence to an observable sequence and merges the resulting observable sequences into one observable sequence.
|
||||
*
|
||||
* @example
|
||||
* var res = source.selectMany(function (x) { return Rx.Observable.range(0, x); });
|
||||
* Or:
|
||||
* Projects each element of an observable sequence to an observable sequence, invokes the result selector for the source element and each of the corresponding inner sequence's elements, and merges the results into one observable sequence.
|
||||
*
|
||||
* var res = source.selectMany(function (x) { return Rx.Observable.range(0, x); }, function (x, y) { return x + y; });
|
||||
* Or:
|
||||
* Projects each element of the source observable sequence to the other observable sequence and merges the resulting observable sequences into one observable sequence.
|
||||
*
|
||||
* var res = source.selectMany(Rx.Observable.fromArray([1,2,3]));
|
||||
* @param {Function} selector A transform function to apply to each element or an observable sequence to project each element from the source sequence onto which could be either an observable or Promise.
|
||||
* @param {Function} [resultSelector] A transform function to apply to each element of the intermediate sequence.
|
||||
* @param {Any} [thisArg] Object to use as this when executing callback.
|
||||
* @returns {Observable} An observable sequence whose elements are the result of invoking the one-to-many transform function collectionSelector on each element of the input sequence and then mapping each of those sequence elements and their corresponding source element to a result element.
|
||||
*/
|
||||
selectMany<TOther, TResult>(selector: _ValueOrSelector<T, ArrayOrIterable<TOther>>, resultSelector: special._FlatMapResultSelector<T, TOther, TResult>, thisArg?: any): Observable<TResult>;
|
||||
}
|
||||
}
|
||||
|
||||
(function() {
|
||||
var o: Rx.Observable<string>;
|
||||
var n: Rx.Observable<number>;
|
||||
n = o.flatMap(x => Rx.Observable.from([1, 2, 3]));
|
||||
n = o.flatMap(x => Rx.Observable.from([1, 2, 3]).toPromise());
|
||||
n = o.flatMap(x => [1, 2, 3]);
|
||||
n = o.flatMap((x, z, b) => Rx.Observable.from([1, 2, 3]), (x, y, a, b) => y);
|
||||
n = o.flatMap(x => Rx.Observable.from([1, 2, 3]).toPromise(), (x, y) => y);
|
||||
n = o.flatMap(x => [1, 2, 3], (x, y) => y);
|
||||
n = o.flatMap(Rx.Observable.from([1, 2, 3]));
|
||||
n = o.flatMap(Rx.Observable.from([1, 2, 3]).toPromise());
|
||||
n = o.flatMap([1, 2, 3]);
|
||||
n = o.flatMap(Rx.Observable.from([1, 2, 3]), (x, y) => y);
|
||||
n = o.flatMap(Rx.Observable.from([1, 2, 3]).toPromise(), (x, y) => y);
|
||||
n = o.flatMap([1, 2, 3], (x, y) => y);
|
||||
|
||||
n = o.selectMany(x => Rx.Observable.from([1, 2, 3]));
|
||||
n = o.selectMany(x => Rx.Observable.from([1, 2, 3]).toPromise());
|
||||
n = o.selectMany(x => [1, 2, 3]);
|
||||
n = o.selectMany(x => Rx.Observable.from([1, 2, 3]), (x, y) => y);
|
||||
n = o.selectMany(x => Rx.Observable.from([1, 2, 3]).toPromise(), (x, y) => y);
|
||||
n = o.selectMany(x => [1, 2, 3], (x, y) => y);
|
||||
n = o.selectMany(Rx.Observable.from([1, 2, 3]));
|
||||
n = o.selectMany(Rx.Observable.from([1, 2, 3]).toPromise());
|
||||
n = o.selectMany([1, 2, 3]);
|
||||
n = o.selectMany(Rx.Observable.from([1, 2, 3]), (x, y) => y);
|
||||
n = o.selectMany(Rx.Observable.from([1, 2, 3]).toPromise(), (x, y) => y);
|
||||
n = o.selectMany([1, 2, 3], (x, y) => y);
|
||||
});
|
109
node_modules/rx/ts/core/linq/observable/flatmapfirst.ts
generated
vendored
Normal file
109
node_modules/rx/ts/core/linq/observable/flatmapfirst.ts
generated
vendored
Normal file
@ -0,0 +1,109 @@
|
||||
/// <reference path="../../observable.ts" />
|
||||
module Rx {
|
||||
export interface Observable<T> {
|
||||
/**
|
||||
* Projects each element of an observable sequence into a new sequence of observable sequences by incorporating the element's index and then
|
||||
* transforms an observable sequence of observable sequences into an observable sequence which performs a exclusive waiting for the first to finish before subscribing to another observable.
|
||||
* @param {Function} selector A transform function to apply to each source element; the second parameter of the function represents the index of the source element.
|
||||
* @param {Any} [thisArg] Object to use as this when executing callback.
|
||||
* @returns {Observable} An observable sequence whose elements are the result of invoking the transform function on each element of source producing an Observable of Observable sequences
|
||||
* and that at any point in time performs a exclusive waiting for the first to finish before subscribing to another observable.
|
||||
*/
|
||||
selectSwitchFirst<TResult>(selector: _ValueOrSelector<T, ObservableOrPromise<TResult>>): Observable<TResult>;
|
||||
/**
|
||||
* Projects each element of an observable sequence into a new sequence of observable sequences by incorporating the element's index and then
|
||||
* transforms an observable sequence of observable sequences into an observable sequence which performs a exclusive waiting for the first to finish before subscribing to another observable.
|
||||
* @param {Function} selector A transform function to apply to each source element; the second parameter of the function represents the index of the source element.
|
||||
* @param {Any} [thisArg] Object to use as this when executing callback.
|
||||
* @returns {Observable} An observable sequence whose elements are the result of invoking the transform function on each element of source producing an Observable of Observable sequences
|
||||
* and that at any point in time performs a exclusive waiting for the first to finish before subscribing to another observable.
|
||||
*/
|
||||
selectSwitchFirst<TResult>(selector: _ValueOrSelector<T, ArrayOrIterable<TResult>>): Observable<TResult>;
|
||||
/**
|
||||
* Projects each element of an observable sequence into a new sequence of observable sequences by incorporating the element's index and then
|
||||
* transforms an observable sequence of observable sequences into an observable sequence which performs a exclusive waiting for the first to finish before subscribing to another observable.
|
||||
* @param {Function} selector A transform function to apply to each source element; the second parameter of the function represents the index of the source element.
|
||||
* @param {Any} [thisArg] Object to use as this when executing callback.
|
||||
* @returns {Observable} An observable sequence whose elements are the result of invoking the transform function on each element of source producing an Observable of Observable sequences
|
||||
* and that at any point in time performs a exclusive waiting for the first to finish before subscribing to another observable.
|
||||
*/
|
||||
selectSwitchFirst<TOther, TResult>(selector: _ValueOrSelector<T, ObservableOrPromise<TOther>>, resultSelector: special._FlatMapResultSelector<T, TOther, TResult>, thisArg?: any): Observable<TResult>;
|
||||
/**
|
||||
* Projects each element of an observable sequence into a new sequence of observable sequences by incorporating the element's index and then
|
||||
* transforms an observable sequence of observable sequences into an observable sequence which performs a exclusive waiting for the first to finish before subscribing to another observable.
|
||||
* @param {Function} selector A transform function to apply to each source element; the second parameter of the function represents the index of the source element.
|
||||
* @param {Any} [thisArg] Object to use as this when executing callback.
|
||||
* @returns {Observable} An observable sequence whose elements are the result of invoking the transform function on each element of source producing an Observable of Observable sequences
|
||||
* and that at any point in time performs a exclusive waiting for the first to finish before subscribing to another observable.
|
||||
*/
|
||||
selectSwitchFirst<TOther, TResult>(selector: _ValueOrSelector<T, ArrayOrIterable<TOther>>, resultSelector: special._FlatMapResultSelector<T, TOther, TResult>, thisArg?: any): Observable<TResult>;
|
||||
|
||||
/**
|
||||
* Projects each element of an observable sequence into a new sequence of observable sequences by incorporating the element's index and then
|
||||
* transforms an observable sequence of observable sequences into an observable sequence which performs a exclusive waiting for the first to finish before subscribing to another observable.
|
||||
* @param {Function} selector A transform function to apply to each source element; the second parameter of the function represents the index of the source element.
|
||||
* @param {Any} [thisArg] Object to use as this when executing callback.
|
||||
* @returns {Observable} An observable sequence whose elements are the result of invoking the transform function on each element of source producing an Observable of Observable sequences
|
||||
* and that at any point in time performs a exclusive waiting for the first to finish before subscribing to another observable.
|
||||
*/
|
||||
flatMapFirst<TResult>(selector: _ValueOrSelector<T, ObservableOrPromise<TResult>>): Observable<TResult>;
|
||||
|
||||
/**
|
||||
* Projects each element of an observable sequence into a new sequence of observable sequences by incorporating the element's index and then
|
||||
* transforms an observable sequence of observable sequences into an observable sequence which performs a exclusive waiting for the first to finish before subscribing to another observable.
|
||||
* @param {Function} selector A transform function to apply to each source element; the second parameter of the function represents the index of the source element.
|
||||
* @param {Any} [thisArg] Object to use as this when executing callback.
|
||||
* @returns {Observable} An observable sequence whose elements are the result of invoking the transform function on each element of source producing an Observable of Observable sequences
|
||||
* and that at any point in time performs a exclusive waiting for the first to finish before subscribing to another observable.
|
||||
*/
|
||||
flatMapFirst<TResult>(selector: _ValueOrSelector<T, ArrayOrIterable<TResult>>): Observable<TResult>;
|
||||
/**
|
||||
* Projects each element of an observable sequence into a new sequence of observable sequences by incorporating the element's index and then
|
||||
* transforms an observable sequence of observable sequences into an observable sequence which performs a exclusive waiting for the first to finish before subscribing to another observable.
|
||||
* @param {Function} selector A transform function to apply to each source element; the second parameter of the function represents the index of the source element.
|
||||
* @param {Any} [thisArg] Object to use as this when executing callback.
|
||||
* @returns {Observable} An observable sequence whose elements are the result of invoking the transform function on each element of source producing an Observable of Observable sequences
|
||||
* and that at any point in time performs a exclusive waiting for the first to finish before subscribing to another observable.
|
||||
*/
|
||||
flatMapFirst<TOther, TResult>(selector: _ValueOrSelector<T, ObservableOrPromise<TOther>>, resultSelector: special._FlatMapResultSelector<T, TOther, TResult>, thisArg?: any): Observable<TResult>;
|
||||
/**
|
||||
* Projects each element of an observable sequence into a new sequence of observable sequences by incorporating the element's index and then
|
||||
* transforms an observable sequence of observable sequences into an observable sequence which performs a exclusive waiting for the first to finish before subscribing to another observable.
|
||||
* @param {Function} selector A transform function to apply to each source element; the second parameter of the function represents the index of the source element.
|
||||
* @param {Any} [thisArg] Object to use as this when executing callback.
|
||||
* @returns {Observable} An observable sequence whose elements are the result of invoking the transform function on each element of source producing an Observable of Observable sequences
|
||||
* and that at any point in time performs a exclusive waiting for the first to finish before subscribing to another observable.
|
||||
*/
|
||||
flatMapFirst<TOther, TResult>(selector: _ValueOrSelector<T, ArrayOrIterable<TOther>>, resultSelector: special._FlatMapResultSelector<T, TOther, TResult>, thisArg?: any): Observable<TResult>;
|
||||
}
|
||||
}
|
||||
|
||||
(function() {
|
||||
var o: Rx.Observable<string>;
|
||||
var n: Rx.Observable<number>;
|
||||
n = o.flatMapFirst(x => Rx.Observable.from([1, 2, 3]));
|
||||
n = o.flatMapFirst(x => Rx.Observable.from([1, 2, 3]).toPromise());
|
||||
n = o.flatMapFirst(x => [1, 2, 3]);
|
||||
n = o.flatMapFirst(x => Rx.Observable.from([1, 2, 3]), (x, y) => y);
|
||||
n = o.flatMapFirst(x => Rx.Observable.from([1, 2, 3]).toPromise(), (x, y) => y);
|
||||
n = o.flatMapFirst(x => [1, 2, 3], (x, y) => y);
|
||||
n = o.flatMapFirst(Rx.Observable.from([1, 2, 3]));
|
||||
n = o.flatMapFirst(Rx.Observable.from([1, 2, 3]).toPromise());
|
||||
n = o.flatMapFirst([1, 2, 3]);
|
||||
n = o.flatMapFirst(Rx.Observable.from([1, 2, 3]), (x, y) => y);
|
||||
n = o.flatMapFirst(Rx.Observable.from([1, 2, 3]).toPromise(), (x, y) => y);
|
||||
n = o.flatMapFirst([1, 2, 3], (x, y) => y);
|
||||
|
||||
n = o.selectSwitchFirst(x => Rx.Observable.from([1, 2, 3]));
|
||||
n = o.selectSwitchFirst(x => Rx.Observable.from([1, 2, 3]).toPromise());
|
||||
n = o.selectSwitchFirst(x => [1, 2, 3]);
|
||||
n = o.selectSwitchFirst(x => Rx.Observable.from([1, 2, 3]), (x, y) => y);
|
||||
n = o.selectSwitchFirst(x => Rx.Observable.from([1, 2, 3]).toPromise(), (x, y) => y);
|
||||
n = o.selectSwitchFirst(x => [1, 2, 3], (x, y) => y);
|
||||
n = o.selectSwitchFirst(Rx.Observable.from([1, 2, 3]));
|
||||
n = o.selectSwitchFirst(Rx.Observable.from([1, 2, 3]).toPromise());
|
||||
n = o.selectSwitchFirst([1, 2, 3]);
|
||||
n = o.selectSwitchFirst(Rx.Observable.from([1, 2, 3]), (x, y) => y);
|
||||
n = o.selectSwitchFirst(Rx.Observable.from([1, 2, 3]).toPromise(), (x, y) => y);
|
||||
n = o.selectSwitchFirst([1, 2, 3], (x, y) => y);
|
||||
});
|
108
node_modules/rx/ts/core/linq/observable/flatmaplatest.ts
generated
vendored
Normal file
108
node_modules/rx/ts/core/linq/observable/flatmaplatest.ts
generated
vendored
Normal file
@ -0,0 +1,108 @@
|
||||
/// <reference path="../../observable.ts" />
|
||||
module Rx {
|
||||
export interface Observable<T> {
|
||||
/**
|
||||
* Projects each element of an observable sequence into a new sequence of observable sequences by incorporating the element's index and then
|
||||
* transforms an observable sequence of observable sequences into an observable sequence producing values only from the most recent observable sequence.
|
||||
* @param {Function} selector A transform function to apply to each source element; the second parameter of the function represents the index of the source element.
|
||||
* @param {Any} [thisArg] Object to use as this when executing callback.
|
||||
* @returns {Observable} An observable sequence whose elements are the result of invoking the transform function on each element of source producing an Observable of Observable sequences
|
||||
* and that at any point in time produces the elements of the most recent inner observable sequence that has been received.
|
||||
*/
|
||||
selectSwitch<TResult>(selector: _ValueOrSelector<T, ObservableOrPromise<TResult>>): Observable<TResult>;
|
||||
/**
|
||||
* Projects each element of an observable sequence into a new sequence of observable sequences by incorporating the element's index and then
|
||||
* transforms an observable sequence of observable sequences into an observable sequence producing values only from the most recent observable sequence.
|
||||
* @param {Function} selector A transform function to apply to each source element; the second parameter of the function represents the index of the source element.
|
||||
* @param {Any} [thisArg] Object to use as this when executing callback.
|
||||
* @returns {Observable} An observable sequence whose elements are the result of invoking the transform function on each element of source producing an Observable of Observable sequences
|
||||
* and that at any point in time produces the elements of the most recent inner observable sequence that has been received.
|
||||
*/
|
||||
selectSwitch<TResult>(selector: _ValueOrSelector<T, ArrayOrIterable<TResult>>): Observable<TResult>;
|
||||
/**
|
||||
* Projects each element of an observable sequence into a new sequence of observable sequences by incorporating the element's index and then
|
||||
* transforms an observable sequence of observable sequences into an observable sequence producing values only from the most recent observable sequence.
|
||||
* @param {Function} selector A transform function to apply to each source element; the second parameter of the function represents the index of the source element.
|
||||
* @param {Any} [thisArg] Object to use as this when executing callback.
|
||||
* @returns {Observable} An observable sequence whose elements are the result of invoking the transform function on each element of source producing an Observable of Observable sequences
|
||||
* and that at any point in time produces the elements of the most recent inner observable sequence that has been received.
|
||||
*/
|
||||
selectSwitch<TOther, TResult>(selector: _ValueOrSelector<T, ObservableOrPromise<TOther>>, resultSelector: special._FlatMapResultSelector<T, TOther, TResult>, thisArg?: any): Observable<TResult>;
|
||||
/**
|
||||
* Projects each element of an observable sequence into a new sequence of observable sequences by incorporating the element's index and then
|
||||
* transforms an observable sequence of observable sequences into an observable sequence producing values only from the most recent observable sequence.
|
||||
* @param {Function} selector A transform function to apply to each source element; the second parameter of the function represents the index of the source element.
|
||||
* @param {Any} [thisArg] Object to use as this when executing callback.
|
||||
* @returns {Observable} An observable sequence whose elements are the result of invoking the transform function on each element of source producing an Observable of Observable sequences
|
||||
* and that at any point in time produces the elements of the most recent inner observable sequence that has been received.
|
||||
*/
|
||||
selectSwitch<TOther, TResult>(selector: _ValueOrSelector<T, ArrayOrIterable<TOther>>, resultSelector: special._FlatMapResultSelector<T, TOther, TResult>, thisArg?: any): Observable<TResult>;
|
||||
/**
|
||||
* Projects each element of an observable sequence into a new sequence of observable sequences by incorporating the element's index and then
|
||||
* transforms an observable sequence of observable sequences into an observable sequence producing values only from the most recent observable sequence.
|
||||
* @param {Function} selector A transform function to apply to each source element; the second parameter of the function represents the index of the source element.
|
||||
* @param {Any} [thisArg] Object to use as this when executing callback.
|
||||
* @returns {Observable} An observable sequence whose elements are the result of invoking the transform function on each element of source producing an Observable of Observable sequences
|
||||
* and that at any point in time produces the elements of the most recent inner observable sequence that has been received.
|
||||
*/
|
||||
flatMapLatest<TResult>(selector: _ValueOrSelector<T, ObservableOrPromise<TResult>>): Observable<TResult>;
|
||||
/**
|
||||
* Projects each element of an observable sequence into a new sequence of observable sequences by incorporating the element's index and then
|
||||
* transforms an observable sequence of observable sequences into an observable sequence producing values only from the most recent observable sequence.
|
||||
* @param {Function} selector A transform function to apply to each source element; the second parameter of the function represents the index of the source element.
|
||||
* @param {Any} [thisArg] Object to use as this when executing callback.
|
||||
* @returns {Observable} An observable sequence whose elements are the result of invoking the transform function on each element of source producing an Observable of Observable sequences
|
||||
* and that at any point in time produces the elements of the most recent inner observable sequence that has been received.
|
||||
*/
|
||||
flatMapLatest<TResult>(selector: _ValueOrSelector<T, ArrayOrIterable<TResult>>): Observable<TResult>;
|
||||
/**
|
||||
* Projects each element of an observable sequence into a new sequence of observable sequences by incorporating the element's index and then
|
||||
* transforms an observable sequence of observable sequences into an observable sequence producing values only from the most recent observable sequence.
|
||||
* @param {Function} selector A transform function to apply to each source element; the second parameter of the function represents the index of the source element.
|
||||
* @param {Any} [thisArg] Object to use as this when executing callback.
|
||||
* @returns {Observable} An observable sequence whose elements are the result of invoking the transform function on each element of source producing an Observable of Observable sequences
|
||||
* and that at any point in time produces the elements of the most recent inner observable sequence that has been received.
|
||||
*/
|
||||
flatMapLatest<TOther, TResult>(selector: _ValueOrSelector<T, ObservableOrPromise<TOther>>, resultSelector: special._FlatMapResultSelector<T, TOther, TResult>, thisArg?: any): Observable<TResult>;
|
||||
/**
|
||||
* Projects each element of an observable sequence into a new sequence of observable sequences by incorporating the element's index and then
|
||||
* transforms an observable sequence of observable sequences into an observable sequence producing values only from the most recent observable sequence.
|
||||
* @param {Function} selector A transform function to apply to each source element; the second parameter of the function represents the index of the source element.
|
||||
* @param {Any} [thisArg] Object to use as this when executing callback.
|
||||
* @returns {Observable} An observable sequence whose elements are the result of invoking the transform function on each element of source producing an Observable of Observable sequences
|
||||
* and that at any point in time produces the elements of the most recent inner observable sequence that has been received.
|
||||
*/
|
||||
flatMapLatest<TOther, TResult>(selector: _ValueOrSelector<T, ArrayOrIterable<TOther>>, resultSelector: special._FlatMapResultSelector<T, TOther, TResult>, thisArg?: any): Observable<TResult>;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
(function() {
|
||||
var o: Rx.Observable<string>;
|
||||
var n: Rx.Observable<number>;
|
||||
n = o.flatMapLatest(x => Rx.Observable.from([1, 2, 3]));
|
||||
n = o.flatMapLatest(x => Rx.Observable.from([1, 2, 3]).toPromise());
|
||||
n = o.flatMapLatest(x => [1, 2, 3]);
|
||||
n = o.flatMapLatest(x => Rx.Observable.from([1, 2, 3]), (x, y) => y);
|
||||
n = o.flatMapLatest(x => Rx.Observable.from([1, 2, 3]).toPromise(), (x, y) => y);
|
||||
n = o.flatMapLatest(x => [1, 2, 3], (x, y) => y);
|
||||
n = o.flatMapLatest(Rx.Observable.from([1, 2, 3]));
|
||||
n = o.flatMapLatest(Rx.Observable.from([1, 2, 3]).toPromise());
|
||||
n = o.flatMapLatest([1, 2, 3]);
|
||||
n = o.flatMapLatest(Rx.Observable.from([1, 2, 3]), (x, y) => y);
|
||||
n = o.flatMapLatest(Rx.Observable.from([1, 2, 3]).toPromise(), (x, y) => y);
|
||||
n = o.flatMapLatest([1, 2, 3], (x, y) => y);
|
||||
|
||||
n = o.selectSwitch(x => Rx.Observable.from([1, 2, 3]));
|
||||
n = o.selectSwitch(x => Rx.Observable.from([1, 2, 3]).toPromise());
|
||||
n = o.selectSwitch(x => [1, 2, 3]);
|
||||
n = o.selectSwitch(x => Rx.Observable.from([1, 2, 3]), (x, y) => y);
|
||||
n = o.selectSwitch(x => Rx.Observable.from([1, 2, 3]).toPromise(), (x, y) => y);
|
||||
n = o.selectSwitch(x => [1, 2, 3], (x, y) => y);
|
||||
n = o.selectSwitch(Rx.Observable.from([1, 2, 3]));
|
||||
n = o.selectSwitch(Rx.Observable.from([1, 2, 3]).toPromise());
|
||||
n = o.selectSwitch([1, 2, 3]);
|
||||
n = o.selectSwitch(Rx.Observable.from([1, 2, 3]), (x, y) => y);
|
||||
n = o.selectSwitch(Rx.Observable.from([1, 2, 3]).toPromise(), (x, y) => y);
|
||||
n = o.selectSwitch([1, 2, 3], (x, y) => y);
|
||||
});
|
205
node_modules/rx/ts/core/linq/observable/flatmapwithmaxconcurrent.ts
generated
vendored
Normal file
205
node_modules/rx/ts/core/linq/observable/flatmapwithmaxconcurrent.ts
generated
vendored
Normal file
@ -0,0 +1,205 @@
|
||||
/// <reference path="../../observable.ts" />
|
||||
module Rx {
|
||||
export interface Observable<T> {
|
||||
/**
|
||||
* One of the Following:
|
||||
* Projects each element of an observable sequence to an observable sequence and merges the resulting observable sequences into one observable sequence.
|
||||
*
|
||||
* @example
|
||||
* var res = source.flatMapWithMaxConcurrent(5, function (x) { return Rx.Observable.range(0, x); });
|
||||
* Or:
|
||||
* Projects each element of an observable sequence to an observable sequence, invokes the result selector for the source element and each of the corresponding inner sequence's elements, and merges the results into one observable sequence.
|
||||
*
|
||||
* var res = source.flatMapWithMaxConcurrent(5, function (x) { return Rx.Observable.range(0, x); }, function (x, y) { return x + y; });
|
||||
* Or:
|
||||
* Projects each element of the source observable sequence to the other observable sequence and merges the resulting observable sequences into one observable sequence.
|
||||
*
|
||||
* var res = source.flatMapWithMaxConcurrent(5, Rx.Observable.fromArray([1,2,3]));
|
||||
* @param selector A transform function to apply to each element or an observable sequence to project each element from the
|
||||
* source sequence onto which could be either an observable or Promise.
|
||||
* @param {Function} [resultSelector] A transform function to apply to each element of the intermediate sequence.
|
||||
* @param {Any} [thisArg] Object to use as this when executing callback.
|
||||
* @returns {Observable} An observable sequence whose elements are the result of invoking the one-to-many transform function collectionSelector on each element of the input sequence and then mapping each of those sequence elements and their corresponding source element to a result element.
|
||||
*/
|
||||
selectManyWithMaxConcurrent<TResult>(maxConcurrent: number, selector: _ValueOrSelector<T, ObservableOrPromise<TResult>>): Observable<TResult>;
|
||||
/**
|
||||
* One of the Following:
|
||||
* Projects each element of an observable sequence to an observable sequence and merges the resulting observable sequences into one observable sequence.
|
||||
*
|
||||
* @example
|
||||
* var res = source.flatMapWithMaxConcurrent(5, function (x) { return Rx.Observable.range(0, x); });
|
||||
* Or:
|
||||
* Projects each element of an observable sequence to an observable sequence, invokes the result selector for the source element and each of the corresponding inner sequence's elements, and merges the results into one observable sequence.
|
||||
*
|
||||
* var res = source.flatMapWithMaxConcurrent(5, function (x) { return Rx.Observable.range(0, x); }, function (x, y) { return x + y; });
|
||||
* Or:
|
||||
* Projects each element of the source observable sequence to the other observable sequence and merges the resulting observable sequences into one observable sequence.
|
||||
*
|
||||
* var res = source.flatMapWithMaxConcurrent(5, Rx.Observable.fromArray([1,2,3]));
|
||||
* @param selector A transform function to apply to each element or an observable sequence to project each element from the
|
||||
* source sequence onto which could be either an observable or Promise.
|
||||
* @param {Function} [resultSelector] A transform function to apply to each element of the intermediate sequence.
|
||||
* @param {Any} [thisArg] Object to use as this when executing callback.
|
||||
* @returns {Observable} An observable sequence whose elements are the result of invoking the one-to-many transform function collectionSelector on each element of the input sequence and then mapping each of those sequence elements and their corresponding source element to a result element.
|
||||
*/
|
||||
selectManyWithMaxConcurrent<TResult>(maxConcurrent: number, selector: _ValueOrSelector<T, ArrayOrIterable<TResult>>): Observable<TResult>;
|
||||
/**
|
||||
* One of the Following:
|
||||
* Projects each element of an observable sequence to an observable sequence and merges the resulting observable sequences into one observable sequence.
|
||||
*
|
||||
* @example
|
||||
* var res = source.flatMapWithMaxConcurrent(5, function (x) { return Rx.Observable.range(0, x); });
|
||||
* Or:
|
||||
* Projects each element of an observable sequence to an observable sequence, invokes the result selector for the source element and each of the corresponding inner sequence's elements, and merges the results into one observable sequence.
|
||||
*
|
||||
* var res = source.flatMapWithMaxConcurrent(5, function (x) { return Rx.Observable.range(0, x); }, function (x, y) { return x + y; });
|
||||
* Or:
|
||||
* Projects each element of the source observable sequence to the other observable sequence and merges the resulting observable sequences into one observable sequence.
|
||||
*
|
||||
* var res = source.flatMapWithMaxConcurrent(5, Rx.Observable.fromArray([1,2,3]));
|
||||
* @param selector A transform function to apply to each element or an observable sequence to project each element from the
|
||||
* source sequence onto which could be either an observable or Promise.
|
||||
* @param {Function} [resultSelector] A transform function to apply to each element of the intermediate sequence.
|
||||
* @param {Any} [thisArg] Object to use as this when executing callback.
|
||||
* @returns {Observable} An observable sequence whose elements are the result of invoking the one-to-many transform function collectionSelector on each element of the input sequence and then mapping each of those sequence elements and their corresponding source element to a result element.
|
||||
*/
|
||||
selectManyWithMaxConcurrent<TOther, TResult>(maxConcurrent: number, selector: _ValueOrSelector<T, ObservableOrPromise<TOther>>, resultSelector: special._FlatMapResultSelector<T, TOther, TResult>, thisArg?: any): Observable<TResult>;
|
||||
/**
|
||||
* One of the Following:
|
||||
* Projects each element of an observable sequence to an observable sequence and merges the resulting observable sequences into one observable sequence.
|
||||
*
|
||||
* @example
|
||||
* var res = source.flatMapWithMaxConcurrent(5, function (x) { return Rx.Observable.range(0, x); });
|
||||
* Or:
|
||||
* Projects each element of an observable sequence to an observable sequence, invokes the result selector for the source element and each of the corresponding inner sequence's elements, and merges the results into one observable sequence.
|
||||
*
|
||||
* var res = source.flatMapWithMaxConcurrent(5, function (x) { return Rx.Observable.range(0, x); }, function (x, y) { return x + y; });
|
||||
* Or:
|
||||
* Projects each element of the source observable sequence to the other observable sequence and merges the resulting observable sequences into one observable sequence.
|
||||
*
|
||||
* var res = source.flatMapWithMaxConcurrent(5, Rx.Observable.fromArray([1,2,3]));
|
||||
* @param selector A transform function to apply to each element or an observable sequence to project each element from the
|
||||
* source sequence onto which could be either an observable or Promise.
|
||||
* @param {Function} [resultSelector] A transform function to apply to each element of the intermediate sequence.
|
||||
* @param {Any} [thisArg] Object to use as this when executing callback.
|
||||
* @returns {Observable} An observable sequence whose elements are the result of invoking the one-to-many transform function collectionSelector on each element of the input sequence and then mapping each of those sequence elements and their corresponding source element to a result element.
|
||||
*/
|
||||
selectManyWithMaxConcurrent<TOther, TResult>(maxConcurrent: number, selector: _ValueOrSelector<T, ArrayOrIterable<TOther>>, resultSelector: special._FlatMapResultSelector<T, TOther, TResult>, thisArg?: any): Observable<TResult>;
|
||||
|
||||
/**
|
||||
* One of the Following:
|
||||
* Projects each element of an observable sequence to an observable sequence and merges the resulting observable sequences into one observable sequence.
|
||||
*
|
||||
* @example
|
||||
* var res = source.flatMapWithMaxConcurrent(5, function (x) { return Rx.Observable.range(0, x); });
|
||||
* Or:
|
||||
* Projects each element of an observable sequence to an observable sequence, invokes the result selector for the source element and each of the corresponding inner sequence's elements, and merges the results into one observable sequence.
|
||||
*
|
||||
* var res = source.flatMapWithMaxConcurrent(5, function (x) { return Rx.Observable.range(0, x); }, function (x, y) { return x + y; });
|
||||
* Or:
|
||||
* Projects each element of the source observable sequence to the other observable sequence and merges the resulting observable sequences into one observable sequence.
|
||||
*
|
||||
* var res = source.flatMapWithMaxConcurrent(5, Rx.Observable.fromArray([1,2,3]));
|
||||
* @param selector A transform function to apply to each element or an observable sequence to project each element from the
|
||||
* source sequence onto which could be either an observable or Promise.
|
||||
* @param {Function} [resultSelector] A transform function to apply to each element of the intermediate sequence.
|
||||
* @param {Any} [thisArg] Object to use as this when executing callback.
|
||||
* @returns {Observable} An observable sequence whose elements are the result of invoking the one-to-many transform function collectionSelector on each element of the input sequence and then mapping each of those sequence elements and their corresponding source element to a result element.
|
||||
*/
|
||||
flatMapWithMaxConcurrent<TResult>(maxConcurrent: number, selector: _ValueOrSelector<T, ObservableOrPromise<TResult>>): Observable<TResult>;
|
||||
|
||||
/**
|
||||
* One of the Following:
|
||||
* Projects each element of an observable sequence to an observable sequence and merges the resulting observable sequences into one observable sequence.
|
||||
*
|
||||
* @example
|
||||
* var res = source.flatMapWithMaxConcurrent(5, function (x) { return Rx.Observable.range(0, x); });
|
||||
* Or:
|
||||
* Projects each element of an observable sequence to an observable sequence, invokes the result selector for the source element and each of the corresponding inner sequence's elements, and merges the results into one observable sequence.
|
||||
*
|
||||
* var res = source.flatMapWithMaxConcurrent(5, function (x) { return Rx.Observable.range(0, x); }, function (x, y) { return x + y; });
|
||||
* Or:
|
||||
* Projects each element of the source observable sequence to the other observable sequence and merges the resulting observable sequences into one observable sequence.
|
||||
*
|
||||
* var res = source.flatMapWithMaxConcurrent(5, Rx.Observable.fromArray([1,2,3]));
|
||||
* @param selector A transform function to apply to each element or an observable sequence to project each element from the
|
||||
* source sequence onto which could be either an observable or Promise.
|
||||
* @param {Function} [resultSelector] A transform function to apply to each element of the intermediate sequence.
|
||||
* @param {Any} [thisArg] Object to use as this when executing callback.
|
||||
* @returns {Observable} An observable sequence whose elements are the result of invoking the one-to-many transform function collectionSelector on each element of the input sequence and then mapping each of those sequence elements and their corresponding source element to a result element.
|
||||
*/
|
||||
flatMapWithMaxConcurrent<TResult>(maxConcurrent: number, selector: _ValueOrSelector<T, ArrayOrIterable<TResult>>): Observable<TResult>;
|
||||
/**
|
||||
* One of the Following:
|
||||
* Projects each element of an observable sequence to an observable sequence and merges the resulting observable sequences into one observable sequence.
|
||||
*
|
||||
* @example
|
||||
* var res = source.flatMapWithMaxConcurrent(5, function (x) { return Rx.Observable.range(0, x); });
|
||||
* Or:
|
||||
* Projects each element of an observable sequence to an observable sequence, invokes the result selector for the source element and each of the corresponding inner sequence's elements, and merges the results into one observable sequence.
|
||||
*
|
||||
* var res = source.flatMapWithMaxConcurrent(5, function (x) { return Rx.Observable.range(0, x); }, function (x, y) { return x + y; });
|
||||
* Or:
|
||||
* Projects each element of the source observable sequence to the other observable sequence and merges the resulting observable sequences into one observable sequence.
|
||||
*
|
||||
* var res = source.flatMapWithMaxConcurrent(5, Rx.Observable.fromArray([1,2,3]));
|
||||
* @param selector A transform function to apply to each element or an observable sequence to project each element from the
|
||||
* source sequence onto which could be either an observable or Promise.
|
||||
* @param {Function} [resultSelector] A transform function to apply to each element of the intermediate sequence.
|
||||
* @param {Any} [thisArg] Object to use as this when executing callback.
|
||||
* @returns {Observable} An observable sequence whose elements are the result of invoking the one-to-many transform function collectionSelector on each element of the input sequence and then mapping each of those sequence elements and their corresponding source element to a result element.
|
||||
*/
|
||||
flatMapWithMaxConcurrent<TOther, TResult>(maxConcurrent: number, selector: _ValueOrSelector<T, ObservableOrPromise<TOther>>, resultSelector: special._FlatMapResultSelector<T, TOther, TResult>, thisArg?: any): Observable<TResult>;
|
||||
/**
|
||||
* One of the Following:
|
||||
* Projects each element of an observable sequence to an observable sequence and merges the resulting observable sequences into one observable sequence.
|
||||
*
|
||||
* @example
|
||||
* var res = source.flatMapWithMaxConcurrent(5, function (x) { return Rx.Observable.range(0, x); });
|
||||
* Or:
|
||||
* Projects each element of an observable sequence to an observable sequence, invokes the result selector for the source element and each of the corresponding inner sequence's elements, and merges the results into one observable sequence.
|
||||
*
|
||||
* var res = source.flatMapWithMaxConcurrent(5, function (x) { return Rx.Observable.range(0, x); }, function (x, y) { return x + y; });
|
||||
* Or:
|
||||
* Projects each element of the source observable sequence to the other observable sequence and merges the resulting observable sequences into one observable sequence.
|
||||
*
|
||||
* var res = source.flatMapWithMaxConcurrent(5, Rx.Observable.fromArray([1,2,3]));
|
||||
* @param selector A transform function to apply to each element or an observable sequence to project each element from the
|
||||
* source sequence onto which could be either an observable or Promise.
|
||||
* @param {Function} [resultSelector] A transform function to apply to each element of the intermediate sequence.
|
||||
* @param {Any} [thisArg] Object to use as this when executing callback.
|
||||
* @returns {Observable} An observable sequence whose elements are the result of invoking the one-to-many transform function collectionSelector on each element of the input sequence and then mapping each of those sequence elements and their corresponding source element to a result element.
|
||||
*/
|
||||
flatMapWithMaxConcurrent<TOther, TResult>(maxConcurrent: number, selector: _ValueOrSelector<T, ArrayOrIterable<TOther>>, resultSelector: special._FlatMapResultSelector<T, TOther, TResult>, thisArg?: any): Observable<TResult>;
|
||||
}
|
||||
}
|
||||
|
||||
(function() {
|
||||
var o: Rx.Observable<string>;
|
||||
var n: Rx.Observable<number>;
|
||||
n = o.flatMapWithMaxConcurrent(1, x => Rx.Observable.from([1, 2, 3]));
|
||||
n = o.flatMapWithMaxConcurrent(1, x => Rx.Observable.from([1, 2, 3]).toPromise());
|
||||
n = o.flatMapWithMaxConcurrent(1, x => [1, 2, 3]);
|
||||
n = o.flatMapWithMaxConcurrent(1, x => Rx.Observable.from([1, 2, 3]), (x, y) => y);
|
||||
n = o.flatMapWithMaxConcurrent(1, x => Rx.Observable.from([1, 2, 3]).toPromise(), (x, y) => y);
|
||||
n = o.flatMapWithMaxConcurrent(1, x => [1, 2, 3], (x, y) => y);
|
||||
n = o.flatMapWithMaxConcurrent(1, Rx.Observable.from([1, 2, 3]));
|
||||
n = o.flatMapWithMaxConcurrent(1, Rx.Observable.from([1, 2, 3]).toPromise());
|
||||
n = o.flatMapWithMaxConcurrent(1, [1, 2, 3]);
|
||||
n = o.flatMapWithMaxConcurrent(1, Rx.Observable.from([1, 2, 3]), (x, y) => y);
|
||||
n = o.flatMapWithMaxConcurrent(1, Rx.Observable.from([1, 2, 3]).toPromise(), (x, y) => y);
|
||||
n = o.flatMapWithMaxConcurrent(1, [1, 2, 3], (x, y) => y);
|
||||
|
||||
n = o.selectManyWithMaxConcurrent(1, x => Rx.Observable.from([1, 2, 3]));
|
||||
n = o.selectManyWithMaxConcurrent(1, x => Rx.Observable.from([1, 2, 3]).toPromise());
|
||||
n = o.selectManyWithMaxConcurrent(1, x => [1, 2, 3]);
|
||||
n = o.selectManyWithMaxConcurrent(1, x => Rx.Observable.from([1, 2, 3]), (x, y) => y);
|
||||
n = o.selectManyWithMaxConcurrent(1, x => Rx.Observable.from([1, 2, 3]).toPromise(), (x, y) => y);
|
||||
n = o.selectManyWithMaxConcurrent(1, x => [1, 2, 3], (x, y) => y);
|
||||
n = o.selectManyWithMaxConcurrent(1, Rx.Observable.from([1, 2, 3]));
|
||||
n = o.selectManyWithMaxConcurrent(1, Rx.Observable.from([1, 2, 3]).toPromise());
|
||||
n = o.selectManyWithMaxConcurrent(1, [1, 2, 3]);
|
||||
n = o.selectManyWithMaxConcurrent(1, Rx.Observable.from([1, 2, 3]), (x, y) => y);
|
||||
n = o.selectManyWithMaxConcurrent(1, Rx.Observable.from([1, 2, 3]).toPromise(), (x, y) => y);
|
||||
n = o.selectManyWithMaxConcurrent(1, [1, 2, 3], (x, y) => y);
|
||||
});
|
27
node_modules/rx/ts/core/linq/observable/for.ts
generated
vendored
Normal file
27
node_modules/rx/ts/core/linq/observable/for.ts
generated
vendored
Normal file
@ -0,0 +1,27 @@
|
||||
/// <reference path="../../observable.ts" />
|
||||
module Rx {
|
||||
export interface ObservableStatic {
|
||||
/**
|
||||
* Concatenates the observable sequences obtained by running the specified result selector for each element in source.
|
||||
* There is an alias for this method called 'forIn' for browsers <IE9
|
||||
* @param {Array} sources An array of values to turn into an observable sequence.
|
||||
* @param {Function} resultSelector A function to apply to each item in the sources array to turn it into an observable sequence.
|
||||
* @returns {Observable} An observable sequence from the concatenated observable sequences.
|
||||
*/
|
||||
for<T, TResult>(sources: T[], resultSelector: _Selector<T, TResult>, thisArg?: any): Observable<TResult>;
|
||||
/**
|
||||
* Concatenates the observable sequences obtained by running the specified result selector for each element in source.
|
||||
* There is an alias for this method called 'forIn' for browsers <IE9
|
||||
* @param {Array} sources An array of values to turn into an observable sequence.
|
||||
* @param {Function} resultSelector A function to apply to each item in the sources array to turn it into an observable sequence.
|
||||
* @returns {Observable} An observable sequence from the concatenated observable sequences.
|
||||
*/
|
||||
forIn<T, TResult>(sources: T[], resultSelector: _Selector<T, TResult>, thisArg?: any): Observable<TResult>;
|
||||
}
|
||||
}
|
||||
|
||||
(function() {
|
||||
Rx.Observable.for(['a'], x => x);
|
||||
Rx.Observable.forIn(['a'], x => x);
|
||||
|
||||
});
|
31
node_modules/rx/ts/core/linq/observable/forkjoin.ts
generated
vendored
Normal file
31
node_modules/rx/ts/core/linq/observable/forkjoin.ts
generated
vendored
Normal file
@ -0,0 +1,31 @@
|
||||
/// <reference path="../../observable.ts" />
|
||||
module Rx {
|
||||
export interface ObservableStatic {
|
||||
/**
|
||||
* Runs all observable sequences in parallel and collect their last elements.
|
||||
*
|
||||
* @example
|
||||
* 1 - res = Rx.Observable.forkJoin([obs1, obs2]);
|
||||
* 1 - res = Rx.Observable.forkJoin(obs1, obs2, ...);
|
||||
* @returns {Observable} An observable sequence with an array collecting the last elements of all the input sequences.
|
||||
*/
|
||||
forkJoin<T>(sources: ObservableOrPromise<T>[]): Observable<T[]>;
|
||||
|
||||
/**
|
||||
* Runs all observable sequences in parallel and collect their last elements.
|
||||
*
|
||||
* @example
|
||||
* 1 - res = Rx.Observable.forkJoin([obs1, obs2]);
|
||||
* 1 - res = Rx.Observable.forkJoin(obs1, obs2, ...);
|
||||
* @returns {Observable} An observable sequence with an array collecting the last elements of all the input sequences.
|
||||
*/
|
||||
forkJoin<T>(...args: ObservableOrPromise<T>[]): Observable<T[]>;
|
||||
}
|
||||
}
|
||||
|
||||
(function () {
|
||||
var a : Rx.Observable<string>;
|
||||
var b : Rx.Promise<string>;
|
||||
Rx.Observable.forkJoin(a, b);
|
||||
Rx.Observable.forkJoin([a, b]);
|
||||
});
|
20
node_modules/rx/ts/core/linq/observable/forkjoinproto.ts
generated
vendored
Normal file
20
node_modules/rx/ts/core/linq/observable/forkjoinproto.ts
generated
vendored
Normal file
@ -0,0 +1,20 @@
|
||||
/// <reference path="../../observable.ts" />
|
||||
module Rx {
|
||||
export interface Observable<T> {
|
||||
/**
|
||||
* Runs two observable sequences in parallel and combines their last elemenets.
|
||||
*
|
||||
* @param {Observable} second Second observable sequence.
|
||||
* @param {Function} resultSelector Result selector function to invoke with the last elements of both sequences.
|
||||
* @returns {Observable} An observable sequence with the result of calling the selector function with the last elements of both input sequences.
|
||||
*/
|
||||
forkJoin<TSecond, TResult>(second: ObservableOrPromise<TSecond>, resultSelector: (left: T, right: TSecond) => TResult): Observable<TResult>;
|
||||
}
|
||||
}
|
||||
|
||||
(function () {
|
||||
var a : Rx.Observable<string>;
|
||||
var b : Rx.Observable<number>;
|
||||
a = a.forkJoin(b, (a, b) => a);
|
||||
b = a.forkJoin(b, (a, b) => b);
|
||||
});
|
31
node_modules/rx/ts/core/linq/observable/from.ts
generated
vendored
Normal file
31
node_modules/rx/ts/core/linq/observable/from.ts
generated
vendored
Normal file
@ -0,0 +1,31 @@
|
||||
/// <reference path="../../observable.ts" />
|
||||
/// <reference path="../../concurrency/scheduler.ts" />
|
||||
module Rx {
|
||||
export interface ObservableStatic {
|
||||
/**
|
||||
* This method creates a new Observable sequence from an array-like or iterable object.
|
||||
* @param {Any} arrayLike An array-like or iterable object to convert to an Observable sequence.
|
||||
* @param {Function} [mapFn] Map function to call on every element of the array.
|
||||
* @param {Any} [thisArg] The context to use calling the mapFn if provided.
|
||||
* @param {Scheduler} [scheduler] Optional scheduler to use for scheduling. If not provided, defaults to Scheduler.currentThread.
|
||||
*/
|
||||
from<T>(array: ArrayOrIterable<T>): Observable<T>;
|
||||
/**
|
||||
* This method creates a new Observable sequence from an array-like or iterable object.
|
||||
* @param {Any} arrayLike An array-like or iterable object to convert to an Observable sequence.
|
||||
* @param {Function} [mapFn] Map function to call on every element of the array.
|
||||
* @param {Any} [thisArg] The context to use calling the mapFn if provided.
|
||||
* @param {Scheduler} [scheduler] Optional scheduler to use for scheduling. If not provided, defaults to Scheduler.currentThread.
|
||||
*/
|
||||
from<T, TResult>(array: ArrayOrIterable<T>, mapFn: (value: T, index: number) => TResult, thisArg?: any, scheduler?: IScheduler): Observable<TResult>;
|
||||
}
|
||||
}
|
||||
|
||||
(function () {
|
||||
var a : Rx.Observable<string>;
|
||||
var b : Rx.Promise<string>;
|
||||
Rx.Observable.from([1,2,3]);
|
||||
Rx.Observable.from([1,2,3], x => x + 1);
|
||||
Rx.Observable.from([1,2,3], x => x + 1, {});
|
||||
Rx.Observable.from([1,2,3], x => x + 1, {}, Rx.Scheduler.async);
|
||||
});
|
18
node_modules/rx/ts/core/linq/observable/fromarray.ts
generated
vendored
Normal file
18
node_modules/rx/ts/core/linq/observable/fromarray.ts
generated
vendored
Normal file
@ -0,0 +1,18 @@
|
||||
/// <reference path="../../observable.ts" />
|
||||
/// <reference path="../../concurrency/scheduler.ts" />
|
||||
module Rx {
|
||||
export interface ObservableStatic {
|
||||
/**
|
||||
* Converts an array to an observable sequence, using an optional scheduler to enumerate the array.
|
||||
* @deprecated use Observable.from or Observable.of
|
||||
* @param {Scheduler} [scheduler] Scheduler to run the enumeration of the input sequence on.
|
||||
* @returns {Observable} The observable sequence whose elements are pulled from the given enumerable sequence.
|
||||
*/
|
||||
fromArray<T>(array: ArrayLike<T>, scheduler?: IScheduler): Observable<T>;
|
||||
}
|
||||
}
|
||||
|
||||
(function () {
|
||||
Rx.Observable.fromArray([1,2,3]);
|
||||
Rx.Observable.fromArray([1,2,3], Rx.Scheduler.async);
|
||||
});
|
96
node_modules/rx/ts/core/linq/observable/fromcallback.ts
generated
vendored
Normal file
96
node_modules/rx/ts/core/linq/observable/fromcallback.ts
generated
vendored
Normal file
@ -0,0 +1,96 @@
|
||||
/// <reference path="../../observable.ts" />
|
||||
/// <reference path="../../concurrency/scheduler.ts" />
|
||||
module Rx {
|
||||
export interface ObservableStatic {
|
||||
/**
|
||||
* Converts a callback function to an observable sequence.
|
||||
*
|
||||
* @param {Function} function Function with a callback as the last parameter to convert to an Observable sequence.
|
||||
* @param {Mixed} [context] The context for the func parameter to be executed. If not specified, defaults to undefined.
|
||||
* @param {Function} [selector] A selector which takes the arguments from the callback to produce a single item to yield on next.
|
||||
* @returns {Function} A function, when executed with the required parameters minus the callback, produces an Observable sequence with a single value of the arguments to the callback as an array.
|
||||
*/
|
||||
fromCallback<TResult>(func: Function, context: any, selector: Function): (...args: any[]) => Observable<TResult>;
|
||||
/**
|
||||
* Converts a callback function to an observable sequence.
|
||||
*
|
||||
* @param {Function} function Function with a callback as the last parameter to convert to an Observable sequence.
|
||||
* @param {Mixed} [context] The context for the func parameter to be executed. If not specified, defaults to undefined.
|
||||
* @param {Function} [selector] A selector which takes the arguments from the callback to produce a single item to yield on next.
|
||||
* @returns {Function} A function, when executed with the required parameters minus the callback, produces an Observable sequence with a single value of the arguments to the callback as an array.
|
||||
*/
|
||||
fromCallback<TResult, T1>(func: (arg1: T1, callback: (result: TResult) => any) => any, context?: any, selector?: Function): (arg1: T1) => Observable<TResult>;
|
||||
/**
|
||||
* Converts a callback function to an observable sequence.
|
||||
*
|
||||
* @param {Function} function Function with a callback as the last parameter to convert to an Observable sequence.
|
||||
* @param {Mixed} [context] The context for the func parameter to be executed. If not specified, defaults to undefined.
|
||||
* @param {Function} [selector] A selector which takes the arguments from the callback to produce a single item to yield on next.
|
||||
* @returns {Function} A function, when executed with the required parameters minus the callback, produces an Observable sequence with a single value of the arguments to the callback as an array.
|
||||
*/
|
||||
fromCallback<TResult, T1, T2>(func: (arg1: T1, arg2: T2, callback: (result: TResult) => any) => any, context?: any, selector?: Function): (arg1: T1, arg2: T2) => Observable<TResult>;
|
||||
/**
|
||||
* Converts a callback function to an observable sequence.
|
||||
*
|
||||
* @param {Function} function Function with a callback as the last parameter to convert to an Observable sequence.
|
||||
* @param {Mixed} [context] The context for the func parameter to be executed. If not specified, defaults to undefined.
|
||||
* @param {Function} [selector] A selector which takes the arguments from the callback to produce a single item to yield on next.
|
||||
* @returns {Function} A function, when executed with the required parameters minus the callback, produces an Observable sequence with a single value of the arguments to the callback as an array.
|
||||
*/
|
||||
fromCallback<TResult, T1, T2, T3>(func: (arg1: T1, arg2: T2, arg3: T3, callback: (result: TResult) => any) => any, context?: any, selector?: Function): (arg1: T1, arg2: T2, arg3: T3) => Observable<TResult>;
|
||||
/**
|
||||
* Converts a callback function to an observable sequence.
|
||||
*
|
||||
* @param {Function} function Function with a callback as the last parameter to convert to an Observable sequence.
|
||||
* @param {Mixed} [context] The context for the func parameter to be executed. If not specified, defaults to undefined.
|
||||
* @param {Function} [selector] A selector which takes the arguments from the callback to produce a single item to yield on next.
|
||||
* @returns {Function} A function, when executed with the required parameters minus the callback, produces an Observable sequence with a single value of the arguments to the callback as an array.
|
||||
*/
|
||||
fromCallback<TResult, T1, T2, T3, T4>(func: (arg1: T1, arg2: T2, arg3: T3, arg4: T4, callback: (result: TResult) => any) => any, context?: any, selector?: Function): (arg1: T1, arg2: T2, arg3: T3, arg4: T4) => Observable<TResult>;
|
||||
/**
|
||||
* Converts a callback function to an observable sequence.
|
||||
*
|
||||
* @param {Function} function Function with a callback as the last parameter to convert to an Observable sequence.
|
||||
* @param {Mixed} [context] The context for the func parameter to be executed. If not specified, defaults to undefined.
|
||||
* @param {Function} [selector] A selector which takes the arguments from the callback to produce a single item to yield on next.
|
||||
* @returns {Function} A function, when executed with the required parameters minus the callback, produces an Observable sequence with a single value of the arguments to the callback as an array.
|
||||
*/
|
||||
fromCallback<TResult, T1, T2, T3, T4, T5>(func: (arg1: T1, arg2: T2, arg3: T3, arg4: T4, arg5: T5, callback: (result: TResult) => any) => any, context?: any, selector?: Function): (arg1: T1, arg2: T2, arg3: T3, arg4: T4, arg5: T5) => Observable<TResult>;
|
||||
/**
|
||||
* Converts a callback function to an observable sequence.
|
||||
*
|
||||
* @param {Function} function Function with a callback as the last parameter to convert to an Observable sequence.
|
||||
* @param {Mixed} [context] The context for the func parameter to be executed. If not specified, defaults to undefined.
|
||||
* @param {Function} [selector] A selector which takes the arguments from the callback to produce a single item to yield on next.
|
||||
* @returns {Function} A function, when executed with the required parameters minus the callback, produces an Observable sequence with a single value of the arguments to the callback as an array.
|
||||
*/
|
||||
fromCallback<TResult, T1, T2, T3, T4, T5, T6>(func: (arg1: T1, arg2: T2, arg3: T3, arg4: T4, arg5: T5, arg6: T6, callback: (result: TResult) => any) => any, context?: any, selector?: Function): (arg1: T1, arg2: T2, arg3: T3, arg4: T4, arg5: T5, arg6: T6) => Observable<TResult>;
|
||||
/**
|
||||
* Converts a callback function to an observable sequence.
|
||||
*
|
||||
* @param {Function} function Function with a callback as the last parameter to convert to an Observable sequence.
|
||||
* @param {Mixed} [context] The context for the func parameter to be executed. If not specified, defaults to undefined.
|
||||
* @param {Function} [selector] A selector which takes the arguments from the callback to produce a single item to yield on next.
|
||||
* @returns {Function} A function, when executed with the required parameters minus the callback, produces an Observable sequence with a single value of the arguments to the callback as an array.
|
||||
*/
|
||||
fromCallback<TResult, T1, T2, T3, T4, T5, T6, T7>(func: (arg1: T1, arg2: T2, arg3: T3, arg4: T4, arg5: T5, arg6: T6, arg7: T7, callback: (result: TResult) => any) => any, context?: any, selector?: Function): (arg1: T1, arg2: T2, arg3: T3, arg4: T4, arg5: T5, arg6: T6, arg7: T7) => Observable<TResult>;
|
||||
/**
|
||||
* Converts a callback function to an observable sequence.
|
||||
*
|
||||
* @param {Function} function Function with a callback as the last parameter to convert to an Observable sequence.
|
||||
* @param {Mixed} [context] The context for the func parameter to be executed. If not specified, defaults to undefined.
|
||||
* @param {Function} [selector] A selector which takes the arguments from the callback to produce a single item to yield on next.
|
||||
* @returns {Function} A function, when executed with the required parameters minus the callback, produces an Observable sequence with a single value of the arguments to the callback as an array.
|
||||
*/
|
||||
fromCallback<TResult, T1, T2, T3, T4, T5, T6, T7, T8>(func: (arg1: T1, arg2: T2, arg3: T3, arg4: T4, arg5: T5, arg6: T6, arg7: T7, arg8: T8, callback: (result: TResult) => any) => any, context?: any, selector?: Function): (arg1: T1, arg2: T2, arg3: T3, arg4: T4, arg5: T5, arg6: T6, arg7: T7, arg8: T8) => Observable<TResult>;
|
||||
/**
|
||||
* Converts a callback function to an observable sequence.
|
||||
*
|
||||
* @param {Function} function Function with a callback as the last parameter to convert to an Observable sequence.
|
||||
* @param {Mixed} [context] The context for the func parameter to be executed. If not specified, defaults to undefined.
|
||||
* @param {Function} [selector] A selector which takes the arguments from the callback to produce a single item to yield on next.
|
||||
* @returns {Function} A function, when executed with the required parameters minus the callback, produces an Observable sequence with a single value of the arguments to the callback as an array.
|
||||
*/
|
||||
fromCallback<TResult, T1, T2, T3, T4, T5, T6, T7, T8, T9>(func: (arg1: T1, arg2: T2, arg3: T3, arg4: T4, arg5: T5, arg6: T6, arg7: T7, arg8: T8, arg9: T9, callback: (result: TResult) => any) => any, context?: any, selector?: Function): (arg1: T1, arg2: T2, arg3: T3, arg4: T4, arg5: T5, arg6: T6, arg7: T7, arg8: T8, arg9: T9) => Observable<TResult>;
|
||||
}
|
||||
}
|
22
node_modules/rx/ts/core/linq/observable/fromevent.ts
generated
vendored
Normal file
22
node_modules/rx/ts/core/linq/observable/fromevent.ts
generated
vendored
Normal file
@ -0,0 +1,22 @@
|
||||
/// <reference path="../../observable.ts" />
|
||||
/// <reference path="../../concurrency/scheduler.ts" />
|
||||
module Rx {
|
||||
export interface ObservableStatic {
|
||||
/**
|
||||
* Creates an observable sequence by adding an event listener to the matching DOMElement or each item in the NodeList.
|
||||
* @param {Object} element The DOMElement or NodeList to attach a listener.
|
||||
* @param {String} eventName The event name to attach the observable sequence.
|
||||
* @param {Function} [selector] A selector which takes the arguments from the event handler to produce a single item to yield on next.
|
||||
* @returns {Observable} An observable sequence of events from the specified element and the specified event.
|
||||
*/
|
||||
fromEvent<T>(element: EventTarget, eventName: string, selector?: (arguments: any[]) => T): Observable<T>;
|
||||
/**
|
||||
* Creates an observable sequence by adding an event listener to the matching DOMElement or each item in the NodeList.
|
||||
* @param {Object} element The DOMElement or NodeList to attach a listener.
|
||||
* @param {String} eventName The event name to attach the observable sequence.
|
||||
* @param {Function} [selector] A selector which takes the arguments from the event handler to produce a single item to yield on next.
|
||||
* @returns {Observable} An observable sequence of events from the specified element and the specified event.
|
||||
*/
|
||||
fromEvent<T>(element: { on: (name: string, cb: (e: any) => any) => void; off: (name: string, cb: (e: any) => any) => void }, eventName: string, selector?: (arguments: any[]) => T): Observable<T>;
|
||||
}
|
||||
}
|
13
node_modules/rx/ts/core/linq/observable/fromeventpattern.ts
generated
vendored
Normal file
13
node_modules/rx/ts/core/linq/observable/fromeventpattern.ts
generated
vendored
Normal file
@ -0,0 +1,13 @@
|
||||
/// <reference path="../../observable.ts" />
|
||||
module Rx {
|
||||
export interface ObservableStatic {
|
||||
/**
|
||||
* Creates an observable sequence from an event emitter via an addHandler/removeHandler pair.
|
||||
* @param {Function} addHandler The function to add a handler to the emitter.
|
||||
* @param {Function} [removeHandler] The optional function to remove a handler from an emitter.
|
||||
* @param {Function} [selector] A selector which takes the arguments from the event handler to produce a single item to yield on next.
|
||||
* @returns {Observable} An observable sequence which wraps an event from an event emitter
|
||||
*/
|
||||
fromEventPattern<T>(addHandler: (handler: Function) => void, removeHandler: (handler: Function) => void, selector?: (arguments: any[]) => T): Observable<T>;
|
||||
}
|
||||
}
|
85
node_modules/rx/ts/core/linq/observable/fromnodecallback.ts
generated
vendored
Normal file
85
node_modules/rx/ts/core/linq/observable/fromnodecallback.ts
generated
vendored
Normal file
@ -0,0 +1,85 @@
|
||||
/// <reference path="../../observable.ts" />
|
||||
module Rx {
|
||||
export interface ObservableStatic {
|
||||
/**
|
||||
* Converts a Node.js callback style function to an observable sequence. This must be in function (err, ...) format.
|
||||
* @param {Function} func The function to call
|
||||
* @param {Mixed} [context] The context for the func parameter to be executed. If not specified, defaults to undefined.
|
||||
* @param {Function} [selector] A selector which takes the arguments from the callback minus the error to produce a single item to yield on next.
|
||||
* @returns {Function} An async function which when applied, returns an observable sequence with the callback arguments as an array.
|
||||
*/
|
||||
fromNodeCallback<TResult>(func: Function, context?: any, selector?: Function): (...args: any[]) => Observable<TResult>;
|
||||
/**
|
||||
* Converts a Node.js callback style function to an observable sequence. This must be in function (err, ...) format.
|
||||
* @param {Function} func The function to call
|
||||
* @param {Mixed} [context] The context for the func parameter to be executed. If not specified, defaults to undefined.
|
||||
* @param {Function} [selector] A selector which takes the arguments from the callback minus the error to produce a single item to yield on next.
|
||||
* @returns {Function} An async function which when applied, returns an observable sequence with the callback arguments as an array.
|
||||
*/
|
||||
fromNodeCallback<TResult, T1>(func: (arg1: T1, callback: (err: any, result: TResult) => any) => any, context?: any, selector?: Function): (arg1: T1) => Observable<TResult>;
|
||||
/**
|
||||
* Converts a Node.js callback style function to an observable sequence. This must be in function (err, ...) format.
|
||||
* @param {Function} func The function to call
|
||||
* @param {Mixed} [context] The context for the func parameter to be executed. If not specified, defaults to undefined.
|
||||
* @param {Function} [selector] A selector which takes the arguments from the callback minus the error to produce a single item to yield on next.
|
||||
* @returns {Function} An async function which when applied, returns an observable sequence with the callback arguments as an array.
|
||||
*/
|
||||
fromNodeCallback<TResult, T1, T2>(func: (arg1: T1, arg2: T2, callback: (err: any, result: TResult) => any) => any, context?: any, selector?: Function): (arg1: T1, arg2: T2) => Observable<TResult>;
|
||||
/**
|
||||
* Converts a Node.js callback style function to an observable sequence. This must be in function (err, ...) format.
|
||||
* @param {Function} func The function to call
|
||||
* @param {Mixed} [context] The context for the func parameter to be executed. If not specified, defaults to undefined.
|
||||
* @param {Function} [selector] A selector which takes the arguments from the callback minus the error to produce a single item to yield on next.
|
||||
* @returns {Function} An async function which when applied, returns an observable sequence with the callback arguments as an array.
|
||||
*/
|
||||
fromNodeCallback<TResult, T1, T2, T3>(func: (arg1: T1, arg2: T2, arg3: T3, callback: (err: any, result: TResult) => any) => any, context?: any, selector?: Function): (arg1: T1, arg2: T2, arg3: T3) => Observable<TResult>;
|
||||
/**
|
||||
* Converts a Node.js callback style function to an observable sequence. This must be in function (err, ...) format.
|
||||
* @param {Function} func The function to call
|
||||
* @param {Mixed} [context] The context for the func parameter to be executed. If not specified, defaults to undefined.
|
||||
* @param {Function} [selector] A selector which takes the arguments from the callback minus the error to produce a single item to yield on next.
|
||||
* @returns {Function} An async function which when applied, returns an observable sequence with the callback arguments as an array.
|
||||
*/
|
||||
fromNodeCallback<TResult, T1, T2, T3, T4>(func: (arg1: T1, arg2: T2, arg3: T3, arg4: T4, callback: (err: any, result: TResult) => any) => any, context?: any, selector?: Function): (arg1: T1, arg2: T2, arg3: T3, arg4: T4) => Observable<TResult>;
|
||||
/**
|
||||
* Converts a Node.js callback style function to an observable sequence. This must be in function (err, ...) format.
|
||||
* @param {Function} func The function to call
|
||||
* @param {Mixed} [context] The context for the func parameter to be executed. If not specified, defaults to undefined.
|
||||
* @param {Function} [selector] A selector which takes the arguments from the callback minus the error to produce a single item to yield on next.
|
||||
* @returns {Function} An async function which when applied, returns an observable sequence with the callback arguments as an array.
|
||||
*/
|
||||
fromNodeCallback<TResult, T1, T2, T3, T4, T5>(func: (arg1: T1, arg2: T2, arg3: T3, arg4: T4, arg5: T5, callback: (err: any, result: TResult) => any) => any, context?: any, selector?: Function): (arg1: T1, arg2: T2, arg3: T3, arg4: T4, arg5: T5) => Observable<TResult>;
|
||||
/**
|
||||
* Converts a Node.js callback style function to an observable sequence. This must be in function (err, ...) format.
|
||||
* @param {Function} func The function to call
|
||||
* @param {Mixed} [context] The context for the func parameter to be executed. If not specified, defaults to undefined.
|
||||
* @param {Function} [selector] A selector which takes the arguments from the callback minus the error to produce a single item to yield on next.
|
||||
* @returns {Function} An async function which when applied, returns an observable sequence with the callback arguments as an array.
|
||||
*/
|
||||
fromNodeCallback<TResult, T1, T2, T3, T4, T5, T6>(func: (arg1: T1, arg2: T2, arg3: T3, arg4: T4, arg5: T5, arg6: T6, callback: (err: any, result: TResult) => any) => any, context?: any, selector?: Function): (arg1: T1, arg2: T2, arg3: T3, arg4: T4, arg5: T5, arg6: T6) => Observable<TResult>;
|
||||
/**
|
||||
* Converts a Node.js callback style function to an observable sequence. This must be in function (err, ...) format.
|
||||
* @param {Function} func The function to call
|
||||
* @param {Mixed} [context] The context for the func parameter to be executed. If not specified, defaults to undefined.
|
||||
* @param {Function} [selector] A selector which takes the arguments from the callback minus the error to produce a single item to yield on next.
|
||||
* @returns {Function} An async function which when applied, returns an observable sequence with the callback arguments as an array.
|
||||
*/
|
||||
fromNodeCallback<TResult, T1, T2, T3, T4, T5, T6, T7>(func: (arg1: T1, arg2: T2, arg3: T3, arg4: T4, arg5: T5, arg6: T6, arg7: T7, callback: (err: any, result: TResult) => any) => any, context?: any, selector?: Function): (arg1: T1, arg2: T2, arg3: T3, arg4: T4, arg5: T5, arg6: T6, arg7: T7) => Observable<TResult>;
|
||||
/**
|
||||
* Converts a Node.js callback style function to an observable sequence. This must be in function (err, ...) format.
|
||||
* @param {Function} func The function to call
|
||||
* @param {Mixed} [context] The context for the func parameter to be executed. If not specified, defaults to undefined.
|
||||
* @param {Function} [selector] A selector which takes the arguments from the callback minus the error to produce a single item to yield on next.
|
||||
* @returns {Function} An async function which when applied, returns an observable sequence with the callback arguments as an array.
|
||||
*/
|
||||
fromNodeCallback<TResult, T1, T2, T3, T4, T5, T6, T7, T8>(func: (arg1: T1, arg2: T2, arg3: T3, arg4: T4, arg5: T5, arg6: T6, arg7: T7, arg8: T8, callback: (err: any, result: TResult) => any) => any, context?: any, selector?: Function): (arg1: T1, arg2: T2, arg3: T3, arg4: T4, arg5: T5, arg6: T6, arg7: T7, arg8: T8) => Observable<TResult>;
|
||||
/**
|
||||
* Converts a Node.js callback style function to an observable sequence. This must be in function (err, ...) format.
|
||||
* @param {Function} func The function to call
|
||||
* @param {Mixed} [context] The context for the func parameter to be executed. If not specified, defaults to undefined.
|
||||
* @param {Function} [selector] A selector which takes the arguments from the callback minus the error to produce a single item to yield on next.
|
||||
* @returns {Function} An async function which when applied, returns an observable sequence with the callback arguments as an array.
|
||||
*/
|
||||
fromNodeCallback<TResult, T1, T2, T3, T4, T5, T6, T7, T8, T9>(func: (arg1: T1, arg2: T2, arg3: T3, arg4: T4, arg5: T5, arg6: T6, arg7: T7, arg8: T8, arg9: T9, callback: (err: any, result: TResult) => any) => any, context?: any, selector?: Function): (arg1: T1, arg2: T2, arg3: T3, arg4: T4, arg5: T5, arg6: T6, arg7: T7, arg8: T8, arg9: T9) => Observable<TResult>;
|
||||
}
|
||||
}
|
16
node_modules/rx/ts/core/linq/observable/frompromise.ts
generated
vendored
Normal file
16
node_modules/rx/ts/core/linq/observable/frompromise.ts
generated
vendored
Normal file
@ -0,0 +1,16 @@
|
||||
/// <reference path="../../observable.ts" />
|
||||
module Rx {
|
||||
export interface ObservableStatic {
|
||||
/**
|
||||
* Converts a Promise to an Observable sequence
|
||||
* @param {Promise} An ES6 Compliant promise.
|
||||
* @returns {Observable} An Observable sequence which wraps the existing promise success and failure.
|
||||
*/
|
||||
fromPromise<T>(promise: Promise<T>): Observable<T>;
|
||||
}
|
||||
}
|
||||
|
||||
(function () {
|
||||
var p : Rx.Promise<string>;
|
||||
var o : Rx.Observable<string> = Rx.Observable.fromPromise(p);
|
||||
})
|
20
node_modules/rx/ts/core/linq/observable/generate.ts
generated
vendored
Normal file
20
node_modules/rx/ts/core/linq/observable/generate.ts
generated
vendored
Normal file
@ -0,0 +1,20 @@
|
||||
/// <reference path="../../observable.ts" />
|
||||
/// <reference path="../../concurrency/scheduler.ts" />
|
||||
module Rx {
|
||||
export interface ObservableStatic {
|
||||
/**
|
||||
* Generates an observable sequence by running a state-driven loop producing the sequence's elements, using the specified scheduler to send out observer messages.
|
||||
*
|
||||
* @example
|
||||
* var res = Rx.Observable.generate(0, function (x) { return x < 10; }, function (x) { return x + 1; }, function (x) { return x; });
|
||||
* var res = Rx.Observable.generate(0, function (x) { return x < 10; }, function (x) { return x + 1; }, function (x) { return x; }, Rx.Scheduler.timeout);
|
||||
* @param {Mixed} initialState Initial state.
|
||||
* @param {Function} condition Condition to terminate generation (upon returning false).
|
||||
* @param {Function} iterate Iteration step function.
|
||||
* @param {Function} resultSelector Selector function for results produced in the sequence.
|
||||
* @param {Scheduler} [scheduler] Scheduler on which to run the generator loop. If not provided, defaults to Scheduler.currentThread.
|
||||
* @returns {Observable} The generated sequence.
|
||||
*/
|
||||
generate<TState, TResult>(initialState: TState, condition: (state: TState) => boolean, iterate: (state: TState) => TState, resultSelector: (state: TState) => TResult, scheduler?: IScheduler): Observable<TResult>;
|
||||
}
|
||||
}
|
32
node_modules/rx/ts/core/linq/observable/generatewithabsolutetime.ts
generated
vendored
Normal file
32
node_modules/rx/ts/core/linq/observable/generatewithabsolutetime.ts
generated
vendored
Normal file
@ -0,0 +1,32 @@
|
||||
/// <reference path="../../observable.ts" />
|
||||
/// <reference path="../../concurrency/scheduler.ts" />
|
||||
module Rx {
|
||||
export interface ObservableStatic {
|
||||
/**
|
||||
* Generates an observable sequence by iterating a state from an initial state until the condition fails.
|
||||
*
|
||||
* @example
|
||||
* res = source.generateWithAbsoluteTime(0,
|
||||
* function (x) { return return true; },
|
||||
* function (x) { return x + 1; },
|
||||
* function (x) { return x; },
|
||||
* function (x) { return new Date(); }
|
||||
* });
|
||||
*
|
||||
* @param {Mixed} initialState Initial state.
|
||||
* @param {Function} condition Condition to terminate generation (upon returning false).
|
||||
* @param {Function} iterate Iteration step function.
|
||||
* @param {Function} resultSelector Selector function for results produced in the sequence.
|
||||
* @param {Function} timeSelector Time selector function to control the speed of values being produced each iteration, returning Date values.
|
||||
* @param {Scheduler} [scheduler] Scheduler on which to run the generator loop. If not specified, the timeout scheduler is used.
|
||||
* @returns {Observable} The generated sequence.
|
||||
*/
|
||||
generateWithAbsoluteTime<TState, TResult>(
|
||||
initialState: TState,
|
||||
condition: (state: TState) => boolean,
|
||||
iterate: (state: TState) => TState,
|
||||
resultSelector: (state: TState) => TResult,
|
||||
timeSelector: (state: TState) => Date,
|
||||
scheduler?: IScheduler): Observable<TResult>;
|
||||
}
|
||||
}
|
32
node_modules/rx/ts/core/linq/observable/generatewithrelativetime.ts
generated
vendored
Normal file
32
node_modules/rx/ts/core/linq/observable/generatewithrelativetime.ts
generated
vendored
Normal file
@ -0,0 +1,32 @@
|
||||
/// <reference path="../../observable.ts" />
|
||||
/// <reference path="../../concurrency/scheduler.ts" />
|
||||
module Rx {
|
||||
export interface ObservableStatic {
|
||||
/**
|
||||
* Generates an observable sequence by iterating a state from an initial state until the condition fails.
|
||||
*
|
||||
* @example
|
||||
* res = source.generateWithRelativeTime(0,
|
||||
* function (x) { return return true; },
|
||||
* function (x) { return x + 1; },
|
||||
* function (x) { return x; },
|
||||
* function (x) { return 500; }
|
||||
* );
|
||||
*
|
||||
* @param {Mixed} initialState Initial state.
|
||||
* @param {Function} condition Condition to terminate generation (upon returning false).
|
||||
* @param {Function} iterate Iteration step function.
|
||||
* @param {Function} resultSelector Selector function for results produced in the sequence.
|
||||
* @param {Function} timeSelector Time selector function to control the speed of values being produced each iteration, returning integer values denoting milliseconds.
|
||||
* @param {Scheduler} [scheduler] Scheduler on which to run the generator loop. If not specified, the timeout scheduler is used.
|
||||
* @returns {Observable} The generated sequence.
|
||||
*/
|
||||
generateWithRelativeTime<TState, TResult>(
|
||||
initialState: TState,
|
||||
condition: (state: TState) => boolean,
|
||||
iterate: (state: TState) => TState,
|
||||
resultSelector: (state: TState) => TResult,
|
||||
timeSelector: (state: TState) => number,
|
||||
scheduler?: IScheduler): Observable<TResult>;
|
||||
}
|
||||
}
|
29
node_modules/rx/ts/core/linq/observable/groupby.ts
generated
vendored
Normal file
29
node_modules/rx/ts/core/linq/observable/groupby.ts
generated
vendored
Normal file
@ -0,0 +1,29 @@
|
||||
/// <reference path="./groupbyuntil.ts" />
|
||||
module Rx {
|
||||
export interface Observable<T> {
|
||||
/**
|
||||
* Groups the elements of an observable sequence according to a specified key selector function and comparer and selects the resulting elements by using a specified function.
|
||||
*
|
||||
* @example
|
||||
* var res = observable.groupBy(function (x) { return x.id; });
|
||||
* 2 - observable.groupBy(function (x) { return x.id; }), function (x) { return x.name; });
|
||||
* 3 - observable.groupBy(function (x) { return x.id; }), function (x) { return x.name; }, function (x) { return x.toString(); });
|
||||
* @param {Function} keySelector A function to extract the key for each element.
|
||||
* @param {Function} [elementSelector] A function to map each source element to an element in an observable group.
|
||||
* @returns {Observable} A sequence of observable groups, each of which corresponds to a unique key value, containing all elements that share that same key value.
|
||||
*/
|
||||
groupBy<TKey, TElement>(keySelector: (value: T) => TKey, skipElementSelector?: boolean, keySerializer?: (key: TKey) => string): Observable<GroupedObservable<TKey, T>>;
|
||||
/**
|
||||
* Groups the elements of an observable sequence according to a specified key selector function and comparer and selects the resulting elements by using a specified function.
|
||||
*
|
||||
* @example
|
||||
* var res = observable.groupBy(function (x) { return x.id; });
|
||||
* 2 - observable.groupBy(function (x) { return x.id; }), function (x) { return x.name; });
|
||||
* 3 - observable.groupBy(function (x) { return x.id; }), function (x) { return x.name; }, function (x) { return x.toString(); });
|
||||
* @param {Function} keySelector A function to extract the key for each element.
|
||||
* @param {Function} [elementSelector] A function to map each source element to an element in an observable group.
|
||||
* @returns {Observable} A sequence of observable groups, each of which corresponds to a unique key value, containing all elements that share that same key value.
|
||||
*/
|
||||
groupBy<TKey, TElement>(keySelector: (value: T) => TKey, elementSelector: (value: T) => TElement, keySerializer?: (key: TKey) => string): Observable<GroupedObservable<TKey, TElement>>;
|
||||
}
|
||||
}
|
41
node_modules/rx/ts/core/linq/observable/groupbyuntil.ts
generated
vendored
Normal file
41
node_modules/rx/ts/core/linq/observable/groupbyuntil.ts
generated
vendored
Normal file
@ -0,0 +1,41 @@
|
||||
/// <reference path="../../observable.ts" />
|
||||
/// <reference path="../groupedobservable.ts" />
|
||||
module Rx {
|
||||
export interface Observable<T> {
|
||||
/**
|
||||
* Groups the elements of an observable sequence according to a specified key selector function.
|
||||
* A duration selector function is used to control the lifetime of groups. When a group expires, it receives an OnCompleted notification. When a new element with the same
|
||||
* key value as a reclaimed group occurs, the group will be reborn with a new lifetime request.
|
||||
*
|
||||
* @example
|
||||
* var res = observable.groupByUntil(function (x) { return x.id; }, null, function () { return Rx.Observable.never(); });
|
||||
* 2 - observable.groupBy(function (x) { return x.id; }), function (x) { return x.name; }, function () { return Rx.Observable.never(); });
|
||||
* 3 - observable.groupBy(function (x) { return x.id; }), function (x) { return x.name; }, function () { return Rx.Observable.never(); }, function (x) { return x.toString(); });
|
||||
* @param {Function} keySelector A function to extract the key for each element.
|
||||
* @param {Function} durationSelector A function to signal the expiration of a group.
|
||||
* @returns {Observable}
|
||||
* A sequence of observable groups, each of which corresponds to a unique key value, containing all elements that share that same key value.
|
||||
* If a group's lifetime expires, a new group with the same key value can be created once an element with such a key value is encoutered.
|
||||
*
|
||||
*/
|
||||
groupByUntil<TKey, TDuration>(keySelector: (value: T) => TKey, skipElementSelector: boolean, durationSelector: (group: GroupedObservable<TKey, T>) => Observable<TDuration>, keySerializer?: (key: TKey) => string): Observable<GroupedObservable<TKey, T>>;
|
||||
|
||||
/**
|
||||
* Groups the elements of an observable sequence according to a specified key selector function.
|
||||
* A duration selector function is used to control the lifetime of groups. When a group expires, it receives an OnCompleted notification. When a new element with the same
|
||||
* key value as a reclaimed group occurs, the group will be reborn with a new lifetime request.
|
||||
*
|
||||
* @example
|
||||
* var res = observable.groupByUntil(function (x) { return x.id; }, null, function () { return Rx.Observable.never(); });
|
||||
* 2 - observable.groupBy(function (x) { return x.id; }), function (x) { return x.name; }, function () { return Rx.Observable.never(); });
|
||||
* 3 - observable.groupBy(function (x) { return x.id; }), function (x) { return x.name; }, function () { return Rx.Observable.never(); }, function (x) { return x.toString(); });
|
||||
* @param {Function} keySelector A function to extract the key for each element.
|
||||
* @param {Function} durationSelector A function to signal the expiration of a group.
|
||||
* @returns {Observable}
|
||||
* A sequence of observable groups, each of which corresponds to a unique key value, containing all elements that share that same key value.
|
||||
* If a group's lifetime expires, a new group with the same key value can be created once an element with such a key value is encoutered.
|
||||
*
|
||||
*/
|
||||
groupByUntil<TKey, TElement, TDuration>(keySelector: (value: T) => TKey, elementSelector: (value: T) => TElement, durationSelector: (group: GroupedObservable<TKey, TElement>) => Observable<TDuration>, keySerializer?: (key: TKey) => string): Observable<GroupedObservable<TKey, TElement>>;
|
||||
}
|
||||
}
|
19
node_modules/rx/ts/core/linq/observable/groupjoin.ts
generated
vendored
Normal file
19
node_modules/rx/ts/core/linq/observable/groupjoin.ts
generated
vendored
Normal file
@ -0,0 +1,19 @@
|
||||
/// <reference path="./groupbyuntil.ts" />
|
||||
module Rx {
|
||||
export interface Observable<T> {
|
||||
/**
|
||||
* Correlates the elements of two sequences based on overlapping durations, and groups the results.
|
||||
*
|
||||
* @param {Observable} right The right observable sequence to join elements for.
|
||||
* @param {Function} leftDurationSelector A function to select the duration (expressed as an observable sequence) of each element of the left observable sequence, used to determine overlap.
|
||||
* @param {Function} rightDurationSelector A function to select the duration (expressed as an observable sequence) of each element of the right observable sequence, used to determine overlap.
|
||||
* @param {Function} resultSelector A function invoked to compute a result element for any element of the left sequence with overlapping elements from the right observable sequence. The first parameter passed to the function is an element of the left sequence. The second parameter passed to the function is an observable sequence with elements from the right sequence that overlap with the left sequence's element.
|
||||
* @returns {Observable} An observable sequence that contains result elements computed from source elements that have an overlapping duration.
|
||||
*/
|
||||
groupJoin<TRight, TDurationLeft, TDurationRight, TResult>(
|
||||
right: Observable<TRight>,
|
||||
leftDurationSelector: (leftItem: T) => Observable<TDurationLeft>,
|
||||
rightDurationSelector: (rightItem: TRight) => Observable<TDurationRight>,
|
||||
resultSelector: (leftItem: T, rightItem: Observable<TRight>) => TResult): Observable<TResult>;
|
||||
}
|
||||
}
|
27
node_modules/rx/ts/core/linq/observable/if.ts
generated
vendored
Normal file
27
node_modules/rx/ts/core/linq/observable/if.ts
generated
vendored
Normal file
@ -0,0 +1,27 @@
|
||||
/// <reference path="../../observable.ts" />
|
||||
/// <reference path="../../concurrency/scheduler.ts" />
|
||||
module Rx {
|
||||
export interface ObservableStatic {
|
||||
/**
|
||||
* Determines whether an observable collection contains values.
|
||||
*
|
||||
* @example
|
||||
* 1 - res = Rx.Observable.if(condition, obs1);
|
||||
* 2 - res = Rx.Observable.if(condition, obs1, obs2);
|
||||
* 3 - res = Rx.Observable.if(condition, obs1, scheduler);
|
||||
* @param {Function} condition The condition which determines if the thenSource or elseSource will be run.
|
||||
* @param {Observable} thenSource The observable sequence or Promise that will be run if the condition function returns true.
|
||||
* @param {Observable} [elseSource] The observable sequence or Promise that will be run if the condition function returns false. If this is not provided, it defaults to Rx.Observabe.Empty with the specified scheduler.
|
||||
* @returns {Observable} An observable sequence which is either the thenSource or elseSource.
|
||||
*/
|
||||
if<T>(condition: () => boolean, thenSource: ObservableOrPromise<T>, elseSourceOrScheduler?: ObservableOrPromise<T> | IScheduler): Observable<T>;
|
||||
}
|
||||
}
|
||||
|
||||
(function () {
|
||||
var o : Rx.Observable<string>;
|
||||
|
||||
Rx.Observable.if(() => false, o);
|
||||
Rx.Observable.if(() => false, o, o);
|
||||
Rx.Observable.if(() => false, o, Rx.Scheduler.async);
|
||||
})
|
15
node_modules/rx/ts/core/linq/observable/ignoreelements.ts
generated
vendored
Normal file
15
node_modules/rx/ts/core/linq/observable/ignoreelements.ts
generated
vendored
Normal file
@ -0,0 +1,15 @@
|
||||
/// <reference path="../../observable.ts" />
|
||||
module Rx {
|
||||
export interface Observable<T> {
|
||||
/**
|
||||
* Ignores all elements in an observable sequence leaving only the termination messages.
|
||||
* @returns {Observable} An empty observable sequence that signals termination, successful or exceptional, of the source sequence.
|
||||
*/
|
||||
ignoreElements(): Observable<T>;
|
||||
}
|
||||
}
|
||||
|
||||
(function () {
|
||||
var o : Rx.Observable<string>;
|
||||
o.ignoreElements();
|
||||
});
|
17
node_modules/rx/ts/core/linq/observable/includes.ts
generated
vendored
Normal file
17
node_modules/rx/ts/core/linq/observable/includes.ts
generated
vendored
Normal file
@ -0,0 +1,17 @@
|
||||
/// <reference path="../../observable.ts" />
|
||||
module Rx {
|
||||
export interface Observable<T> {
|
||||
/**
|
||||
* Determines whether an observable sequence includes a specified element with an optional equality comparer.
|
||||
* @param searchElement The value to locate in the source sequence.
|
||||
* @param {Number} [fromIndex] An equality comparer to compare elements.
|
||||
* @returns {Observable} An observable sequence containing a single element determining whether the source sequence includes an element that has the specified value from the given index.
|
||||
*/
|
||||
includes(value: T, comparer?: _Comparer<T, boolean>): Observable<boolean>;
|
||||
}
|
||||
}
|
||||
|
||||
(function () {
|
||||
var o : Rx.Observable<string>;
|
||||
var b : Rx.Observable<boolean> = o.includes('a');
|
||||
});
|
18
node_modules/rx/ts/core/linq/observable/indexof.ts
generated
vendored
Normal file
18
node_modules/rx/ts/core/linq/observable/indexof.ts
generated
vendored
Normal file
@ -0,0 +1,18 @@
|
||||
/// <reference path="../../observable.ts" />
|
||||
module Rx {
|
||||
export interface Observable<T> {
|
||||
/**
|
||||
* Returns the first index at which a given element can be found in the observable sequence, or -1 if it is not present.
|
||||
* @param {Any} searchElement Element to locate in the array.
|
||||
* @param {Number} [fromIndex] The index to start the search. If not specified, defaults to 0.
|
||||
* @returns {Observable} And observable sequence containing the first index at which a given element can be found in the observable sequence, or -1 if it is not present.
|
||||
*/
|
||||
indexOf(element: T, fromIndex?: number): Observable<number>;
|
||||
}
|
||||
}
|
||||
|
||||
(function () {
|
||||
var o : Rx.Observable<string>;
|
||||
var b : Rx.Observable<number> = o.indexOf('a');
|
||||
var b : Rx.Observable<number> = o.indexOf('a', 1);
|
||||
});
|
23
node_modules/rx/ts/core/linq/observable/interval.ts
generated
vendored
Normal file
23
node_modules/rx/ts/core/linq/observable/interval.ts
generated
vendored
Normal file
@ -0,0 +1,23 @@
|
||||
/// <reference path="../../observable.ts" />
|
||||
module Rx {
|
||||
export interface ObservableStatic {
|
||||
/**
|
||||
* Returns an observable sequence that produces a value after each period.
|
||||
*
|
||||
* @example
|
||||
* 1 - res = Rx.Observable.interval(1000);
|
||||
* 2 - res = Rx.Observable.interval(1000, Rx.Scheduler.timeout);
|
||||
*
|
||||
* @param {Number} period Period for producing the values in the resulting sequence (specified as an integer denoting milliseconds).
|
||||
* @param {Scheduler} [scheduler] Scheduler to run the timer on. If not specified, Rx.Scheduler.timeout is used.
|
||||
* @returns {Observable} An observable sequence that produces a value after each period.
|
||||
*/
|
||||
interval(period: number, scheduler?: IScheduler): Observable<number>;
|
||||
}
|
||||
}
|
||||
|
||||
(function () {
|
||||
var o : Rx.Observable<number>;
|
||||
o = Rx.Observable.interval(100);
|
||||
o = Rx.Observable.interval(100, Rx.Scheduler.async);
|
||||
});
|
15
node_modules/rx/ts/core/linq/observable/isempty.ts
generated
vendored
Normal file
15
node_modules/rx/ts/core/linq/observable/isempty.ts
generated
vendored
Normal file
@ -0,0 +1,15 @@
|
||||
/// <reference path="../../observable.ts" />
|
||||
module Rx {
|
||||
export interface Observable<T> {
|
||||
/**
|
||||
* Determines whether an observable sequence is empty.
|
||||
* @returns {Observable} An observable sequence containing a single element determining whether the source sequence is empty.
|
||||
*/
|
||||
isEmpty(): Observable<boolean>;
|
||||
}
|
||||
}
|
||||
|
||||
(function () {
|
||||
var o : Rx.Observable<number>;
|
||||
var b : Rx.Observable<boolean> = o.isEmpty();
|
||||
});
|
19
node_modules/rx/ts/core/linq/observable/join.ts
generated
vendored
Normal file
19
node_modules/rx/ts/core/linq/observable/join.ts
generated
vendored
Normal file
@ -0,0 +1,19 @@
|
||||
/// <reference path="../../observable.ts" />
|
||||
module Rx {
|
||||
export interface Observable<T> {
|
||||
/**
|
||||
* Correlates the elements of two sequences based on overlapping durations.
|
||||
*
|
||||
* @param {Observable} right The right observable sequence to join elements for.
|
||||
* @param {Function} leftDurationSelector A function to select the duration (expressed as an observable sequence) of each element of the left observable sequence, used to determine overlap.
|
||||
* @param {Function} rightDurationSelector A function to select the duration (expressed as an observable sequence) of each element of the right observable sequence, used to determine overlap.
|
||||
* @param {Function} resultSelector A function invoked to compute a result element for any two overlapping elements of the left and right observable sequences. The parameters passed to the function correspond with the elements from the left and right source sequences for which overlap occurs.
|
||||
* @returns {Observable} An observable sequence that contains result elements computed from source elements that have an overlapping duration.
|
||||
*/
|
||||
join<TRight, TDurationLeft, TDurationRight, TResult>(
|
||||
right: Observable<TRight>,
|
||||
leftDurationSelector: (leftItem: T) => Observable<TDurationLeft>,
|
||||
rightDurationSelector: (rightItem: TRight) => Observable<TDurationRight>,
|
||||
resultSelector: (leftItem: T, rightItem: TRight) => TResult): Observable<TResult>;
|
||||
}
|
||||
}
|
16
node_modules/rx/ts/core/linq/observable/jortsort.ts
generated
vendored
Normal file
16
node_modules/rx/ts/core/linq/observable/jortsort.ts
generated
vendored
Normal file
@ -0,0 +1,16 @@
|
||||
/// <reference path="../../observable.ts" />
|
||||
module Rx {
|
||||
export interface Observable<T> {
|
||||
/**
|
||||
* jortSort checks if your inputs are sorted. Note that this is only for a sequence with an end.
|
||||
* See http://jort.technology/ for full details.
|
||||
* @returns {Observable} An observable which has a single value of true if sorted, else false.
|
||||
*/
|
||||
jortSort(): Observable<boolean>;
|
||||
}
|
||||
}
|
||||
|
||||
(function () {
|
||||
var o : Rx.Observable<number>;
|
||||
var b : Rx.Observable<boolean> = o.jortSort();
|
||||
});
|
16
node_modules/rx/ts/core/linq/observable/jortsortuntil.ts
generated
vendored
Normal file
16
node_modules/rx/ts/core/linq/observable/jortsortuntil.ts
generated
vendored
Normal file
@ -0,0 +1,16 @@
|
||||
/// <reference path="../../observable.ts" />
|
||||
module Rx {
|
||||
export interface Observable<T> {
|
||||
/**
|
||||
* jortSort checks if your inputs are sorted until another Observable sequence fires.
|
||||
* See http://jort.technology/ for full details.
|
||||
* @returns {Observable} An observable which has a single value of true if sorted, else false.
|
||||
*/
|
||||
jortSortUntil<TOther>(other: TOther): Observable<boolean>;
|
||||
}
|
||||
}
|
||||
|
||||
(function () {
|
||||
var o : Rx.Observable<number>;
|
||||
var b : Rx.Observable<boolean> = o.jortSortUntil(o);
|
||||
});
|
31
node_modules/rx/ts/core/linq/observable/just.ts
generated
vendored
Normal file
31
node_modules/rx/ts/core/linq/observable/just.ts
generated
vendored
Normal file
@ -0,0 +1,31 @@
|
||||
/// <reference path="../../observable.ts"/>
|
||||
/// <reference path="../../concurrency/scheduler.ts" />
|
||||
module Rx {
|
||||
export interface ObservableStatic {
|
||||
/**
|
||||
* Returns an observable sequence that contains a single element, using the specified scheduler to send out observer messages.
|
||||
* There is an alias called 'just' or browsers <IE9.
|
||||
* @param {Mixed} value Single element in the resulting observable sequence.
|
||||
* @param {Scheduler} scheduler Scheduler to send the single element on. If not specified, defaults to Scheduler.immediate.
|
||||
* @returns {Observable} An observable sequence containing the single specified element.
|
||||
*/
|
||||
return<T>(value: T, scheduler?: IScheduler): Observable<T>;
|
||||
/**
|
||||
* Returns an observable sequence that contains a single element, using the specified scheduler to send out observer messages.
|
||||
* There is an alias called 'just' or browsers <IE9.
|
||||
* @param {Mixed} value Single element in the resulting observable sequence.
|
||||
* @param {Scheduler} scheduler Scheduler to send the single element on. If not specified, defaults to Scheduler.immediate.
|
||||
* @returns {Observable} An observable sequence containing the single specified element.
|
||||
*/
|
||||
just<T>(value: T, scheduler?: IScheduler): Observable<T>;
|
||||
}
|
||||
}
|
||||
|
||||
(function () {
|
||||
var a : Rx.Observable<string>;
|
||||
var b : Rx.Observable<number>;
|
||||
b = Rx.Observable.return(1);
|
||||
a = Rx.Observable.return('a', Rx.Scheduler.async);
|
||||
b = Rx.Observable.just(1);
|
||||
a = Rx.Observable.just('a', Rx.Scheduler.async);
|
||||
});
|
16
node_modules/rx/ts/core/linq/observable/last.ts
generated
vendored
Normal file
16
node_modules/rx/ts/core/linq/observable/last.ts
generated
vendored
Normal file
@ -0,0 +1,16 @@
|
||||
/// <reference path="../../observable.ts" />
|
||||
module Rx {
|
||||
export interface Observable<T> {
|
||||
/**
|
||||
* Returns the last element of an observable sequence that satisfies the condition in the predicate if specified, else the last element.
|
||||
* @returns {Observable} Sequence containing the last element in the observable sequence that satisfies the condition in the predicate.
|
||||
*/
|
||||
last(predicate?: _Predicate<T>, thisArg?: any): Observable<T>;
|
||||
}
|
||||
}
|
||||
|
||||
(function () {
|
||||
var o : Rx.Observable<number>;
|
||||
o = o.last((x) => true);
|
||||
o = o.last((x) => true, {});
|
||||
});
|
19
node_modules/rx/ts/core/linq/observable/let.ts
generated
vendored
Normal file
19
node_modules/rx/ts/core/linq/observable/let.ts
generated
vendored
Normal file
@ -0,0 +1,19 @@
|
||||
/// <reference path="../../observable.ts" />
|
||||
module Rx {
|
||||
export interface Observable<T> {
|
||||
/**
|
||||
* Returns an observable sequence that is the result of invoking the selector on the source sequence, without sharing subscriptions.
|
||||
* This operator allows for a fluent style of writing queries that use the same sequence multiple times.
|
||||
*
|
||||
* @param {Function} selector Selector function which can use the source sequence as many times as needed, without sharing subscriptions to the source sequence.
|
||||
* @returns {Observable} An observable sequence that contains the elements of a sequence produced by multicasting the source sequence within a selector function.
|
||||
*/
|
||||
let<TResult>(selector: (source: Observable<T>) => Observable<TResult>): Observable<TResult>;
|
||||
}
|
||||
}
|
||||
|
||||
(function () {
|
||||
var a : Rx.Observable<string>;
|
||||
var b : Rx.Observable<number>;
|
||||
a.let(x => x.concat(Rx.Observable.just('a')));
|
||||
});
|
27
node_modules/rx/ts/core/linq/observable/manyselect.ts
generated
vendored
Normal file
27
node_modules/rx/ts/core/linq/observable/manyselect.ts
generated
vendored
Normal file
@ -0,0 +1,27 @@
|
||||
/// <reference path="../../observable.ts" />
|
||||
/// <reference path="../../concurrency/scheduler.ts" />
|
||||
module Rx {
|
||||
export interface Observable<T> {
|
||||
/**
|
||||
* Comonadic bind operator.
|
||||
* @param {Function} selector A transform function to apply to each element.
|
||||
* @param {Object} scheduler Scheduler used to execute the operation. If not specified, defaults to the ImmediateScheduler.
|
||||
* @returns {Observable} An observable sequence which results from the comonadic bind operation.
|
||||
*/
|
||||
manySelect<TResult>(selector: _Selector<Observable<T>, TResult>, scheduler?: IScheduler): Observable<TResult>;
|
||||
/**
|
||||
* Comonadic bind operator.
|
||||
* @param {Function} selector A transform function to apply to each element.
|
||||
* @param {Object} scheduler Scheduler used to execute the operation. If not specified, defaults to the ImmediateScheduler.
|
||||
* @returns {Observable} An observable sequence which results from the comonadic bind operation.
|
||||
*/
|
||||
extend<TResult>(selector: _Selector<Observable<T>, TResult>, scheduler?: IScheduler): Observable<TResult>;
|
||||
}
|
||||
}
|
||||
|
||||
(function() {
|
||||
var o: Rx.Observable<string>;
|
||||
|
||||
var oo: Rx.Observable<Rx.Observable<string>> = o.extend(x => x.first());
|
||||
var oo: Rx.Observable<Rx.Observable<string>> = o.manySelect(x => x.first());
|
||||
});
|
27
node_modules/rx/ts/core/linq/observable/map.ts
generated
vendored
Normal file
27
node_modules/rx/ts/core/linq/observable/map.ts
generated
vendored
Normal file
@ -0,0 +1,27 @@
|
||||
/// <reference path="../../observable.ts"/>
|
||||
module Rx {
|
||||
export interface Observable<T> {
|
||||
/**
|
||||
* Projects each element of an observable sequence into a new form by incorporating the element's index.
|
||||
* @param {Function} selector A transform function to apply to each source element; the second parameter of the function represents the index of the source element.
|
||||
* @param {Any} [thisArg] Object to use as this when executing callback.
|
||||
* @returns {Observable} An observable sequence whose elements are the result of invoking the transform function on each element of source.
|
||||
*/
|
||||
select<TResult>(selector: _Selector<T, TResult>, thisArg?: any): Observable<TResult>;
|
||||
/**
|
||||
* Projects each element of an observable sequence into a new form by incorporating the element's index.
|
||||
* @param {Function} selector A transform function to apply to each source element; the second parameter of the function represents the index of the source element.
|
||||
* @param {Any} [thisArg] Object to use as this when executing callback.
|
||||
* @returns {Observable} An observable sequence whose elements are the result of invoking the transform function on each element of source.
|
||||
*/
|
||||
map<TResult>(selector: _Selector<T, TResult>, thisArg?: any): Observable<TResult>;
|
||||
}
|
||||
}
|
||||
|
||||
(function () {
|
||||
var o : Rx.Observable<boolean>;
|
||||
o = o.map((x) => true);
|
||||
o = o.map((x) => true, {});
|
||||
o = o.select((x) => true);
|
||||
o = o.select((x) => true, {});
|
||||
});
|
15
node_modules/rx/ts/core/linq/observable/materialize.ts
generated
vendored
Normal file
15
node_modules/rx/ts/core/linq/observable/materialize.ts
generated
vendored
Normal file
@ -0,0 +1,15 @@
|
||||
/// <reference path="../../observable.ts" />
|
||||
module Rx {
|
||||
export interface Observable<T> {
|
||||
/**
|
||||
* Materializes the implicit notifications of an observable sequence as explicit notification values.
|
||||
* @returns {Observable} An observable sequence containing the materialized notification values from the source sequence.
|
||||
*/
|
||||
materialize(): Observable<T>;
|
||||
}
|
||||
}
|
||||
|
||||
(function () {
|
||||
var o : Rx.Observable<boolean>;
|
||||
o = o.materialize();
|
||||
});
|
21
node_modules/rx/ts/core/linq/observable/max.ts
generated
vendored
Normal file
21
node_modules/rx/ts/core/linq/observable/max.ts
generated
vendored
Normal file
@ -0,0 +1,21 @@
|
||||
/// <reference path="../../observable.ts" />
|
||||
module Rx {
|
||||
export interface Observable<T> {
|
||||
/**
|
||||
* Returns the maximum value in an observable sequence according to the specified comparer.
|
||||
* @example
|
||||
* var res = source.max();
|
||||
* var res = source.max(function (x, y) { return x.value - y.value; });
|
||||
* @param {Function} [comparer] Comparer used to compare elements.
|
||||
* @returns {Observable} An observable sequence containing a single element with the maximum element in the source sequence.
|
||||
*/
|
||||
max(comparer?: _Comparer<T, number>): Observable<number>;
|
||||
}
|
||||
}
|
||||
|
||||
(function () {
|
||||
var o : Rx.Observable<number>;
|
||||
var a : Rx.Observable<string>;
|
||||
o = o.max();
|
||||
o = a.max((x, y) => x.length - y.length);
|
||||
});
|
32
node_modules/rx/ts/core/linq/observable/maxby.ts
generated
vendored
Normal file
32
node_modules/rx/ts/core/linq/observable/maxby.ts
generated
vendored
Normal file
@ -0,0 +1,32 @@
|
||||
/// <reference path="../../observable.ts" />
|
||||
module Rx {
|
||||
export interface Observable<T> {
|
||||
/**
|
||||
* Returns the elements in an observable sequence with the maximum key value according to the specified comparer.
|
||||
* @example
|
||||
* var res = source.maxBy(function (x) { return x.value; });
|
||||
* var res = source.maxBy(function (x) { return x.value; }, function (x, y) { return x - y;; });
|
||||
* @param {Function} keySelector Key selector function.
|
||||
* @param {Function} [comparer] Comparer used to compare key values.
|
||||
* @returns {Observable} An observable sequence containing a list of zero or more elements that have a maximum key value.
|
||||
*/
|
||||
maxBy<TKey>(keySelector: (item: T) => TKey, comparer: _Comparer<TKey, number>): Observable<T>;
|
||||
/**
|
||||
* Returns the elements in an observable sequence with the maximum key value according to the specified comparer.
|
||||
* @example
|
||||
* var res = source.maxBy(function (x) { return x.value; });
|
||||
* var res = source.maxBy(function (x) { return x.value; }, function (x, y) { return x - y;; });
|
||||
* @param {Function} keySelector Key selector function.
|
||||
* @param {Function} [comparer] Comparer used to compare key values.
|
||||
* @returns {Observable} An observable sequence containing a list of zero or more elements that have a maximum key value.
|
||||
*/
|
||||
maxBy(keySelector: (item: T) => number): Observable<T>;
|
||||
}
|
||||
}
|
||||
|
||||
(function () {
|
||||
var o : Rx.Observable<{value:number}>;
|
||||
var a : Rx.Observable<{value: string}>;
|
||||
o = o.maxBy(x => x.value);
|
||||
a = a.maxBy(x => x.value, (x, y) => x.length - y.length);
|
||||
});
|
40
node_modules/rx/ts/core/linq/observable/merge.ts
generated
vendored
Normal file
40
node_modules/rx/ts/core/linq/observable/merge.ts
generated
vendored
Normal file
@ -0,0 +1,40 @@
|
||||
/// <reference path="../../observable.ts" />
|
||||
/// <reference path="../../concurrency/scheduler.ts" />
|
||||
module Rx {
|
||||
export interface ObservableStatic {
|
||||
/**
|
||||
* Merges all the observable sequences into a single observable sequence.
|
||||
* The scheduler is optional and if not specified, the immediate scheduler is used.
|
||||
* @returns {Observable} The observable sequence that merges the elements of the observable sequences.
|
||||
*/
|
||||
merge<T>(...sources: ObservableOrPromise<T>[]): Observable<T>;
|
||||
/**
|
||||
* Merges all the observable sequences into a single observable sequence.
|
||||
* The scheduler is optional and if not specified, the immediate scheduler is used.
|
||||
* @returns {Observable} The observable sequence that merges the elements of the observable sequences.
|
||||
*/
|
||||
merge<T>(sources: ObservableOrPromise<T>[]): Observable<T>;
|
||||
/**
|
||||
* Merges all the observable sequences into a single observable sequence.
|
||||
* The scheduler is optional and if not specified, the immediate scheduler is used.
|
||||
* @returns {Observable} The observable sequence that merges the elements of the observable sequences.
|
||||
*/
|
||||
merge<T>(scheduler: IScheduler, ...sources: ObservableOrPromise<T>[]): Observable<T>;
|
||||
/**
|
||||
* Merges all the observable sequences into a single observable sequence.
|
||||
* The scheduler is optional and if not specified, the immediate scheduler is used.
|
||||
* @returns {Observable} The observable sequence that merges the elements of the observable sequences.
|
||||
*/
|
||||
merge<T>(scheduler: IScheduler, sources: ObservableOrPromise<T>[]): Observable<T>;
|
||||
}
|
||||
}
|
||||
|
||||
(function() {
|
||||
var o: Rx.Observable<string>;
|
||||
var p: Rx.Promise<string>;
|
||||
|
||||
o = Rx.Observable.merge(o, p, o, p);
|
||||
o = Rx.Observable.merge([o, p, o, p]);
|
||||
o = Rx.Observable.merge(Rx.Scheduler.async, o, p, o, p);
|
||||
o = Rx.Observable.merge(Rx.Scheduler.async, [o, p, o, p]);
|
||||
});
|
17
node_modules/rx/ts/core/linq/observable/mergeall.ts
generated
vendored
Normal file
17
node_modules/rx/ts/core/linq/observable/mergeall.ts
generated
vendored
Normal file
@ -0,0 +1,17 @@
|
||||
/// <reference path="../../observable.ts" />
|
||||
module Rx {
|
||||
export interface Observable<T> {
|
||||
/**
|
||||
* Merges an observable sequence of observable sequences into an observable sequence.
|
||||
* @returns {Observable} The observable sequence that merges the elements of the inner sequences.
|
||||
*/
|
||||
mergeAll(): T;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
(function() {
|
||||
var o: Rx.Observable<Rx.Observable<string>>;
|
||||
|
||||
var oo : Rx.Observable<string> = o.mergeAll();
|
||||
});
|
37
node_modules/rx/ts/core/linq/observable/mergeconcat.ts
generated
vendored
Normal file
37
node_modules/rx/ts/core/linq/observable/mergeconcat.ts
generated
vendored
Normal file
@ -0,0 +1,37 @@
|
||||
/// <reference path="../../observable.ts" />
|
||||
module Rx {
|
||||
export interface Observable<T> {
|
||||
/**
|
||||
* Merges an observable sequence of observable sequences into an observable sequence, limiting the number of concurrent subscriptions to inner sequences.
|
||||
* Or merges two observable sequences into a single observable sequence.
|
||||
*
|
||||
* @example
|
||||
* 1 - merged = sources.merge(1);
|
||||
* 2 - merged = source.merge(otherSource);
|
||||
* @param {Mixed} [maxConcurrentOrOther] Maximum number of inner observable sequences being subscribed to concurrently or the second observable sequence.
|
||||
* @returns {Observable} The observable sequence that merges the elements of the inner sequences.
|
||||
*/
|
||||
merge(maxConcurrent: number): T;
|
||||
/**
|
||||
* Merges an observable sequence of observable sequences into an observable sequence, limiting the number of concurrent subscriptions to inner sequences.
|
||||
* Or merges two observable sequences into a single observable sequence.
|
||||
*
|
||||
* @example
|
||||
* 1 - merged = sources.merge(1);
|
||||
* 2 - merged = source.merge(otherSource);
|
||||
* @param {Mixed} [maxConcurrentOrOther] Maximum number of inner observable sequences being subscribed to concurrently or the second observable sequence.
|
||||
* @returns {Observable} The observable sequence that merges the elements of the inner sequences.
|
||||
*/
|
||||
merge(other: ObservableOrPromise<T>): Observable<T>;
|
||||
}
|
||||
}
|
||||
|
||||
(function() {
|
||||
var o: Rx.Observable<string>;
|
||||
var oo: Rx.Observable<Rx.Observable<string>>;
|
||||
var p: Rx.Promise<string>;
|
||||
|
||||
o = oo.merge(1);
|
||||
o = o.merge(p);
|
||||
o = o.merge(o);
|
||||
});
|
37
node_modules/rx/ts/core/linq/observable/mergedelayerror.ts
generated
vendored
Normal file
37
node_modules/rx/ts/core/linq/observable/mergedelayerror.ts
generated
vendored
Normal file
@ -0,0 +1,37 @@
|
||||
/// <reference path="../../observable.ts" />
|
||||
module Rx {
|
||||
export interface ObservableStatic {
|
||||
/**
|
||||
* Flattens an Observable that emits Observables into one Observable, in a way that allows an Observer to
|
||||
* receive all successfully emitted items from all of the source Observables without being interrupted by
|
||||
* an error notification from one of them.
|
||||
*
|
||||
* This behaves like Observable.prototype.mergeAll except that if any of the merged Observables notify of an
|
||||
* error via the Observer's onError, mergeDelayError will refrain from propagating that
|
||||
* error notification until all of the merged Observables have finished emitting items.
|
||||
* @param {Array | Arguments} args Arguments or an array to merge.
|
||||
* @returns {Observable} an Observable that emits all of the items emitted by the Observables emitted by the Observable
|
||||
*/
|
||||
mergeDelayError<T>(...sources: ObservableOrPromise<T>[]): Observable<T>;
|
||||
/**
|
||||
* Flattens an Observable that emits Observables into one Observable, in a way that allows an Observer to
|
||||
* receive all successfully emitted items from all of the source Observables without being interrupted by
|
||||
* an error notification from one of them.
|
||||
*
|
||||
* This behaves like Observable.prototype.mergeAll except that if any of the merged Observables notify of an
|
||||
* error via the Observer's onError, mergeDelayError will refrain from propagating that
|
||||
* error notification until all of the merged Observables have finished emitting items.
|
||||
* @param {Array | Arguments} args Arguments or an array to merge.
|
||||
* @returns {Observable} an Observable that emits all of the items emitted by the Observables emitted by the Observable
|
||||
*/
|
||||
mergeDelayError<T>(sources: ObservableOrPromise<T>[]): Observable<T>;
|
||||
}
|
||||
}
|
||||
|
||||
(function() {
|
||||
var o: Rx.Observable<string>;
|
||||
var p: Rx.Promise<string>;
|
||||
|
||||
Rx.Observable.mergeDelayError(o, p, o, p);
|
||||
Rx.Observable.mergeDelayError([o, p, o, p]);
|
||||
})
|
21
node_modules/rx/ts/core/linq/observable/min.ts
generated
vendored
Normal file
21
node_modules/rx/ts/core/linq/observable/min.ts
generated
vendored
Normal file
@ -0,0 +1,21 @@
|
||||
/// <reference path="../../observable.ts" />
|
||||
module Rx {
|
||||
export interface Observable<T> {
|
||||
/**
|
||||
* Returns the minimum element in an observable sequence according to the optional comparer else a default greater than less than check.
|
||||
* @example
|
||||
* var res = source.min();
|
||||
* var res = source.min(function (x, y) { return x.value - y.value; });
|
||||
* @param {Function} [comparer] Comparer used to compare elements.
|
||||
* @returns {Observable} An observable sequence containing a single element with the minimum element in the source sequence.
|
||||
*/
|
||||
min(comparer?: _Comparer<T, number>): Observable<number>;
|
||||
}
|
||||
}
|
||||
|
||||
(function () {
|
||||
var o : Rx.Observable<number>;
|
||||
var a : Rx.Observable<string>;
|
||||
o = o.min();
|
||||
o = a.min((x, y) => x.length - y.length);
|
||||
});
|
32
node_modules/rx/ts/core/linq/observable/minby.ts
generated
vendored
Normal file
32
node_modules/rx/ts/core/linq/observable/minby.ts
generated
vendored
Normal file
@ -0,0 +1,32 @@
|
||||
/// <reference path="../../observable.ts" />
|
||||
module Rx {
|
||||
export interface Observable<T> {
|
||||
/**
|
||||
* Returns the elements in an observable sequence with the minimum key value according to the specified comparer.
|
||||
* @example
|
||||
* var res = source.minBy(function (x) { return x.value; });
|
||||
* var res = source.minBy(function (x) { return x.value; }, function (x, y) { return x - y; });
|
||||
* @param {Function} keySelector Key selector function.
|
||||
* @param {Function} [comparer] Comparer used to compare key values.
|
||||
* @returns {Observable} An observable sequence containing a list of zero or more elements that have a minimum key value.
|
||||
*/
|
||||
minBy<TKey>(keySelector: (item: T) => TKey, comparer: _Comparer<TKey, number>): Observable<T>;
|
||||
/**
|
||||
* Returns the elements in an observable sequence with the minimum key value according to the specified comparer.
|
||||
* @example
|
||||
* var res = source.minBy(function (x) { return x.value; });
|
||||
* var res = source.minBy(function (x) { return x.value; }, function (x, y) { return x - y; });
|
||||
* @param {Function} keySelector Key selector function.
|
||||
* @param {Function} [comparer] Comparer used to compare key values.
|
||||
* @returns {Observable} An observable sequence containing a list of zero or more elements that have a minimum key value.
|
||||
*/
|
||||
minBy(keySelector: (item: T) => number): Observable<T>;
|
||||
}
|
||||
}
|
||||
|
||||
(function () {
|
||||
var o : Rx.Observable<{value:number}>;
|
||||
var a : Rx.Observable<{value: string}>;
|
||||
o = o.minBy(x => x.value);
|
||||
a = a.minBy(x => x.value, (x, y) => x.length - y.length);
|
||||
});
|
58
node_modules/rx/ts/core/linq/observable/multicast.ts
generated
vendored
Normal file
58
node_modules/rx/ts/core/linq/observable/multicast.ts
generated
vendored
Normal file
@ -0,0 +1,58 @@
|
||||
/// <reference path="../../subjects/subject.ts" />
|
||||
/// <reference path="../connectableobservable.ts" />
|
||||
module Rx {
|
||||
export interface Observable<T> {
|
||||
/**
|
||||
* Multicasts the source sequence notifications through an instantiated subject into all uses of the sequence within a selector function. Each
|
||||
* subscription to the resulting sequence causes a separate multicast invocation, exposing the sequence resulting from the selector function's
|
||||
* invocation. For specializations with fixed subject types, see Publish, PublishLast, and Replay.
|
||||
*
|
||||
* @example
|
||||
* 1 - res = source.multicast(observable);
|
||||
* 2 - res = source.multicast(function () { return new Subject(); }, function (x) { return x; });
|
||||
*
|
||||
* @param {Function|Subject} subjectOrSubjectSelector
|
||||
* Factory function to create an intermediate subject through which the source sequence's elements will be multicast to the selector function.
|
||||
* Or:
|
||||
* Subject to push source elements into.
|
||||
*
|
||||
* @param {Function} [selector] Optional selector function which can use the multicasted source sequence subject to the policies enforced by the created subject. Specified only if <paramref name="subjectOrSubjectSelector" is a factory function.
|
||||
* @returns {Observable} An observable sequence that contains the elements of a sequence produced by multicasting the source sequence within a selector function.
|
||||
*/
|
||||
multicast(subject: ISubject<T> | (() => ISubject<T>)): ConnectableObservable<T>;
|
||||
/**
|
||||
* Multicasts the source sequence notifications through an instantiated subject into all uses of the sequence within a selector function. Each
|
||||
* subscription to the resulting sequence causes a separate multicast invocation, exposing the sequence resulting from the selector function's
|
||||
* invocation. For specializations with fixed subject types, see Publish, PublishLast, and Replay.
|
||||
*
|
||||
* @example
|
||||
* 1 - res = source.multicast(observable);
|
||||
* 2 - res = source.multicast(function () { return new Subject(); }, function (x) { return x; });
|
||||
*
|
||||
* @param {Function|Subject} subjectOrSubjectSelector
|
||||
* Factory function to create an intermediate subject through which the source sequence's elements will be multicast to the selector function.
|
||||
* Or:
|
||||
* Subject to push source elements into.
|
||||
*
|
||||
* @param {Function} [selector] Optional selector function which can use the multicasted source sequence subject to the policies enforced by the created subject. Specified only if <paramref name="subjectOrSubjectSelector" is a factory function.
|
||||
* @returns {Observable} An observable sequence that contains the elements of a sequence produced by multicasting the source sequence within a selector function.
|
||||
*/
|
||||
multicast<TResult>(subjectSelector: ISubject<T> | (() => ISubject<T>), selector: (source: ConnectableObservable<T>) => Observable<T>): Observable<T>;
|
||||
}
|
||||
}
|
||||
|
||||
(function() {
|
||||
var o: Rx.Observable<number>;
|
||||
var oc: Rx.ConnectableObservable<number>;
|
||||
var is: Rx.ISubject<number>;
|
||||
var s: Rx.Subject<number>;
|
||||
var a: Rx.Observable<string>;
|
||||
|
||||
oc = o.multicast(is);
|
||||
oc = o.multicast(s);
|
||||
oc = o.multicast(() => s);
|
||||
|
||||
o = o.multicast(is, a => a.asObservable());
|
||||
o = o.multicast(s, a => a.asObservable());
|
||||
o = o.multicast(() => s, a => a.asObservable());
|
||||
});
|
16
node_modules/rx/ts/core/linq/observable/never.ts
generated
vendored
Normal file
16
node_modules/rx/ts/core/linq/observable/never.ts
generated
vendored
Normal file
@ -0,0 +1,16 @@
|
||||
/// <reference path="../../observable.ts" />
|
||||
/// <reference path="../../concurrency/scheduler.ts" />
|
||||
module Rx {
|
||||
export interface ObservableStatic {
|
||||
/**
|
||||
* Returns a non-terminating observable sequence, which can be used to denote an infinite duration (e.g. when using reactive joins).
|
||||
* @returns {Observable} An observable sequence whose observers will never get called.
|
||||
*/
|
||||
never<T>(): Observable<T>;
|
||||
}
|
||||
}
|
||||
|
||||
(function () {
|
||||
var o : Rx.Observable<string>;
|
||||
o = Rx.Observable.never<string>();
|
||||
});
|
21
node_modules/rx/ts/core/linq/observable/observeon.ts
generated
vendored
Normal file
21
node_modules/rx/ts/core/linq/observable/observeon.ts
generated
vendored
Normal file
@ -0,0 +1,21 @@
|
||||
/// <reference path="../../observable.ts"/>
|
||||
/// <reference path="../../concurrency/scheduler.ts" />
|
||||
module Rx {
|
||||
export interface Observable<T> {
|
||||
/**
|
||||
* Wraps the source sequence in order to run its observer callbacks on the specified scheduler.
|
||||
*
|
||||
* This only invokes observer callbacks on a scheduler. In case the subscription and/or unsubscription actions have side-effects
|
||||
* that require to be run on a scheduler, use subscribeOn.
|
||||
*
|
||||
* @param {Scheduler} scheduler Scheduler to notify observers on.
|
||||
* @returns {Observable} The source sequence whose observations happen on the specified scheduler.
|
||||
*/
|
||||
observeOn(scheduler: IScheduler): Observable<T>;
|
||||
}
|
||||
}
|
||||
|
||||
(function () {
|
||||
var o : Rx.Observable<string>;
|
||||
o = o.observeOn(Rx.Scheduler.async);
|
||||
});
|
24
node_modules/rx/ts/core/linq/observable/of.ts
generated
vendored
Normal file
24
node_modules/rx/ts/core/linq/observable/of.ts
generated
vendored
Normal file
@ -0,0 +1,24 @@
|
||||
/// <reference path="../../observable.ts" />
|
||||
/// <reference path="../../concurrency/scheduler.ts" />
|
||||
module Rx {
|
||||
export interface ObservableStatic {
|
||||
/**
|
||||
* This method creates a new Observable instance with a variable number of arguments, regardless of number or type of the arguments.
|
||||
* @returns {Observable} The observable sequence whose elements are pulled from the given arguments.
|
||||
*/
|
||||
of<T>(...values: T[]): Observable<T>;
|
||||
|
||||
/**
|
||||
* This method creates a new Observable instance with a variable number of arguments, regardless of number or type of the arguments.
|
||||
* @param {Scheduler} scheduler A scheduler to use for scheduling the arguments.
|
||||
* @returns {Observable} The observable sequence whose elements are pulled from the given arguments.
|
||||
*/
|
||||
ofWithScheduler<T>(scheduler?: IScheduler, ...values: T[]): Observable<T>;
|
||||
}
|
||||
}
|
||||
|
||||
(function() {
|
||||
var o: Rx.Observable<number>;
|
||||
o = Rx.Observable.of(1, 2, 3, 4, 5);
|
||||
o = Rx.Observable.ofWithScheduler(Rx.Scheduler.async, 1, 2, 3, 4, 5);
|
||||
});
|
26
node_modules/rx/ts/core/linq/observable/ofarraychanges.ts
generated
vendored
Normal file
26
node_modules/rx/ts/core/linq/observable/ofarraychanges.ts
generated
vendored
Normal file
@ -0,0 +1,26 @@
|
||||
/// <reference path="../../observable.ts" />
|
||||
module Rx {
|
||||
export interface ArrayObserveChange<T> {
|
||||
type: string;
|
||||
object: T[];
|
||||
name?: string;
|
||||
oldValue?: T;
|
||||
index?: number;
|
||||
removed?: T[];
|
||||
added?: number;
|
||||
}
|
||||
|
||||
export interface ObservableStatic {
|
||||
/**
|
||||
* Creates an Observable sequence from changes to an array using Array.observe.
|
||||
* @param {Array} array An array to observe changes.
|
||||
* @returns {Observable} An observable sequence containing changes to an array from Array.observe.
|
||||
*/
|
||||
ofArrayChanges<T>(obj: T[]): Observable<ArrayObserveChange<T>>;
|
||||
}
|
||||
}
|
||||
|
||||
(function () {
|
||||
var o : Rx.Observable<Rx.ArrayObserveChange<string>>;
|
||||
o = Rx.Observable.ofArrayChanges(<string[]>[]);
|
||||
});
|
23
node_modules/rx/ts/core/linq/observable/ofobjectchanges.ts
generated
vendored
Normal file
23
node_modules/rx/ts/core/linq/observable/ofobjectchanges.ts
generated
vendored
Normal file
@ -0,0 +1,23 @@
|
||||
/// <reference path="../../observable.ts" />
|
||||
module Rx {
|
||||
export interface ObjectObserveChange<T> {
|
||||
type: string;
|
||||
object: T;
|
||||
name: string;
|
||||
oldValue?: any;
|
||||
}
|
||||
|
||||
export interface ObservableStatic {
|
||||
/**
|
||||
* Creates an Observable sequence from changes to an object using Object.observe.
|
||||
* @param {Object} obj An object to observe changes.
|
||||
* @returns {Observable} An observable sequence containing changes to an object from Object.observe.
|
||||
*/
|
||||
ofObjectChanges<T>(obj: T): Observable<ObjectObserveChange<T>>;
|
||||
}
|
||||
}
|
||||
|
||||
(function () {
|
||||
var o : Rx.Observable<Rx.ObjectObserveChange<{}>>;
|
||||
o = Rx.Observable.ofObjectChanges({});
|
||||
});
|
30
node_modules/rx/ts/core/linq/observable/onerrorresumenext.ts
generated
vendored
Normal file
30
node_modules/rx/ts/core/linq/observable/onerrorresumenext.ts
generated
vendored
Normal file
@ -0,0 +1,30 @@
|
||||
/// <reference path="../../observable.ts" />
|
||||
module Rx {
|
||||
export interface ObservableStatic {
|
||||
/**
|
||||
* Continues an observable sequence that is terminated normally or by an exception with the next observable sequence.
|
||||
*
|
||||
* @example
|
||||
* 1 - res = Rx.Observable.onErrorResumeNext(xs, ys, zs);
|
||||
* 1 - res = Rx.Observable.onErrorResumeNext([xs, ys, zs]);
|
||||
* @returns {Observable} An observable sequence that concatenates the source sequences, even if a sequence terminates exceptionally.
|
||||
*/
|
||||
onErrorResumeNext<T>(...sources: ObservableOrPromise<T>[]): Observable<T>;
|
||||
/**
|
||||
* Continues an observable sequence that is terminated normally or by an exception with the next observable sequence.
|
||||
*
|
||||
* @example
|
||||
* 1 - res = Rx.Observable.onErrorResumeNext(xs, ys, zs);
|
||||
* 1 - res = Rx.Observable.onErrorResumeNext([xs, ys, zs]);
|
||||
* @returns {Observable} An observable sequence that concatenates the source sequences, even if a sequence terminates exceptionally.
|
||||
*/
|
||||
onErrorResumeNext<T>(sources: ObservableOrPromise<T>[]): Observable<T>;
|
||||
}
|
||||
}
|
||||
|
||||
(function() {
|
||||
var o: Rx.Observable<number>;
|
||||
var p: Rx.Promise<number>;
|
||||
o = Rx.Observable.onErrorResumeNext(o, p, o, p);
|
||||
o = Rx.Observable.onErrorResumeNext([o, p, o, p]);
|
||||
});
|
18
node_modules/rx/ts/core/linq/observable/onerrorresumenextproto.ts
generated
vendored
Normal file
18
node_modules/rx/ts/core/linq/observable/onerrorresumenextproto.ts
generated
vendored
Normal file
@ -0,0 +1,18 @@
|
||||
/// <reference path="../../observable.ts" />
|
||||
module Rx {
|
||||
export interface Observable<T> {
|
||||
/**
|
||||
* Continues an observable sequence that is terminated normally or by an exception with the next observable sequence.
|
||||
* @param {Observable} second Second observable sequence used to produce results after the first sequence terminates.
|
||||
* @returns {Observable} An observable sequence that concatenates the first and second sequence, even if the first sequence terminates exceptionally.
|
||||
*/
|
||||
onErrorResumeNext(second: ObservableOrPromise<T>): Observable<T>;
|
||||
}
|
||||
}
|
||||
|
||||
(function() {
|
||||
var o: Rx.Observable<number>;
|
||||
var p: Rx.Promise<number>;
|
||||
o = o.onErrorResumeNext(p);
|
||||
o = o.onErrorResumeNext(o);
|
||||
});
|
30
node_modules/rx/ts/core/linq/observable/pairs.ts
generated
vendored
Normal file
30
node_modules/rx/ts/core/linq/observable/pairs.ts
generated
vendored
Normal file
@ -0,0 +1,30 @@
|
||||
/// <reference path="../../observable.ts" />
|
||||
/// <reference path="../../concurrency/scheduler.ts" />
|
||||
module Rx {
|
||||
export interface ObservableStatic {
|
||||
/**
|
||||
* Convert an object into an observable sequence of [key, value] pairs.
|
||||
* @param {Object} obj The object to inspect.
|
||||
* @param {Scheduler} [scheduler] Scheduler to run the enumeration of the input sequence on.
|
||||
* @returns {Observable} An observable sequence of [key, value] pairs from the object.
|
||||
*/
|
||||
pairs<T>(obj: { [key: string]: T }, scheduler?: IScheduler): Observable<[string, T]>;
|
||||
/**
|
||||
* Convert an object into an observable sequence of [key, value] pairs.
|
||||
* @param {Object} obj The object to inspect.
|
||||
* @param {Scheduler} [scheduler] Scheduler to run the enumeration of the input sequence on.
|
||||
* @returns {Observable} An observable sequence of [key, value] pairs from the object.
|
||||
*/
|
||||
pairs<T>(obj: { [key: number]: T }, scheduler?: IScheduler): Observable<[number, T]>;
|
||||
}
|
||||
}
|
||||
|
||||
(function() {
|
||||
var n: Rx.Observable<[number, string]>;
|
||||
var s: Rx.Observable<[string, number]>;
|
||||
|
||||
s = Rx.Observable.pairs(<{ [key: string]: number }>{});
|
||||
s = Rx.Observable.pairs(<{ [key: string]: number }>{}, Rx.Scheduler.default);
|
||||
n = Rx.Observable.pairs(<{ [key: number]: string }>{});
|
||||
n = Rx.Observable.pairs(<{ [key: number]: string }>{}, Rx.Scheduler.default);
|
||||
});
|
20
node_modules/rx/ts/core/linq/observable/pairwise.ts
generated
vendored
Normal file
20
node_modules/rx/ts/core/linq/observable/pairwise.ts
generated
vendored
Normal file
@ -0,0 +1,20 @@
|
||||
/// <reference path="../../observable.ts" />
|
||||
module Rx {
|
||||
export interface Observable<T> {
|
||||
/**
|
||||
* Returns a new observable that triggers on the second and subsequent triggerings of the input observable.
|
||||
* The Nth triggering of the input observable passes the arguments from the N-1th and Nth triggering as a pair.
|
||||
* The argument passed to the N-1th triggering is held in hidden internal state until the Nth triggering occurs.
|
||||
* @returns {Observable} An observable that triggers on successive pairs of observations from the input observable as an array.
|
||||
*/
|
||||
pairwise(): Observable<[T, T]>;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
(function () {
|
||||
var o : Rx.Observable<number>;
|
||||
var r : Rx.Observable<[number, number]>;
|
||||
|
||||
r = o.pairwise();
|
||||
});
|
26
node_modules/rx/ts/core/linq/observable/partition.ts
generated
vendored
Normal file
26
node_modules/rx/ts/core/linq/observable/partition.ts
generated
vendored
Normal file
@ -0,0 +1,26 @@
|
||||
/// <reference path="../../observable.ts" />
|
||||
module Rx {
|
||||
export interface Observable<T> {
|
||||
/**
|
||||
* Returns two observables which partition the observations of the source by the given function.
|
||||
* The first will trigger observations for those values for which the predicate returns true.
|
||||
* The second will trigger observations for those values where the predicate returns false.
|
||||
* The predicate is executed once for each subscribed observer.
|
||||
* Both also propagate all error observations arising from the source and each completes
|
||||
* when the source completes.
|
||||
* @param {Function} predicate
|
||||
* The function to determine which output Observable will trigger a particular observation.
|
||||
* @returns {Array}
|
||||
* An array of observables. The first triggers when the predicate returns true,
|
||||
* and the second triggers when the predicate returns false.
|
||||
*/
|
||||
partition(predicate: _Predicate<T>, thisArg?: any): [Observable<T>, Observable<T>];
|
||||
}
|
||||
}
|
||||
|
||||
(function() {
|
||||
var o: Rx.Observable<number>;
|
||||
var r: [Rx.Observable<number>, Rx.Observable<number>];
|
||||
|
||||
r = o.partition(x => x % 2 === 0);
|
||||
});
|
12
node_modules/rx/ts/core/linq/observable/pipe.ts
generated
vendored
Normal file
12
node_modules/rx/ts/core/linq/observable/pipe.ts
generated
vendored
Normal file
@ -0,0 +1,12 @@
|
||||
/// <reference path="../../observable.ts" />
|
||||
module Rx {
|
||||
export interface Observable<T> {
|
||||
/**
|
||||
* Pipes the existing Observable sequence into a Node.js Stream.
|
||||
* @param {Stream} dest The destination Node.js stream.
|
||||
* @returns {Stream} The destination stream.
|
||||
*/
|
||||
pipe<TDest>(dest: TDest): TDest;
|
||||
// TODO: Add link to node.d.ts some where
|
||||
}
|
||||
}
|
19
node_modules/rx/ts/core/linq/observable/pluck.ts
generated
vendored
Normal file
19
node_modules/rx/ts/core/linq/observable/pluck.ts
generated
vendored
Normal file
@ -0,0 +1,19 @@
|
||||
/// <reference path="../../observable.ts" />
|
||||
module Rx {
|
||||
export interface Observable<T> {
|
||||
/**
|
||||
* Retrieves the value of a specified nested property from all elements in
|
||||
* the Observable sequence.
|
||||
* @param {Arguments} arguments The nested properties to pluck.
|
||||
* @returns {Observable} Returns a new Observable sequence of property values.
|
||||
*/
|
||||
pluck<TResult>(prop: string): Observable<TResult>;
|
||||
}
|
||||
}
|
||||
|
||||
(function() {
|
||||
var o: Rx.Observable<{}>;
|
||||
var n: Rx.Observable<number>;
|
||||
|
||||
n = o.pluck<number>('abc');
|
||||
});
|
40
node_modules/rx/ts/core/linq/observable/publish.ts
generated
vendored
Normal file
40
node_modules/rx/ts/core/linq/observable/publish.ts
generated
vendored
Normal file
@ -0,0 +1,40 @@
|
||||
/// <reference path="./multicast.ts" />
|
||||
module Rx {
|
||||
export interface Observable<T> {
|
||||
/**
|
||||
* Returns an observable sequence that is the result of invoking the selector on a connectable observable sequence that shares a single subscription to the underlying sequence.
|
||||
* This operator is a specialization of Multicast using a regular Subject.
|
||||
*
|
||||
* @example
|
||||
* var resres = source.publish();
|
||||
* var res = source.publish(function (x) { return x; });
|
||||
*
|
||||
* @param {Function} [selector] Selector function which can use the multicasted source sequence as many times as needed, without causing multiple subscriptions to the source sequence. Subscribers to the given source will receive all notifications of the source from the time of the subscription on.
|
||||
* @returns {Observable} An observable sequence that contains the elements of a sequence produced by multicasting the source sequence within a selector function.
|
||||
*/
|
||||
publish(): ConnectableObservable<T>;
|
||||
/**
|
||||
* Returns an observable sequence that is the result of invoking the selector on a connectable observable sequence that shares a single subscription to the underlying sequence.
|
||||
* This operator is a specialization of Multicast using a regular Subject.
|
||||
*
|
||||
* @example
|
||||
* var resres = source.publish();
|
||||
* var res = source.publish(function (x) { return x; });
|
||||
*
|
||||
* @param {Function} [selector] Selector function which can use the multicasted source sequence as many times as needed, without causing multiple subscriptions to the source sequence. Subscribers to the given source will receive all notifications of the source from the time of the subscription on.
|
||||
* @returns {Observable} An observable sequence that contains the elements of a sequence produced by multicasting the source sequence within a selector function.
|
||||
*/
|
||||
publish<TResult>(selector: (source: ConnectableObservable<T>) => Observable<TResult>): Observable<TResult>;
|
||||
}
|
||||
}
|
||||
|
||||
(function() {
|
||||
var o: Rx.Observable<number>;
|
||||
var oc: Rx.ConnectableObservable<number>;
|
||||
var is: Rx.ISubject<number>;
|
||||
var s: Rx.Subject<number>;
|
||||
var a: Rx.Observable<string>;
|
||||
|
||||
oc = o.publish();
|
||||
o = o.publish(a => a.asObservable());
|
||||
});
|
41
node_modules/rx/ts/core/linq/observable/publishlast.ts
generated
vendored
Normal file
41
node_modules/rx/ts/core/linq/observable/publishlast.ts
generated
vendored
Normal file
@ -0,0 +1,41 @@
|
||||
/// <reference path="./multicast.ts" />
|
||||
module Rx {
|
||||
export interface Observable<T> {
|
||||
/**
|
||||
* Returns an observable sequence that is the result of invoking the selector on a connectable observable sequence that shares a single subscription to the underlying sequence containing only the last notification.
|
||||
* This operator is a specialization of Multicast using a AsyncSubject.
|
||||
*
|
||||
* @example
|
||||
* var res = source.publishLast();
|
||||
* var res = source.publishLast(function (x) { return x; });
|
||||
*
|
||||
* @param selector [Optional] Selector function which can use the multicasted source sequence as many times as needed, without causing multiple subscriptions to the source sequence. Subscribers to the given source will only receive the last notification of the source.
|
||||
* @returns {Observable} An observable sequence that contains the elements of a sequence produced by multicasting the source sequence within a selector function.
|
||||
*/
|
||||
publishLast(): ConnectableObservable<T>;
|
||||
/**
|
||||
* Returns an observable sequence that is the result of invoking the selector on a connectable observable sequence that shares a single subscription to the underlying sequence containing only the last notification.
|
||||
* This operator is a specialization of Multicast using a AsyncSubject.
|
||||
*
|
||||
* @example
|
||||
* var res = source.publishLast();
|
||||
* var res = source.publishLast(function (x) { return x; });
|
||||
*
|
||||
* @param selector [Optional] Selector function which can use the multicasted source sequence as many times as needed, without causing multiple subscriptions to the source sequence. Subscribers to the given source will only receive the last notification of the source.
|
||||
* @returns {Observable} An observable sequence that contains the elements of a sequence produced by multicasting the source sequence within a selector function.
|
||||
*/
|
||||
publishLast<TResult>(selector: (source: ConnectableObservable<T>) => Observable<TResult>): Observable<TResult>;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
(function() {
|
||||
var o: Rx.Observable<number>;
|
||||
var oc: Rx.ConnectableObservable<number>;
|
||||
var is: Rx.ISubject<number>;
|
||||
var s: Rx.Subject<number>;
|
||||
var a: Rx.Observable<string>;
|
||||
|
||||
oc = o.publishLast();
|
||||
o = o.publishLast(a => a.asObservable());
|
||||
});
|
42
node_modules/rx/ts/core/linq/observable/publishvalue.ts
generated
vendored
Normal file
42
node_modules/rx/ts/core/linq/observable/publishvalue.ts
generated
vendored
Normal file
@ -0,0 +1,42 @@
|
||||
/// <reference path="./multicast.ts" />
|
||||
module Rx {
|
||||
export interface Observable<T> {
|
||||
/**
|
||||
* Returns an observable sequence that is the result of invoking the selector on a connectable observable sequence that shares a single subscription to the underlying sequence and starts with initialValue.
|
||||
* This operator is a specialization of Multicast using a BehaviorSubject.
|
||||
*
|
||||
* @example
|
||||
* var res = source.publishValue(42);
|
||||
* var res = source.publishValue(function (x) { return x.select(function (y) { return y * y; }) }, 42);
|
||||
*
|
||||
* @param {Function} [selector] Optional selector function which can use the multicasted source sequence as many times as needed, without causing multiple subscriptions to the source sequence. Subscribers to the given source will receive immediately receive the initial value, followed by all notifications of the source from the time of the subscription on.
|
||||
* @param {Mixed} initialValue Initial value received by observers upon subscription.
|
||||
* @returns {Observable} An observable sequence that contains the elements of a sequence produced by multicasting the source sequence within a selector function.
|
||||
*/
|
||||
publishValue(initialValue: T): ConnectableObservable<T>;
|
||||
/**
|
||||
* Returns an observable sequence that is the result of invoking the selector on a connectable observable sequence that shares a single subscription to the underlying sequence and starts with initialValue.
|
||||
* This operator is a specialization of Multicast using a BehaviorSubject.
|
||||
*
|
||||
* @example
|
||||
* var res = source.publishValue(42);
|
||||
* var res = source.publishValue(function (x) { return x.select(function (y) { return y * y; }) }, 42);
|
||||
*
|
||||
* @param {Function} [selector] Optional selector function which can use the multicasted source sequence as many times as needed, without causing multiple subscriptions to the source sequence. Subscribers to the given source will receive immediately receive the initial value, followed by all notifications of the source from the time of the subscription on.
|
||||
* @param {Mixed} initialValue Initial value received by observers upon subscription.
|
||||
* @returns {Observable} An observable sequence that contains the elements of a sequence produced by multicasting the source sequence within a selector function.
|
||||
*/
|
||||
publishValue<TResult>(selector: (source: ConnectableObservable<T>) => Observable<TResult>, initialValue: T): Observable<TResult>;
|
||||
}
|
||||
}
|
||||
|
||||
(function() {
|
||||
var o: Rx.Observable<number>;
|
||||
var oc: Rx.ConnectableObservable<number>;
|
||||
var is: Rx.ISubject<number>;
|
||||
var s: Rx.Subject<number>;
|
||||
var a: Rx.Observable<string>;
|
||||
|
||||
oc = o.publishValue(12);
|
||||
o = o.publishValue(a => a.asObservable(), 12);
|
||||
});
|
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user