mirror of
https://github.com/gosticks/DefinitelyTyped.git
synced 2026-08-13 05:20:25 +00:00
Ember Data: more Snapshot improvements.
This commit is contained in:
Vendored
+11
-4
@@ -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<L extends keyof ModelRegistry & keyof ModelRegistry[K]>(
|
||||
belongsTo<L extends keyof ModelRegistry[K]>(
|
||||
keyName: L,
|
||||
options?: {}
|
||||
): Snapshot<K>['record'][L] | string | null | undefined;
|
||||
/**
|
||||
* Returns the current value of a hasMany relationship.
|
||||
*/
|
||||
hasMany<L extends keyof ModelRegistry[K]>(keyName: L, options?: {}): any[] | undefined;
|
||||
hasMany<L extends keyof ModelRegistry[K]>(
|
||||
keyName: L,
|
||||
options?: { ids: false }
|
||||
): Array<Snapshot<K>['record'][L]> | undefined;
|
||||
hasMany<L extends keyof ModelRegistry[K]>(
|
||||
keyName: L,
|
||||
options: { ids: true }
|
||||
): Array<string> | undefined;
|
||||
/**
|
||||
* Iterates through all the attributes of the model, calling the passed
|
||||
* function on each attribute.
|
||||
|
||||
Reference in New Issue
Block a user