mirror of
https://github.com/Comfy-Org/ComfyUI_frontend.git
synced 2026-03-09 07:00:06 +00:00
[Refactor] Remove repeat interface definitions (#976)
Prefers param destructuring over manual impl.
This commit is contained in:
@@ -1,9 +1,6 @@
|
||||
import type { LGraphCanvas } from "@/LGraphCanvas"
|
||||
import type { LGraphNode } from "@/LGraphNode"
|
||||
import type { CanvasMouseEvent } from "@/types/events"
|
||||
import type { IStringWidget, IWidgetOptions } from "@/types/widgets"
|
||||
|
||||
import { BaseWidget, type DrawWidgetOptions } from "./BaseWidget"
|
||||
import { BaseWidget, type DrawWidgetOptions, type WidgetEventOptions } from "./BaseWidget"
|
||||
|
||||
export class TextWidget extends BaseWidget implements IStringWidget {
|
||||
// IStringWidget properties
|
||||
@@ -78,13 +75,7 @@ export class TextWidget extends BaseWidget implements IStringWidget {
|
||||
ctx.fillStyle = originalFillStyle
|
||||
}
|
||||
|
||||
override onClick(options: {
|
||||
e: CanvasMouseEvent
|
||||
node: LGraphNode
|
||||
canvas: LGraphCanvas
|
||||
}) {
|
||||
const { e, node, canvas } = options
|
||||
|
||||
override onClick({ e, node, canvas }: WidgetEventOptions) {
|
||||
// Show prompt dialog for text input
|
||||
canvas.prompt(
|
||||
"Value",
|
||||
|
||||
Reference in New Issue
Block a user