@robot-admin/naive-ui-components 0.14.3 → 0.16.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (254) hide show
  1. package/CHANGELOG.md +35 -0
  2. package/README.md +130 -741
  3. package/README_EN.md +137 -678
  4. package/dist/C_ActionBar.css +57 -58
  5. package/dist/C_ActionBar2.cjs +1 -1
  6. package/dist/C_ActionBar2.js +1 -1
  7. package/dist/C_AntV.css +232 -238
  8. package/dist/C_AntV2.cjs +2 -2
  9. package/dist/C_AntV2.js +2 -2
  10. package/dist/C_AudioPlayer.css +9 -9
  11. package/dist/C_AvatarGroup.css +5 -6
  12. package/dist/C_Barcode.css +1 -1
  13. package/dist/C_Breadcrumb.css +15 -18
  14. package/dist/C_Breadcrumb2.cjs +1 -1
  15. package/dist/C_Breadcrumb2.js +1 -1
  16. package/dist/C_Captcha.css +46 -49
  17. package/dist/C_Captcha2.cjs +1 -1
  18. package/dist/C_Captcha2.js +1 -1
  19. package/dist/C_Cascade.css +5 -6
  20. package/dist/C_Chat.css +8 -8
  21. package/dist/C_City.css +2 -2
  22. package/dist/C_Code.css +9 -9
  23. package/dist/C_CollapsePanel.css +9 -9
  24. package/dist/C_ContextMenu.css +31 -31
  25. package/dist/C_Cron.css +271 -274
  26. package/dist/C_Date.css +1 -1
  27. package/dist/C_Draggable.css +10 -11
  28. package/dist/C_Editor.css +2 -2
  29. package/dist/C_FilePreview.css +423 -423
  30. package/dist/C_Form.base.css +608 -602
  31. package/dist/C_Form.cjs +1 -1
  32. package/dist/C_Form.css +610 -604
  33. package/dist/C_Form.d.cts +2 -2
  34. package/dist/C_Form.d.ts +2 -2
  35. package/dist/C_Form.js +1 -1
  36. package/dist/C_FormModal.cjs +1 -1
  37. package/dist/C_FormModal.css +12 -17
  38. package/dist/C_FormModal.js +1 -1
  39. package/dist/C_FormModal2.cjs +1 -1
  40. package/dist/C_FormModal2.js +1 -1
  41. package/dist/C_FormSearch.css +53 -55
  42. package/dist/C_FormSearch2.cjs +1 -1
  43. package/dist/C_FormSearch2.js +1 -1
  44. package/dist/C_FormulaEditor.css +204 -205
  45. package/dist/C_FullCalendar.css +13 -15
  46. package/dist/C_FullCalendar2.cjs +1 -1
  47. package/dist/C_FullCalendar2.js +1 -1
  48. package/dist/C_GlobalSearch.css +11 -12
  49. package/dist/C_Guide.css +10 -10
  50. package/dist/C_Icon.css +7 -8
  51. package/dist/C_ImageCropper.css +69 -69
  52. package/dist/C_Language.css +8 -8
  53. package/dist/C_Loading.css +22 -25
  54. package/dist/C_Loading2.cjs +1 -1
  55. package/dist/C_Loading2.js +1 -1
  56. package/dist/C_Login.css +130 -135
  57. package/dist/C_Login2.cjs +1 -1
  58. package/dist/C_Login2.js +1 -1
  59. package/dist/C_Map.css +22 -23
  60. package/dist/C_Markdown.css +6 -7
  61. package/dist/C_Menu.css +2 -5
  62. package/dist/C_Menu2.cjs +1 -1
  63. package/dist/C_Menu2.js +1 -1
  64. package/dist/C_NotificationCenter.css +316 -281
  65. package/dist/C_NotificationCenter.d.cts +2 -2
  66. package/dist/C_NotificationCenter.d.ts +2 -2
  67. package/dist/C_NotificationCenter2.cjs +1 -1
  68. package/dist/C_NotificationCenter2.js +1 -1
  69. package/dist/C_OrgChart.css +8 -8
  70. package/dist/C_PageLoading.css +34 -39
  71. package/dist/C_QRCode.css +5 -6
  72. package/dist/C_Signature.css +5 -6
  73. package/dist/C_Skeleton.css +2 -2
  74. package/dist/C_SplitPane.css +2 -2
  75. package/dist/C_Steps.css +5 -6
  76. package/dist/C_Table.base.css +1090 -879
  77. package/dist/C_Table.cjs +1 -1
  78. package/dist/C_Table.css +1096 -885
  79. package/dist/C_Table.d.cts +1 -1
  80. package/dist/C_Table.d.ts +1 -1
  81. package/dist/C_Table.js +1 -1
  82. package/dist/C_Tabs.css +5 -6
  83. package/dist/C_TagsView.css +60 -63
  84. package/dist/C_TagsView2.cjs +1 -1
  85. package/dist/C_TagsView2.js +1 -1
  86. package/dist/C_Theme.css +7 -8
  87. package/dist/C_Time.css +1 -1
  88. package/dist/C_Timeline.css +8 -8
  89. package/dist/C_Transfer.css +10 -11
  90. package/dist/C_Tree.css +16 -17
  91. package/dist/C_Upload.css +156 -157
  92. package/dist/C_VideoPlayer.css +267 -267
  93. package/dist/C_VtableGantt.css +2 -2
  94. package/dist/C_WaterFall.css +2 -2
  95. package/dist/C_WorkFlow.css +466 -470
  96. package/dist/C_WorkFlow2.cjs +1 -1
  97. package/dist/C_WorkFlow2.js +1 -1
  98. package/dist/Card.cjs +1 -0
  99. package/dist/Card.js +1 -0
  100. package/dist/Custom.cjs +1 -0
  101. package/dist/Custom.js +1 -0
  102. package/dist/Dynamic.cjs +1 -0
  103. package/dist/Dynamic.js +1 -0
  104. package/dist/Steps.cjs +1 -0
  105. package/dist/Steps.js +1 -0
  106. package/dist/Tabs.cjs +1 -0
  107. package/dist/Tabs.js +1 -0
  108. package/dist/cascader.cjs +1 -0
  109. package/dist/cascader.js +1 -0
  110. package/dist/color-picker.cjs +1 -0
  111. package/dist/color-picker.js +1 -0
  112. package/dist/constants3.d.cts +71 -117
  113. package/dist/constants3.d.ts +71 -117
  114. package/dist/constants4.d.cts +3 -3
  115. package/dist/constants4.d.ts +3 -3
  116. package/dist/constants5.d.cts +2 -2
  117. package/dist/constants5.d.ts +2 -2
  118. package/dist/context.cjs +1 -0
  119. package/dist/context.js +1 -0
  120. package/dist/contracts.d.cts +24 -0
  121. package/dist/contracts.d.ts +24 -0
  122. package/dist/createPageLoading.cjs +1 -1
  123. package/dist/createPageLoading.js +1 -1
  124. package/dist/data.cjs +1 -1
  125. package/dist/data.d.cts +9 -9
  126. package/dist/data.d.ts +9 -9
  127. package/dist/data.js +1 -1
  128. package/dist/date-picker.cjs +1 -0
  129. package/dist/date-picker.js +1 -0
  130. package/dist/feedback.cjs +1 -0
  131. package/dist/feedback.js +1 -0
  132. package/dist/helpers.cjs +1 -1
  133. package/dist/helpers.js +1 -1
  134. package/dist/index.cjs +1 -1
  135. package/dist/index.d.cts +7 -5
  136. package/dist/index.d.ts +7 -5
  137. package/dist/index.js +1 -1
  138. package/dist/index.vue.d.cts +5 -5
  139. package/dist/index.vue.d.ts +5 -5
  140. package/dist/index10.vue.d.cts +5 -5
  141. package/dist/index10.vue.d.ts +3 -3
  142. package/dist/index11.vue.d.cts +3 -3
  143. package/dist/index11.vue.d.ts +2 -2
  144. package/dist/index12.vue.d.cts +2 -2
  145. package/dist/index12.vue.d.ts +1 -1
  146. package/dist/index13.vue.d.cts +1 -1
  147. package/dist/index14.vue.d.ts +9 -9
  148. package/dist/index15.vue.d.cts +9 -9
  149. package/dist/index15.vue.d.ts +1 -1
  150. package/dist/index16.vue.d.cts +1 -1
  151. package/dist/index18.vue.d.ts +4 -4
  152. package/dist/index19.vue.d.cts +4 -4
  153. package/dist/index19.vue.d.ts +2 -9
  154. package/dist/index2.vue.d.cts +2 -2
  155. package/dist/index2.vue.d.ts +2 -2
  156. package/dist/index20.vue.d.cts +1 -1
  157. package/dist/index20.vue.d.ts +1 -1
  158. package/dist/index21.vue.d.cts +2 -2
  159. package/dist/index21.vue.d.ts +2 -2
  160. package/dist/index22.vue.d.cts +1 -1
  161. package/dist/index22.vue.d.ts +1 -1
  162. package/dist/index23.vue.d.cts +1 -1
  163. package/dist/index23.vue.d.ts +1 -1
  164. package/dist/index25.vue.d.cts +4 -4
  165. package/dist/index25.vue.d.ts +4 -4
  166. package/dist/index26.vue.d.cts +1 -1
  167. package/dist/index26.vue.d.ts +1 -1
  168. package/dist/index27.vue.d.cts +5 -5
  169. package/dist/index27.vue.d.ts +5 -5
  170. package/dist/index28.vue.d.cts +3 -3
  171. package/dist/index28.vue.d.ts +3 -3
  172. package/dist/index3.vue.d.cts +3 -3
  173. package/dist/index3.vue.d.ts +3 -3
  174. package/dist/index4.vue.d.cts +2 -9
  175. package/dist/index6.vue.d.ts +4 -4
  176. package/dist/index7.vue.d.cts +4 -4
  177. package/dist/index8.vue.d.ts +3 -3
  178. package/dist/index9.vue.d.cts +3 -3
  179. package/dist/index9.vue.d.ts +5 -5
  180. package/dist/mapUtils.d.cts +5 -5
  181. package/dist/mapUtils.d.ts +5 -5
  182. package/dist/presets.d.cts +8 -2
  183. package/dist/presets.d.ts +8 -2
  184. package/dist/rate.cjs +1 -0
  185. package/dist/rate.js +1 -0
  186. package/dist/slider.cjs +1 -0
  187. package/dist/slider.js +1 -0
  188. package/dist/style.css +10725 -10722
  189. package/dist/time-picker.cjs +1 -0
  190. package/dist/time-picker.js +1 -0
  191. package/dist/upload.cjs +1 -0
  192. package/dist/upload.js +1 -0
  193. package/dist/useActionTask.cjs +1 -0
  194. package/dist/useActionTask.js +1 -0
  195. package/dist/useCalendarEvents.d.cts +2 -2
  196. package/dist/useCalendarEvents.d.ts +2 -2
  197. package/dist/useCollapsePanel.d.cts +5 -5
  198. package/dist/useCollapsePanel.d.ts +5 -5
  199. package/dist/useComponentLocale.cjs +1 -0
  200. package/dist/useComponentLocale.js +1 -0
  201. package/dist/useCropperCore.d.cts +8 -8
  202. package/dist/useCropperCore.d.ts +8 -8
  203. package/dist/useDraggableLayout.d.cts +9 -9
  204. package/dist/useDraggableLayout.d.ts +9 -9
  205. package/dist/useDynamicFormState.cjs +1 -0
  206. package/dist/useDynamicFormState.d.cts +64 -40
  207. package/dist/useDynamicFormState.d.ts +64 -40
  208. package/dist/useDynamicFormState.js +1 -0
  209. package/dist/useEdgeInteraction.d.cts +2 -2
  210. package/dist/useEdgeInteraction.d.ts +2 -2
  211. package/dist/useQRCode.d.cts +2 -2
  212. package/dist/useQRCode.d.ts +2 -2
  213. package/dist/useSearchState.d.cts +14 -724
  214. package/dist/useSearchState.d.ts +14 -833
  215. package/dist/useSignatureHistory.d.cts +3 -3
  216. package/dist/useSignatureHistory.d.ts +3 -3
  217. package/dist/useSplitResize.d.cts +5 -5
  218. package/dist/useSplitResize.d.ts +5 -5
  219. package/dist/useTableQuery.cjs +3 -3
  220. package/dist/useTableQuery.d.cts +66 -33
  221. package/dist/useTableQuery.d.ts +66 -33
  222. package/dist/useTableQuery.js +3 -3
  223. package/dist/useTimeSelection.d.cts +2 -2
  224. package/dist/useTimeSelection.d.ts +2 -2
  225. package/dist/useTreeOperations.d.cts +7 -7
  226. package/dist/useTreeOperations.d.ts +7 -7
  227. package/dist/useWorkflowValidation.d.cts +5 -5
  228. package/dist/useWorkflowValidation.d.ts +5 -5
  229. package/dist/verification.d.cts +1 -1
  230. package/dist/verification.d.ts +1 -1
  231. package/docs/architecture.en.md +83 -0
  232. package/docs/architecture.md +83 -0
  233. package/docs/assets/README.md +47 -0
  234. package/docs/assets/naive-ui-components-banner.png +0 -0
  235. package/docs/assets/naive-ui-components-banner.svg +69 -0
  236. package/docs/assets/naive-ui-components-logo.png +0 -0
  237. package/docs/assets/naive-ui-components-logo.svg +22 -0
  238. package/docs/components.en.md +118 -0
  239. package/docs/components.md +118 -0
  240. package/docs/engineering.en.md +132 -0
  241. package/docs/engineering.md +133 -0
  242. package/docs/guides/notification-center.md +95 -0
  243. package/docs/guides/usage.en.md +638 -0
  244. package/docs/guides/usage.md +699 -0
  245. package/docs/performance-0.15.0.md +20 -0
  246. package/docs/security-scan-2026-10-06.md +11 -0
  247. package/docs/security-scan-2026-10-18.md +16 -0
  248. package/package.json +29 -11
  249. package/dist/C_Form2.cjs +0 -1
  250. package/dist/C_Form2.js +0 -1
  251. package/dist/config.cjs +0 -1
  252. package/dist/config.d.cts +0 -33
  253. package/dist/config.d.ts +0 -33
  254. package/dist/config.js +0 -1
