forked from zhangyonghao/minimap
48 lines
867 B
TypeScript
48 lines
867 B
TypeScript
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;
|
|
}
|