import { VibeControlsInitialDataQuery } from '../generated/wspace-operations'; /** * Options for useInitialDataLoader */ interface UseInitialDataLoaderOptions { /** Workspace ID to use when the hook is called outside provider context */ workspaceId?: string | null; /** Fetch policy for the initial query */ fetchPolicy?: 'cache-first' | 'network-only' | 'cache-only'; } /** * Return type for useInitialDataLoader */ interface UseInitialDataLoaderResult { /** Whether the initial data is still loading */ loading: boolean; /** Any error that occurred during the initial fetch */ error?: Error; /** Refetch function to manually refresh all initial data */ refetch: () => void; /** The loaded data (raw from Apollo cache) */ data?: VibeControlsInitialDataQuery; } /** * Hook that prefetches all initial data for the VibeControls microfrontend. * * Usage: * ```tsx * function MyComponent() { * const { loading, error, refetch } = useInitialDataLoader(); * * if (loading) return ; * if (error) return ; * * // Data is available in Apollo cache for other components * return
Loaded!
; * } * ``` */ export declare function useInitialDataLoader(options?: UseInitialDataLoaderOptions): UseInitialDataLoaderResult; /** * Simplified hook for components that just need to know if initial data is loaded. * Useful for components that will read from cache using useQuery with cache-only. */ export declare function useIsInitialDataLoaded(): boolean; export default useInitialDataLoader;