Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

support helper and modifier helpers #410

Closed
patricklx opened this issue Sep 13, 2022 · 4 comments · Fixed by #553
Closed

support helper and modifier helpers #410

patricklx opened this issue Sep 13, 2022 · 4 comments · Fixed by #553
Labels
enhancement New feature or request

Comments

@patricklx
Copy link
Contributor

using {{#let (helper ...)}... or {{#let (modifier ...)}} does not work

@chriskrycho
Copy link
Member

Hi @patricklx, thanks for filing. Can you elaborate a bit?

  • What versions of the Glint packages do you have?
  • What is your glint config?
  • What is the actual error you are seeing?

@chriskrycho chriskrycho added the bug Something isn't working label Sep 13, 2022
@patricklx
Copy link
Contributor Author

patricklx commented Sep 13, 2022

sure:

  • version: 0.9.3
  • glint config: ember-loose env, nothing else
  • the actual error is:
    when I use {{#let (helper "my-helper" as |myhelper|)}{{/let}} then the resolved type of myhelper is any

@patricklx
Copy link
Contributor Author

btw, i already fixed it myself with this

declare module '@glint/environment-ember-loose/registry' {
  type helper = DirectInvokable<{
    <T extends keyof Registry>(args: EmptyObject, value: T): T extends keyof Registry ? Registry[T] : never
  }>;
  export default interface Registry {
    helper: helper;
    modifier: helper;
  }
}

@chriskrycho
Copy link
Member

Very good – thanks! If you’re up for it, a PR adding it to the environment-ember-loose type definitions would be welcome!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
2 participants