diff --git a/types/ember-data/index.d.ts b/types/ember-data/index.d.ts index a2ad80faff..2fcf1c8ed2 100644 --- a/types/ember-data/index.d.ts +++ b/types/ember-data/index.d.ts @@ -946,22 +946,29 @@ declare module 'ember-data' { /** * Returns all attributes and their corresponding values. */ - attributes(): {}; + attributes(): { [L in keyof ModelRegistry[K]]: ModelRegistry[K][L] }; /** * Returns all changed attributes and their old and new values. */ - changedAttributes(): {}; + changedAttributes(): Partial<{ [L in keyof ModelRegistry[K]]: ModelRegistry[K][L] }>; /** * Returns the current value of a belongsTo relationship. */ - belongsTo( + belongsTo( keyName: L, options?: {} ): Snapshot['record'][L] | string | null | undefined; /** * Returns the current value of a hasMany relationship. */ - hasMany(keyName: L, options?: {}): any[] | undefined; + hasMany( + keyName: L, + options?: { ids: false } + ): Array['record'][L]> | undefined; + hasMany( + keyName: L, + options: { ids: true } + ): Array | undefined; /** * Iterates through all the attributes of the model, calling the passed * function on each attribute.