/// module Rx { export interface Observable { /** * Applies an accumulator function over an observable sequence and returns each intermediate result. The optional seed value is used as the initial accumulator value. * For aggregation behavior with no intermediate results, see Observable.aggregate. * @example * var res = source.scan(function (acc, x) { return acc + x; }); * var res = source.scan(function (acc, x) { return acc + x; }, 0); * @param {Function} accumulator An accumulator function to be invoked on each element. * @param {Mixed} [seed] The initial accumulator value. * @returns {Observable} An observable sequence containing the accumulated values. */ scan(accumulator: _Accumulator, seed?: TAcc): Observable; /** * Applies an accumulator function over an observable sequence and returns each intermediate result. The optional seed value is used as the initial accumulator value. * For aggregation behavior with no intermediate results, see Observable.aggregate. * @example * var res = source.scan(function (acc, x) { return acc + x; }); * var res = source.scan(function (acc, x) { return acc + x; }, 0); * @param {Function} accumulator An accumulator function to be invoked on each element. * @param {Mixed} [seed] The initial accumulator value. * @returns {Observable} An observable sequence containing the accumulated values. */ scan(accumulator: _Accumulator, seed?: T): Observable; } } (function() { var o: Rx.Observable; o = o.scan((a, x) => a * x); o = o.scan((a, x) => a * x, 1); });