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

Convert to TS or supply ambient definitions #239

Closed
chriskrycho opened this issue Aug 23, 2022 · 9 comments
Closed

Convert to TS or supply ambient definitions #239

chriskrycho opened this issue Aug 23, 2022 · 9 comments

Comments

@chriskrycho
Copy link
Contributor

As part of Ember.js RFC #0800, this package needs to supply type definitions. Preferably, this would happen by converting to TS and generating from the source; as an alternative, it can publish ambient types (presumably starting with the ones on DefinitelyTyped).

All the members of the Typed Ember team are happy to advise on how to do this; feel free to reach out in #dev-typescript on Discord if you have questions!

@knownasilya
Copy link
Contributor

If converting to TS, is there a setup that people are using in embroider addons? Would love an example. cc @NullVoxPopuli

@knownasilya
Copy link
Contributor

Is there a consistent TS setup among them?

@NullVoxPopuli
Copy link
Contributor

mostly, ya

@leepfrog
Copy link

I ran into the lack of page-title types when trying to use the new ember 5.1 ember-source types:

app/templates/application.hbs:1:3 - error TS7053: Unknown name 'page-title'. If this isn't a typo, you may be missing a registry entry for this value; see the Template Registry page in the Glint documentation for more details.
  Element implicitly has an 'any' type because expression of type '"page-title"' can't be used to index type 'Globals'.
    Property 'page-title' does not exist on type 'Globals'.

To fix, I added types to types/ember-page-title/index.d.ts:

import { HelperLike } from '@glint/template';

export type PageTitle = abstract new <T>() => InstanceType<
  HelperLike<{
    Args: {
      Positional: [value: T];
    };
    Return: '';
  }>
>;

declare module '@glint/environment-ember-loose/registry' {
  export default interface Registry {
    'page-title': PageTitle;
  }
}

@knownasilya
Copy link
Contributor

@leepfrog any help in getting #246 across the finish line is appreciated 👍🏼

@leepfrog
Copy link

@knownasilya opened up #256 that might help?

@HeroicEric
Copy link

@NullVoxPopuli This should be fixed by #275 ?

@NullVoxPopuli
Copy link
Contributor

yup! thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

5 participants