mirror of
https://github.com/Comfy-Org/ComfyUI_frontend.git
synced 2026-03-13 17:10:06 +00:00
Support async hooks in TreeExplorerNode (#888)
* Support async hooks in TreeExplorerNode * rebase * nit * Fix component test failure * Add edit vitest * Add more tests * Add component test
This commit is contained in:
@@ -9,14 +9,17 @@ export interface TreeExplorerNode<T = any> {
|
||||
icon?: string
|
||||
getIcon?: (node: TreeExplorerNode<T>) => string
|
||||
// Function to handle renaming the node
|
||||
handleRename?: (node: TreeExplorerNode<T>, newName: string) => void
|
||||
handleRename?: (
|
||||
node: TreeExplorerNode<T>,
|
||||
newName: string
|
||||
) => void | Promise<void>
|
||||
// Function to handle deleting the node
|
||||
handleDelete?: (node: TreeExplorerNode<T>) => void
|
||||
handleDelete?: (node: TreeExplorerNode<T>) => void | Promise<void>
|
||||
// Function to handle adding a child node
|
||||
handleAddChild?: (
|
||||
node: TreeExplorerNode<T>,
|
||||
child: TreeExplorerNode<T>
|
||||
) => void
|
||||
) => void | Promise<void>
|
||||
// Whether the node is draggable
|
||||
draggable?: boolean
|
||||
// Whether the node is droppable
|
||||
@@ -25,9 +28,12 @@ export interface TreeExplorerNode<T = any> {
|
||||
handleDrop?: (
|
||||
node: TreeExplorerNode<T>,
|
||||
data: TreeExplorerDragAndDropData
|
||||
) => void
|
||||
) => void | Promise<void>
|
||||
// Function to handle clicking a node
|
||||
handleClick?: (node: TreeExplorerNode<T>, event: MouseEvent) => void
|
||||
handleClick?: (
|
||||
node: TreeExplorerNode<T>,
|
||||
event: MouseEvent
|
||||
) => void | Promise<void>
|
||||
// Function to handle errors
|
||||
handleError?: (error: Error) => void
|
||||
// Extra context menu items
|
||||
|
||||
Reference in New Issue
Block a user