mirror of
https://github.com/aljazceru/claude-code-viewer.git
synced 2026-01-16 20:14:22 +01:00
perf: refactor sse handleing
This commit is contained in:
31
src/types/sse.ts
Normal file
31
src/types/sse.ts
Normal file
@@ -0,0 +1,31 @@
|
||||
import type { AliveClaudeCodeTask } from "../server/service/claude-code/types";
|
||||
|
||||
export type SSEEventDeclaration = {
|
||||
// biome-ignore lint/complexity/noBannedTypes: correct type
|
||||
connect: {};
|
||||
|
||||
// biome-ignore lint/complexity/noBannedTypes: correct type
|
||||
heartbeat: {};
|
||||
|
||||
sessionListChanged: {
|
||||
projectId: string;
|
||||
};
|
||||
|
||||
sessionChanged: {
|
||||
projectId: string;
|
||||
sessionId: string;
|
||||
};
|
||||
|
||||
taskChanged: {
|
||||
aliveTasks: AliveClaudeCodeTask[];
|
||||
};
|
||||
};
|
||||
|
||||
export type SSEEventMap = {
|
||||
[K in keyof SSEEventDeclaration]: SSEEventDeclaration[K] & {
|
||||
kind: K;
|
||||
timestamp: string;
|
||||
};
|
||||
};
|
||||
|
||||
export type SSEEvent = SSEEventMap[keyof SSEEventDeclaration];
|
||||
Reference in New Issue
Block a user