/*! * Copyright (c) Microsoft Corporation and contributors. All rights reserved. * Licensed under the MIT License. */ import { UnreferencedState } from "./gcDefinitions.js"; /** * The collection of UnreferencedStateTrackers for all unreferenced nodes. Ensures stopTracking is called when deleting */ export declare class UnreferencedStateTrackerMap extends Map { /** * Delete the given key, and stop tracking if that node was actually unreferenced */ delete(key: string): boolean; } /** * Helper class that tracks the state of an unreferenced node such as the time it was unreferenced and if it can * be tombstoned or deleted by the sweep phase. */ export declare class UnreferencedStateTracker { readonly unreferencedTimestampMs: number; /** * The time after which node transitions to Inactive state. */ private readonly inactiveTimeoutMs; /** * The time after which node transitions to TombstoneReady state; undefined if session expiry is disabled. */ private readonly tombstoneTimeoutMs; /** * The delay from TombstoneReady to SweepReady (only applies if tombstoneTimeoutMs is defined) */ private readonly sweepGracePeriodMs; private _state; get state(): UnreferencedState; /** * Timer to indicate when an unreferenced object is considered Inactive */ private readonly inactiveTimer; /** * Timer to indicate when an unreferenced object is Tombstone-Ready */ private readonly tombstoneTimer; /** * Timer to indicate when an unreferenced object is Sweep-Ready */ private readonly sweepTimer; constructor(unreferencedTimestampMs: number, /** * The time after which node transitions to Inactive state. */ inactiveTimeoutMs: number, /** * The current reference timestamp used to track how long this node has been unreferenced for. */ currentReferenceTimestampMs: number, /** * The time after which node transitions to TombstoneReady state; undefined if session expiry is disabled. */ tombstoneTimeoutMs: number | undefined, /** * The delay from TombstoneReady to SweepReady (only applies if tombstoneTimeoutMs is defined) */ sweepGracePeriodMs: number); /** * Updates the unreferenced state based on the provided timestamp. */ updateTracking(currentReferenceTimestampMs: number): void; private clearTimers; /** * Stop tracking this node. Reset the unreferenced timers and state, if any. */ stopTracking(): void; } //# sourceMappingURL=gcUnreferencedStateTracker.d.ts.map