import { alamos } from '@synnaxlabs/alamos';
import { MultiSeries, Size, TimeRange, TimeSpan } from '@synnaxlabs/x';
export interface DirtyReadResult {
    series: MultiSeries;
    gaps: TimeRange[];
}
export interface CacheGCMetrics {
    purgedSeries: number;
    purgedBytes: Size;
}
export declare const zeroCacheGCMetrics: () => CacheGCMetrics;
/** Props for the @link Static cache. */
export interface StaticProps {
    /** Used for logging */
    instrumentation?: alamos.Instrumentation;
    /**
     * Sets the amount of time that a cache entry must be in the cache before it can
     * be marked as stale and subject to garbage collection.
     * @default TimeSpan.seconds(20) */
    staleEntryThreshold?: TimeSpan;
}
export declare const DEFAULT_STATIC_PROPS: Required<StaticProps>;
/**
 * A cache for historical channel data that will not be modified after it is written.
 */
export declare class Static {
    private data;
    private readonly props;
    constructor(props: StaticProps);
    /**
     * Writes the given series to the cache, merging written series with any
     * existing series in the cache.
     */
    write(series: MultiSeries): void;
    /**
     * Executes a 'dirty' read of the cache, retrieving any series in the cache that overlap
     * with the given time range. Note that these series may have data that is before or
     * after the given time range.
     *
     * @param tr - The time range to read from the cache.
     * @returns A list of series that overlap with the given time range and a list of gaps,
     * representing the missing regions of time between the series and before and after
     * the first and last series.
     */
    dirtyRead(tr: TimeRange): DirtyReadResult;
    /**
     * Garbage collects the cache, removing any stale entries.
     *
     * @returns metrics about the garbage collection.
     */
    gc(): CacheGCMetrics;
    /**
     * Closes the cache, freeing all of its resources.
     */
    close(): void;
    private writeOne;
    private checkIntegrity;
}
//# sourceMappingURL=static.d.ts.map