@comfyorg/comfyui-frontend-types 1.38.4 → 1.38.6
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.
- package/index.d.ts +53 -5
- package/package.json +1 -1
package/index.d.ts
CHANGED
|
@@ -297,6 +297,13 @@ declare abstract class BaseWidget<TWidget extends IBaseWidget = IBaseWidget> imp
|
|
|
297
297
|
* @remarks Leaves {@link ctx} dirty.
|
|
298
298
|
*/
|
|
299
299
|
protected drawWidgetShape(ctx: CanvasRenderingContext2D, { width, showText }: DrawWidgetOptions): void;
|
|
300
|
+
/**
|
|
301
|
+
* Draws a placeholder for widgets that only have a Vue implementation.
|
|
302
|
+
* @param ctx The canvas context
|
|
303
|
+
* @param options The options for drawing the widget
|
|
304
|
+
* @param label The label to display (e.g., "ImageCrop", "BoundingBox")
|
|
305
|
+
*/
|
|
306
|
+
protected drawVueOnlyWarning(ctx: CanvasRenderingContext2D, { width }: DrawWidgetOptions, label: string): void;
|
|
300
307
|
/**
|
|
301
308
|
* A shared routine for drawing a label and value as text, truncated
|
|
302
309
|
* if they exceed the available width.
|
|
@@ -341,6 +348,23 @@ declare class BooleanWidget extends BaseWidget<IBooleanWidget> implements IBoole
|
|
|
341
348
|
|
|
342
349
|
export declare type BottomPanelExtension = VueBottomPanelExtension | CustomBottomPanelExtension;
|
|
343
350
|
|
|
351
|
+
/**
|
|
352
|
+
* Widget for defining bounding box regions.
|
|
353
|
+
* This widget only has a Vue implementation.
|
|
354
|
+
*/
|
|
355
|
+
declare class BoundingBoxWidget extends BaseWidget<IBoundingBoxWidget> implements IBoundingBoxWidget {
|
|
356
|
+
type: "boundingbox";
|
|
357
|
+
drawWidget(ctx: CanvasRenderingContext2D, options: DrawWidgetOptions): void;
|
|
358
|
+
onClick(_options: WidgetEventOptions): void;
|
|
359
|
+
}
|
|
360
|
+
|
|
361
|
+
declare interface Bounds {
|
|
362
|
+
x: number;
|
|
363
|
+
y: number;
|
|
364
|
+
width: number;
|
|
365
|
+
height: number;
|
|
366
|
+
}
|
|
367
|
+
|
|
344
368
|
declare class ButtonWidget extends BaseWidget<IButtonWidget> implements IButtonWidget {
|
|
345
369
|
type: "button";
|
|
346
370
|
clicked: boolean;
|
|
@@ -2539,6 +2563,12 @@ export declare class ComfyApp {
|
|
|
2539
2563
|
left: LGraphNode;
|
|
2540
2564
|
}
|
|
2541
2565
|
|
|
2566
|
+
/** Bounding box widget for defining regions with numeric inputs */
|
|
2567
|
+
declare interface IBoundingBoxWidget extends IBaseWidget<Bounds, 'boundingbox'> {
|
|
2568
|
+
type: 'boundingbox';
|
|
2569
|
+
value: Bounds;
|
|
2570
|
+
}
|
|
2571
|
+
|
|
2542
2572
|
declare interface IButtonWidget extends IBaseWidget<string | undefined, 'button'> {
|
|
2543
2573
|
type: 'button';
|
|
2544
2574
|
value: string | undefined;
|
|
@@ -2742,6 +2772,12 @@ export declare class ComfyApp {
|
|
|
2742
2772
|
value: string[];
|
|
2743
2773
|
}
|
|
2744
2774
|
|
|
2775
|
+
/** Image crop widget for cropping image */
|
|
2776
|
+
declare interface IImageCropWidget extends IBaseWidget<Bounds, 'imagecrop'> {
|
|
2777
|
+
type: 'imagecrop';
|
|
2778
|
+
value: Bounds;
|
|
2779
|
+
}
|
|
2780
|
+
|
|
2745
2781
|
/** Image display widget */
|
|
2746
2782
|
declare interface IImageWidget extends IBaseWidget<string, 'image'> {
|
|
2747
2783
|
type: 'image';
|
|
@@ -2769,6 +2805,16 @@ export declare class ComfyApp {
|
|
|
2769
2805
|
onClick(_options: WidgetEventOptions): void;
|
|
2770
2806
|
}
|
|
2771
2807
|
|
|
2808
|
+
/**
|
|
2809
|
+
* Widget for displaying an image crop preview.
|
|
2810
|
+
* This widget only has a Vue implementation.
|
|
2811
|
+
*/
|
|
2812
|
+
declare class ImageCropWidget extends BaseWidget<IImageCropWidget> implements IImageCropWidget {
|
|
2813
|
+
type: "imagecrop";
|
|
2814
|
+
drawWidget(ctx: CanvasRenderingContext2D, options: DrawWidgetOptions): void;
|
|
2815
|
+
onClick(_options: WidgetEventOptions): void;
|
|
2816
|
+
}
|
|
2817
|
+
|
|
2772
2818
|
/** Markdown widget for displaying formatted text */
|
|
2773
2819
|
declare interface IMarkdownWidget extends IBaseWidget<string, 'markdown'> {
|
|
2774
2820
|
type: 'markdown';
|
|
@@ -3120,7 +3166,7 @@ export declare class ComfyApp {
|
|
|
3120
3166
|
* Recommend declaration merging any properties that use IWidget (e.g. {@link LGraphNode.widgets}) with a new type alias.
|
|
3121
3167
|
* @see ICustomWidget
|
|
3122
3168
|
*/
|
|
3123
|
-
declare type IWidget = IBooleanWidget | INumericWidget | IStringWidget | IComboWidget | IStringComboWidget | ICustomWidget | ISliderWidget | IButtonWidget | IKnobWidget | IFileUploadWidget | IColorWidget | IMarkdownWidget | IImageWidget | ITreeSelectWidget | IMultiSelectWidget | IChartWidget | IGalleriaWidget | IImageCompareWidget | ISelectButtonWidget | ITextareaWidget | IAssetWidget;
|
|
3169
|
+
declare type IWidget = IBooleanWidget | INumericWidget | IStringWidget | IComboWidget | IStringComboWidget | ICustomWidget | ISliderWidget | IButtonWidget | IKnobWidget | IFileUploadWidget | IColorWidget | IMarkdownWidget | IImageWidget | ITreeSelectWidget | IMultiSelectWidget | IChartWidget | IGalleriaWidget | IImageCompareWidget | ISelectButtonWidget | ITextareaWidget | IAssetWidget | IImageCropWidget | IBoundingBoxWidget;
|
|
3124
3170
|
|
|
3125
3171
|
declare interface IWidgetAssetOptions extends IWidgetOptions {
|
|
3126
3172
|
openModal: (widget: IBaseWidget) => void;
|
|
@@ -7879,8 +7925,8 @@ export declare class ComfyApp {
|
|
|
7879
7925
|
export declare type TerminalSize = z.infer<typeof zTerminalSize>;
|
|
7880
7926
|
|
|
7881
7927
|
/**
|
|
7882
|
-
* Widget for multi-line text input
|
|
7883
|
-
* This
|
|
7928
|
+
* Widget for multi-line text input.
|
|
7929
|
+
* This widget only has a Vue implementation.
|
|
7884
7930
|
*/
|
|
7885
7931
|
declare class TextareaWidget extends BaseWidget<ITextareaWidget> implements ITextareaWidget {
|
|
7886
7932
|
type: "textarea";
|
|
@@ -8079,8 +8125,8 @@ export declare class ComfyApp {
|
|
|
8079
8125
|
}
|
|
8080
8126
|
|
|
8081
8127
|
/**
|
|
8082
|
-
* Widget for hierarchical tree selection
|
|
8083
|
-
* This
|
|
8128
|
+
* Widget for hierarchical tree selection.
|
|
8129
|
+
* This widget only has a Vue implementation.
|
|
8084
8130
|
*/
|
|
8085
8131
|
declare class TreeSelectWidget extends BaseWidget<ITreeSelectWidget> implements ITreeSelectWidget {
|
|
8086
8132
|
type: "treeselect";
|
|
@@ -8227,6 +8273,8 @@ export declare class ComfyApp {
|
|
|
8227
8273
|
selectbutton: SelectButtonWidget;
|
|
8228
8274
|
textarea: TextareaWidget;
|
|
8229
8275
|
asset: AssetWidget;
|
|
8276
|
+
imagecrop: ImageCropWidget;
|
|
8277
|
+
boundingbox: BoundingBoxWidget;
|
|
8230
8278
|
[key: string]: BaseWidget;
|
|
8231
8279
|
};
|
|
8232
8280
|
|