@@ -1,6 +1,11 @@
1
1
  import * as vue from "vue";
2
+ import { Ref } from "vue";
2
3
 
3
4
  //#region src/components/C_NotificationCenter/types.d.ts
5
+ /** 远程模式缺少接口时明确报错,不回退演示数据。 */
6
+ type NotificationDataMode = 'demo' | 'remote';
7
+ /** 未返回的分类计数保持未知,避免把当前页误当成完整统计。 */
8
+ type NotificationUnreadByCategory = Partial<Record<NotificationCategory, number>>;
4
9
  /** 消息类别 */
5
10
  type NotificationCategory = 'system' | 'business' | 'alarm';
6
11
  /** 消息优先级 */
@@ -42,16 +47,19 @@ interface NotificationSender {
42
47
  avatar?: string;
43
48
  }
44
49
  /** 拉取消息列表函数 */
50
+ interface FetchNotificationsResult {
51
+ list: NotificationMessage[];
52
+ total: number;
53
+ /** 全局未读总数,与当前分类和页码无关。 */
54
+ unreadCount: number;
55
+ unreadByCategory?: NotificationUnreadByCategory;
56
+ }
45
57
  type FetchNotificationsFn = (params: {
46
58
  category?: NotificationCategory;
47
59
  status?: NotificationStatus;
48
60
  page?: number;
49
61
  pageSize?: number;
50
- }) => Promise<{
51
- list: NotificationMessage[];
52
- total: number;
53
- unreadCount: number;
54
- }>;
62
+ }) => Promise<FetchNotificationsResult>;
55
63
  /** 标记已读函数 */
