[Type] Mark app as required arg for ComfyWidgetConstructor (#2518)

This commit is contained in:
Chenlei Hu
2025-02-11 11:39:23 -05:00
committed by GitHub
parent efe7843469
commit 8db101c1cb
6 changed files with 12 additions and 9 deletions

View File

@@ -8,6 +8,7 @@ import TiptapTableRow from '@tiptap/extension-table-row'
import TiptapStarterKit from '@tiptap/starter-kit'
import { Markdown as TiptapMarkdown } from 'tiptap-markdown'
import type { ComfyWidgetConstructor } from '@/scripts/widgets'
import type { ComfyApp } from '@/types'
import type { InputSpec } from '@/types/apiTypes'
@@ -101,13 +102,13 @@ function addMarkdownWidget(
}
export const useMarkdownWidget = () => {
const widgetConstructor = (
const widgetConstructor: ComfyWidgetConstructor = (
node: LGraphNode,
inputName: string,
inputData: InputSpec,
app: ComfyApp
) => {
const defaultVal = inputData[1].default || ''
const defaultVal = inputData[1]?.default || ''
return addMarkdownWidget(
node,
inputName,