/** * Client-side User Data Utilities * * Client-side utilities for managing user plan and flags data. * Works with the server-side user-data.ts module. */ import type { PlanType, UserFlag } from './entities/types'; import type { SessionUser } from './auth'; /** * Client-side interface for user plan data */ export interface ClientUserPlanData { plan: PlanType; flags: UserFlag[]; fromStorage: boolean; } /** * Get user plan and flags from localStorage (client-side cache) */ export declare function getCachedUserPlanData(userId: string): ClientUserPlanData | null; /** * Cache user plan data to localStorage */ export declare function cacheUserPlanData(userId: string, plan: PlanType, flags: UserFlag[]): void; /** * Fetch user plan and flags from API */ export declare function fetchUserPlanData(userId: string): Promise; /** * Get user plan and flags with caching strategy */ export declare function getUserPlanDataWithCache(userId: string): Promise; /** * Update user plan via API */ export declare function updateUserPlanClient(userId: string, plan: PlanType): Promise; /** * Update user flags via API */ export declare function updateUserFlagsClient(userId: string, flags: UserFlag[]): Promise; /** * Extract plan data from session user (enhanced version) */ export declare function extractUserPlanDataWithCache(user: SessionUser | null): ClientUserPlanData; /** * Clear cached user data (useful for logout or data refresh) */ export declare function clearCachedUserPlanData(userId?: string): void; /** * React hook for user plan data */ export declare function useUserPlanData(user: SessionUser | null): { loading: boolean; error: string; updatePlan: (plan: PlanType) => Promise; updateFlags: (flags: UserFlag[]) => Promise; refetch: () => void; plan: PlanType; flags: UserFlag[]; fromStorage: boolean; }; //# sourceMappingURL=user-data-client.d.ts.map