Add LGraphNode.getExtraSlotMenuOptions hook (#522)

This commit is contained in:
Chenlei Hu
2025-02-12 15:52:27 -05:00
committed by GitHub
parent 9abcf0fd32
commit 361a1a76ef
2 changed files with 12 additions and 0 deletions

View File

@@ -458,7 +458,15 @@ export class LGraphNode implements Positionable, IPinnable {
canvasElement: HTMLCanvasElement,
): void
onMouseLeave?(this: LGraphNode, e: CanvasMouseEvent): void
/**
* Override the default slot menu options.
*/
getSlotMenuOptions?(this: LGraphNode, slot: IFoundSlot): IContextMenuValue[]
/**
* Add extra menu options to the slot context menu.
*/
getExtraSlotMenuOptions?(this: LGraphNode, slot: IFoundSlot): IContextMenuValue[]
// FIXME: Re-typing
onDropItem?(this: LGraphNode, event: Event): boolean
onDropData?(