import { channel, TimeSpan } from '@synnaxlabs/client';
import { DynamicProps } from './dynamic';
import { StaticProps } from './static';
import { Unary } from './unary';
export declare const CACHE_BUFFER_SIZE: TimeSpan;
/** Props for instantiating an @link Cache */
export interface CacheProps extends StaticProps, Partial<Pick<DynamicProps, "dynamicBufferSize">> {
    /** Used to populate new cache entries with relevant info about the channel */
    channelRetriever: channel.Retriever;
    /**
     * Sets the interval at which the cache will garbage collect, removing data that
     * currently in use by the rest of hte program.
     * @default TimeSpan.seconds(30)
     */
    gcInterval?: TimeSpan;
}
/**
 * Maintains an in-memory cache of channel data.
 */
export declare class Cache {
    private readonly props;
    private readonly cache;
    private readonly gcInterval;
    constructor(props: CacheProps);
    /**
     * Populates cache entries for the given keys, if they are not already present.
     *
     * @param keys - The keys to populate the cache with.
     */
    populateMissing(keys: channel.Keys): Promise<void>;
    /**
     * Returns the cache entry for the given channel.
     *
     * @param key - The key of the channel to retrieve.
     * @returns The cache entry for the given channel.
     */
    get(key: channel.Key): Unary;
    /** Garbage collects the cache */
    private gc;
    /**
     * Closes the cache, clearing all entries and stopping garbage collection. After this
     * method is called, the cache and it's entries should not be used.
     */
    close(): void;
}
//# sourceMappingURL=cache.d.ts.map