@comfyorg/comfyui-frontend-types 1.38.1 → 1.38.3

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 +71 -9
  2. package/package.json +1 -1
package/index.d.ts CHANGED
@@ -2420,7 +2420,7 @@ export declare class ComfyApp {
2420
2420
  onPointerLeave?(e?: CanvasPointerEvent): void;
2421
2421
  }
2422
2422
 
2423
- declare interface IAssetWidget extends IBaseWidget<string, 'asset', IWidgetOptions<string[]>> {
2423
+ declare interface IAssetWidget extends IBaseWidget<string, 'asset', IWidgetAssetOptions> {
2424
2424
  type: 'asset';
2425
2425
  value: string;
2426
2426
  }
@@ -2833,9 +2833,12 @@ export declare class ComfyApp {
2833
2833
  }
2834
2834
 
2835
2835
  declare interface INodePropertyInfo {
2836
- name: string;
2836
+ name?: string;
2837
2837
  type?: string;
2838
- default_value: NodeProperty | undefined;
2838
+ default_value?: NodeProperty;
2839
+ widget?: string;
2840
+ label?: string;
2841
+ values?: TWidgetValue[];
2839
2842
  }
2840
2843
 
2841
2844
  declare interface INodeSlot extends HasBoundingRect {
@@ -3139,6 +3142,10 @@ export declare class ComfyApp {
3139
3142
  */
3140
3143
  declare type IWidget = IBooleanWidget | INumericWidget | IStringWidget | IComboWidget | IStringComboWidget | ICustomWidget | ISliderWidget | IButtonWidget | IKnobWidget | IFileUploadWidget | IColorWidget | IMarkdownWidget | IImageWidget | ITreeSelectWidget | IMultiSelectWidget | IChartWidget | IGalleriaWidget | IImageCompareWidget | ISelectButtonWidget | ITextareaWidget | IAssetWidget;
3141
3144
 
3145
+ declare interface IWidgetAssetOptions extends IWidgetOptions {
3146
+ openModal: () => void;
3147
+ }
3148
+
3142
3149
  declare interface IWidgetKnobOptions extends IWidgetOptions<number[]> {
3143
3150
  min: number;
3144
3151
  max: number;
@@ -3895,9 +3902,9 @@ export declare class ComfyApp {
3895
3902
  _highlight_pos?: Point;
3896
3903
  _highlight_input?: INodeInputSlot;
3897
3904
  /** @deprecated Panels */
3898
- node_panel?: any;
3905
+ node_panel?: Panel;
3899
3906
  /** @deprecated Panels */
3900
- options_panel?: any;
3907
+ options_panel?: Panel;
3901
3908
  _bg_img?: HTMLImageElement;
3902
3909
  _pattern?: CanvasPattern;
3903
3910
  _pattern_img?: HTMLImageElement;
@@ -4326,7 +4333,7 @@ export declare class ComfyApp {
4326
4333
  showSearchBox(event: MouseEvent | null, searchOptions?: IShowSearchOptions): HTMLDivElement;
4327
4334
  showEditPropertyValue(node: LGraphNode, property: string, options: IDialogOptions): IDialog | undefined;
4328
4335
  createDialog(html: string, options: IDialogOptions): IDialog;
4329
- createPanel(title: string, options: ICreatePanelOptions): any;
4336
+ createPanel(title: string, options: ICreatePanelOptions): Panel;
4330
4337
  closePanels(): void;
4331
4338
  showShowNodePanel(node: LGraphNode): void;
4332
4339
  checkPanels(): void;
@@ -4790,8 +4797,8 @@ export declare class ComfyApp {
4790
4797
  * If an invalid index or non-number (false, null, NaN etc) is returned, the connection will be cancelled.
4791
4798
  */
4792
4799
  onBeforeConnectInput?(this: LGraphNode, target_slot: number, requested_slot?: number | string): number | false | null;
4793
- onShowCustomPanelInfo?(this: LGraphNode, panel: any): void;
4794
- onAddPropertyToPanel?(this: LGraphNode, pName: string, panel: any): boolean;
4800
+ onShowCustomPanelInfo?(this: LGraphNode, panel: Panel): void;
4801
+ onAddPropertyToPanel?(this: LGraphNode, pName: string, panel: Panel): boolean;
4795
4802
  onWidgetChanged?(this: LGraphNode, name: string, value: unknown, old_value: unknown, w: IBaseWidget): void;
4796
4803
  onDeselected?(this: LGraphNode): void;
4797
4804
  onKeyUp?(this: LGraphNode, e: KeyboardEvent): void;
@@ -4818,7 +4825,7 @@ export declare class ComfyApp {
4818
4825
  onInputDblClick?(this: LGraphNode, index: number, e: CanvasPointerEvent): void;
4819
4826
  onOutputClick?(this: LGraphNode, index: number, e: CanvasPointerEvent): void;
4820
4827
  onOutputDblClick?(this: LGraphNode, index: number, e: CanvasPointerEvent): void;
4821
- onGetPropertyInfo?(this: LGraphNode, property: string): any;
4828
+ onGetPropertyInfo?(this: LGraphNode, property: string): INodePropertyInfo;
4822
4829
  onNodeOutputAdd?(this: LGraphNode, value: unknown): void;
4823
4830
  onNodeInputAdd?(this: LGraphNode, value: unknown): void;
4824
4831
  onMenuNodeInputs?(this: LGraphNode, entries: (IContextMenuValue<INodeSlotContextItem> | null)[]): (IContextMenuValue<INodeSlotContextItem> | null)[];
@@ -6582,6 +6589,61 @@ export declare class ComfyApp {
6582
6589
  */
6583
6590
  declare function overlapBounding(a: ReadOnlyRect, b: ReadOnlyRect): boolean;
6584
6591
 
6592
+ /**
6593
+ * A dialog panel created by LGraphCanvas.createPanel().
6594
+ * Extends HTMLDivElement with additional properties and methods for panel management.
6595
+ */
6596
+ declare interface Panel extends HTMLDivElement {
6597
+ header: HTMLElement;
6598
+ title_element: HTMLSpanElement;
6599
+ content: HTMLDivElement;
6600
+ alt_content: HTMLDivElement;
6601
+ footer: HTMLDivElement;
6602
+ node?: LGraphNode;
6603
+ onOpen?: () => void;
6604
+ onClose?: () => void;
6605
+ close(): void;
6606
+ toggleAltContent(force?: boolean): void;
6607
+ toggleFooterVisibility(force?: boolean): void;
6608
+ clear(): void;
6609
+ addHTML(code: string, classname?: string, on_footer?: boolean): HTMLDivElement;
6610
+ addButton(name: string, callback: () => void, options?: unknown): PanelButton;
6611
+ addSeparator(): void;
6612
+ addWidget(type: string, name: string, value: TWidgetValue, options?: PanelWidgetOptions, callback?: PanelWidgetCallback): PanelWidget;
6613
+ inner_showCodePad?(property: string): void;
6614
+ }
6615
+
6616
+ /**
6617
+ * A button element with optional options property.
6618
+ */
6619
+ declare interface PanelButton extends HTMLButtonElement {
6620
+ options?: unknown;
6621
+ }
6622
+
6623
+ /**
6624
+ * A widget element with options and value properties.
6625
+ */
6626
+ declare interface PanelWidget extends HTMLDivElement {
6627
+ options?: PanelWidgetOptions;
6628
+ value?: TWidgetValue;
6629
+ }
6630
+
6631
+ /**
6632
+ * Callback for panel widget value changes.
6633
+ */
6634
+ declare type PanelWidgetCallback = (name: string | undefined, value: TWidgetValue, options: PanelWidgetOptions) => void;
6635
+
6636
+ /**
6637
+ * Options for panel widgets.
6638
+ */
6639
+ declare interface PanelWidgetOptions {
6640
+ label?: string;
6641
+ type?: string;
6642
+ widget?: string;
6643
+ values?: Array<string | IContextMenuValue<unknown, unknown, unknown> | null>;
6644
+ callback?: PanelWidgetCallback;
6645
+ }
6646
+
6585
6647
  declare type ParamsArray<T extends Record<any, any>, K extends MethodNames<T>> = Parameters<T[K]>[1] extends undefined ? Parameters<T[K]> | Parameters<T[K]>[0] : Parameters<T[K]>;
6586
6648
 
6587
6649
  /** An object containing a set of child objects */
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@comfyorg/comfyui-frontend-types",
3
- "version": "1.38.1",
3
+ "version": "1.38.3",
4
4
  "types": "./index.d.ts",
5
5
  "files": [
6
6
  "index.d.ts"