/**
 * Cache computed values or resources for a specified duration to improve performances.
 *
 * @license
 * Copyright 2022-2026 Matter.js Authors
 * SPDX-License-Identifier: Apache-2.0
 */
import { Duration } from "#time/Duration.js";
declare class GenericCache<T> {
    private readonly expiration;
    private readonly expireCallback?;
    protected readonly knownKeys: Set<string>;
    protected readonly values: Map<string, T>;
    protected readonly timestamps: Map<string, number>;
    private readonly periodicTimer;
    constructor(name: string, expiration: Duration, expireCallback?: ((key: string, value: T) => Promise<void>) | undefined);
    keys(): string[];
    delete(key: string): Promise<void>;
    clear(): Promise<void>;
    close(): Promise<void>;
    private expire;
}
export declare class Cache<T> extends GenericCache<T> {
    private readonly generator;
    constructor(name: string, generator: (...params: any[]) => T, expiration: Duration, expireCallback?: (key: string, value: T) => Promise<void>);
    get(...params: any[]): T;
}
export declare class AsyncCache<T> extends GenericCache<T> {
    private readonly generator;
    constructor(name: string, generator: (...params: any[]) => Promise<T>, expiration: Duration, expireCallback?: (key: string, value: T) => Promise<void>);
    get(...params: any[]): Promise<T>;
}
export {};
//# sourceMappingURL=Cache.d.ts.map