/**
 * 通知渠道集成模块
 *
 * 对外导出:
 * - sendNotification / sendBatchNotifications: 分发器入口
 * - createNotification / getNotifications / markNotificationAsRead / markAllNotificationsAsRead / getUnreadNotificationCount: 站内通知 CRUD
 * - getNotificationPreferences / upsertNotificationPreferences: 通知偏好 CRUD
 * - Server Actions: sendNotificationAction / sendClassNotificationAction / getNotificationsAction / markNotificationAsReadAction / markAllNotificationsAsReadAction / getUnreadNotificationCountAction
 * - UI 组件: NotificationList / NotificationDropdown
 * - 类型定义: NotificationPayload, ChannelSendResult, NotificationChannel, NotificationType, Notification, NotificationPreferences 等
 * - 渠道发送器工厂: createSmsSender, createWechatSender, createEmailSender, createInAppSender
 *
 * 典型用法:
 * ```ts
 * import { sendNotification } from "@/modules/notifications"
 * await sendNotification({
 *   userId: "user-xxx",
 *   title: "作业提醒",
 *   content: "您有一份新作业待提交",
 *   type: "info",
 *   actionUrl: "/homework/123",
 * })
 * ```
 */

export { sendNotification, sendBatchNotifications } from "./dispatcher"
export {
  createNotification,
  getNotifications,
  markNotificationAsRead,
  markAllNotificationsAsRead,
  getUnreadNotificationCount,
  archiveNotification,
  unarchiveNotification,
  getUserContactInfo,
  logNotificationSend,
  logNotificationSendBatch,
} from "./data-access"
export {
  getNotificationPreferences,
  upsertNotificationPreferences,
} from "./preferences"
export {
  sendNotificationAction,
  sendClassNotificationAction,
  getNotificationsAction,
  getUnreadNotificationCountAction,
  markNotificationAsReadAction,
  markAllNotificationsAsReadAction,
  archiveNotificationAction,
  getNotificationPreferencesAction,
  updateNotificationPreferencesAction,
} from "./actions"
export { UpdateNotificationPreferencesSchema } from "./schema"
export type { UpdateNotificationPreferencesFormInput } from "./schema"
export { NotificationList, NotificationDropdown } from "./components"
export type {
  NotificationChannel,
  NotificationPayload,
  ChannelSendResult,
  NotificationChannelConfig,
  SmsChannelConfig,
  WechatChannelConfig,
  EmailChannelConfig,
  NotificationType,
  NotificationPriority,
  Notification,
  NotificationLog,
  PaginatedResult,
  GetNotificationsParams,
  CreateNotificationInput,
  NotificationPreferences,
  UpdateNotificationPreferencesInput,
} from "./types"
export type { NotificationChannelSender, ChannelRecipient } from "./channels/types"

// 渠道发送器工厂（供高级用法直接调用单个渠道）
export { createSmsSender } from "./channels/sms-channel"
export { createWechatSender, isWechatEnabled } from "./channels/wechat-channel"
export { createEmailSender, isEmailEnabled } from "./channels/email-channel"
export { createInAppSender } from "./channels/in-app-channel"

// Hooks
export { useNotificationStream } from "./hooks/use-notification-stream"
export { useDesktopNotifications } from "./hooks/use-desktop-notifications"
