/** * Map actions interface */ export type MapActions = { set: (key: K, value: V) => void; setAll: (entries: Array<[K, V]>) => void; remove: (key: K) => void; reset: () => void; clear: () => void; }; /** * Hook that tracks state of an object as a Map * * @template K - Key type * @template V - Value type * @param initialValue - Initial map entries * @returns Tuple of [map, actions] * * @example * ```tsx * const [map, { set, remove, clear }] = useMap([ * ['key1', 'value1'], * ['key2', 'value2'], * ]); * * return ( *
* * * *
{JSON.stringify(Object.fromEntries(map), null, 2)}
*
* ); * ``` */ export declare function useMap(initialValue?: Array<[K, V]>): [Map, MapActions]; //# sourceMappingURL=useMap.d.ts.map