UNPKG

1.63 kBTypeScriptView Raw
1/// <reference types="rx-lite" />
2
3declare namespace Rx {
4 interface VirtualTimeScheduler<TAbsolute, TRelative> extends Scheduler {
5 // protected constructor(initialClock: TAbsolute, comparer: (first: TAbsolute, second: TAbsolute) => number);
6
7 advanceBy(time: TRelative): void;
8 advanceTo(time: TAbsolute): void;
9 scheduleAbsolute(dueTime: TAbsolute, action: () => void): IDisposable;
10 scheduleAbsoluteWithState<TState>(
11 state: TState,
12 dueTime: TAbsolute,
13 action: (scheduler: IScheduler, state: TState) => IDisposable,
14 ): IDisposable;
15 scheduleRelative(dueTime: TRelative, action: () => void): IDisposable;
16 scheduleRelativeWithState<TState>(
17 state: TState,
18 dueTime: TRelative,
19 action: (scheduler: IScheduler, state: TState) => IDisposable,
20 ): IDisposable;
21 sleep(time: TRelative): void;
22 start(): IDisposable;
23 stop(): void;
24
25 isEnabled: boolean;
26
27 /* protected abstract */ add(from: TAbsolute, by: TRelative): TAbsolute;
28 /* protected abstract */ toDateTimeOffset(duetime: TAbsolute): number;
29 /* protected abstract */ toRelative(duetime: number): TRelative;
30
31 /* protected */ getNext(): internals.ScheduledItem<TAbsolute>;
32 }
33
34 interface HistoricalScheduler extends VirtualTimeScheduler<number, number> {
35 }
36
37 const HistoricalScheduler: {
38 new(initialClock: number, comparer: (first: number, second: number) => number): HistoricalScheduler;
39 };
40}
41
42declare module "rx-lite-virtualtime" {
43 export = Rx;
44}