import type {ImmutableTree} from './types'; declare class DoNothing { // Empty classes are compatible with any type in TypeScript (?). private is_typescript_sound: never; } declare class RemoveValue { private why_do_i_exist: unknown; } export const DO_NOTHING: DoNothing; export const REMOVE_VALUE: RemoveValue; export type InsertConflictHandler = (existingTreeValue: T, key: K) => T | RemoveValue; export type InsertNotFoundHandler = (key: K) => T | DoNothing; export type UpdateOptions = { key: K; cmp: (key: K, treeValue: T) => number; isEqual?: (a: T, b: T) => boolean; onConflict: InsertConflictHandler; onNotFound: InsertNotFoundHandler; }; export function onConflictThrowError(): never; export function onConflictKeepTreeValue( treeValue: T, givenValue: K, ): T; export function onConflictUseGivenValue( treeValue: T, givenValue: T, ): T; export function onConflictRemoveValue(): RemoveValue; export function onNotFoundDoNothing(): DoNothing; export function onNotFoundThrowError(): never; export function onNotFoundUseGivenValue(givenValue: T): T; export default function update( tree: ImmutableTree, options: UpdateOptions, ): ImmutableTree;