mirror of
https://github.com/Comfy-Org/ComfyUI_frontend.git
synced 2026-04-29 18:52:19 +00:00
Fix TS types - Widgets (#428)
* Remove downstream types These optional type definitions were test code and should not have been upstreamed. * Remove unnecessary workaround Build workaround TS conversion; no longer relevant. * Fix TS type - widget size callback
This commit is contained in:
@@ -17,12 +17,8 @@ export interface IWidgetOptions<TValue = unknown> extends Record<string, unknown
|
|||||||
// TODO: Confirm this
|
// TODO: Confirm this
|
||||||
property?: string
|
property?: string
|
||||||
|
|
||||||
hasOwnProperty?(arg0: string): any
|
|
||||||
// values?(widget?: IWidget, node?: LGraphNode): any
|
|
||||||
values?: TValue[]
|
values?: TValue[]
|
||||||
callback?: IWidget["callback"]
|
callback?: IWidget["callback"]
|
||||||
|
|
||||||
onHide?(widget: IWidget): void
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -132,8 +128,6 @@ export interface IBaseWidget<TElement extends HTMLElement = HTMLElement> {
|
|||||||
pos?: Point,
|
pos?: Point,
|
||||||
e?: CanvasMouseEvent,
|
e?: CanvasMouseEvent,
|
||||||
): void
|
): void
|
||||||
onRemove?(): void
|
|
||||||
beforeQueued?(): void
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Simple callback for pointer events, allowing custom widgets to events relevant to them.
|
* Simple callback for pointer events, allowing custom widgets to events relevant to them.
|
||||||
@@ -150,7 +144,7 @@ export interface IBaseWidget<TElement extends HTMLElement = HTMLElement> {
|
|||||||
y: number,
|
y: number,
|
||||||
H: number,
|
H: number,
|
||||||
): void
|
): void
|
||||||
computeSize?(width: number): Size
|
computeSize?(width?: number): Size
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Callback for pointerdown events, allowing custom widgets to register callbacks to occur
|
* Callback for pointerdown events, allowing custom widgets to register callbacks to occur
|
||||||
|
|||||||
Reference in New Issue
Block a user