mirror of
https://github.com/Comfy-Org/ComfyUI_frontend.git
synced 2026-05-03 12:42:01 +00:00
[refactor] Improve type safety across Vue node widget system
- Create WidgetValue union type for all valid widget values - Replace 'any' types with proper generic constraints in SimplifiedWidget - Add runtime validation for widget values in useGraphNodeManager - Update WidgetSelect to use constrained generics instead of any - Fix type assertions with proper validation functions - Ensure SafeWidgetData uses WidgetValue type consistently This eliminates most 'any' usage while maintaining runtime safety through validation.
This commit is contained in:
@@ -25,13 +25,13 @@ import {
|
||||
} from '@/utils/widgetPropFilter'
|
||||
|
||||
const props = defineProps<{
|
||||
widget: SimplifiedWidget<any>
|
||||
modelValue: any
|
||||
widget: SimplifiedWidget<string | number | undefined>
|
||||
modelValue: string | number | undefined
|
||||
readonly?: boolean
|
||||
}>()
|
||||
|
||||
const emit = defineEmits<{
|
||||
'update:modelValue': [value: any]
|
||||
'update:modelValue': [value: string | number | undefined]
|
||||
}>()
|
||||
|
||||
// Use the composable for consistent widget value handling
|
||||
|
||||
Reference in New Issue
Block a user