Skip to content

Commit

Permalink
Fix TS types - Widgets (#428)
Browse files Browse the repository at this point in the history
* 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
  • Loading branch information
webfiltered authored Jan 20, 2025
1 parent 76ebabb commit 604a3e6
Showing 1 changed file with 1 addition and 7 deletions.
8 changes: 1 addition & 7 deletions src/types/widgets.ts
Original file line number Diff line number Diff line change
Expand Up @@ -17,12 +17,8 @@ export interface IWidgetOptions<TValue = unknown> extends Record<string, unknown
// TODO: Confirm this
property?: string

hasOwnProperty?(arg0: string): any
// values?(widget?: IWidget, node?: LGraphNode): any
values?: TValue[]
callback?: IWidget["callback"]

onHide?(widget: IWidget): void
}

/**
Expand Down Expand Up @@ -132,8 +128,6 @@ export interface IBaseWidget<TElement extends HTMLElement = HTMLElement> {
pos?: Point,
e?: CanvasMouseEvent,
): void
onRemove?(): void
beforeQueued?(): void

/**
* Simple callback for pointer events, allowing custom widgets to events relevant to them.
Expand All @@ -150,7 +144,7 @@ export interface IBaseWidget<TElement extends HTMLElement = HTMLElement> {
y: number,
H: number,
): void
computeSize?(width: number): Size
computeSize?(width?: number): Size

/**
* Callback for pointerdown events, allowing custom widgets to register callbacks to occur
Expand Down

0 comments on commit 604a3e6

Please sign in to comment.