()
| 221 | * 获取工作区 Store 的接口实现 |
| 222 | */ |
| 223 | export 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 | } |
no test coverage detected