mirror of
https://github.com/Comfy-Org/ComfyUI_frontend.git
synced 2026-02-06 08:00:05 +00:00
[Type] Mark name as required prop for IBaseWidget (#623)
This commit is contained in:
@@ -39,7 +39,7 @@ export function serializeSlot(slot: INodeInputSlot | INodeOutputSlot): ISerialis
|
||||
_layoutElement: undefined,
|
||||
_data: undefined,
|
||||
pos: isWidgetInputSlot(slot) ? undefined : slot.pos,
|
||||
widget: isWidgetInputSlot(slot) && slot.widget?.name ? { name: slot.widget.name } : undefined,
|
||||
widget: isWidgetInputSlot(slot) ? { name: slot.widget.name } : undefined,
|
||||
}, value => value === undefined) as ISerialisedNodeInputSlot | ISerialisedNodeOutputSlot
|
||||
}
|
||||
|
||||
|
||||
@@ -123,9 +123,10 @@ export type TWidgetValue = IWidget["value"]
|
||||
export interface IBaseWidget<TElement extends HTMLElement = HTMLElement> {
|
||||
linkedWidgets?: IWidget[]
|
||||
|
||||
name: string
|
||||
options: IWidgetOptions
|
||||
|
||||
label?: string
|
||||
name?: string
|
||||
/** Widget type (see {@link TWidgetType}) */
|
||||
type?: TWidgetType
|
||||
value?: TWidgetValue
|
||||
|
||||
@@ -7,9 +7,9 @@ import { LiteGraph } from "@/litegraph"
|
||||
|
||||
export abstract class BaseWidget implements IBaseWidget {
|
||||
linkedWidgets?: IWidget[]
|
||||
name: string
|
||||
options: IWidgetOptions<unknown>
|
||||
label?: string
|
||||
name?: string
|
||||
type?: TWidgetType
|
||||
value?: TWidgetValue
|
||||
y?: number
|
||||
@@ -40,6 +40,7 @@ export abstract class BaseWidget implements IBaseWidget {
|
||||
|
||||
constructor(widget: IBaseWidget) {
|
||||
Object.assign(this, widget)
|
||||
this.name = widget.name
|
||||
this.options = widget.options
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user