mirror of
https://github.com/gosticks/DefinitelyTyped.git
synced 2026-12-06 13:11:46 +00:00
Add Ember.CoreObject constructor with initial properties arg (#24997)
This commit is contained in:
committed by
Ryan Cavanaugh
parent
ed2cf925b3
commit
a7f56fc5ce
Vendored
+8
-2
@@ -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<T> = (new () => T) & (new (...args: any[]) => T);
|
||||
type EmberClassConstructor<T> = (new (properties?: object) => T) & (new (...args: any[]) => T);
|
||||
|
||||
type ComputedPropertyGetterFunction<T> = (this: any, key: string) => T;
|
||||
|
||||
@@ -761,6 +761,12 @@ declare module 'ember' {
|
||||
}
|
||||
const Copyable: Ember.Mixin<Copyable>;
|
||||
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;
|
||||
|
||||
/**
|
||||
|
||||
@@ -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);
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user