[TS] Use strict mode in LGraphCanvas (#654)

- Prefer creating HTML elements in JS and `append()` over innerHTML &
`querySelector()`
- Removes redundant code
- Adds/fixes TS types
This commit is contained in:
filtered
2025-03-01 22:52:42 +11:00
committed by GitHub
parent bad923a7f0
commit c473130499
4 changed files with 74 additions and 78 deletions

View File

@@ -28,7 +28,7 @@ export class ContextMenu<TValue = unknown> {
* - ignore_item_callbacks: ignores the callback inside the item, it just calls the options.callback
* - event: you can pass a MouseEvent, this way the ContextMenu appears in that position
*/
constructor(values: (string | IContextMenuValue<TValue> | null)[], options: IContextMenuOptions<TValue>) {
constructor(values: readonly (string | IContextMenuValue<TValue> | null)[], options: IContextMenuOptions<TValue>) {
options ||= {}
this.options = options