MCPcopy Create free account
hub / github.com/Comfy-Org/litegraph.js / addCustomWidget

Method addCustomWidget

src/LGraphNode.ts:1811–1818  ·  view source on GitHub ↗
(
    custom_widget: TPlainWidget,
  )

Source from the content-addressed store, hash-verified

1809 }
1810
1811 addCustomWidget<TPlainWidget extends IBaseWidget>(
1812 custom_widget: TPlainWidget,
1813 ): TPlainWidget | WidgetTypeMap[TPlainWidget["type"]] {
1814 this.widgets ||= []
1815 const widget = toConcreteWidget(custom_widget, this, false) ?? custom_widget
1816 this.widgets.push(widget)
1817 return widget
1818 }
1819
1820 addTitleButton(options: LGraphButtonOptions): LGraphButton {
1821 this.title_buttons ||= []

Callers 1

addWidgetMethod · 0.95

Calls 1

toConcreteWidgetFunction · 0.90

Tested by

no test coverage detected