import { Context } from 'react'; import ReducerSystem from './ReducerSystem'; /** * A hook which manages a cache. * * @param context - The context created with `createHookCache` (**must be consistent** across calls). * @param identifier - The identifier of the element to be extracted from the cache. * @param globalLoad - If false or absent, elements will be retrieved and loaded one by one in the cache * (**must be consistent** across calls). * @returns An array containing: * - the searched value or undefined if not in cache yet, * - the method to add the element in the cache, if the element can be loaded by this component, or * undefined otherwise. */ declare function useHookCache(context: Context; }> | undefined>, identifier: string, globalLoad?: false): [V | undefined, ((element: V) => void) | undefined]; /** * A hook which manages a cache. * * @param context - The context created with `createHookCache` (**must be consistent** across calls). * @param identifier - The identifier of the element to be extracted from the cache. * @param globalLoad - If true, the loading process will load all elements at once (**must be consistent** * across calls). * @returns An array containing: * - the searched value or undefined if not in cache yet, * - the method to add all elements in the cache, if the elements can be loaded by this component, or * undefined otherwise. */ declare function useHookCache(context: Context | undefined> | undefined>, identifier: string, globleLoad: true): [V | undefined, ((elements: Array<{ identifier: string; element: V; }>) => void) | undefined]; export default useHookCache;