import { Entity, User } from "@rebasepro/types"; import { AdminCollection } from "@rebasepro/cms-types"; /** * @group Hooks and utilities */ export interface FetchProps, USER extends User = User> { path: string; entityId?: string | number; databaseId?: string; collection: AdminCollection; useCache?: boolean; } /** * @group Hooks and utilities */ export interface FetchResult> { entity?: Entity; dataLoading: boolean; dataLoadingError?: Error; } /** * Pre-populate the entity fetch cache with entities loaded from a collection. * This allows entity detail views to render instantly using cached data, * while the background fetch/listener brings in fresh data. * @param path - The collection path (e.g. "products") * @param entities - Array of entities to cache */ export declare function populateFetchCache>(path: string, entities: Entity[]): void; /** * Clear the entity fetch cache. Call this on auth state changes (e.g. logout) * to prevent stale data from a previous session leaking into the next. */ export declare function clearFetchCache(): void; /** * This hook is used to fetch a entity. * It gives real time updates if the driver supports it. * @param path * @param collection * @param entityId * @param useCache * @group Hooks and utilities */ export declare function useFetch, USER extends User = User>({ path, entityId, collection, databaseId, useCache }: FetchProps): FetchResult;