56
64
  type MarkAsReadFn = (ids: string[]) => Promise<void>;
57
65
  /** 标记全部已读函数 */
@@ -74,6 +82,8 @@ interface NotificationWSConfig {
74
82
  heartbeatInterval?: number;
75
83
  /** 心跳消息内容 */
76
84
  heartbeatMessage?: string;
85
+ /** 等待 pong 的超时(ms);0 保持仅发送心跳的兼容行为。 */
86
+ heartbeatTimeout?: number;
77
87
  /** 鉴权 token 获取函数 */
78
88
  getToken?: () => string | undefined;
79
89
  }
@@ -86,10 +96,53 @@ interface WSNotificationPayload {
86
96
  /** 推送的消息数据 */
87
97
  data: NotificationMessage | NotificationMessage[] | {
88
98
  unreadCount: number;
99
+ unreadByCategory?: NotificationUnreadByCategory;
89
100
  };
90
101
  }
102
+ /**
103
+ * 可共享的通知数据源。组件只消费状态与操作,不拥有外部控制器的生命周期。
104
+ * Ref 支持 computed 投影,便于应用将顶部消息与完整消息中心接到同一 Store。
105
+ */
106
+ interface NotificationCenterController {
107
+ messages: Readonly<Ref<NotificationMessage[]>>;
108
+ activeCategory: Ref<NotificationCategory | 'all'>;
109
+ loading: Readonly<Ref<boolean>>;
110
+ total: Readonly<Ref<number>>;
111
+ page: Readonly<Ref<number>>;
112
+ selectedMessage: Ref<NotificationMessage | null>;
113
+ popoverVisible: Ref<boolean>;
114
+ wsStatus: Readonly<Ref<WSConnectionStatus>>;
115
+ unreadCount: Readonly<Ref<number>>;
116
+ unreadByCategory: Readonly<Ref<NotificationUnreadByCategory>>;
117
+ filteredMessages: Readonly<Ref<NotificationMessage[]>>;
118
+ hasMore: Readonly<Ref<boolean>>;
119
+ error: Readonly<Ref<string | null>>;
120
+ busy: Readonly<Ref<boolean>>;
121
+ pendingIds: Readonly<Ref<readonly string[]>>;
122
+ fetchMessages: (reset?: boolean) => Promise<void>;
123
+ loadMore: () => Promise<void>;
124
+ markAsRead: (ids: string[]) => Promise<void>;
125
+ markAllAsRead: (category?: NotificationCategory) => Promise<void>;
126
+ deleteMessages: (ids: string[]) => Promise<void>;
127
+ clearMessages: (category?: NotificationCategory) => Promise<void>;
128
+ selectMessage: (message: NotificationMessage) => void;
129
+ clearSelection: () => void;
130
+ switchCategory: (category: NotificationCategory | 'all') => void;
131
+ clearError: () => void;
132
+ /** 重试最近失败的操作;未实现时组件退回刷新列表。 */
133
+ retry?: () => Promise<void>;
134
+ connectWS: (config?: NotificationWSConfig) => void;
135
+ disconnectWS: () => void;
136
+ requestDesktopPermission: () => Promise<NotificationPermission | 'unsupported'>;
137
+ }
91
138
  /** 组件 Props */
