@ember-data/model 5.4.0-alpha.30 → 5.4.0-alpha.32

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.
Files changed (73) hide show
  1. package/addon/-private.js +2 -2
  2. package/addon/has-many-Qm5aUQol.js +645 -0
  3. package/addon/has-many-Qm5aUQol.js.map +1 -0
  4. package/addon/{hooks-bOTjo_Wd.js → hooks-YY4O5eQM.js} +2 -2
  5. package/addon/hooks-YY4O5eQM.js.map +1 -0
  6. package/addon/hooks.js +1 -1
  7. package/addon/index.js +3 -3
  8. package/addon/migration-support.js +1 -1
  9. package/addon/migration-support.js.map +1 -1
  10. package/addon/{model-jh9D1v1Y.js → model-eXqU5A13.js} +2 -4
  11. package/addon/model-eXqU5A13.js.map +1 -0
  12. package/addon/{util-3DHZJC9h.js → util-Km_Z-hz0.js} +1 -4
  13. package/addon/util-Km_Z-hz0.js.map +1 -0
  14. package/package.json +22 -20
  15. package/unstable-preview-types/-private/attr.d.ts +172 -0
  16. package/unstable-preview-types/-private/attr.d.ts.map +1 -0
  17. package/unstable-preview-types/-private/attr.type-test.d.ts +2 -0
  18. package/unstable-preview-types/-private/attr.type-test.d.ts.map +1 -0
  19. package/unstable-preview-types/-private/belongs-to.d.ts +179 -0
  20. package/unstable-preview-types/-private/belongs-to.d.ts.map +1 -0
  21. package/unstable-preview-types/-private/belongs-to.type-test.d.ts +2 -0
  22. package/unstable-preview-types/-private/belongs-to.type-test.d.ts.map +1 -0
  23. package/unstable-preview-types/-private/debug/assert-polymorphic-type.d.ts +6 -0
  24. package/unstable-preview-types/-private/debug/assert-polymorphic-type.d.ts.map +1 -0
  25. package/unstable-preview-types/-private/errors.d.ts +306 -0
  26. package/unstable-preview-types/-private/errors.d.ts.map +1 -0
  27. package/unstable-preview-types/-private/has-many.d.ts +168 -0
  28. package/unstable-preview-types/-private/has-many.d.ts.map +1 -0
  29. package/unstable-preview-types/-private/has-many.type-test.d.ts +2 -0
  30. package/unstable-preview-types/-private/has-many.type-test.d.ts.map +1 -0
  31. package/unstable-preview-types/-private/hooks.d.ts +11 -0
  32. package/unstable-preview-types/-private/hooks.d.ts.map +1 -0
  33. package/unstable-preview-types/-private/legacy-relationships-support.d.ts +60 -0
  34. package/unstable-preview-types/-private/legacy-relationships-support.d.ts.map +1 -0
  35. package/unstable-preview-types/-private/many-array.d.ts +195 -0
  36. package/unstable-preview-types/-private/many-array.d.ts.map +1 -0
  37. package/unstable-preview-types/-private/model-for-mixin.d.ts +4 -0
  38. package/unstable-preview-types/-private/model-for-mixin.d.ts.map +1 -0
  39. package/unstable-preview-types/-private/model-methods.d.ts +32 -0
  40. package/unstable-preview-types/-private/model-methods.d.ts.map +1 -0
  41. package/unstable-preview-types/-private/model.d.ts +101 -0
  42. package/unstable-preview-types/-private/model.type-test.d.ts +2 -0
  43. package/unstable-preview-types/-private/model.type-test.d.ts.map +1 -0
  44. package/unstable-preview-types/-private/notify-changes.d.ts +6 -0
  45. package/unstable-preview-types/-private/notify-changes.d.ts.map +1 -0
  46. package/unstable-preview-types/-private/promise-belongs-to.d.ts +45 -0
  47. package/unstable-preview-types/-private/promise-belongs-to.d.ts.map +1 -0
  48. package/unstable-preview-types/-private/promise-many-array.d.ts +127 -0
  49. package/unstable-preview-types/-private/promise-many-array.d.ts.map +1 -0
  50. package/unstable-preview-types/-private/promise-proxy-base.d.ts +32 -0
  51. package/unstable-preview-types/-private/record-state.d.ts +89 -0
  52. package/unstable-preview-types/-private/record-state.d.ts.map +1 -0
  53. package/unstable-preview-types/-private/references/belongs-to.d.ts +501 -0
  54. package/unstable-preview-types/-private/references/belongs-to.d.ts.map +1 -0
  55. package/unstable-preview-types/-private/references/has-many.d.ts +513 -0
  56. package/unstable-preview-types/-private/references/has-many.d.ts.map +1 -0
  57. package/unstable-preview-types/-private/schema-provider.d.ts +25 -0
  58. package/unstable-preview-types/-private/schema-provider.d.ts.map +1 -0
  59. package/unstable-preview-types/-private/util.d.ts +9 -0
  60. package/unstable-preview-types/-private/util.d.ts.map +1 -0
  61. package/unstable-preview-types/-private.d.ts +10 -0
  62. package/unstable-preview-types/-private.d.ts.map +1 -0
  63. package/unstable-preview-types/hooks.d.ts +3 -0
  64. package/unstable-preview-types/hooks.d.ts.map +1 -0
  65. package/unstable-preview-types/index.d.ts +46 -0
  66. package/unstable-preview-types/index.d.ts.map +1 -0
  67. package/unstable-preview-types/migration-support.d.ts +9 -0
  68. package/unstable-preview-types/migration-support.d.ts.map +1 -0
  69. package/addon/has-many-dFQwoHgB.js +0 -323
  70. package/addon/has-many-dFQwoHgB.js.map +0 -1
  71. package/addon/hooks-bOTjo_Wd.js.map +0 -1
  72. package/addon/model-jh9D1v1Y.js.map +0 -1
  73. package/addon/util-3DHZJC9h.js.map +0 -1
