Add type checking to WidgetConfig.