92
139
  interface NotificationCenterProps {
140
+ /** 不传时根据 fetchNotifications 推断,保留无接口演示兼容性。 */
141
+ dataMode?: NotificationDataMode;
142
+ /** 外部共享控制器;传入后不再初始化本地数据、轮询或 WebSocket。 */
143
+ controller?: NotificationCenterController;
144
+ /** 独立 core 是否自动初始化,默认 true。 */
145
+ autoStart?: boolean;
93
146
  /** 拉取消息列表 */
94
147
  fetchNotifications?: FetchNotificationsFn;
95
148
  /** 标记已读 */
@@ -117,6 +170,7 @@ interface NotificationCenterProps {
117
170
  }
118
171
  /** 组件 Emits */
119
172
  interface NotificationCenterEmits {
173
+ viewAll: [];
120
174
  /** 点击消息 */
121
175
  itemClick: [message: NotificationMessage];
122
176
  /** 消息已读 */
@@ -162,6 +216,7 @@ declare const __VLS_export: vue.DefineComponent<NotificationCenterProps, Notific
162
216
  wsStatusChange: (status: WSConnectionStatus) => any;
163
217
  newMessage: (message: NotificationMessage) => any;
164
218
  navigate: (url: string) => any;
219
+ viewAll: () => any;
165
220
  }, string, vue.PublicProps, Readonly<NotificationCenterProps> & Readonly<{
166
221
  onDelete?: ((ids: string[]) => any) | undefined;
167
222
  onItemClick?: ((message: NotificationMessage) => any) | undefined;
@@ -171,12 +226,14 @@ declare const __VLS_export: vue.DefineComponent<NotificationCenterProps, Notific
171
226
  onWsStatusChange?: ((status: WSConnectionStatus) => any) | undefined;
172
227
  onNewMessage?: ((message: NotificationMessage) => any) | undefined;
173
228
  onNavigate?: ((url: string) => any) | undefined;
229
+ onViewAll?: (() => any) | undefined;
174
230
  }>, {
231
+ pageSize: number;
232
+ storageKey: string;
233
+ autoStart: boolean;
175
234
  desktopNotification: boolean;
176
235
  maxBadgeCount: number;
177
236
  pollingInterval: number;
178
- pageSize: number;
179
- storageKey: string;
180
237
  }, {}, {}, {}, string, vue.ComponentProvideOptions, false, {}, any>;
181
238
  declare const _default: typeof __VLS_export;
182
239
  //#endregion
@@ -185,117 +242,14 @@ interface NotificationCoreEvents {
185
242
  onNewMessage?: (message: NotificationMessage) => void;
186
243
  onWSStatusChange?: (status: WSConnectionStatus) => void;
187
244
  }
245
+ /** 验证查询与推送中的消息边界,拒绝畸形事件。 */
188
246
  /**
189
- * 通知中心核心状态管理
190
- *
191
- * 统一管理消息列表、未读数、分类过滤、已读标记、
192
- * API 交互、WebSocket 桥接、轮询调度和本地缓存。
247
+ * 独立组件与应用 Store 共用的无后端依赖控制器。
248
+ * 未指定模式时兼容旧接入:有查询接口为 remote,否则为 demo。
193
249
  */
194
- declare function useNotificationCore(props: NotificationCenterProps, events?: NotificationCoreEvents): {
195
- messages: vue.Ref<{
196
- id: string;
197
- title: string;
198
- summary: string;
199
- content?: string | undefined;
200
- category: NotificationCategory;
201
- priority: NotificationPriority;
202
- status: NotificationStatus;
203
- timestamp: string;
204
- sender?: {
205
- name: string;
206
- avatar?: string | undefined;
207
- } | undefined;
208
- actionUrl?: string | undefined;
209
- actionText?: string | undefined;
210
- extra?: Record<string, unknown> | undefined;
211
- }[], NotificationMessage[] | {
212
- id: string;
213
- title: string;
214
- summary: string;
215
- content?: string | undefined;
216
- category: NotificationCategory;
217
- priority: NotificationPriority;
218
- status: NotificationStatus;
219
- timestamp: string;
220
- sender?: {
221
- name: string;
222
- avatar?: string | undefined;
223
- } | undefined;
224
- actionUrl?: string | undefined;
225
- actionText?: string | undefined;
226
- extra?: Record<string, unknown> | undefined;
227
- }[]>;
228
- activeCategory: vue.Ref<NotificationCategory | "all", NotificationCategory | "all">;
229
- loading: vue.Ref<boolean, boolean>;
230
- total: vue.Ref<number, number>;
231
- page: vue.Ref<number, number>;
232
- selectedMessage: vue.Ref<{
233
- id: string;
234
- title: string;
235
- summary: string;
236
- content?: string | undefined;
237
- category: NotificationCategory;
238
- priority: NotificationPriority;
239
- status: NotificationStatus;
240
- timestamp: string;
241
- sender?: {
242
- name: string;
243
- avatar?: string | undefined;
244
- } | undefined;
245
- actionUrl?: string | undefined;
246
- actionText?: string | undefined;
247
- extra?: Record<string, unknown> | undefined;
248
- } | null, NotificationMessage | {
249
- id: string;
250
- title: string;
251
- summary: string;
252
- content?: string | undefined;
253
- category: NotificationCategory;
254
- priority: NotificationPriority;
255
- status: NotificationStatus;
256
- timestamp: string;
257
- sender?: {
258
- name: string;
259
- avatar?: string | undefined;
260
- } | undefined;
261
- actionUrl?: string | undefined;
262
- actionText?: string | undefined;
263
- extra?: Record<string, unknown> | undefined;
264
- } | null>;
265
- popoverVisible: vue.Ref<boolean, boolean>;
266
- wsStatus: vue.Ref<WSConnectionStatus, WSConnectionStatus>;
267
- unreadCount: vue.ComputedRef<number>;
268
- unreadByCategory: vue.ComputedRef<Record<string, number>>;
269
- filteredMessages: vue.ComputedRef<{
270
- id: string;
271
- title: string;
272
- summary: string;
273
- content?: string | undefined;
274
- category: NotificationCategory;
275
- priority: NotificationPriority;
276
- status: NotificationStatus;
277
- timestamp: string;
278
- sender?: {
279
- name: string;
280
- avatar?: string | undefined;
281
- } | undefined;
282
- actionUrl?: string | undefined;
283
- actionText?: string | undefined;
284
- extra?: Record<string, unknown> | undefined;
285
- }[]>;
286
- hasMore: vue.ComputedRef<boolean>;
287
- fetchMessages: (reset?: boolean) => Promise<void>;
288
- loadMore: () => Promise<void>;
289
- markAsRead: (ids: string[]) => Promise<void>;
290
- markAllAsRead: (category?: NotificationCategory) => Promise<void>;
291
- deleteMessages: (ids: string[]) => Promise<void>;
292
- clearMessages: (category?: NotificationCategory) => Promise<void>;
293
- selectMessage: (msg: NotificationMessage) => void;
294
- clearSelection: () => void;
295
- switchCategory: (category: NotificationCategory | "all") => void;
296
- requestDesktopPermission: () => Promise<NotificationPermission | "unsupported">;
297
- connectWS: (config: NotificationWSConfig) => void;
298
- disconnectWS: () => void;
250
+ declare function useNotificationCore(props: NotificationCenterProps, events?: NotificationCoreEvents): NotificationCenterController & {
251
+ initialize: () => void;
252
+ dispose: () => void;
299
253
  };
300
254
  //#endregion
301
255
  //#region src/components/C_NotificationCenter/composables/useNotificationFormat.d.ts
@@ -480,4 +434,4 @@ declare const MOCK_MESSAGES: ({
480
434
  actionText?: undefined;
481
435
  })[];
482
436
  //#endregion
483
- export { NotificationWSConfig as A, NotificationCenterEmits as C, NotificationPriority as D, NotificationMessage as E, WSNotificationPayload as M, NotificationSender as O, NotificationCategory as S, NotificationCenterProps as T, ClearNotificationsFn as _, DEFAULT_POLLING_INTERVAL as a, MarkAllReadFn as b, DEFAULT_WS_HEARTBEAT_MESSAGE as c, MOCK_MESSAGES as d, PRIORITY_MAP as f, _default as g, useNotificationCore as h, DEFAULT_PAGE_SIZE as i, WSConnectionStatus as j, NotificationStatus as k, DEFAULT_WS_MAX_RECONNECT as l, useNotificationFormat as m, CATEGORY_TABS as n, DEFAULT_STORAGE_KEY as o, useNotificationWS as p, DEFAULT_MAX_BADGE_COUNT as r, DEFAULT_WS_HEARTBEAT_INTERVAL as s, CATEGORY_MAP as t, DEFAULT_WS_RECONNECT_INTERVAL as u, DeleteNotificationFn as v, NotificationCenterExpose as w, MarkAsReadFn as x, FetchNotificationsFn as y };
437
+ export { NotificationPriority as A, NotificationCategory as C, NotificationCenterProps as D, NotificationCenterExpose as E, WSConnectionStatus as F, WSNotificationPayload as I, NotificationStatus as M, NotificationUnreadByCategory as N, NotificationDataMode as O, NotificationWSConfig as P, MarkAsReadFn as S, NotificationCenterEmits as T, ClearNotificationsFn as _, DEFAULT_POLLING_INTERVAL as a, FetchNotificationsResult as b, DEFAULT_WS_HEARTBEAT_MESSAGE as c, MOCK_MESSAGES as d, PRIORITY_MAP as f, _default as g, useNotificationCore as h, DEFAULT_PAGE_SIZE as i, NotificationSender as j, NotificationMessage as k, DEFAULT_WS_MAX_RECONNECT as l, useNotificationFormat as m, CATEGORY_TABS as n, DEFAULT_STORAGE_KEY as o, useNotificationWS as p, DEFAULT_MAX_BADGE_COUNT as r, DEFAULT_WS_HEARTBEAT_INTERVAL as s, CATEGORY_MAP as t, DEFAULT_WS_RECONNECT_INTERVAL as u, DeleteNotificationFn as v, NotificationCenterController as w, MarkAllReadFn as x, FetchNotificationsFn as y };
@@ -1,6 +1,11 @@
1
1
  import * as vue from "vue";
2
+ import { Ref } from "vue";
2
3
 
3
4
  //#region src/components/C_NotificationCenter/types.d.ts
5
+ /** 远程模式缺少接口时明确报错,不回退演示数据。 */
6
+ type NotificationDataMode = 'demo' | 'remote';
7
+ /** 未返回的分类计数保持未知,避免把当前页误当成完整统计。 */
8
+ type NotificationUnreadByCategory = Partial<Record<NotificationCategory, number>>;
4
9
  /** 消息类别 */
5
10
  type NotificationCategory = 'system' | 'business' | 'alarm';
6
11
  /** 消息优先级 */
@@ -42,16 +47,19 @@ interface NotificationSender {
42
47
  avatar?: string;
43
48
  }
44
49
  /** 拉取消息列表函数 */
50
+ interface FetchNotificationsResult {
51
+ list: NotificationMessage[];
52
+ total: number;
53
+ /** 全局未读总数,与当前分类和页码无关。 */
54
+ unreadCount: number;
55
+ unreadByCategory?: NotificationUnreadByCategory;
56
+ }
45
57
  type FetchNotificationsFn = (params: {
46
58
  category?: NotificationCategory;
47
59
  status?: NotificationStatus;
48
60
  page?: number;
49
61
  pageSize?: number;
50
- }) => Promise<{
51
- list: NotificationMessage[];
52
- total: number;
53
- unreadCount: number;
54
- }>;
62
+ }) => Promise<FetchNotificationsResult>;
55
63
  /** 标记已读函数 */
