forked from zhangyonghao/minimap
first commit
This commit is contained in:
47
frontend/types/mindmap.ts
Normal file
47
frontend/types/mindmap.ts
Normal file
@@ -0,0 +1,47 @@
|
||||
import type { Edge, Node } from "reactflow";
|
||||
|
||||
export interface MindmapNode {
|
||||
id: string;
|
||||
label: string;
|
||||
parent_id: string | null;
|
||||
level: number;
|
||||
is_leaf: boolean;
|
||||
children: MindmapNode[];
|
||||
}
|
||||
|
||||
export interface Mindmap {
|
||||
id: number;
|
||||
unique_id: string;
|
||||
session_id: string;
|
||||
title: string;
|
||||
raw_json: string;
|
||||
tree: MindmapNode;
|
||||
url: string;
|
||||
created_at: string;
|
||||
updated_at: string;
|
||||
}
|
||||
|
||||
export interface CreateMindmapPayload {
|
||||
session_id: string;
|
||||
mindmap_json: Record<string, unknown>;
|
||||
}
|
||||
|
||||
export interface GraphNodeData {
|
||||
label: string;
|
||||
level: number;
|
||||
isLeaf: boolean;
|
||||
hasChildren: boolean;
|
||||
isExpanded: boolean;
|
||||
onToggle?: () => void;
|
||||
onOpenChat?: () => void;
|
||||
}
|
||||
|
||||
export interface GraphData {
|
||||
nodes: Node<GraphNodeData>[];
|
||||
edges: Edge[];
|
||||
}
|
||||
|
||||
export interface ChatMessage {
|
||||
role: "user" | "assistant";
|
||||
content: string;
|
||||
}
|
||||
Reference in New Issue
Block a user