@comfyorg/comfyui-frontend-types 1.9.18 → 1.10.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (2) hide show
  1. package/index.d.ts +154 -0
  2. package/package.json +2 -2
package/index.d.ts CHANGED
@@ -33574,3 +33574,157 @@ export declare class ComfyApp {
33574
33574
  declare global {
33575
33575
  const app: ComfyApp;
33576
33576
  }
33577
+
33578
+ /// <reference types="vite/client" />
33579
+
33580
+ declare global {
33581
+ interface Window {
33582
+ __COMFYUI_FRONTEND_VERSION__: string
33583
+ }
33584
+ }
33585
+
33586
+
33587
+
33588
+ /** ComfyUI extensions of litegraph */
33589
+ declare module '@comfyorg/litegraph/dist/types/widgets' {
33590
+ interface IWidgetOptions {
33591
+ /** Currently used by DOM widgets only. Declaring here reduces complexity. */
33592
+ onHide?: (widget: DOMWidget) => void
33593
+ }
33594
+
33595
+ interface IBaseWidget {
33596
+ onRemove?: () => void
33597
+ beforeQueued?: () => unknown
33598
+ afterQueued?: () => unknown
33599
+ serializeValue?: (node: LGraphNode, index: number) => Promise<unknown>
33600
+
33601
+ /**
33602
+ * If the widget supports dynamic prompts, this will be set to true.
33603
+ * See extensions/core/dynamicPrompts.ts
33604
+ */
33605
+ dynamicPrompts?: boolean
33606
+ }
33607
+ }
33608
+
33609
+
33610
+
33611
+ /**
33612
+ * ComfyUI extensions of litegraph
33613
+ */
33614
+ declare module '@comfyorg/litegraph' {
33615
+ interface LGraphNodeConstructor<T extends LGraphNode = LGraphNode> {
33616
+ type?: string
33617
+ comfyClass: string
33618
+ title: string
33619
+ nodeData?: ComfyNodeDef
33620
+ category?: string
33621
+ new (): T
33622
+ }
33623
+
33624
+ interface LGraphNode {
33625
+ constructor: LGraphNodeConstructor
33626
+
33627
+ /**
33628
+ * Callback fired on each node after the graph is configured
33629
+ */
33630
+ onAfterGraphConfigured?(): void
33631
+ onGraphConfigured?(): void
33632
+ onExecuted?(output: any): void
33633
+ onNodeCreated?(this: LGraphNode): void
33634
+ setInnerNodes?(nodes: LGraphNode[]): void
33635
+ getInnerNodes?(): LGraphNode[]
33636
+ convertToNodes?(): LGraphNode[]
33637
+ recreate?(): Promise<LGraphNode>
33638
+ refreshComboInNode?(defs: Record<string, ComfyNodeDef>)
33639
+ applyToGraph?(extraLinks?: LLink[]): void
33640
+ updateLink?(link: LLink): LLink | null
33641
+ onExecutionStart?(): unknown
33642
+ /**
33643
+ * Callback invoked when the node is dragged over from an external source, i.e.
33644
+ * a file or another HTML element.
33645
+ * @param e The drag event
33646
+ * @returns {boolean} True if the drag event should be handled by this node, false otherwise
33647
+ */
33648
+ onDragOver?(e: DragEvent): boolean
33649
+ /**
33650
+ * Callback invoked when the node is dropped from an external source, i.e.
33651
+ * a file or another HTML element.
33652
+ * @param e The drag event
33653
+ * @returns {boolean} True if the drag event should be handled by this node, false otherwise
33654
+ */
33655
+ onDragDrop?(e: DragEvent): Promise<boolean> | boolean
33656
+
33657
+ index?: number
33658
+ runningInternalNodeId?: NodeId
33659
+
33660
+ comfyClass?: string
33661
+
33662
+ /**
33663
+ * If the node is a frontend only node and should not be serialized into the prompt.
33664
+ */
33665
+ isVirtualNode?: boolean
33666
+
33667
+ addDOMWidget(
33668
+ name: string,
33669
+ type: string,
33670
+ element: HTMLElement,
33671
+ options?: Record<string, any>
33672
+ ): DOMWidget
33673
+
33674
+ animatedImages?: boolean
33675
+ imgs?: HTMLImageElement[]
33676
+ images?: ExecutedWsMessage['output']
33677
+
33678
+ preview: string[]
33679
+ /** Index of the currently selected image on a multi-image node such as Preview Image */
33680
+ imageIndex?: number | null
33681
+ imageRects: Rect[]
33682
+ overIndex?: number | null
33683
+ pointerDown?: { index: number | null; pos: Point } | null
33684
+
33685
+ setSizeForImage?(force?: boolean): void
33686
+ /** @deprecated Unused */
33687
+ inputHeight?: unknown
33688
+
33689
+ /** @deprecated Unused */
33690
+ imageOffset?: number
33691
+ /** Callback for pasting an image file into the node */
33692
+ pasteFile?(file: File): void
33693
+ }
33694
+ }
33695
+
33696
+
33697
+
33698
+ /**
33699
+ * Extended types for litegraph, to be merged upstream once it has stabilized.
33700
+ */
33701
+ declare module '@comfyorg/litegraph' {
33702
+ interface INodeInputSlot {
33703
+ pos?: [number, number]
33704
+ }
33705
+
33706
+ interface LGraphNode {
33707
+ widgets_values?: unknown[]
33708
+ }
33709
+
33710
+ interface LGraphCanvas {
33711
+ /** This is in the litegraph types but has incorrect return type */
33712
+ isOverNodeInput(
33713
+ node: LGraphNode,
33714
+ canvasX: number,
33715
+ canvasY: number,
33716
+ slotPos: Vector2
33717
+ ): number
33718
+
33719
+ isOverNodeOutput(
33720
+ node: LGraphNode,
33721
+ canvasX: number,
33722
+ canvasY: number,
33723
+ slotPos: Vector2
33724
+ ): number
33725
+ }
33726
+
33727
+ interface ContextMenu {
33728
+ root?: HTMLDivElement
33729
+ }
33730
+ }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@comfyorg/comfyui-frontend-types",
3
- "version": "1.9.18",
3
+ "version": "1.10.0",
4
4
  "types": "./index.d.ts",
5
5
  "files": [
6
6
  "index.d.ts"
@@ -13,7 +13,7 @@
13
13
  "description": "TypeScript definitions for @comfyorg/comfyui-frontend",
14
14
  "license": "GPL-3.0-only",
15
15
  "dependencies": {
16
- "@comfyorg/litegraph": "^0.8.78"
16
+ "@comfyorg/litegraph": "^0.8.80"
17
17
  },
18
18
  "peerDependencies": {
19
19
  "vue": "^3.5.13",