[TS] Widget typing (#3804)

This commit is contained in:
filtered
2025-05-08 04:38:17 +10:00
committed by GitHub
parent bb1ac32ccd
commit b9d9ce78f9
12 changed files with 51 additions and 65 deletions

View File

@@ -50,7 +50,8 @@ export const useFloatWidget = () => {
Math.max(0, -Math.floor(Math.log10(step)))
const enableRounding = !settingStore.get('Comfy.DisableFloatRounding')
const defaultValue = inputSpec.default ?? 0
/** Assertion {@link inputSpec.default} */
const defaultValue = (inputSpec.default as number | undefined) ?? 0
return node.addWidget(
widgetType,
inputSpec.name,

View File

@@ -55,7 +55,8 @@ export const useIntWidget = () => {
: 'number'
const step = inputSpec.step ?? 1
const defaultValue = inputSpec.default ?? 0
/** Assertion {@link inputSpec.default} */
const defaultValue = (inputSpec.default as number | undefined) ?? 0
const widget = node.addWidget(
widgetType,
inputSpec.name,