/**
 * A tick-based caching utility for a single value.
 *
 * Caches the result of an expensive operation and reuses it until
 * the configured tick threshold is exceeded. Ticks are monotonic
 * counters (typically lamport ticks) passed by the caller — the
 * cache never reaches for wall-clock time.
 *
 * @example
 * const cache = new CachedValue({
 *   ttlTicks: 100,
 *   compute: async () => await expensiveOperation(),
 * });
 *
 * // First call computes the value
 * const value1 = await cache.get(currentLamport);
 *
 * // Subsequent calls within tick threshold return cached value
 * const value2 = await cache.get(currentLamport + 50); // Same as value1
 *
 * // Force recompute
 * cache.invalidate();
 * const value3 = await cache.get(currentLamport + 200); // Fresh value
 */
interface CachedValueOptions<T> {
    readonly ttlTicks: number;
    readonly compute: () => T | Promise<T>;
}
declare class CachedValue<T> {
    private readonly _ttlTicks;
    private readonly _compute;
    private _value;
    private _inflight;
    private _generation;
    private _cachedAtTick;
    /**
     * Creates a CachedValue instance.
     *
     * @throws {WarpError} If ttlTicks is not a positive number
     */
    constructor({ ttlTicks, compute }: CachedValueOptions<T>);
    /** Gets the cached value, computing it if stale or not present. */
    get(currentTick: number): Promise<T>;
    /**
     * Runs the compute function and caches the result if the generation is still current.
     */
    private _computeAndCache;
    /** Gets the cached value with metadata about when it was cached. */
    getWithMetadata(currentTick: number): Promise<{
        value: T;
        cachedAtTick: number;
        fromCache: boolean;
    }>;
    /** Invalidates the cached value, forcing recomputation on next get(). */
    invalidate(): void;
    /** Checks if the cached value is still valid. */
    private _isValid;
    /**
     * Gets the tick at which the value was cached.
     * Returns 0 if no value is cached.
     */
    get cachedAtTick(): number;
    /** Checks if a value is currently cached (regardless of validity). */
    get hasValue(): boolean;
}
export default CachedValue;