@@ -0,0 +1 @@
1
+ {"version":3,"file":"record-state.d.ts","sourceRoot":"","sources":["../../src/-private/record-state.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,KAAK,MAAM,mBAAmB,CAAC;AAI3C,OAAO,KAAK,mBAAmB,MAAM,kDAAkD,CAAC;AACxF,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,kDAAkD,CAAC;AACrF,OAAO,KAAK,EAAE,KAAK,EAAE,MAAM,kCAAkC,CAAC;AAG9D,OAAO,KAAK,EAAE,sBAAsB,EAAE,MAAM,wBAAwB,CAAC;AAErE,OAAO,KAAK,MAAM,MAAM,UAAU,CAAC;AACnC,OAAO,KAAK,EAAE,mBAAmB,EAAE,MAAM,iBAAiB,CAAC;AAgB3D;;;;;;;GAOG;AACH,wBAAgB,MAAM,CAAC,CAAC,SAAS,MAAM,EAAE,CAAC,SAAS,MAAM,CAAC,GAAG,MAAM,EAAE,OAAO,EAAE,CAAC,EAAE,GAAG,EAAE,CAAC,EAAE,IAAI,EAAE,kBAAkB,sBAwBhH;AAED,wBAAgB,YAAY,CAAC,CAAC,SAAS,MAAM,EAAE,CAAC,SAAS,MAAM,CAAC,GAAG,MAAM,EAAE,GAAG,EAAE,CAAC,EAAE,GAAG,EAAE,CAAC,QAMxF;AAED;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EAsCE;AACF,MAAM,CAAC,OAAO,OAAO,WAAW;IACtB,KAAK,EAAE,KAAK,CAAC;IACb,UAAU,EAAE,sBAAsB,CAAC;IACnC,MAAM,EAAE,mBAAmB,CAAC;IAC5B,EAAE,EAAE,mBAAmB,CAAC;IAExB,YAAY,EAAE,MAAM,CAAC;IACrB,cAAc,EAAE,MAAM,CAAC;IACvB,aAAa,EAAE,MAAM,CAAC;IACtB,KAAK,EAAE,KAAK,CAAC;IACb,cAAc,EAAE,YAAY,EAAE,CAAC;IAC/B,UAAU,EAAE,YAAY,GAAG,IAAI,CAAC;IAChC,OAAO,EAAE,MAAM,CAAC;gBAEZ,MAAM,EAAE,mBAAmB;IAoGvC,OAAO;IAIP,MAAM,CAAC,GAAG,EAAE,MAAM,IAAI,GAAG,MAAM;IAI/B,mBAAmB,CAAC,MAAM,EAAE,MAAM;IA+BlC,kBAAkB;IAQV,QAAQ,EAAE,OAAO,CAAC;IAE1B,IACI,SAAS,YAEZ;IAED,IACI,QAAQ,YAKX;IAED,IACI,OAAO,YAUV;IAED,IACI,OAAO,YAMV;IAED,IACI,KAAK,YAIR;IAED,IACI,SAAS,YAIZ;IAED,IACI,OAAO,YAEV;IAED,IACI,OAAO,YAMV;IAED,IACI,OAAO,YAOV;IAED,IACI,YAAY,YAMf;IAED,IACI,WAAW,YAEd;IAED,IACI,SAAS,yWA2CZ;IAED,IACI,SAAS,2CAqBZ;CACF"}
@@ -0,0 +1,501 @@
1
+ import type { ResourceEdge } from '@ember-data/graph/-private/edges/resource';
2
+ import type { Graph } from '@ember-data/graph/-private/graph';
3
+ import type Store from '@ember-data/store';
4
+ import type { StableRecordIdentifier } from '@warp-drive/core-types';
5
+ import type { TypeFromInstanceOrString } from '@warp-drive/core-types/record';
6
+ import type { Links, Meta, SingleResourceDocument, SingleResourceRelationship } from '@warp-drive/core-types/spec/raw';
7
+ import type { IsUnknown } from '../belongs-to';
8
+ /**
9
+ A `BelongsToReference` is a low-level API that allows access
10
+ and manipulation of a belongsTo relationship.
11
+
12
+ It is especially useful when you're dealing with `async` relationships
13
+ from `@ember-data/model` as it allows synchronous access to
14
+ the relationship data if loaded, as well as APIs for loading, reloading
15
+ the data or accessing available information without triggering a load.
16
+
17
+ It may also be useful when using `sync` relationships with `@ember-data/model`
18
+ that need to be loaded/reloaded with more precise timing than marking the
19
+ relationship as `async` and relying on autofetch would have allowed.
20
+
21
+ However,keep in mind that marking a relationship as `async: false` will introduce
22
+ bugs into your application if the data is not always guaranteed to be available
23
+ by the time the relationship is accessed. Ergo, it is recommended when using this
24
+ approach to utilize `links` for unloaded relationship state instead of identifiers.
25
+
26
+ Reference APIs are entangled with the relationship's underlying state,
27
+ thus any getters or cached properties that utilize these will properly
28
+ invalidate if the relationship state changes.
29
+
30
+ References are "stable", meaning that multiple calls to retrieve the reference
31
+ for a given relationship will always return the same HasManyReference.
32
+
33
+ @class BelongsToReference
34
+ @public
35
+ */
36
+ export default class BelongsToReference<T = unknown, K extends string = IsUnknown<T> extends true ? string : keyof T & string, Related = K extends keyof T ? Awaited<T[K]> : unknown> {
37
+ graph: Graph;
38
+ store: Store;
39
+ belongsToRelationship: ResourceEdge;
40
+ /**
41
+ * The field name on the parent record for this has-many relationship.
42
+ *
43
+ * @property {String} key
44
+ * @public
45
+ */
46
+ key: K;
47
+ /**
48
+ * The type of resource this relationship will contain.
49
+ *
50
+ * @property {String} type
51
+ * @public
52
+ */
53
+ type: TypeFromInstanceOrString<Related>;
54
+ ___token: object;
55
+ ___identifier: StableRecordIdentifier<TypeFromInstanceOrString<T>>;
56
+ ___relatedToken: object | null;
57
+ _ref: number;
58
+ constructor(store: Store, graph: Graph, parentIdentifier: StableRecordIdentifier<TypeFromInstanceOrString<T>>, belongsToRelationship: ResourceEdge, key: K);
59
+ destroy(): void;
60
+ /**
61
+ * The identifier of the record that this reference refers to.
62
+ * `null` if no related record is known.
63
+ *
64
+ * @property {StableRecordIdentifier | null} identifier
65
+ * @public
66
+ */
67
+ get identifier(): StableRecordIdentifier<TypeFromInstanceOrString<Related>> | null;
68
+ /**
69
+ The `id` of the record that this reference refers to. Together, the
70
+ `type()` and `id()` methods form a composite key for the identity
71
+ map. This can be used to access the id of an async relationship
72
+ without triggering a fetch that would normally happen if you
73
+ attempted to use `record.relationship.id`.
74
+
75
+ Example
76
+
77
+ ```javascript
78
+ // models/blog.js
79
+ import Model, { belongsTo } from '@ember-data/model';
80
+
81
+ export default class BlogModel extends Model {
82
+ @belongsTo('user', { async: true, inverse: null }) user;
83
+ }
84
+
85
+ let blog = store.push({
86
+ data: {
87
+ type: 'blog',
88
+ id: 1,
89
+ relationships: {
90
+ user: {
91
+ data: { type: 'user', id: 1 }
92
+ }
93
+ }
94
+ }
95
+ });
96
+ let userRef = blog.belongsTo('user');
97
+
98
+ // get the identifier of the reference
99
+ if (userRef.remoteType() === "id") {
100
+ let id = userRef.id();
101
+ }
102
+ ```
103
+
104
+ @method id
105
+ @public
106
+ @return {String} The id of the record in this belongsTo relationship.
107
+ */
108
+ id(): string | null;
109
+ /**
110
+ The link Ember Data will use to fetch or reload this belongs-to
111
+ relationship. By default it uses only the "related" resource linkage.
112
+
113
+ Example
114
+
115
+ ```javascript
116
+ // models/blog.js
117
+ import Model, { belongsTo } from '@ember-data/model';
118
+ export default Model.extend({
119
+ user: belongsTo('user', { async: true, inverse: null })
120
+ });
121
+
122
+ let blog = store.push({
123
+ data: {
124
+ type: 'blog',
125
+ id: 1,
126
+ relationships: {
127
+ user: {
128
+ links: {
129
+ related: '/articles/1/author'
130
+ }
131
+ }
132
+ }
133
+ }
134
+ });
135
+ let userRef = blog.belongsTo('user');
136
+
137
+ // get the identifier of the reference
138
+ if (userRef.remoteType() === "link") {
139
+ let link = userRef.link();
140
+ }
141
+ ```
142
+
143
+ @method link
144
+ @public
145
+ @return {String} The link Ember Data will use to fetch or reload this belongs-to relationship.
146
+ */
147
+ link(): string | null;
148
+ /**
149
+ * any links that have been received for this relationship
150
+ *
151
+ * @method links
152
+ * @public
153
+ * @return
154
+ */
155
+ links(): Links | null;
156
+ /**
157
+ The meta data for the belongs-to relationship.
158
+
159
+ Example
160
+
161
+ ```javascript
162
+ // models/blog.js
163
+ import Model, { belongsTo } from '@ember-data/model';
164
+ export default Model.extend({
165
+ user: belongsTo('user', { async: true, inverse: null })
166
+ });
167
+
168
+ let blog = store.push({
169
+ data: {
170
+ type: 'blog',
171
+ id: 1,
172
+ relationships: {
173
+ user: {
174
+ links: {
175
+ related: {
176
+ href: '/articles/1/author'
177
+ },
178
+ },
179
+ meta: {
180
+ lastUpdated: 1458014400000
181
+ }
182
+ }
183
+ }
184
+ }
185
+ });
186
+
187
+ let userRef = blog.belongsTo('user');
188
+
189
+ userRef.meta() // { lastUpdated: 1458014400000 }
190
+ ```
191
+
192
+ @method meta
193
+ @public
194
+ @return {Object} The meta information for the belongs-to relationship.
195
+ */
196
+ meta(): Meta | null;
197
+ _resource(): SingleResourceRelationship;
198
+ /**
199
+ This returns a string that represents how the reference will be
200
+ looked up when it is loaded. If the relationship has a link it will
201
+ use the "link" otherwise it defaults to "id".
202
+
203
+ Example
204
+
205
+ ```app/models/post.js
206
+ import Model, { hasMany } from '@ember-data/model';
207
+
208
+ export default class PostModel extends Model {
209
+ @hasMany('comment', { async: true, inverse: null }) comments;
210
+ }
211
+ ```
212
+
213
+ ```javascript
214
+ let post = store.push({
215
+ data: {
216
+ type: 'post',
217
+ id: 1,
218
+ relationships: {
219
+ comments: {
220
+ data: [{ type: 'comment', id: 1 }]
221
+ }
222
+ }
223
+ }
224
+ });
225
+
226
+ let commentsRef = post.hasMany('comments');
227
+
228
+ // get the identifier of the reference
229
+ if (commentsRef.remoteType() === "ids") {
230
+ let ids = commentsRef.ids();
231
+ } else if (commentsRef.remoteType() === "link") {
232
+ let link = commentsRef.link();
233
+ }
234
+ ```
235
+
236
+ @method remoteType
237
+ @public
238
+ @return {String} The name of the remote type. This should either be `link` or `id`
239
+ */
240
+ remoteType(): 'link' | 'id';
241
+ /**
242
+ `push` can be used to update the data in the relationship and EmberData
243
+ will treat the new data as the canonical value of this relationship on
244
+ the backend. A value of `null` (e.g. `{ data: null }`) can be passed to
245
+ clear the relationship.
246
+
247
+ Example model
248
+
249
+ ```app/models/blog.js
250
+ import Model, { belongsTo } from '@ember-data/model';
251
+
252
+ export default class BlogModel extends Model {
253
+ @belongsTo('user', { async: true, inverse: null }) user;
254
+ }
255
+ ```
256
+
257
+ Setup some initial state, note we haven't loaded the user yet:
258
+
259
+ ```js
260
+ const blog = store.push({
261
+ data: {
262
+ type: 'blog',
263
+ id: '1',
264
+ relationships: {
265
+ user: {
266
+ data: { type: 'user', id: '1' }
267
+ }
268
+ }
269
+ }
270
+ });
271
+
272
+ const userRef = blog.belongsTo('user');
273
+ userRef.id(); // '1'
274
+ ```
275
+
276
+ Update the state using `push`, note we can do this even without
277
+ having loaded the user yet by providing a resource-identifier.
278
+
279
+ Both full a resource and a resource-identifier are supported.
280
+
281
+ ```js
282
+ await userRef.push({
283
+ data: {
284
+ type: 'user',
285
+ id: '2',
286
+ }
287
+ });
288
+
289
+ userRef.id(); // '2'
290
+ ```
291
+
292
+ You may also pass in links and meta fore the relationship, and sideload
293
+ additional resources that might be required.
294
+
295
+ ```js
296
+ await userRef.push({
297
+ data: {
298
+ type: 'user',
299
+ id: '2',
300
+ },
301
+ links: {
302
+ related: '/articles/1/author'
303
+ },
304
+ meta: {
305
+ lastUpdated: Date.now()
306
+ },
307
+ included: [
308
+ {
309
+ type: 'user-preview',
310
+ id: '2',
311
+ attributes: {
312
+ username: '@runspired'
313
+ }
314
+ }
315
+ ]
316
+ });
317
+ ```
318
+
319
+ By default, the store will attempt to fetch the record if it is not loaded or its
320
+ resource data is not included in the call to `push` before resolving the returned
321
+ promise with the new state..
322
+
323
+ Alternatively, pass `true` as the second argument to avoid fetching unloaded records
324
+ and instead the promise will resolve with void without attempting to fetch. This is
325
+ particularly useful if you want to update the state of the relationship without
326
+ forcing the load of all of the associated record.
327
+
328
+ @method push
329
+ @public
330
+ @param {Object} doc a JSONAPI document object describing the new value of this relationship.
331
+ @param {Boolean} [skipFetch] if `true`, do not attempt to fetch unloaded records
332
+ @return {Promise<OpaqueRecordInstance | null | void>}
333
+ */
334
+ push(doc: SingleResourceDocument, skipFetch?: boolean): Promise<Related | null | void>;
335
+ /**
336
+ `value()` synchronously returns the current value of the belongs-to
337
+ relationship. Unlike `record.relationshipName`, calling
338
+ `value()` on a reference does not trigger a fetch if the async
339
+ relationship is not yet loaded. If the relationship is not loaded
340
+ it will always return `null`.
341
+
342
+ Example
343
+
344
+ ```javascript
345
+ // models/blog.js
346
+ import Model, { belongsTo } from '@ember-data/model';
347
+
348
+ export default class BlogModel extends Model {
349
+ @belongsTo('user', { async: true, inverse: null }) user;
350
+ }
351
+
352
+ let blog = store.push({
353
+ data: {
354
+ type: 'blog',
355
+ id: 1,
356
+ relationships: {
357
+ user: {
358
+ data: { type: 'user', id: 1 }
359
+ }
360
+ }
361
+ }
362
+ });
363
+ let userRef = blog.belongsTo('user');
364
+
365
+ userRef.value(); // null
366
+
367
+ // provide data for reference
368
+ userRef.push({
369
+ data: {
370
+ type: 'user',
371
+ id: 1,
372
+ attributes: {
373
+ username: "@user"
374
+ }
375
+ }
376
+ }).then(function(user) {
377
+ userRef.value(); // user
378
+ });
379
+ ```
380
+
381
+ @method value
382
+ @public
383
+ @return {Model} the record in this relationship
384
+ */
385
+ value(): Related | null;
386
+ /**
387
+ Loads a record in a belongs-to relationship if it is not already
388
+ loaded. If the relationship is already loaded this method does not
389
+ trigger a new load.
390
+
391
+ Example
392
+
393
+ ```javascript
394
+ // models/blog.js
395
+ import Model, { belongsTo } from '@ember-data/model';
396
+
397
+ export default class BlogModel extends Model {
398
+ @belongsTo('user', { async: true, inverse: null }) user;
399
+ }
400
+
401
+ let blog = store.push({
402
+ data: {
403
+ type: 'blog',
404
+ id: 1,
405
+ relationships: {
406
+ user: {
407
+ data: { type: 'user', id: 1 }
408
+ }
409
+ }
410
+ }
411
+ });
412
+ let userRef = blog.belongsTo('user');
413
+
414
+ userRef.value(); // null
415
+
416
+ userRef.load().then(function(user) {
417
+ userRef.value() === user
418
+ });
419
+ ```
420
+
421
+ You may also pass in an options object whose properties will be
422
+ fed forward. This enables you to pass `adapterOptions` into the
423
+ request given to the adapter via the reference.
424
+
425
+ Example
426
+
427
+ ```javascript
428
+ userRef.load({ adapterOptions: { isPrivate: true } }).then(function(user) {
429
+ userRef.value() === user;
430
+ });
431
+ ```
432
+ ```app/adapters/user.js
433
+ import Adapter from '@ember-data/adapter';
434
+
435
+ export default class UserAdapter extends Adapter {
436
+ findRecord(store, type, id, snapshot) {
437
+ // In the adapter you will have access to adapterOptions.
438
+ let adapterOptions = snapshot.adapterOptions;
439
+ }
440
+ });
441
+ ```
442
+
443
+ @method load
444
+ @public
445
+ @param {Object} options the options to pass in.
446
+ @return {Promise} a promise that resolves with the record in this belongs-to relationship.
447
+ */
448
+ load(options?: Record<string, unknown>): Promise<Related | null>;
449
+ /**
450
+ Triggers a reload of the value in this relationship. If the
451
+ remoteType is `"link"` Ember Data will use the relationship link to
452
+ reload the relationship. Otherwise it will reload the record by its
453
+ id.
454
+
455
+ Example
456
+
457
+ ```javascript
458
+ // models/blog.js
459
+ import Model, { belongsTo } from '@ember-data/model';
460
+
461
+ export default class BlogModel extends Model {
462
+ @belongsTo('user', { async: true, inverse: null }) user;
463
+ }
464
+
465
+ let blog = store.push({
466
+ data: {
467
+ type: 'blog',
468
+ id: 1,
469
+ relationships: {
470
+ user: {
471
+ data: { type: 'user', id: 1 }
472
+ }
473
+ }
474
+ }
475
+ });
476
+ let userRef = blog.belongsTo('user');
477
+
478
+ userRef.reload().then(function(user) {
479
+ userRef.value() === user
480
+ });
481
+ ```
482
+
483
+ You may also pass in an options object whose properties will be
484
+ fed forward. This enables you to pass `adapterOptions` into the
485
+ request given to the adapter via the reference. A full example
486
+ can be found in the `load` method.
487
+
488
+ Example
489
+
490
+ ```javascript
491
+ userRef.reload({ adapterOptions: { isPrivate: true } })
492
+ ```
493
+
494
+ @method reload
495
+ @public
496
+ @param {Object} options the options to pass in.
497
+ @return {Promise} a promise that resolves with the record in this belongs-to relationship after the reload has completed.
498
+ */
499
+ reload(options?: Record<string, unknown>): Promise<Related | null>;
500
+ }
501
+ //# sourceMappingURL=belongs-to.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"belongs-to.d.ts","sourceRoot":"","sources":["../../../src/-private/references/belongs-to.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,2CAA2C,CAAC;AAC9E,OAAO,KAAK,EAAE,KAAK,EAAE,MAAM,kCAAkC,CAAC;AAC9D,OAAO,KAAK,KAAK,MAAM,mBAAmB,CAAC;AAI3C,OAAO,KAAK,EAAE,sBAAsB,EAAE,MAAM,wBAAwB,CAAC;AAErE,OAAO,KAAK,EAAE,wBAAwB,EAAE,MAAM,+BAA+B,CAAC;AAC9E,OAAO,KAAK,EAEV,KAAK,EACL,IAAI,EACJ,sBAAsB,EACtB,0BAA0B,EAC3B,MAAM,iCAAiC,CAAC;AAEzC,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,eAAe,CAAC;AAuB/C;;;;;;;;;;;;;;;;;;;;;;;;;;;GA2BG;AACH,MAAM,CAAC,OAAO,OAAO,kBAAkB,CACrC,CAAC,GAAG,OAAO,EACX,CAAC,SAAS,MAAM,GAAG,SAAS,CAAC,CAAC,CAAC,SAAS,IAAI,GAAG,MAAM,GAAG,MAAM,CAAC,GAAG,MAAM,EACxE,OAAO,GAAG,CAAC,SAAS,MAAM,CAAC,GAAG,OAAO,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,GAAG,OAAO;IAE7C,KAAK,EAAE,KAAK,CAAC;IACb,KAAK,EAAE,KAAK,CAAC;IACb,qBAAqB,EAAE,YAAY,CAAC;IAC5C;;;;;OAKG;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