/**
 * 状态管理 Store 导出
 */

// ==================== Auth 模块 ====================
export { useAuthStore, useCurrentUser, useIsAuthenticated, useAuthLoading } from './auth';
export { useSessionStore, getCurrentUserId } from './auth';
export { useRegisterStore, useRegisterStep, useRegisterFormData, useRegisterCountdown } from './auth';
export { useVerificationStore, useVerificationStatus, useIsVerified, useHasPendingVerification, useVerificationLoading } from './auth';
export type { RegisterStep, RegisterFormData } from './auth';

// ==================== Settings 模块 ====================
export {
  useChatSettingsStore,
  useChatSettingsActions,
  useChatFontSize,
  useChatMessageRadius,
  useChatTheme,
  useChatNightMode,
  CHAT_THEMES,
} from './settings';
export type { ChatSettings, ChatThemeId } from './settings';
export {
  useAppColors,
  useThemePreference,
  useResolvedColorScheme,
  useSetThemePreference,
  usePaperThemeFromStore,
  ThemeBootstrap,
  useThemeStore,
  getSystemScheme,
} from './settings';
export type { ThemePreference, ResolvedScheme } from './settings';

// ==================== UI 模块 ====================
export { useHomeTabBarVisibilityStore } from './ui';
export { useHomeTabPressStore } from './ui';

// ==================== Call 模块 ====================
export { callStore } from './call';
export type { CallType, CallSession, CallStatus, IncomingCallInfo } from './call';

// ==================== User Store（首页/通知/搜索等） ====================
export {
  useUserStore,
  usePosts,
  useNotifications,
  useNotificationBadge,
  useMessageUnreadCount,
  useSearchHistory,
} from './userStore';

// ==================== Message 模块 ====================
export { messageManager, MessageManager, useMessageStore } from './message';
export type { MessageManagerConversationListDeps } from './message';
export {
  CONVERSATION_LIST_PAGE_SIZE,
  type ConversationListPage,
  type IConversationListPagedSource,
  type RemoteConversationListSourceKind,
  NetworkRemoteConversationListPagedSource,
  SqliteConversationListPagedSource,
  createRemoteConversationListSource,
} from './message';
export {
  useConversations as useMessageManagerConversations,
  useMessages,
  useSendMessage,
  useMarkAsRead,
  useUnreadCount,
  useTotalUnreadCount,
  useConversation as useMessageManagerConversation,
  useMessageManager,
  useChat,
  useMessageList,
  useMessageListRefresh,
  useCreateConversation,
  useUpdateConversation,
  useSystemUnreadCount as useMessageManagerSystemUnreadCount,
  useGroupTyping,
  useGroupMuted,
} from './message';

// ==================== Group 模块 ====================
export {
  groupManager,
  GroupManager,
  useGroupManagerStore,
  useGroups,
  useGroup,
  useGroupMembers,
  type GroupManagerState,
  type GroupManagerActions,
  type GroupManagerStore,
} from './group';
export {
  GROUP_MEMBER_LIST_PAGE_SIZE,
  type GroupMemberListSourceKind,
  type IGroupMemberListPagedSource,
  NetworkCursorGroupMemberListPagedSource,
  NetworkOffsetGroupMemberListPagedSource,
  createRemoteGroupMemberListSource,
  enrichGroupMembersWithUserProfiles,
} from './group';

// ==================== Post 模块 ====================
export {
  postManager,
  PostManager,
  usePostManagerStore,
  usePostList,
  usePostDetail,
  type PostManagerState,
  type PostManagerActions,
  type PostManagerStore,
} from './post';
export {
  type PostListTab,
  type IPostListPagedSource,
  createRemotePostListSource,
} from './post';

// ==================== User 模块（userManager） ====================
export {
  userManager,
  UserManager,
  useUserManagerStore,
  useCurrentUser as useCurrentUserFromManager,
  useUser,
  useUsers,
  type UserManagerState,
  type UserManagerActions,
  type UserManagerStore,
} from './user';

// ==================== 工具函数 ====================
export {
  CacheEntry,
  createCacheEntry,
  isCacheExpired,
  isCacheValid,
  getCacheRemainingTTL,
  DEFAULT_TTL,
} from './utils/cache';
export { routePayloadCache } from './utils/routePayloadCache';
