export declare type CacheIdentifierTypes = string | number | Symbol | Record<string, any>;
export declare type CreateCacheIdentifer<T extends CacheIdentifierTypes> = (id: T) => string | Symbol | number;
export declare type CreateFetchCacheParams<ID, Data> = {
    fetch(id: ID): Promise<Data>;
    createIdentifier?: CreateCacheIdentifer<ID>;
    isCachedValid?(id: ID, cachedData: Data): boolean;
};
export declare class FetchCache<IdentificationData extends CacheIdentifierTypes, Data> {
    static makeIdentifier: CreateCacheIdentifer<CacheIdentifierTypes>;
    private dataHolder;
    private fetchPromises;
    private fetch;
    private createIdentifier;
    private isCacheValid;
    constructor(params: CreateFetchCacheParams<IdentificationData, Data>);
    /**
     * Adds a resource to the cache
     *
     * @param {IdentificationData} identification
     * @param {Data} data
     */
    add(identification: IdentificationData, data: Data): void;
    /**
     * Synchronously gets a resource from the cache. returns undefined for not existing resources
     *
     * @param {(string | number | Symbol)} identifier
     * @returns
     */
    get(identifier: string | number | Symbol): Data | undefined;
    /**
     *	Ensures that a resource is inside the cache and the cached resource is still valid.
     *
     * @param {IdentificationData} data
     * @returns
     */
    ensure(data: IdentificationData): Promise<Data>;
    /**
     * Deletes a resource from the cache
     *
     * @param {IdentificationData} data
     */
    delete(data: IdentificationData): void;
}
