typed-ember / ember-cli-typescript

Use TypeScript in your Ember.js apps!
https://docs.ember-cli-typescript.com
MIT License
363 stars 99 forks source link

How to import glimmer/tracking? #1165

Closed Bouke closed 3 years ago

Bouke commented 4 years ago

Which package(s) does this enhancement pertain to?

Please write a user story for this feature

As a developer I want to import @tracked from @glimmer/tracking. I don't understand how to do that.

As a workaround I've added glimmer.d.ts:

declare module "@glimmer/tracking" {
    export function tracked(target: object, propertyKey: string | symbol): void;
}
dfreeman commented 4 years ago

@Bouke I believe new apps/addons include a dependency on @glimmer/tracking out of the box (https://github.com/ember-cli/ember-new-output/blob/2ec0339c5e1bc7ac5f23efede3dd9929262a1926/package.json#L25), which should ship with type declarations.