mirror of
https://github.com/Comfy-Org/ComfyUI_frontend.git
synced 2026-04-20 22:39:39 +00:00
[TS] Widget typing (#3804)
This commit is contained in:
@@ -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,
|
||||
|
||||
@@ -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,
|
||||
|
||||
Reference in New Issue
Block a user