refactor: update socket types

This commit is contained in:
wancat committed 2024-03-28 21:06:09 +08:00
1 parent bb2a1a145f
commit ebd713200c
6 files changed
+120 -19

No files matched your search

+1 -14
View File
@@ -18,6 +18,7 @@ function newSession() {
discovered: false,
})
return {
_id: '',
status: 'inactive',
graph,
pwd: '',
@@ -100,18 +101,10 @@ function updateGraph(event: { discover: FileObject[]; pwd: string }) {
}
}
function updateHints(hints: never) {
store.session.hints.push(hints)
}
function updateStatus(status: string) {
store.session.status = status
}
function setTasks(tasks: never[]) {
store.session.tasks = tasks
}
export function useTerminal() {
return term
}
@@ -150,12 +143,6 @@ function setup() {
socket.on('graph', (event: { discover: FileObject[]; pwd: string }) => {
updateGraph(event)
})
socket.on('hints', (event: never) => {
updateHints(event)
})
socket.on('tasks', (tasks: never[]) => {
setTasks(tasks)
})
socket.on('status', (event: string) => {
updateStatus(event)
})