type PlainObject = Record; type Data = PlainObject | ValidTypes[]; type Key = string | number; type KeyType = P | D extends any[] ? Key : keyof P | keyof D; type ValidTypes = string | boolean | number | PlainObject; type Value = ValidTypes | ValidTypes[]; interface TreeChanges { added: (key?: K, value?: Value) => boolean; changed: (key?: K | string, actual?: Value, previous?: Value) => boolean; changedFrom: (key: K | string, previous: Value, actual?: Value) => boolean; decreased: (key: K, actual?: Value, previous?: Value) => boolean; emptied: (key?: K) => boolean; filled: (key?: K) => boolean; increased: (key: K, actual?: Value, previous?: Value) => boolean; removed: (key?: K, value?: Value) => boolean; } declare function treeChanges

>(previousData: P, data: D): TreeChanges; export { Data, KeyType, TreeChanges, Value, treeChanges as default };