2024-08-20 23:25:37 +04:00

6 lines
470 B
TypeScript

import { type KeyType } from '../Cache';
export type ExtractStyle<CacheValue> = (cache: CacheValue, effectStyles: Record<string, boolean>, options?: {
plain?: boolean;
}) => [order: number, styleId: string, style: string] | null;
export default function useGlobalCache<CacheType>(prefix: string, keyPath: KeyType[], cacheFn: () => CacheType, onCacheRemove?: (cache: CacheType, fromHMR: boolean) => void, onCacheEffect?: (cachedValue: CacheType) => void): CacheType;