1 import { Operator } from '../Operator';
2 import { Subscriber } from '../Subscriber';
3 import { OperatorFunction } from '../types';
5 * Applies a given `project` function to each value emitted by the source
6 * Observable, and emits the resulting values as an Observable.
8 * <span class="informal">Like [Array.prototype.map()](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/map),
9 * it passes each source value through a transformation function to get
10 * corresponding output values.</span>
14 * Similar to the well known `Array.prototype.map` function, this operator
15 * applies a projection to each value and emits that projection in the output
19 * Map every click to the clientX position of that click
21 * import { fromEvent } from 'rxjs';
22 * import { map } from 'rxjs/operators';
24 * const clicks = fromEvent(document, 'click');
25 * const positions = clicks.pipe(map(ev => ev.clientX));
26 * positions.subscribe(x => console.log(x));
32 * @param {function(value: T, index: number): R} project The function to apply
33 * to each `value` emitted by the source Observable. The `index` parameter is
34 * the number `i` for the i-th emission that has happened since the
35 * subscription, starting from the number `0`.
36 * @param {any} [thisArg] An optional argument to define what `this` is in the
38 * @return {Observable<R>} An Observable that emits the values from the source
39 * Observable transformed by the given `project` function.
43 export declare function map<T, R>(project: (value: T, index: number) => R, thisArg?: any): OperatorFunction<T, R>;
44 export declare class MapOperator<T, R> implements Operator<T, R> {
47 constructor(project: (value: T, index: number) => R, thisArg: any);
48 call(subscriber: Subscriber<R>, source: any): any;