/** PURE_IMPORTS_START .._util_isNumeric,.._Observable,.._scheduler_async,.._util_isScheduler,.._util_isDate PURE_IMPORTS_END */ var __extends = (this && this.__extends) || function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; function __() { this.constructor = d; } d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); }; import { isNumeric } from '../util/isNumeric'; import { Observable } from '../Observable'; import { async } from '../scheduler/async'; import { isScheduler } from '../util/isScheduler'; import { isDate } from '../util/isDate'; /** * We need this JSDoc comment for affecting ESDoc. * @extends {Ignored} * @hide true */ export var TimerObservable = /*@__PURE__*/ (/*@__PURE__*/ function (_super) { __extends(TimerObservable, _super); function TimerObservable(dueTime, period, scheduler) { if (dueTime === void 0) { dueTime = 0; } _super.call(this); this.period = -1; this.dueTime = 0; if (isNumeric(period)) { this.period = Number(period) < 1 && 1 || Number(period); } else if (isScheduler(period)) { scheduler = period; } if (!isScheduler(scheduler)) { scheduler = async; } this.scheduler = scheduler; this.dueTime = isDate(dueTime) ? (+dueTime - this.scheduler.now()) : dueTime; } /** * Creates an Observable that starts emitting after an `initialDelay` and * emits ever increasing numbers after each `period` of time thereafter. * * Its like {@link interval}, but you can specify when * should the emissions start. * * * * `timer` returns an Observable that emits an infinite sequence of ascending * integers, with a constant interval of time, `period` of your choosing * between those emissions. The first emission happens after the specified * `initialDelay`. The initial delay may be a {@link Date}. By default, this * operator uses the `async` IScheduler to provide a notion of time, but you * may pass any IScheduler to it. If `period` is not specified, the output * Observable emits only one value, `0`. Otherwise, it emits an infinite * sequence. * * @example