MCPcopy Create free account
hub / github.com/experdot/pointer / getMessageStoreInterface

Function getMessageStoreInterface

src/renderer/src/stores/messagesStore.ts:189–211  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

187 * 获取消息 Store 的接口实现
188 */
189export function getMessageStoreInterface(): IMessageStore {
190 const store = useMessagesStore
191 return {
192 load: (key) => store.getState().load(key),
193 get: (key) => store.getState().get(key),
194 has: (key) => store.getState().has(key),
195 evict: (key) => store.getState().evict(key),
196 evictAll: () => store.getState().evictAll(),
197 reset: () => store.getState().reset(),
198 update: (pageId, updater) => store.getState().update(pageId, updater),
199 addMessage: (pageId, message) => store.getState().addMessage(pageId, message),
200 updateMessage: (pageId, messageId, changes) =>
201 store.getState().updateMessage(pageId, messageId, changes),
202 deleteMessages: (pageId, messageIds) => store.getState().deleteMessages(pageId, messageIds),
203 updateSession: (pageId, changes) => store.getState().updateSession(pageId, changes),
204 addTopic: (pageId, topic) => store.getState().addTopic(pageId, topic),
205 updateTopic: (pageId, topicId, changes) =>
206 store.getState().updateTopic(pageId, topicId, changes),
207 deleteTopic: (pageId, topicId) => store.getState().deleteTopic(pageId, topicId),
208 getTopics: (pageId) => store.getState().getTopics(pageId),
209 removeRecord: (pageId) => store.getState().removeRecord(pageId)
210 }
211}
212
213// ==================== 兼容性导出(过渡期使用)====================
214// 导航功能已移至 navigationStore

Callers 1

initStoresFunction · 0.90

Calls 15

loadMethod · 0.80
hasMethod · 0.80
evictMethod · 0.80
evictAllMethod · 0.80
addMessageMethod · 0.80
updateMessageMethod · 0.80
deleteMessagesMethod · 0.80
updateSessionMethod · 0.80
addTopicMethod · 0.80
updateTopicMethod · 0.80
deleteTopicMethod · 0.80
getTopicsMethod · 0.80

Tested by

no test coverage detected