import { CacheReplacementPolicy, Deleter, EntryValidity } from '../../contracts/cache-replacement-policy';
import { CacheEntry } from '../../contracts/commons';
import { GraphEntry } from '../../data-structures/dependency-graph';
import { ReadonlyCacheBackend } from '../../contracts/cache-backend';
/**
 * @private
 */
interface CacheEntryWithDependencies<Key, Value> extends CacheEntry<Key, Value>, GraphEntry {
}
interface KeysDependenciesEvictionPolicyArgumentsBundle<Key> {
    /**
     * Dependencies of the entry.
     */
    dependencies?: Array<Key>;
    /**
     * Dependents of the entry.
     */
    dependents?: Array<Key>;
    /**
     * Behaviour to take when dependency not present in the {@link ReadonlyCacheBackend}:
     *
     * Throw on dependency not found  | Behaviour
     * ------------------------------ | ------------------------------
     * true  						  | An exception will be thrown, and entry insertion will fail. There aren't any exception guarantees, meaning that after exception is thrown, state of the this and other policies might be corrupted. You can use *throwOnDependencyNotFound* mode for debugging or testing, in production is not recommended to use it.
     * false  						  | Dependency will be ignored and relationship with entry won't be established.
     *
     * Defaults to **false**.
     */
    throwOnDependencyNotFound?: boolean;
}
/**
 * Eviction policy, purpose of which is to offer ***cascade delete*** functionality. <br/>
 *
 * When one of the keys is deleted/eviction, all of it's direct and transitive dependencies will also be deleted/evicted. <br/>
 *
 * This is achieved by using an internal dependency graph. Graph is able to handle cycles. <br/>
 *
 * When `key` is inserted in the cache, clients should also specify a list of dependencies and/or dependents (if `key` has them).
 * **The only limitation is that dependencies/dependents must be already present in the cache when they are specified,
 * otherwise relationships of the `key` with them will be ignored.**
 *
 * @template Key				Type of the key.
 * @template Value				Type of the value.
 * @template ArgumentsBundle	Type of the arguments bundle.
 */
declare class KeysDependenciesEvictionPolicy<Key, Value, ArgumentsBundle extends KeysDependenciesEvictionPolicyArgumentsBundle<Key> = KeysDependenciesEvictionPolicyArgumentsBundle<Key>> implements CacheReplacementPolicy<Key, Value, ArgumentsBundle> {
    /**
     * @private
     */
    private readonly dependencyGraph;
    private readonly readonlyCacheBackend;
    private readonly visitedEntriesOnDeletion;
    private deleteFromCache;
    /**
     * @param readonlyCacheBackend	Cache backend instance.
     */
    constructor(readonlyCacheBackend: ReadonlyCacheBackend<Key, Value>);
    /**
     * @inheritDoc
     */
    onHit(): EntryValidity;
    /**
     * @inheritDoc
     */
    onMiss(): void;
    /**
     * @inheritDoc
     */
    onSet(entry: CacheEntryWithDependencies<Key, Value>, options?: ArgumentsBundle): void;
    /**
     * This method doesn't manipulate cache dependencies.
     * @inheritDoc
     */
    onUpdate(): void;
    /**
     * @inheritDoc
     */
    onDelete(entry: CacheEntryWithDependencies<Key, Value>): void;
    /**
     * @inheritDoc
     */
    onClear(): void;
    /**
     * @inheritDoc
     */
    setDeleter(deleter: Deleter<Key, Value>): void;
}
export { KeysDependenciesEvictionPolicy, KeysDependenciesEvictionPolicyArgumentsBundle, CacheEntryWithDependencies };
