fluidstate
Version:
Library for fine-grained reactivity state management
29 lines (28 loc) • 1.51 kB
TypeScript
import { ReactiveChange } from "./reactive-plugin";
/**
* Generates a list of change descriptions for a map set operation.
*
* @param map The reactive map proxy.
* @param key The key being set.
* @param previousValue The previous value associated with the key.
* @param nextValue The new value being set for the key.
* @returns An array of ReactiveChange objects, or null if no reportable changes occurred (though for set, it always reports if called).
*/
export declare const getMapSetChanges: (map: Map<unknown, unknown>, key: unknown, previousValue: unknown, nextValue: unknown) => ReactiveChange[] | null;
/**
* Generates a list of change descriptions for a map delete operation.
*
* @param map The reactive map proxy.
* @param key The key being deleted.
* @param previousValue The value associated with the key before deletion.
* @returns An array of ReactiveChange objects, or null if no reportable changes occurred.
*/
export declare const getMapDeleteChanges: (map: Map<unknown, unknown>, key: unknown, previousValue: unknown) => ReactiveChange[] | null;
/**
* Generates a list of change descriptions for a map clear operation.
*
* @param map The reactive map proxy.
* @param entries The array of [key, value] pairs representing the map's content before clearing.
* @returns An array of ReactiveChange objects, or null if the map was already empty.
*/
export declare const getMapClearChanges: (map: Map<unknown, unknown>, entries: Array<[unknown, unknown]>) => ReactiveChange[] | null;