tauri-notice-window 1.0.9 → 1.0.11

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.
package/dist/index.d.ts CHANGED
@@ -14,8 +14,8 @@ export { NoticeLayout } from './components/NoticeLayout';
14
14
  export { setNoticeConfig, getNoticeConfig } from './config/noticeConfig';
15
15
  import { initializeNoticeWindowSystem, createNoticeWindow, closeNoticeWindow, closeAllNoticeWindows } from './utils/noticeWindow';
16
16
  export { initializeNoticeWindowSystem, createNoticeWindow, closeNoticeWindow, closeAllNoticeWindows, };
17
- import { initializeDatabase, saveMessage, hasMessage, isMessageShown, getPendingMessages, getMessage, deleteMessageById, markAsShown, markAsHidden, clearPendingMessages, updateQueueStatus } from './utils/db';
18
- export { initializeDatabase, saveMessage, hasMessage, isMessageShown, getPendingMessages, getMessage, deleteMessageById, updateQueueStatus, markAsShown, markAsHidden, clearPendingMessages, };
17
+ import { initializeDatabase, getPendingMessages, getMessage } from './utils/db';
18
+ export { initializeDatabase, getPendingMessages, getMessage, };
19
19
  /**
20
20
  * Initialize the complete notice window system
21
21
  * Call this once during app startup (e.g., in App.tsx or main layout)
@@ -30,4 +30,55 @@ export { initializeDatabase, saveMessage, hasMessage, isMessageShown, getPending
30
30
  * ```
31
31
  */
32
32
  export declare const initializeNoticeSystem: () => Promise<void>;
33
+ /**
34
+ * Delete a message by ID
35
+ * Removes the message from both the runtime queue (Zustand) and persistent storage (IndexedDB)
36
+ * If the message is currently being displayed, its window will be closed automatically
37
+ *
38
+ * @param messageId - The ID of the message to delete
39
+ *
40
+ * @example
41
+ * ```typescript
42
+ * import { deleteMessageById } from 'tauri-notice-window'
43
+ *
44
+ * // Delete a specific message
45
+ * await deleteMessageById('message-123')
46
+ *
47
+ * // If message is currently shown, window closes and next message displays
48
+ * ```
49
+ */
50
+ export declare const deleteMessageById: (messageId: string) => Promise<void>;
51
+ /**
52
+ * Hide a message by ID
53
+ * Marks the message as hidden in the database and removes it from the queue
54
+ * Typically used for server-triggered hide events
55
+ *
56
+ * @param messageId - The ID of the message to hide
57
+ *
58
+ * @example
59
+ * ```typescript
60
+ * import { hideMessageById } from 'tauri-notice-window'
61
+ *
62
+ * // Server triggers hide via websocket
63
+ * socket.on('hide_message', async (data) => {
64
+ * await hideMessageById(data.message_id)
65
+ * })
66
+ * ```
67
+ */
68
+ export declare const hideMessageById: (messageId: string) => Promise<void>;
69
+ /**
70
+ * Mark a message as shown
71
+ * Updates the database to prevent the message from being shown again
72
+ *
73
+ * @param messageId - The ID of the message to mark as shown
74
+ *
75
+ * @example
76
+ * ```typescript
77
+ * import { markMessageAsShown } from 'tauri-notice-window'
78
+ *
79
+ * // Manually mark a message as shown without displaying it
80
+ * await markMessageAsShown('message-123')
81
+ * ```
82
+ */
83
+ export declare const markMessageAsShown: (messageId: string) => Promise<void>;
33
84
  //# sourceMappingURL=index.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAGH,YAAY,EAAE,WAAW,EAAE,aAAa,EAAE,YAAY,EAAE,cAAc,EAAE,MAAM,iBAAiB,CAAA;AAG/F,OAAO,EAAE,oBAAoB,EAAE,qBAAqB,EAAE,MAAM,4BAA4B,CAAA;AACxF,OAAO,EAAE,oBAAoB,EAAE,qBAAqB,EAAE,CAAA;AAGtD,OAAO,EAAE,eAAe,EAAE,MAAM,yBAAyB,CAAA;AACzD,OAAO,EAAE,cAAc,EAAE,MAAM,wBAAwB,CAAA;AACvD,OAAO,EAAE,aAAa,EAAE,MAAM,uBAAuB,CAAA;AACrD,OAAO,EAAE,iBAAiB,EAAE,MAAM,2BAA2B,CAAA;AAC7D,OAAO,EAAE,eAAe,EAAE,MAAM,yBAAyB,CAAA;AAGzD,OAAO,EAAE,YAAY,EAAE,MAAM,2BAA2B,CAAA;AAGxD,OAAO,EAAE,eAAe,EAAE,eAAe,EAAE,MAAM,uBAAuB,CAAA;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