56
64
  type MarkAsReadFn = (ids: string[]) => Promise<void>;
57
65
  /** 标记全部已读函数 */
@@ -74,6 +82,8 @@ interface NotificationWSConfig {
74
82
  heartbeatInterval?: number;
75
83
  /** 心跳消息内容 */
76
84
  heartbeatMessage?: string;
85
+ /** 等待 pong 的超时(ms);0 保持仅发送心跳的兼容行为。 */
86
+ heartbeatTimeout?: number;
77
87
  /** 鉴权 token 获取函数 */
78
88
  getToken?: () => string | undefined;
79
89
  }
@@ -86,10 +96,53 @@ interface WSNotificationPayload {
86
96
  /** 推送的消息数据 */
87
97
  data: NotificationMessage | NotificationMessage[] | {
88
98
  unreadCount: number;
99
+ unreadByCategory?: NotificationUnreadByCategory;
89
100
  };
90
101
  }
102
+ /**
103
+ * 可共享的通知数据源。组件只消费状态与操作,不拥有外部控制器的生命周期。
104
+ * Ref 支持 computed 投影,便于应用将顶部消息与完整消息中心接到同一 Store。
105
+ */
106
+ interface NotificationCenterController {
107
+ messages: Readonly<Ref<NotificationMessage[]>>;
108
+ activeCategory: Ref<NotificationCategory | 'all'>;
109
+ loading: Readonly<Ref<boolean>>;
110
+ total: Readonly<Ref<number>>;
111
+ page: Readonly<Ref<number>>;
112
+ selectedMessage: Ref<NotificationMessage | null>;
113
+ popoverVisible: Ref<boolean>;
114
+ wsStatus: Readonly<Ref<WSConnectionStatus>>;
115
+ unreadCount: Readonly<Ref<number>>;
116
+ unreadByCategory: Readonly<Ref<NotificationUnreadByCategory>>;
117
+ filteredMessages: Readonly<Ref<NotificationMessage[]>>;
118
+ hasMore: Readonly<Ref<boolean>>;
119
+ error: Readonly<Ref<string | null>>;
120
+ busy: Readonly<Ref<boolean>>;
121
+ pendingIds: Readonly<Ref<readonly string[]>>;
122
+ fetchMessages: (reset?: boolean) => Promise<void>;
123
+ loadMore: () => Promise<void>;
124
+ markAsRead: (ids: string[]) => Promise<void>;
125
+ markAllAsRead: (category?: NotificationCategory) => Promise<void>;
126
+ deleteMessages: (ids: string[]) => Promise<void>;
127
+ clearMessages: (category?: NotificationCategory) => Promise<void>;
128
+ selectMessage: (message: NotificationMessage) => void;
129
+ clearSelection: () => void;
130
+ switchCategory: (category: NotificationCategory | 'all') => void;
131
+ clearError: () => void;
132
+ /** 重试最近失败的操作;未实现时组件退回刷新列表。 */
133
+ retry?: () => Promise<void>;
134
+ connectWS: (config?: NotificationWSConfig) => void;
135
+ disconnectWS: () => void;
136
+ requestDesktopPermission: () => Promise<NotificationPermission | 'unsupported'>;
137
+ }
91
138
  /** 组件 Props */
