UNPKG

1.03 kBTypeScriptView Raw
1/**
2 * Copyright (c) Facebook, Inc. and its affiliates. All Rights Reserved.
3 *
4 * This source code is licensed under the MIT license found in the
5 * LICENSE file in the root directory of this source tree.
6 */
7import { StackTraceConfig } from 'jest-message-util';
8export default class FakeTimers {
9 private _clock;
10 private _config;
11 private _fakingTime;
12 private _global;
13 private _fakeTimers;
14 private _maxLoops;
15 constructor({ global, config, maxLoops, }: {
16 global: typeof globalThis;
17 config: StackTraceConfig;
18 maxLoops?: number;
19 });
20 clearAllTimers(): void;
21 dispose(): void;
22 runAllTimers(): void;
23 runOnlyPendingTimers(): void;
24 advanceTimersToNextTimer(steps?: number): void;
25 advanceTimersByTime(msToRun: number): void;
26 runAllTicks(): void;
27 useRealTimers(): void;
28 useFakeTimers(): void;
29 reset(): void;
30 setSystemTime(now?: number | Date): void;
31 getRealSystemTime(): number;
32 getTimerCount(): number;
33 private _checkFakeTimers;
34}