Conversation
| AppT = unknown, | ||
| ContextRegistryT = unknown | ||
| ContextRegistryT = unknown, | ||
| HelpersT extends PanelHelpers = unknown |
There was a problem hiding this comment.
In order to take advantage of this, you'll need to include a component-specific helpers type to fill in the generic for each individual component, right? Given that we're moving away from using helpers in general (it was mainly there for Jade/Pug ergonomics, and is mostly just extra noise in already-noisy TSX), I wonder if it's worth adding these helpers type defs everywhere. The better move may be to spend that effort moving things out of helpers into main component methods.
There was a problem hiding this comment.
you'll need to include a component-specific helpers type to fill in the generic for each individual component, right?
You don't need to fill in the generic to get the code navigation working. I'm not sure if it's a TypeScript thing or something PyCharm-specific that's making this work.
There was a problem hiding this comment.
OK, if it doesn't need anything except this unused generic, I'm fine with adding it, at least until helpers goes away. Just get the build passing and we can merge.
There was a problem hiding this comment.
can we just type it with &?
get config(): ReturnType<Component['config']> & Helpers
another generic on the class is pretty messy indeed.
Before this change (in PyCharm) navigating to
Component.helpers.someMethod's definition would always take me topanel/lib/index.d.ts
Line 53 in 74dc4c2
Component.config.helpers.someMethod.