import type { LGraphNode } from '@comfyorg/litegraph' type PasteHandler = (file: File) => Promise interface NodePasteOptions { onPaste: PasteHandler fileFilter?: (file: File) => boolean } /** * Adds paste handling to a node */ export const useNodePaste = ( node: LGraphNode, options: NodePasteOptions ) => { const { onPaste, fileFilter = () => true } = options node.pasteFile = function (file: File) { if (!fileFilter(file)) return false onPaste(file).then((result) => { if (!result) return }) return true } }