I am not familiar with Ember, but by checking ember.d.ts, I see that create () is defined as a static universal function for an object:
static create<T extends {}>(arguments?: {}): T;
So you should be able to get the best type information by passing the actual type:
var App = Ember.Application.create<Ember.Application>();
However, I also see that the ember typedef does not include the "Router" element in the application class, and even if it is, the Router class does not define map (). I was able to get it working by creating an extended type definition:
// ./EmberExt.d.ts /// <reference path="typedef/ember/ember.d.ts" /> declare class RouterExt extends Ember.Router { map: ItemIndexEnumerableCallbackTarget; } declare class ApplicationExt extends Ember.Application { Router: RouterExt; }
And then referring to this from my combined router / application file:
/// <reference path="typedef/ember/ember.d.ts" /> /// <reference path="./EmberExt.d.ts" /> var App = Ember.Application.create<ApplicationExt>(); App.Router.map(function () { this.resource('todos', { path: '/' }); });
After that, it compiles and loads without errors, although it actually does nothing (which, in my opinion, is suitable for this phase of the walkthrough)
mushin
source share