1 import { Action } from './scheduler/Action';
2 import { Subscription } from './Subscription';
3 import { SchedulerLike, SchedulerAction } from './types';
5 * An execution context and a data structure to order tasks and schedule their
6 * execution. Provides a notion of (potentially virtual) time, through the
7 * `now()` getter method.
9 * Each unit of work in a Scheduler is called an `Action`.
14 * schedule(work, delay?, state?): Subscription;
19 * @deprecated Scheduler is an internal implementation detail of RxJS, and
20 * should not be used directly. Rather, create your own class and implement
21 * {@link SchedulerLike}
23 export declare class Scheduler implements SchedulerLike {
24 private SchedulerAction;
26 * Note: the extra arrow function wrapper is to make testing by overriding
30 static now: () => number;
31 constructor(SchedulerAction: typeof Action, now?: () => number);
33 * A getter method that returns a number representing the current time
34 * (at the time this function was called) according to the scheduler's own
36 * @return {number} A number that represents the current time. May or may not
37 * have a relation to wall-clock time. May or may not refer to a time unit
38 * (e.g. milliseconds).
42 * Schedules a function, `work`, for execution. May happen at some point in
43 * the future, according to the `delay` parameter, if specified. May be passed
44 * some context object, `state`, which will be passed to the `work` function.
46 * The given arguments will be processed an stored as an Action object in a
49 * @param {function(state: ?T): ?Subscription} work A function representing a
50 * task, or some unit of work to be executed by the Scheduler.
51 * @param {number} [delay] Time to wait before executing the work, where the
52 * time unit is implicit and defined by the Scheduler itself.
53 * @param {T} [state] Some contextual data that the `work` function uses when
54 * called by the Scheduler.
55 * @return {Subscription} A subscription in order to be able to unsubscribe
58 schedule<T>(work: (this: SchedulerAction<T>, state?: T) => void, delay?: number, state?: T): Subscription;