-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathindex.d.ts
More file actions
29 lines (25 loc) · 769 Bytes
/
index.d.ts
File metadata and controls
29 lines (25 loc) · 769 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
/**
* TimeWarpOptions define how to manipulate Date.
*/
export interface TimeWarpOptions {
// Freeze the clock at a specific timestamp (milliseconds).
freezeAt?: number | null;
// Speed multiplier for time. E.g., 2 => time moves twice as fast.
speed?: number;
// If true, monkey-patch the global Date object.
monkeyPatch?: boolean;
}
/**
* Represents a custom time object for advanced usage.
*/
export interface VirtualTime {
now(): number;
Date: typeof Date;
}
/**
* Main TimeWarp API:
*/
export declare function enableTimeWarp(options?: TimeWarpOptions): void;
export declare function disableTimeWarp(): void;
export declare function getVirtualTime(): VirtualTime;
export declare function setTimeWarpOptions(options: TimeWarpOptions): void;