diff --git a/types/ember/index.d.ts b/types/ember/index.d.ts index c825647e49..cd4ba0f85f 100755 --- a/types/ember/index.d.ts +++ b/types/ember/index.d.ts @@ -71,13 +71,13 @@ declare module 'ember' { * * Generally you would use `EmberClass.create()` instead of `new EmberClass()`. * - * The no-arg constructor is required by the typescript compiler. + * The single-arg constructor is required by the typescript compiler. * The multi-arg constructor is included for better ergonomics. * * Implementation is carefully chosen for the reasons described in * https://github.com/typed-ember/ember-typings/pull/29 */ - type EmberClassConstructor = (new () => T) & (new (...args: any[]) => T); + type EmberClassConstructor = (new (properties?: object) => T) & (new (...args: any[]) => T); type ComputedPropertyGetterFunction = (this: any, key: string) => T; @@ -761,6 +761,12 @@ declare module 'ember' { } const Copyable: Ember.Mixin; class CoreObject { + /** + * As of Ember 3.1, CoreObject constructor takes initial object properties as an argument. + * See: https://github.com/emberjs/ember.js/commit/4709935854d4c29b0d2c054614d53fa2c55309b1 + **/ + constructor(properties?: object); + _super(...args: any[]): any; /** diff --git a/types/ember/test/object.ts b/types/ember/test/object.ts index cfe2c9380f..e1eefb75e9 100755 --- a/types/ember/test/object.ts +++ b/types/ember/test/object.ts @@ -13,3 +13,15 @@ const LifetimeHooks = Ember.Object.extend({ this._super(); } }); + +class MyObject30 extends Ember.Object { + constructor() { + super(); + } +} + +class MyObject31 extends Ember.Object { + constructor(properties: object) { + super(properties); + } +}