deepujain commented on code in PR #44559:
URL: https://github.com/apache/superset/pull/44559#discussion_r4079746443


##########
superset-frontend/packages/superset-ui-chart-controls/src/shared-controls/sharedControls.tsx:
##########
@@ -519,4 +519,10 @@ const sharedControls: Record<string, 
SharedControlConfig<any>> = {
   ...matrixifyControls,
 };
 
+type RegisteredControl = (typeof controlConfigs)[keyof typeof controlConfigs];
+
+// Each control retains the option type accepted by its renderer.
+const sharedControls: typeof controlConfigs &
+  Record<string, RegisteredControl> = controlConfigs;

Review Comment:
   Verified: the `...matrixifyControls` spread already gives `controlConfigs` a 
string index signature, so `keyof` collapses to `string` and the 
`RegisteredControl` alias plus the `Record` intersection were redundant. 
Dropped both in 323484f0; the inferred literal type keeps each control's 
specific option type (an improvement over the old `Record<string, 
SharedControlConfig<any>>` annotation) while dynamic lookups still type-check 
via the spread-injected index signature.



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to