Skip to content

@types/ember__component 4.0.6 update breaks Helper.compute without signature #1498

Answered by chriskrycho
mydea asked this question in Q&A
Discussion options

You must be logged in to vote

Good question! I didn't actually realize folks were using that pattern, but it makes sense. This is basically the tradeoff of making class-based helpers natively support Glint, and is an unfortunate limitation of the Typescript type system as it stands: methods whose values are related to the generic type of the class they are members of don't get inference based on the generic types. This is partly to allow subclassing to work as folks expect, and partly just because it's a hard thing TS hasn't solved yet.

I've turned this into a discussion and am leaving it here so folks can share suggestions, alternative designs, etc.!

One option here is:

interface Args {
  Positional: [obj: MyModel, p…

Replies: 2 comments 1 reply

Comment options

You must be logged in to vote
1 reply
@chriskrycho
Comment options

Answer selected by chriskrycho
Comment options

You must be logged in to vote
0 replies
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
3 participants
Converted from issue

This discussion was converted from issue #1496 on April 01, 2022 21:18.