export interface TimeAdvanceOptions { /** * Number of milliseconds to advance */ milliseconds?: number; /** * Number of seconds to advance */ seconds?: number; /** * Number of minutes to advance */ minutes?: number; /** * Number of hours to advance */ hours?: number; /** * Number of days to advance */ days?: number; } export interface TestClockState { readonly isFrozen: boolean; readonly frozenTime: Date | null; readonly totalAdvanced: number; } export declare class TestClock { private static instance; private _isFrozen; private _frozenTime; private _totalAdvanced; private _originalDateNow; private _originalDateConstructor; private constructor(); /** * Gets the singleton TestClock instance */ static getInstance(): TestClock; /** * Creates a new TestClock instance for isolated testing */ static create(): TestClock; /** * Freezes time at the specified date/time * @param date - The date to freeze time at (defaults to current time) */ freeze(date?: Date): this; /** * Advances time by the specified amount * @param options - Time advancement options */ advance(options: TimeAdvanceOptions): this; /** * Advances time by the specified number of milliseconds * @param milliseconds - Number of milliseconds to advance */ advance(milliseconds: number): this; /** * Restores normal time behavior */ restore(): this; /** * Gets the current time (frozen or real) */ now(): Date; /** * Gets the current state of the clock */ getState(): TestClockState; /** * Checks if the clock is currently frozen */ isFrozen(): boolean; /** * Gets the total time advanced in milliseconds */ getTotalAdvanced(): number; /** * Resets the clock to its initial state */ reset(): this; /** * Runs a function with time frozen at the specified date * @param date - The date to freeze time at * @param fn - The function to run with frozen time */ static runWithFrozenTime(date: Date, fn: () => T): T; /** * Runs an async function with time frozen at the specified date * @param date - The date to freeze time at * @param fn - The async function to run with frozen time */ static runWithFrozenTime(date: Date, fn: () => Promise): Promise; /** * Utility for testing time-dependent operations with step-by-step time advancement */ static runWithTimeProgression(startDate: Date, steps: { advance: TimeAdvanceOptions; execute: () => T | Promise; }[]): Promise; /** * Utility for creating time-based test scenarios */ static createTimeScenario(): TimeScenarioBuilder; } export declare class TimeScenarioBuilder { private steps; /** * Freeze time at the specified date */ freezeAt(date: Date): this; /** * Advance time by the specified amount */ advanceBy(options: TimeAdvanceOptions): this; advanceBy(milliseconds: number): this; /** * Execute a function at the current time */ execute(fn: () => T | Promise): this; /** * Run the scenario and return all execution results */ run(): Promise; } export declare function withTestClock(options?: { freezeAt?: Date; autoRestore?: boolean; }): any>(_target: any, _propertyKey: string, descriptor: PropertyDescriptor) => PropertyDescriptor;