/** * MemoryStack React Context * Provides app-wide access to the MemoryStack client */ import { createContext } from 'react'; import type { MemoryStackClient } from '../client'; export interface MemoryStackContextValue { /** The MemoryStack client instance */ client: MemoryStackClient | null; /** Whether the device is currently online */ isOnline: boolean; /** Number of pending offline operations */ pendingOperations: number; /** Manually trigger sync of pending operations */ syncPending: () => Promise; /** Whether the SDK is initialized */ isInitialized: boolean; } /** * React Context for MemoryStack * Access via useMemoryStack hook */ export const MemoryStackContext = createContext({ client: null, isOnline: true, pendingOperations: 0, syncPending: async () => { }, isInitialized: false, }); MemoryStackContext.displayName = 'MemoryStackContext';