92
139
  interface NotificationCenterProps {
140
+ /** 不传时根据 fetchNotifications 推断,保留无接口演示兼容性。 */
141
+ dataMode?: NotificationDataMode;
142
+ /** 外部共享控制器;传入后不再初始化本地数据、轮询或 WebSocket。 */
143
+ controller?: NotificationCenterController;
144
+ /** 独立 core 是否自动初始化,默认 true。 */
145
+ autoStart?: boolean;
93
146
  /** 拉取消息列表 */
94
147
  fetchNotifications?: FetchNotificationsFn;
95
148
  /** 标记已读 */
@@ -117,6 +170,7 @@ interface NotificationCenterProps {
117
170
  }
118
171
  /** 组件 Emits */
119
172
  interface NotificationCenterEmits {
173
+ viewAll: [];
120
174
  /** 点击消息 */
121
175
  itemClick: [message: NotificationMessage];
122
176
  /** 消息已读 */
@@ -162,6 +216,7 @@ declare const __VLS_export: vue.DefineComponent<NotificationCenterProps, Notific
162
216
  wsStatusChange: (status: WSConnectionStatus) => any;
163
217
  newMessage: (message: NotificationMessage) => any;
164
218
  navigate: (url: string) => any;
219
+ viewAll: () => any;
165
220
  }, string, vue.PublicProps, Readonly<NotificationCenterProps> & Readonly<{
166
221
  onDelete?: ((ids: string[]) => any) | undefined;
167
222
  onItemClick?: ((message: NotificationMessage) => any) | undefined;
@@ -171,12 +226,14 @@ declare const __VLS_export: vue.DefineComponent<NotificationCenterProps, Notific
171
226
  onWsStatusChange?: ((status: WSConnectionStatus) => any) | undefined;
172
227
  onNewMessage?: ((message: NotificationMessage) => any) | undefined;
173
228
  onNavigate?: ((url: string) => any) | undefined;
229
+ onViewAll?: (() => any) | undefined;
174
230
  }>, {
231
+ pageSize: number;
232
+ storageKey: string;
233
+ autoStart: boolean;
175
234
  desktopNotification: boolean;
176
235
  maxBadgeCount: number;
177
236
  pollingInterval: number;
178
- pageSize: number;
179
- storageKey: string;
180
237
  }, {}, {}, {}, string, vue.ComponentProvideOptions, false, {}, any>;
181
238
  declare const _default: typeof __VLS_export;
182
239
  //#endregion
@@ -185,117 +242,14 @@ interface NotificationCoreEvents {
185
242
  onNewMessage?: (message: NotificationMessage) => void;
186
243
  onWSStatusChange?: (status: WSConnectionStatus) => void;
187
244
  }
245
+ /** 验证查询与推送中的消息边界,拒绝畸形事件。 */
188
246
  /**
189
- * 通知中心核心状态管理
190
- *
191
- * 统一管理消息列表、未读数、分类过滤、已读标记、
192
- * API 交互、WebSocket 桥接、轮询调度和本地缓存。
247
+ * 独立组件与应用 Store 共用的无后端依赖控制器。
248
+ * 未指定模式时兼容旧接入:有查询接口为 remote,否则为 demo。
193
249
  */
194
- declare function useNotificationCore(props: NotificationCenterProps, events?: NotificationCoreEvents): {
195
- messages: vue.Ref<{
196
- id: string;
197
- title: string;
198
- summary: string;
199
- content?: string | undefined;
200
- category: NotificationCategory;
201
- priority: NotificationPriority;
202
- status: NotificationStatus;
203
- timestamp: string;
204
- sender?: {
205
- name: string;
206
- avatar?: string | undefined;
207
- } | undefined;
208
- actionUrl?: string | undefined;
209
- actionText?: string | undefined;
210
- extra?: Record<string, unknown> | undefined;
211
- }[], NotificationMessage[] | {
212
- id: string;
213
- title: string;
214
- summary: string;
215
- content?: string | undefined;
216
- category: NotificationCategory;
217
- priority: NotificationPriority;
218
- status: NotificationStatus;
219
- timestamp: string;
220
- sender?: {
221
- name: string;
222
- avatar?: string | undefined;
223
- } | undefined;
224
- actionUrl?: string | undefined;
225
- actionText?: string | undefined;
226
- extra?: Record<string, unknown> | undefined;
227
- }[]>;
228
- activeCategory: vue.Ref<NotificationCategory | "all", NotificationCategory | "all">;
229
- loading: vue.Ref<boolean, boolean>;
230
- total: vue.Ref<number, number>;
231
- page: vue.Ref<number, number>;
232
- selectedMessage: vue.Ref<{
233
- id: string;
234
- title: string;
235
- summary: string;
236
- content?: string | undefined;
237
- category: NotificationCategory;
238
- priority: NotificationPriority;
239
- status: NotificationStatus;
240
- timestamp: string;
241
- sender?: {
242
- name: string;
243
- avatar?: string | undefined;
244
- } | undefined;
245
- actionUrl?: string | undefined;
246
- actionText?: string | undefined;
247
- extra?: Record<string, unknown> | undefined;
248
- } | null, NotificationMessage | {
249
- id: string;
250
- title: string;
251
- summary: string;
252
- content?: string | undefined;
253
- category: NotificationCategory;
254
- priority: NotificationPriority;
255
- status: NotificationStatus;
256
- timestamp: string;
257
- sender?: {
258
- name: string;
259
- avatar?: string | undefined;
260
- } | undefined;
261
- actionUrl?: string | undefined;
262
- actionText?: string | undefined;
263
- extra?: Record<string, unknown> | undefined;
264
- } | null>;
265
- popoverVisible: vue.Ref<boolean, boolean>;
266
- wsStatus: vue.Ref<WSConnectionStatus, WSConnectionStatus>;
267
- unreadCount: vue.ComputedRef<number>;
268
- unreadByCategory: vue.ComputedRef<Record<string, number>>;
269
- filteredMessages: vue.ComputedRef<{
270
- id: string;
271
- title: string;
272
- summary: string;
273
- content?: string | undefined;
274
- category: NotificationCategory;
275
- priority: NotificationPriority;
276
- status: NotificationStatus;
277
- timestamp: string;
278
- sender?: {
279
- name: string;
280
- avatar?: string | undefined;
281
- } | undefined;
282
- actionUrl?: string | undefined;
283
- actionText?: string | undefined;
284
- extra?: Record<string, unknown> | undefined;
285
- }[]>;
286
- hasMore: vue.ComputedRef<boolean>;
287
- fetchMessages: (reset?: boolean) => Promise<void>;
288
- loadMore: () => Promise<void>;
289
- markAsRead: (ids: string[]) => Promise<void>;
290
- markAllAsRead: (category?: NotificationCategory) => Promise<void>;
291
- deleteMessages: (ids: string[]) => Promise<void>;
292
- clearMessages: (category?: NotificationCategory) => Promise<void>;
293
- selectMessage: (msg: NotificationMessage) => void;
294
- clearSelection: () => void;
295
- switchCategory: (category: NotificationCategory | "all") => void;
296
- requestDesktopPermission: () => Promise<NotificationPermission | "unsupported">;
297
- connectWS: (config: NotificationWSConfig) => void;
298
- disconnectWS: () => void;
250
+ declare function useNotificationCore(props: NotificationCenterProps, events?: NotificationCoreEvents): NotificationCenterController & {
251
+ initialize: () => void;
252
+ dispose: () => void;
299
253
  };
300
254
  //#endregion
301
255
  //#region src/components/C_NotificationCenter/composables/useNotificationFormat.d.ts
@@ -480,4 +434,4 @@ declare const MOCK_MESSAGES: ({
480
434
  actionText?: undefined;
481
435
  })[];
482
436
  //#endregion
483
- export { NotificationWSConfig as A, NotificationCenterEmits as C, NotificationPriority as D, NotificationMessage as E, WSNotificationPayload as M, NotificationSender as O, NotificationCategory as S, NotificationCenterProps as T, ClearNotificationsFn as _, DEFAULT_POLLING_INTERVAL as a, MarkAllReadFn as b, DEFAULT_WS_HEARTBEAT_MESSAGE as c, MOCK_MESSAGES as d, PRIORITY_MAP as f, _default as g, useNotificationCore as h, DEFAULT_PAGE_SIZE as i, WSConnectionStatus as j, NotificationStatus as k, DEFAULT_WS_MAX_RECONNECT as l, useNotificationFormat as m, CATEGORY_TABS as n, DEFAULT_STORAGE_KEY as o, useNotificationWS as p, DEFAULT_MAX_BADGE_COUNT as r, DEFAULT_WS_HEARTBEAT_INTERVAL as s, CATEGORY_MAP as t, DEFAULT_WS_RECONNECT_INTERVAL as u, DeleteNotificationFn as v, NotificationCenterExpose as w, MarkAsReadFn as x, FetchNotificationsFn as y };
437
+ export { NotificationPriority as A, NotificationCategory as C, NotificationCenterProps as D, NotificationCenterExpose as E, WSConnectionStatus as F, WSNotificationPayload as I, NotificationStatus as M, NotificationUnreadByCategory as N, NotificationDataMode as O, NotificationWSConfig as P, MarkAsReadFn as S, NotificationCenterEmits as T, ClearNotificationsFn as _, DEFAULT_POLLING_INTERVAL as a, FetchNotificationsResult as b, DEFAULT_WS_HEARTBEAT_MESSAGE as c, MOCK_MESSAGES as d, PRIORITY_MAP as f, _default as g, useNotificationCore as h, DEFAULT_PAGE_SIZE as i, NotificationSender as j, NotificationMessage as k, DEFAULT_WS_MAX_RECONNECT as l, useNotificationFormat as m, CATEGORY_TABS as n, DEFAULT_STORAGE_KEY as o, useNotificationWS as p, DEFAULT_MAX_BADGE_COUNT as r, DEFAULT_WS_HEARTBEAT_INTERVAL as s, CATEGORY_MAP as t, DEFAULT_WS_RECONNECT_INTERVAL as u, DeleteNotificationFn as v, NotificationCenterController as w, MarkAllReadFn as x, FetchNotificationsFn as y };
@@ -198,24 +198,24 @@ type __VLS_Slots = {} & {
198
198
  declare const __VLS_base: vue.DefineComponent<UploadProps, UploadExpose, {}, {}, {}, vue.ComponentOptionsMixin, vue.ComponentOptionsMixin, {
199
199
  change: (fileList: UploadFileItem[]) => any;
200
200
  error: (file: UploadFileItem, error: Error) => any;
201
- progress: (file: UploadFileItem, percent: number) => any;
202
201
  success: (file: UploadFileItem, response: unknown) => any;
202
+ progress: (file: UploadFileItem, percent: number) => any;
203
203
  remove: (file: UploadFileItem) => any;
204
204
  finish: (fileList: UploadFileItem[]) => any;
205
205
  exceed: (files: File[], fileList: UploadFileItem[]) => any;
206
206
  }, string, vue.PublicProps, Readonly<UploadProps> & Readonly<{
207
207
  onChange?: ((fileList: UploadFileItem[]) => any) | undefined;
208
208
  onError?: ((file: UploadFileItem, error: Error) => any) | undefined;
209
- onProgress?: ((file: UploadFileItem, percent: number) => any) | undefined;
210
209
  onSuccess?: ((file: UploadFileItem, response: unknown) => any) | undefined;
210
+ onProgress?: ((file: UploadFileItem, percent: number) => any) | undefined;
211
211
  onRemove?: ((file: UploadFileItem) => any) | undefined;
212
212
  onFinish?: ((fileList: UploadFileItem[]) => any) | undefined;
213
213
  onExceed?: ((files: File[], fileList: UploadFileItem[]) => any) | undefined;
214
214
  }>, {
215
- data: Record<string, unknown>;
216
215
  disabled: boolean;
217
216
  draggable: boolean;
218
217
  action: string;
218
+ data: Record<string, unknown>;
219
219
  headers: Record<string, string>;
220
220
  multiple: boolean;
221
221
  directory: boolean;
@@ -198,24 +198,24 @@ type __VLS_Slots = {} & {
198
198
  declare const __VLS_base: vue.DefineComponent<UploadProps, UploadExpose, {}, {}, {}, vue.ComponentOptionsMixin, vue.ComponentOptionsMixin, {
199
199
  change: (fileList: UploadFileItem[]) => any;
200
200
  error: (file: UploadFileItem, error: Error) => any;
201
- progress: (file: UploadFileItem, percent: number) => any;
202
201
  success: (file: UploadFileItem, response: unknown) => any;
202
+ progress: (file: UploadFileItem, percent: number) => any;
203
203
  remove: (file: UploadFileItem) => any;
204
204
  finish: (fileList: UploadFileItem[]) => any;
205
205
  exceed: (files: File[], fileList: UploadFileItem[]) => any;
206
206
  }, string, vue.PublicProps, Readonly<UploadProps> & Readonly<{
207
207
  onChange?: ((fileList: UploadFileItem[]) => any) | undefined;
208
208
  onError?: ((file: UploadFileItem, error: Error) => any) | undefined;
209
- onProgress?: ((file: UploadFileItem, percent: number) => any) | undefined;
210
209
  onSuccess?: ((file: UploadFileItem, response: unknown) => any) | undefined;
210
+ onProgress?: ((file: UploadFileItem, percent: number) => any) | undefined;
211
211
  onRemove?: ((file: UploadFileItem) => any) | undefined;
212
212
  onFinish?: ((fileList: UploadFileItem[]) => any) | undefined;
213
213
  onExceed?: ((files: File[], fileList: UploadFileItem[]) => any) | undefined;
214
214
  }>, {
215
- data: Record<string, unknown>;
216
215
  disabled: boolean;
217
216
  draggable: boolean;
218
217
  action: string;
218
+ data: Record<string, unknown>;
219
219
  headers: Record<string, string>;
220
220
  multiple: boolean;
221
221
  directory: boolean;
@@ -258,9 +258,9 @@ type PlayerInstance = InstanceType<typeof xgplayer.default>;
258
258
  //#endregion
259
259
  //#region src/components/C_VideoPlayer/index.vue.d.ts
260
260
  declare const __VLS_export: vue.DefineComponent<VideoPlayerProps, VideoPlayerExpose, {}, {}, {}, vue.ComponentOptionsMixin, vue.ComponentOptionsMixin, {
261
+ ready: () => any;
261
262
  error: (error: Error) => any;
262
263
  ended: () => any;
263
- ready: () => any;
264
264
  stateChange: (state: PlayerState) => any;
265
265
  timeUpdate: (currentTime: number, duration: number) => any;
266
266
  qualityChange: (quality: QualityLevel) => any;
@@ -271,9 +271,9 @@ declare const __VLS_export: vue.DefineComponent<VideoPlayerProps, VideoPlayerExp
271
271
  chapterChange: (chapter: Chapter) => any;
272
272
  progressUpdate: (data: ProgressData) => any;
273
273
  }, string, vue.PublicProps, Readonly<VideoPlayerProps> & Readonly<{
274
+ onReady?: (() => any) | undefined;
274
275
  onError?: ((error: Error) => any) | undefined;
275
276
  onEnded?: (() => any) | undefined;
276
- onReady?: (() => any) | undefined;
277
277
  onStateChange?: ((state: PlayerState) => any) | undefined;
278
278
  onTimeUpdate?: ((currentTime: number, duration: number) => any) | undefined;
279
279
  onQualityChange?: ((quality: QualityLevel) => any) | undefined;
@@ -258,9 +258,9 @@ type PlayerInstance = InstanceType<typeof xgplayer.default>;
258
258
  //#endregion
259
259
  //#region src/components/C_VideoPlayer/index.vue.d.ts
260
260
  declare const __VLS_export: vue.DefineComponent<VideoPlayerProps, VideoPlayerExpose, {}, {}, {}, vue.ComponentOptionsMixin, vue.ComponentOptionsMixin, {
261
+ ready: () => any;
261
262
  error: (error: Error) => any;
262
263
  ended: () => any;
263
- ready: () => any;
264
264
  stateChange: (state: PlayerState) => any;
265
265
  timeUpdate: (currentTime: number, duration: number) => any;
266
266
  qualityChange: (quality: QualityLevel) => any;
@@ -271,9 +271,9 @@ declare const __VLS_export: vue.DefineComponent<VideoPlayerProps, VideoPlayerExp
271
271
  chapterChange: (chapter: Chapter) => any;
272
272
  progressUpdate: (data: ProgressData) => any;
273
273
  }, string, vue.PublicProps, Readonly<VideoPlayerProps> & Readonly<{
274
+ onReady?: (() => any) | undefined;
274
275
  onError?: ((error: Error) => any) | undefined;
275
276
  onEnded?: (() => any) | undefined;
276
- onReady?: (() => any) | undefined;
277
277
  onStateChange?: ((state: PlayerState) => any) | undefined;
278
278
  onTimeUpdate?: ((currentTime: number, duration: number) => any) | undefined;
279
279
  onQualityChange?: ((quality: QualityLevel) => any) | undefined;
@@ -0,0 +1 @@
1
+ const e=Symbol(`robot-component-feedback`),t=Symbol(`robot-component-locale`);Object.defineProperty(exports,`n`,{enumerable:!0,get:function(){return t}}),Object.defineProperty(exports,`t`,{enumerable:!0,get:function(){return e}});
@@ -0,0 +1 @@
1
+ const e=Symbol(`robot-component-feedback`),t=Symbol(`robot-component-locale`);export{t as n,e as t};
@@ -0,0 +1,24 @@
1
+ //#region src/core/contracts.d.ts
2
+ /** UI-independent feedback and locale protocols. No framework runtime is imported here. */
3
+ interface ConfirmOptions {
4
+ title: string;
5
+ content: string;
6
+ positiveText?: string;
7
+ negativeText?: string;
8
+ type?: 'warning' | 'error' | 'info' | 'success';
9
+ }
10
+ interface ComponentFeedback {
11
+ success?: (message: string) => void;
12
+ error?: (message: string, cause?: unknown) => void;
13
+ warning?: (message: string) => void;
14
+ info?: (message: string) => void;
15
+ confirm?: (options: ConfirmOptions) => boolean | Promise<boolean>;
16
+ }
17
+ type ComponentLocaleName = 'zh-CN' | 'en-US';
18
+ interface ComponentLocale {
19
+ locale?: ComponentLocaleName;
20
+ messages?: Record<string, string>;
21
+ t?: (key: string, params?: Record<string, string | number>) => string;
22
+ }
23
+ //#endregion
24
+ export { ConfirmOptions as i, ComponentLocale as n, ComponentLocaleName as r, ComponentFeedback as t };