Ember-simple-auth: TypeScript definitions for injected session service

Created on 16 Dec 2019  路  2Comments  路  Source: simplabs/ember-simple-auth

I'm trying to import this service:

import EmberSimpleAuthSession from 'ember-simple-auth/addon/services/session';

So that I can use it as a type:

export default class ShowProjectController extends Controller {
  @service
  session!: EmberSimpleAuthSession

...according to the e-typescript documentation.

But TypeScript can't find the definitions. So, I was able to pull this in and have better luck:
https://github.com/Gavant/octane-bootcamp/blob/master/types/ember-simple-auth/services/session.d.ts

But, I'd hate for this file to fall out of sync to any changes across versions.

Separately, I know there's some churn on how to deal with Mixins, but we can at least type parts of the addon. Is there something I'm missing?

Most helpful comment

just so you guys now,
this is still an up-to-date issue in 2021 :)

All 2 comments

It's been a year on this issue. Any updates here?

just so you guys now,
this is still an up-to-date issue in 2021 :)

Was this page helpful?
0 / 5 - 0 ratings