import { RedBlackTreeStructure } from '../internals'; export declare type UpdateTreeEntryCallback = (value: V, tree: RedBlackTreeStructure) => V; /** * Locates a value in the tree and passes it to a callback function that should return an updated value. If the value * returned is equal to the old value, then the original tree is returned, otherwise a modified copy of the original * tree is returned instead. If the specified key does not exist in the tree, undefined is passed to the callback * function, and if a defined value is returned, it is inserted into the tree. If the input tree is mutable, it is * modified and returned as-is, instead of being cloned beforehand. * * @export * @template K The type of keys in the tree * @template V The type of values in the tree * @param {(UpdateTreeEntryCallback)} callback A callback that will be passed * @param {K} key The key of the entry to be updated or inserted * @param {RedBlackTreeStructure} tree The tree to be updated * @returns {RedBlackTreeStructure} An updated copy of the tree, or the same tree if the input tree was already mutable */ export declare function update(callback: UpdateTreeEntryCallback, key: K, tree: RedBlackTreeStructure): RedBlackTreeStructure;