1 import { OperatorFunction, SchedulerLike, Timestamp as TimestampInterface } from '../types';
3 * Attaches a timestamp to each item emitted by an observable indicating when it was emitted
5 * The `timestamp` operator maps the *source* observable stream to an object of type
6 * `{value: T, timestamp: R}`. The properties are generically typed. The `value` property contains the value
7 * and type of the *source* observable. The `timestamp` is generated by the schedulers `now` function. By
8 * default it uses the *async* scheduler which simply returns `Date.now()` (milliseconds since 1970/01/01
9 * 00:00:00:000) and therefore is of type `number`.
15 * In this example there is a timestamp attached to the documents click event.
18 * import { fromEvent } from 'rxjs';
19 * import { timestamp } from 'rxjs/operators';
21 * const clickWithTimestamp = fromEvent(document, 'click').pipe(
25 * // Emits data of type {value: MouseEvent, timestamp: number}
26 * clickWithTimestamp.subscribe(data => {
32 * @return {Observable<Timestamp<any>>|WebSocketSubject<T>|Observable<T>}
36 export declare function timestamp<T>(scheduler?: SchedulerLike): OperatorFunction<T, Timestamp<T>>;
37 export declare class Timestamp<T> implements TimestampInterface<T> {
40 constructor(value: T, timestamp: number);