@ember-data/model 5.4.0-alpha.32 → 5.4.0-alpha.34
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/addon/-private.js +1 -1
- package/addon/{has-many-Qm5aUQol.js → has-many-Mz5PIxmL.js} +10 -0
- package/addon/{has-many-Qm5aUQol.js.map → has-many-Mz5PIxmL.js.map} +1 -1
- package/addon/index.js +1 -1
- package/addon/model-eXqU5A13.js.map +1 -1
- package/package.json +19 -19
- package/unstable-preview-types/-private/attr.d.ts +170 -168
- package/unstable-preview-types/-private/attr.type-test.d.ts +3 -1
- package/unstable-preview-types/-private/belongs-to.d.ts +179 -178
- package/unstable-preview-types/-private/belongs-to.d.ts.map +1 -1
- package/unstable-preview-types/-private/belongs-to.type-test.d.ts +3 -1
- package/unstable-preview-types/-private/debug/assert-polymorphic-type.d.ts +7 -5
- package/unstable-preview-types/-private/errors.d.ts +288 -286
- package/unstable-preview-types/-private/has-many.d.ts +168 -167
- package/unstable-preview-types/-private/has-many.d.ts.map +1 -1
- package/unstable-preview-types/-private/has-many.type-test.d.ts +3 -1
- package/unstable-preview-types/-private/hooks.d.ts +12 -10
- package/unstable-preview-types/-private/legacy-relationships-support.d.ts +60 -58
- package/unstable-preview-types/-private/many-array.d.ts +192 -189
- package/unstable-preview-types/-private/many-array.d.ts.map +1 -1
- package/unstable-preview-types/-private/model-for-mixin.d.ts +5 -3
- package/unstable-preview-types/-private/model-methods.d.ts +32 -30
- package/unstable-preview-types/-private/model.d.ts +103 -100
- package/unstable-preview-types/-private/model.type-test.d.ts +3 -1
- package/unstable-preview-types/-private/notify-changes.d.ts +7 -5
- package/unstable-preview-types/-private/promise-belongs-to.d.ts +45 -43
- package/unstable-preview-types/-private/promise-many-array.d.ts +127 -125
- package/unstable-preview-types/-private/promise-proxy-base.d.ts +35 -32
- package/unstable-preview-types/-private/record-state.d.ts +86 -84
- package/unstable-preview-types/-private/references/belongs-to.d.ts +471 -469
- package/unstable-preview-types/-private/references/has-many.d.ts +486 -484
- package/unstable-preview-types/-private/schema-provider.d.ts +25 -23
- package/unstable-preview-types/-private/util.d.ts +10 -8
- package/unstable-preview-types/-private.d.ts +11 -9
- package/unstable-preview-types/hooks.d.ts +4 -2
- package/unstable-preview-types/index.d.ts +74 -45
- package/unstable-preview-types/migration-support.d.ts +10 -8
|
@@ -1,168 +1,169 @@
|
|
|
1
|
-
|
|
2
|
-
import type {
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
export declare function hasMany(
|
|
165
|
-
export declare function hasMany
|
|
166
|
-
export declare function hasMany<
|
|
167
|
-
export declare function hasMany(type: string, options: RelationshipOptions<unknown, boolean>): RelationshipDecorator<unknown>;
|
|
1
|
+
declare module '@ember-data/model/-private/has-many' {
|
|
2
|
+
import type { TypeFromInstance } from '@warp-drive/core-types/record';
|
|
3
|
+
import type { NoNull, RelationshipDecorator, RelationshipOptions } from '@ember-data/model/-private/belongs-to';
|
|
4
|
+
/**
|
|
5
|
+
`hasMany` is used to define Many-To-One and Many-To-Many, and Many-To-None
|
|
6
|
+
relationships on a [Model](/ember-data/release/classes/Model).
|
|
7
|
+
|
|
8
|
+
`hasMany` takes a configuration hash as a second parameter, currently
|
|
9
|
+
supported options are:
|
|
10
|
+
|
|
11
|
+
- `async`: (*required*) A boolean value used to declare whether this is a sync (false) or async (true) relationship.
|
|
12
|
+
- `inverse`: (*required*) A string used to identify the inverse property on a related model, or `null`.
|
|
13
|
+
- `polymorphic`: (*optional*) A boolean value to mark the relationship as polymorphic
|
|
14
|
+
- `as`: (*optional*) A string used to declare the abstract type "this" record satisfies for polymorphism.
|
|
15
|
+
|
|
16
|
+
### Examples
|
|
17
|
+
|
|
18
|
+
To declare a **many-to-one** (or one-to-many) relationship, use
|
|
19
|
+
`belongsTo` in combination with `hasMany`:
|
|
20
|
+
|
|
21
|
+
```js
|
|
22
|
+
// app/models/post.js
|
|
23
|
+
import Model, { hasMany } from '@ember-data/model';
|
|
24
|
+
|
|
25
|
+
export default class Post extends Model {
|
|
26
|
+
@hasMany('comment', { async: false, inverse: 'post' }) comments;
|
|
27
|
+
}
|
|
28
|
+
|
|
29
|
+
|
|
30
|
+
// app/models/comment.js
|
|
31
|
+
import Model, { belongsTo } from '@ember-data/model';
|
|
32
|
+
|
|
33
|
+
export default class Comment extends Model {
|
|
34
|
+
@belongsTo('post', { async: false, inverse: 'comments' }) post;
|
|
35
|
+
}
|
|
36
|
+
```
|
|
37
|
+
|
|
38
|
+
To declare a **many-to-many** relationship with managed inverses, use `hasMany` for both sides:
|
|
39
|
+
|
|
40
|
+
```js
|
|
41
|
+
// app/models/post.js
|
|
42
|
+
import Model, { hasMany } from '@ember-data/model';
|
|
43
|
+
|
|
44
|
+
export default class Post extends Model {
|
|
45
|
+
@hasMany('tag', { async: true, inverse: 'posts' }) tags;
|
|
46
|
+
}
|
|
47
|
+
|
|
48
|
+
// app/models/tag.js
|
|
49
|
+
import Model, { hasMany } from '@ember-data/model';
|
|
50
|
+
|
|
51
|
+
export default class Tag extends Model {
|
|
52
|
+
@hasMany('post', { async: true, inverse: 'tags' }) posts;
|
|
53
|
+
}
|
|
54
|
+
```
|
|
55
|
+
|
|
56
|
+
To declare a **many-to-many** relationship without managed inverses, use `hasMany` for both sides
|
|
57
|
+
with `null` as the inverse:
|
|
58
|
+
|
|
59
|
+
```js
|
|
60
|
+
// app/models/post.js
|
|
61
|
+
import Model, { hasMany } from '@ember-data/model';
|
|
62
|
+
|
|
63
|
+
export default class Post extends Model {
|
|
64
|
+
@hasMany('tag', { async: true, inverse: null }) tags;
|
|
65
|
+
}
|
|
66
|
+
|
|
67
|
+
// app/models/tag.js
|
|
68
|
+
import Model, { hasMany } from '@ember-data/model';
|
|
69
|
+
|
|
70
|
+
export default class Tag extends Model {
|
|
71
|
+
@hasMany('post', { async: true, inverse: null }) posts;
|
|
72
|
+
}
|
|
73
|
+
```
|
|
74
|
+
|
|
75
|
+
To declare a many-to-none relationship between two models, use
|
|
76
|
+
`hasMany` with inverse set to `null` on just one side::
|
|
77
|
+
|
|
78
|
+
```js
|
|
79
|
+
// app/models/post.js
|
|
80
|
+
import Model, { hasMany } from '@ember-data/model';
|
|
81
|
+
|
|
82
|
+
export default class Post extends Model {
|
|
83
|
+
@hasMany('category', { async: true, inverse: null }) categories;
|
|
84
|
+
}
|
|
85
|
+
```
|
|
86
|
+
|
|
87
|
+
#### Sync vs Async Relationships
|
|
88
|
+
|
|
89
|
+
EmberData fulfills relationships using resource data available in
|
|
90
|
+
the cache.
|
|
91
|
+
|
|
92
|
+
Sync relationships point directly to the known related resources.
|
|
93
|
+
|
|
94
|
+
When a relationship is declared as async, if any of the known related
|
|
95
|
+
resources have not been loaded, they will be fetched. The property
|
|
96
|
+
on the record when accessed provides a promise that resolves once
|
|
97
|
+
all resources are loaded.
|
|
98
|
+
|
|
99
|
+
Async relationships may take advantage of links. On access, if the related
|
|
100
|
+
link has not been loaded, or if any known resources are not available in
|
|
101
|
+
the cache, the fresh state will be fetched using the link.
|
|
102
|
+
|
|
103
|
+
In contrast to async relationship, accessing a sync relationship
|
|
104
|
+
will error on access when any of the known related resources have
|
|
105
|
+
not been loaded.
|
|
106
|
+
|
|
107
|
+
If you are using `links` with sync relationships, you have to use
|
|
108
|
+
the HasMany reference API to fetch or refresh related resources
|
|
109
|
+
that aren't loaded. For instance, for a `comments` relationship:
|
|
110
|
+
|
|
111
|
+
```js
|
|
112
|
+
post.hasMany('comments').reload();
|
|
113
|
+
```
|
|
114
|
+
|
|
115
|
+
#### Polymorphic Relationships
|
|
116
|
+
|
|
117
|
+
To declare a polymorphic relationship, use `hasMany` with the `polymorphic`
|
|
118
|
+
option set to `true`:
|
|
119
|
+
|
|
120
|
+
```js
|
|
121
|
+
// app/models/comment.js
|
|
122
|
+
import Model, { belongsTo } from '@ember-data/model';
|
|
123
|
+
|
|
124
|
+
export default class Comment extends Model {
|
|
125
|
+
@belongsTo('commentable', { async: false, inverse: 'comments', polymorphic: true }) parent;
|
|
126
|
+
}
|
|
127
|
+
```
|
|
128
|
+
|
|
129
|
+
`'commentable'` here is referred to as the "abstract type" for the polymorphic
|
|
130
|
+
relationship.
|
|
131
|
+
|
|
132
|
+
Polymorphic relationships with `inverse: null` will accept any type of record as their content.
|
|
133
|
+
Polymorphic relationships with `inverse` set to a string will only accept records with a matching
|
|
134
|
+
inverse relationships declaring itself as satisfying the abstract type.
|
|
135
|
+
|
|
136
|
+
Below, 'as' is used to declare the that 'post' record satisfies the abstract type 'commentable'
|
|
137
|
+
for this relationship.
|
|
138
|
+
|
|
139
|
+
```js
|
|
140
|
+
// app/models/post.js
|
|
141
|
+
import Model, { hasMany } from '@ember-data/model';
|
|
142
|
+
|
|
143
|
+
export default class Post extends Model {
|
|
144
|
+
@hasMany('comment', { async: false, inverse: 'parent', as: 'commentable' }) comments;
|
|
145
|
+
}
|
|
146
|
+
```
|
|
147
|
+
|
|
148
|
+
Note: every Model that declares an inverse to a polymorphic relationship must
|
|
149
|
+
declare itself exactly the same. This is because polymorphism is based on structural
|
|
150
|
+
traits.
|
|
151
|
+
|
|
152
|
+
Polymorphic to polymorphic relationships are supported. Both sides of the relationship
|
|
153
|
+
must be declared as polymorphic, and the `as` option must be used to declare the abstract
|
|
154
|
+
type each record satisfies on both sides.
|
|
155
|
+
|
|
156
|
+
@method hasMany
|
|
157
|
+
@public
|
|
158
|
+
@static
|
|
159
|
+
@for @ember-data/model
|
|
160
|
+
@param {string} type (optional) the name of the related resource
|
|
161
|
+
@param {object} options (optional) a hash of options
|
|
162
|
+
@return {PropertyDescriptor} relationship
|
|
163
|
+
*/
|
|
164
|
+
export declare function hasMany(): never;
|
|
165
|
+
export declare function hasMany(type: string): never;
|
|
166
|
+
export declare function hasMany<T>(type: TypeFromInstance<NoNull<T>>, options: RelationshipOptions<T, boolean>): RelationshipDecorator<T>;
|
|
167
|
+
export declare function hasMany(type: string, options: RelationshipOptions<unknown, boolean>): RelationshipDecorator<unknown>;
|
|
168
|
+
}
|
|
168
169
|
//# sourceMappingURL=has-many.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"has-many.d.ts","sourceRoot":"","sources":["../../src/-private/has-many.ts"],"names":[],"mappings":"AAWA,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,+BAA+B,CAAC;AAGtE,OAAO,KAAK,EAAE,MAAM,EAAE,qBAAqB,EAAE,mBAAmB,EAAE,MAAM,cAAc,CAAC;AAkFvF;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EA+JE;AACF,wBAAgB,OAAO,IAAI,KAAK,CAAC;AACjC,wBAAgB,OAAO,CAAC,IAAI,EAAE,MAAM,GAAG,KAAK,CAAC;AAC7C,wBAAgB,OAAO,CAAC,CAAC,EACvB,IAAI,EAAE,gBAAgB,CAAC,MAAM,CAAC,CAAC,CAAC,CAAC,EACjC,OAAO,EAAE,mBAAmB,CAAC,CAAC,EAAE,
|
|
1
|
+
{"version":3,"file":"has-many.d.ts","sourceRoot":"","sources":["../../src/-private/has-many.ts"],"names":[],"mappings":"AAWA,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,+BAA+B,CAAC;AAGtE,OAAO,KAAK,EAAE,MAAM,EAAE,qBAAqB,EAAE,mBAAmB,EAAE,MAAM,cAAc,CAAC;AAkFvF;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EA+JE;AACF,wBAAgB,OAAO,IAAI,KAAK,CAAC;AACjC,wBAAgB,OAAO,CAAC,IAAI,EAAE,MAAM,GAAG,KAAK,CAAC;AAC7C,wBAAgB,OAAO,CAAC,CAAC,EACvB,IAAI,EAAE,gBAAgB,CAAC,MAAM,CAAC,CAAC,CAAC,CAAC,EACjC,OAAO,EAAE,mBAAmB,CAAC,CAAC,EAAE,OAAO,CAAC,GACvC,qBAAqB,CAAC,CAAC,CAAC,CAAC;AAK5B,wBAAgB,OAAO,CAAC,IAAI,EAAE,MAAM,EAAE,OAAO,EAAE,mBAAmB,CAAC,OAAO,EAAE,OAAO,CAAC,GAAG,qBAAqB,CAAC,OAAO,CAAC,CAAC"}
|
|
@@ -1,11 +1,13 @@
|
|
|
1
|
-
|
|
2
|
-
import type
|
|
3
|
-
import type {
|
|
4
|
-
import type {
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
export declare function
|
|
10
|
-
export declare function modelFor(type:
|
|
1
|
+
declare module '@ember-data/model/-private/hooks' {
|
|
2
|
+
import { type Store } from '@ember-data/store/-private';
|
|
3
|
+
import type { StableRecordIdentifier } from '@warp-drive/core-types';
|
|
4
|
+
import type { TypeFromInstance } from '@warp-drive/core-types/record';
|
|
5
|
+
import type { Model } from '@ember-data/model/-private/model';
|
|
6
|
+
export declare function instantiateRecord(this: Store, identifier: StableRecordIdentifier, createRecordArgs: {
|
|
7
|
+
[key: string]: unknown;
|
|
8
|
+
}): Model;
|
|
9
|
+
export declare function teardownRecord(record: Model): void;
|
|
10
|
+
export declare function modelFor<T>(type: TypeFromInstance<T>): typeof Model | void;
|
|
11
|
+
export declare function modelFor(type: string): typeof Model | void;
|
|
12
|
+
}
|
|
11
13
|
//# sourceMappingURL=hooks.d.ts.map
|
|
@@ -1,60 +1,62 @@
|
|
|
1
|
-
|
|
2
|
-
import type {
|
|
3
|
-
import type {
|
|
4
|
-
import type {
|
|
5
|
-
import type
|
|
6
|
-
import type
|
|
7
|
-
import type {
|
|
8
|
-
import type {
|
|
9
|
-
import type {
|
|
10
|
-
import type {
|
|
11
|
-
import type {
|
|
12
|
-
import type {
|
|
13
|
-
import type {
|
|
14
|
-
import
|
|
15
|
-
import
|
|
16
|
-
import type {
|
|
17
|
-
import {
|
|
18
|
-
import
|
|
19
|
-
import
|
|
20
|
-
import
|
|
21
|
-
import
|
|
22
|
-
|
|
23
|
-
export declare
|
|
24
|
-
export declare
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
1
|
+
declare module '@ember-data/model/-private/legacy-relationships-support' {
|
|
2
|
+
import type { UpgradedMeta } from '@ember-data/graph/-private/-edge-definition';
|
|
3
|
+
import type { CollectionEdge } from '@ember-data/graph/-private/edges/collection';
|
|
4
|
+
import type { ResourceEdge } from '@ember-data/graph/-private/edges/resource';
|
|
5
|
+
import type { Graph } from '@ember-data/graph/-private/graph';
|
|
6
|
+
import type Store from '@ember-data/store';
|
|
7
|
+
import type { Cache } from '@ember-data/store/-types/q/cache';
|
|
8
|
+
import type { JsonApiRelationship } from '@ember-data/store/-types/q/record-data-json-api';
|
|
9
|
+
import type { OpaqueRecordInstance } from '@ember-data/store/-types/q/record-instance';
|
|
10
|
+
import type { BaseFinderOptions } from '@ember-data/store/-types/q/store';
|
|
11
|
+
import type { StableRecordIdentifier } from '@warp-drive/core-types';
|
|
12
|
+
import type { CollectionRelationship } from '@warp-drive/core-types/cache/relationship';
|
|
13
|
+
import type { LocalRelationshipOperation } from '@warp-drive/core-types/graph';
|
|
14
|
+
import type { CollectionResourceRelationship, SingleResourceRelationship } from '@warp-drive/core-types/spec/raw';
|
|
15
|
+
import RelatedCollection from '@ember-data/model/-private/many-array';
|
|
16
|
+
import type { MinimalLegacyRecord } from '@ember-data/model/-private/model-methods';
|
|
17
|
+
import type { BelongsToProxyCreateArgs } from '@ember-data/model/-private/promise-belongs-to';
|
|
18
|
+
import { PromiseBelongsTo } from '@ember-data/model/-private/promise-belongs-to';
|
|
19
|
+
import type { HasManyProxyCreateArgs } from '@ember-data/model/-private/promise-many-array';
|
|
20
|
+
import PromiseManyArray from '@ember-data/model/-private/promise-many-array';
|
|
21
|
+
import BelongsToReference from '@ember-data/model/-private/references/belongs-to';
|
|
22
|
+
import HasManyReference from '@ember-data/model/-private/references/has-many';
|
|
23
|
+
export declare const LEGACY_SUPPORT: Map<StableRecordIdentifier | MinimalLegacyRecord, LegacySupport>;
|
|
24
|
+
export declare function lookupLegacySupport(record: MinimalLegacyRecord): LegacySupport;
|
|
25
|
+
export declare class LegacySupport {
|
|
26
|
+
record: MinimalLegacyRecord;
|
|
27
|
+
store: Store;
|
|
28
|
+
graph: Graph;
|
|
29
|
+
cache: Cache;
|
|
30
|
+
references: Record<string, BelongsToReference | HasManyReference>;
|
|
31
|
+
identifier: StableRecordIdentifier;
|
|
32
|
+
_manyArrayCache: Record<string, RelatedCollection>;
|
|
33
|
+
_relationshipPromisesCache: Record<string, Promise<RelatedCollection | OpaqueRecordInstance>>;
|
|
34
|
+
_relationshipProxyCache: Record<string, PromiseManyArray | PromiseBelongsTo | undefined>;
|
|
35
|
+
_pending: Record<string, Promise<StableRecordIdentifier | null> | undefined>;
|
|
36
|
+
isDestroying: boolean;
|
|
37
|
+
isDestroyed: boolean;
|
|
38
|
+
constructor(record: MinimalLegacyRecord);
|
|
39
|
+
_syncArray(array: RelatedCollection): void;
|
|
40
|
+
mutate(mutation: LocalRelationshipOperation): void;
|
|
41
|
+
_findBelongsTo(key: string, resource: SingleResourceRelationship, relationship: ResourceEdge, options?: BaseFinderOptions): Promise<OpaqueRecordInstance | null>;
|
|
42
|
+
reloadBelongsTo(key: string, options?: BaseFinderOptions): Promise<OpaqueRecordInstance | null>;
|
|
43
|
+
getBelongsTo(key: string, options?: BaseFinderOptions): PromiseBelongsTo | OpaqueRecordInstance | null;
|
|
44
|
+
setDirtyBelongsTo(key: string, value: OpaqueRecordInstance | null): void;
|
|
45
|
+
_getCurrentState(identifier: StableRecordIdentifier, field: string): [StableRecordIdentifier[], CollectionRelationship];
|
|
46
|
+
getManyArray<T>(key: string, definition?: UpgradedMeta): RelatedCollection<T>;
|
|
47
|
+
fetchAsyncHasMany(key: string, relationship: CollectionEdge, manyArray: RelatedCollection, options?: BaseFinderOptions): Promise<RelatedCollection>;
|
|
48
|
+
reloadHasMany(key: string, options?: BaseFinderOptions): Promise<unknown> | PromiseManyArray<unknown>;
|
|
49
|
+
getHasMany(key: string, options?: BaseFinderOptions): PromiseManyArray | RelatedCollection;
|
|
50
|
+
_updatePromiseProxyFor(kind: 'hasMany', key: string, args: HasManyProxyCreateArgs): PromiseManyArray;
|
|
51
|
+
_updatePromiseProxyFor(kind: 'belongsTo', key: string, args: BelongsToProxyCreateArgs): PromiseBelongsTo;
|
|
52
|
+
_updatePromiseProxyFor(kind: 'belongsTo', key: string, args: {
|
|
53
|
+
promise: Promise<OpaqueRecordInstance | null>;
|
|
54
|
+
}): PromiseBelongsTo;
|
|
55
|
+
referenceFor(kind: string | null, name: string): BelongsToReference<unknown, string, unknown> | HasManyReference<unknown, string, unknown>;
|
|
56
|
+
_findHasManyByJsonApiResource(resource: CollectionResourceRelationship, parentIdentifier: StableRecordIdentifier, relationship: CollectionEdge, options?: BaseFinderOptions): Promise<void | unknown[]> | void;
|
|
57
|
+
_findBelongsToByJsonApiResource(resource: SingleResourceRelationship, parentIdentifier: StableRecordIdentifier, relationship: ResourceEdge, options?: BaseFinderOptions): Promise<StableRecordIdentifier | null>;
|
|
58
|
+
destroy(): void;
|
|
59
|
+
}
|
|
60
|
+
export declare function areAllInverseRecordsLoaded(store: Store, resource: JsonApiRelationship): boolean;
|
|
58
61
|
}
|
|
59
|
-
export declare function areAllInverseRecordsLoaded(store: Store, resource: JsonApiRelationship): boolean;
|
|
60
62
|
//# sourceMappingURL=legacy-relationships-support.d.ts.map
|