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

Function getWorkspaceStoreInterface

src/renderer/src/stores/workspaceStore.ts:223–251  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

221 * 获取工作区 Store 的接口实现
222 */
223export function getWorkspaceStoreInterface(): IWorkspaceStore {
224 const store = useWorkspaceStore
225 return {
226 get workspaces() {
227 return store.getState().workspaces
228 },
229 get currentWorkspaceId() {
230 return store.getState().currentWorkspaceId
231 },
232 get currentWorkspace() {
233 return store.getState().currentWorkspace
234 },
235 get initialized() {
236 return store.getState().initialized
237 },
238 init: () => store.getState().init(),
239 reset: () => store.getState().reset(),
240 getById: (id) => store.getState().getById(id),
241 getAll: () => store.getState().getAll(),
242 update: (id, changes) => store.getState().update(id, changes),
243 delete: (id) => store.getState().delete(id),
244 switchWorkspace: (id) => store.getState().switchWorkspace(id),
245 setCurrentWorkspaceId: (id) => store.getState().setCurrentWorkspaceId(id),
246 initDefaultWorkspace: () => store.getState().initDefaultWorkspace(),
247 validateWorkspacePath: (dirPath) => store.getState().validateWorkspacePath(dirPath),
248 openCustomWorkspace: (dirPath, name) => store.getState().openCustomWorkspace(dirPath, name),
249 repairWorkspacePath: (dirPath) => store.getState().repairWorkspacePath(dirPath)
250 }
251}

Callers 1

initStoresFunction · 0.90

Calls 12

switchWorkspaceMethod · 0.80
openCustomWorkspaceMethod · 0.80
initMethod · 0.65
resetMethod · 0.65
getByIdMethod · 0.65
getAllMethod · 0.65
updateMethod · 0.65
deleteMethod · 0.65
setCurrentWorkspaceIdMethod · 0.65
initDefaultWorkspaceMethod · 0.65
validateWorkspacePathMethod · 0.65
repairWorkspacePathMethod · 0.65

Tested by

no test coverage detected