@warp-drive/core 5.6.0-alpha.15 → 5.6.0-alpha.17
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/declarations/build-config/babel-macros.d.ts +1 -2
- package/declarations/build-config/canary-features.d.ts +1 -2
- package/declarations/build-config/debugging.d.ts +1 -2
- package/declarations/build-config/deprecations.d.ts +1 -2
- package/declarations/build-config/env.d.ts +1 -2
- package/declarations/build-config/macros.d.ts +1 -2
- package/declarations/build-config.d.ts +1 -2
- package/declarations/configure.d.ts +6 -7
- package/declarations/graph/-private/-diff.d.ts +21 -22
- package/declarations/graph/-private/-edge-definition.d.ts +134 -135
- package/declarations/graph/-private/-state.d.ts +93 -7
- package/declarations/graph/-private/-utils.d.ts +18 -13
- package/declarations/graph/-private/coerce-id.d.ts +6 -1
- package/declarations/graph/-private/debug/assert-polymorphic-type.d.ts +15 -4
- package/declarations/graph/-private/edges/collection.d.ts +35 -36
- package/declarations/graph/-private/edges/implicit.d.ts +28 -29
- package/declarations/graph/-private/edges/resource.d.ts +19 -20
- package/declarations/graph/-private/graph.d.ts +83 -48
- package/declarations/graph/-private/normalize-link.d.ts +7 -2
- package/declarations/graph/-private/operations/add-to-related-records.d.ts +3 -4
- package/declarations/graph/-private/operations/merge-identifier.d.ts +2 -3
- package/declarations/graph/-private/operations/remove-from-related-records.d.ts +3 -4
- package/declarations/graph/-private/operations/replace-related-record.d.ts +2 -3
- package/declarations/graph/-private/operations/replace-related-records.d.ts +58 -4
- package/declarations/graph/-private/operations/update-relationship.d.ts +11 -9
- package/declarations/graph/-private.d.ts +9 -10
- package/declarations/index.d.ts +11 -12
- package/declarations/reactive/-private/document.d.ts +143 -144
- package/declarations/reactive/-private/fields/compute.d.ts +31 -28
- package/declarations/reactive/-private/fields/extension.d.ts +2 -3
- package/declarations/reactive/-private/fields/managed-array.d.ts +19 -20
- package/declarations/reactive/-private/fields/managed-object.d.ts +16 -16
- package/declarations/reactive/-private/fields/many-array-manager.d.ts +15 -16
- package/declarations/reactive/-private/hooks.d.ts +3 -4
- package/declarations/reactive/-private/record.d.ts +61 -59
- package/declarations/reactive/-private/schema.d.ts +242 -224
- package/declarations/reactive/-private/symbols.d.ts +26 -1
- package/declarations/reactive/-private.d.ts +1 -2
- package/declarations/reactive.d.ts +4 -5
- package/declarations/request/-private/context.d.ts +34 -35
- package/declarations/request/-private/debug.d.ts +2 -3
- package/declarations/request/-private/fetch.d.ts +23 -24
- package/declarations/request/-private/future.d.ts +3 -4
- package/declarations/request/-private/manager.d.ts +159 -157
- package/declarations/request/-private/promise-cache.d.ts +21 -13
- package/declarations/request/-private/types.d.ts +124 -124
- package/declarations/request/-private/utils.d.ts +8 -9
- package/declarations/request.d.ts +5 -6
- package/declarations/store/-private/cache-handler/handler.d.ts +57 -52
- package/declarations/store/-private/cache-handler/types.d.ts +95 -96
- package/declarations/store/-private/cache-handler/utils.d.ts +16 -16
- package/declarations/store/-private/caches/cache-utils.d.ts +7 -4
- package/declarations/store/-private/caches/identifier-cache.d.ts +234 -246
- package/declarations/store/-private/caches/instance-cache.d.ts +47 -47
- package/declarations/store/-private/caches/resource-utils.d.ts +3 -4
- package/declarations/store/-private/debug/utils.d.ts +6 -7
- package/declarations/store/-private/default-cache-policy.d.ts +362 -361
- package/declarations/store/-private/legacy-model-support/record-reference.d.ts +154 -159
- package/declarations/store/-private/legacy-model-support/shim-model-class.d.ts +14 -14
- package/declarations/store/-private/managers/cache-capabilities-manager.d.ts +21 -22
- package/declarations/store/-private/managers/cache-manager.d.ts +440 -425
- package/declarations/store/-private/managers/notification-manager.d.ts +88 -83
- package/declarations/store/-private/managers/record-array-manager.d.ts +89 -90
- package/declarations/store/-private/network/request-cache.d.ts +86 -83
- package/declarations/store/-private/new-core-tmp/promise-state.d.ts +252 -244
- package/declarations/store/-private/new-core-tmp/reactivity/configure.d.ts +154 -155
- package/declarations/store/-private/new-core-tmp/reactivity/internal.d.ts +148 -149
- package/declarations/store/-private/new-core-tmp/reactivity/signal.d.ts +28 -23
- package/declarations/store/-private/new-core-tmp/request-state.d.ts +263 -241
- package/declarations/store/-private/new-core-tmp/request-subscription.d.ts +253 -223
- package/declarations/store/-private/record-arrays/identifier-array.d.ts +125 -121
- package/declarations/store/-private/record-arrays/many-array.d.ts +180 -184
- package/declarations/store/-private/record-arrays/native-proxy-type-fix.d.ts +120 -110
- package/declarations/store/-private/store-service.d.ts +1594 -1586
- package/declarations/store/-private/utils/coerce-id.d.ts +6 -1
- package/declarations/store/-private/utils/construct-resource.d.ts +1 -2
- package/declarations/store/-private/utils/is-non-empty-string.d.ts +0 -1
- package/declarations/store/-private/utils/normalize-model-name.d.ts +0 -1
- package/declarations/store/-private/utils/uuid-polyfill.d.ts +0 -1
- package/declarations/store/-private.d.ts +31 -28
- package/declarations/store/-types/q/cache-capabilities-manager.d.ts +96 -97
- package/declarations/store/-types/q/ds-model.d.ts +17 -18
- package/declarations/store/-types/q/identifier.d.ts +11 -12
- package/declarations/store/-types/q/record-instance.d.ts +16 -17
- package/declarations/store/-types/q/schema-service.d.ts +346 -343
- package/declarations/store/-types/q/store.d.ts +25 -28
- package/declarations/store.d.ts +1 -2
- package/declarations/types/-private.d.ts +16 -8
- package/declarations/types/cache/aliases.d.ts +11 -1
- package/declarations/types/cache/change.d.ts +4 -5
- package/declarations/types/cache/mutations.d.ts +51 -28
- package/declarations/types/cache/operations.d.ts +60 -47
- package/declarations/types/cache/relationship.d.ts +11 -9
- package/declarations/types/cache.d.ts +495 -484
- package/declarations/types/graph.d.ts +31 -32
- package/declarations/types/identifier.d.ts +83 -82
- package/declarations/types/json/raw.d.ts +1 -2
- package/declarations/types/params.d.ts +4 -5
- package/declarations/types/record.d.ts +117 -76
- package/declarations/types/request.d.ts +289 -266
- package/declarations/types/runtime.d.ts +8 -9
- package/declarations/types/schema/concepts.d.ts +19 -13
- package/declarations/types/schema/fields.d.ts +1712 -1713
- package/declarations/types/schema/fields.type-test.d.ts +0 -1
- package/declarations/types/spec/document.d.ts +28 -22
- package/declarations/types/spec/error.d.ts +16 -17
- package/declarations/types/spec/json-api-raw.d.ts +102 -102
- package/declarations/types/symbols.d.ts +74 -75
- package/declarations/types/utils.d.ts +5 -5
- package/declarations/types.d.ts +10 -11
- package/declarations/utils/string.d.ts +43 -40
- package/dist/graph/-private.js +1 -1
- package/dist/{handler-D1C3Innj.js → handler-C2T-IyJK.js} +1 -1
- package/dist/index.js +2 -2
- package/dist/reactive/-private.js +1 -1
- package/dist/reactive.js +42 -73
- package/dist/{request-state-CCOJIj5i.js → request-state-CjLph1LP.js} +275 -261
- package/dist/store/-private.js +2 -2
- package/dist/{symbols-epHW0Vm9.js → symbols-SIstXMLI.js} +1 -1
- package/dist/types/-private.js +1 -1
- package/package.json +4 -4
- package/declarations/build-config/babel-macros.d.ts.map +0 -1
- package/declarations/build-config/canary-features.d.ts.map +0 -1
- package/declarations/build-config/debugging.d.ts.map +0 -1
- package/declarations/build-config/deprecations.d.ts.map +0 -1
- package/declarations/build-config/env.d.ts.map +0 -1
- package/declarations/build-config/macros.d.ts.map +0 -1
- package/declarations/build-config.d.ts.map +0 -1
- package/declarations/configure.d.ts.map +0 -1
- package/declarations/graph/-private/-diff.d.ts.map +0 -1
- package/declarations/graph/-private/-edge-definition.d.ts.map +0 -1
- package/declarations/graph/-private/-state.d.ts.map +0 -1
- package/declarations/graph/-private/-utils.d.ts.map +0 -1
- package/declarations/graph/-private/coerce-id.d.ts.map +0 -1
- package/declarations/graph/-private/debug/assert-polymorphic-type.d.ts.map +0 -1
- package/declarations/graph/-private/edges/collection.d.ts.map +0 -1
- package/declarations/graph/-private/edges/implicit.d.ts.map +0 -1
- package/declarations/graph/-private/edges/resource.d.ts.map +0 -1
- package/declarations/graph/-private/graph.d.ts.map +0 -1
- package/declarations/graph/-private/normalize-link.d.ts.map +0 -1
- package/declarations/graph/-private/operations/add-to-related-records.d.ts.map +0 -1
- package/declarations/graph/-private/operations/merge-identifier.d.ts.map +0 -1
- package/declarations/graph/-private/operations/remove-from-related-records.d.ts.map +0 -1
- package/declarations/graph/-private/operations/replace-related-record.d.ts.map +0 -1
- package/declarations/graph/-private/operations/replace-related-records.d.ts.map +0 -1
- package/declarations/graph/-private/operations/update-relationship.d.ts.map +0 -1
- package/declarations/graph/-private.d.ts.map +0 -1
- package/declarations/index.d.ts.map +0 -1
- package/declarations/reactive/-private/document.d.ts.map +0 -1
- package/declarations/reactive/-private/fields/compute.d.ts.map +0 -1
- package/declarations/reactive/-private/fields/extension.d.ts.map +0 -1
- package/declarations/reactive/-private/fields/managed-array.d.ts.map +0 -1
- package/declarations/reactive/-private/fields/managed-object.d.ts.map +0 -1
- package/declarations/reactive/-private/fields/many-array-manager.d.ts.map +0 -1
- package/declarations/reactive/-private/hooks.d.ts.map +0 -1
- package/declarations/reactive/-private/record.d.ts.map +0 -1
- package/declarations/reactive/-private/schema.d.ts.map +0 -1
- package/declarations/reactive/-private/symbols.d.ts.map +0 -1
- package/declarations/reactive/-private.d.ts.map +0 -1
- package/declarations/reactive.d.ts.map +0 -1
- package/declarations/request/-private/context.d.ts.map +0 -1
- package/declarations/request/-private/debug.d.ts.map +0 -1
- package/declarations/request/-private/fetch.d.ts.map +0 -1
- package/declarations/request/-private/future.d.ts.map +0 -1
- package/declarations/request/-private/manager.d.ts.map +0 -1
- package/declarations/request/-private/promise-cache.d.ts.map +0 -1
- package/declarations/request/-private/types.d.ts.map +0 -1
- package/declarations/request/-private/utils.d.ts.map +0 -1
- package/declarations/request.d.ts.map +0 -1
- package/declarations/store/-private/cache-handler/handler.d.ts.map +0 -1
- package/declarations/store/-private/cache-handler/types.d.ts.map +0 -1
- package/declarations/store/-private/cache-handler/utils.d.ts.map +0 -1
- package/declarations/store/-private/caches/cache-utils.d.ts.map +0 -1
- package/declarations/store/-private/caches/identifier-cache.d.ts.map +0 -1
- package/declarations/store/-private/caches/instance-cache.d.ts.map +0 -1
- package/declarations/store/-private/caches/resource-utils.d.ts.map +0 -1
- package/declarations/store/-private/debug/utils.d.ts.map +0 -1
- package/declarations/store/-private/default-cache-policy.d.ts.map +0 -1
- package/declarations/store/-private/legacy-model-support/record-reference.d.ts.map +0 -1
- package/declarations/store/-private/legacy-model-support/shim-model-class.d.ts.map +0 -1
- package/declarations/store/-private/managers/cache-capabilities-manager.d.ts.map +0 -1
- package/declarations/store/-private/managers/cache-manager.d.ts.map +0 -1
- package/declarations/store/-private/managers/notification-manager.d.ts.map +0 -1
- package/declarations/store/-private/managers/record-array-manager.d.ts.map +0 -1
- package/declarations/store/-private/network/request-cache.d.ts.map +0 -1
- package/declarations/store/-private/new-core-tmp/promise-state.d.ts.map +0 -1
- package/declarations/store/-private/new-core-tmp/reactivity/configure.d.ts.map +0 -1
- package/declarations/store/-private/new-core-tmp/reactivity/internal.d.ts.map +0 -1
- package/declarations/store/-private/new-core-tmp/reactivity/signal.d.ts.map +0 -1
- package/declarations/store/-private/new-core-tmp/request-state.d.ts.map +0 -1
- package/declarations/store/-private/new-core-tmp/request-subscription.d.ts.map +0 -1
- package/declarations/store/-private/record-arrays/identifier-array.d.ts.map +0 -1
- package/declarations/store/-private/record-arrays/many-array.d.ts.map +0 -1
- package/declarations/store/-private/record-arrays/native-proxy-type-fix.d.ts.map +0 -1
- package/declarations/store/-private/store-service.d.ts.map +0 -1
- package/declarations/store/-private/store-service.type-test.d.ts +0 -2
- package/declarations/store/-private/store-service.type-test.d.ts.map +0 -1
- package/declarations/store/-private/utils/coerce-id.d.ts.map +0 -1
- package/declarations/store/-private/utils/construct-resource.d.ts.map +0 -1
- package/declarations/store/-private/utils/is-non-empty-string.d.ts.map +0 -1
- package/declarations/store/-private/utils/normalize-model-name.d.ts.map +0 -1
- package/declarations/store/-private/utils/uuid-polyfill.d.ts.map +0 -1
- package/declarations/store/-private.d.ts.map +0 -1
- package/declarations/store/-types/q/cache-capabilities-manager.d.ts.map +0 -1
- package/declarations/store/-types/q/ds-model.d.ts.map +0 -1
- package/declarations/store/-types/q/identifier.d.ts.map +0 -1
- package/declarations/store/-types/q/promise-proxies.d.ts +0 -2
- package/declarations/store/-types/q/promise-proxies.d.ts.map +0 -1
- package/declarations/store/-types/q/record-data-json-api.d.ts +0 -31
- package/declarations/store/-types/q/record-data-json-api.d.ts.map +0 -1
- package/declarations/store/-types/q/record-instance.d.ts.map +0 -1
- package/declarations/store/-types/q/schema-service.d.ts.map +0 -1
- package/declarations/store/-types/q/store.d.ts.map +0 -1
- package/declarations/store.d.ts.map +0 -1
- package/declarations/types/-private.d.ts.map +0 -1
- package/declarations/types/cache/aliases.d.ts.map +0 -1
- package/declarations/types/cache/change.d.ts.map +0 -1
- package/declarations/types/cache/mutations.d.ts.map +0 -1
- package/declarations/types/cache/operations.d.ts.map +0 -1
- package/declarations/types/cache/relationship.d.ts.map +0 -1
- package/declarations/types/cache.d.ts.map +0 -1
- package/declarations/types/graph.d.ts.map +0 -1
- package/declarations/types/identifier.d.ts.map +0 -1
- package/declarations/types/json/raw.d.ts.map +0 -1
- package/declarations/types/params.d.ts.map +0 -1
- package/declarations/types/record.d.ts.map +0 -1
- package/declarations/types/record.type-test.d.ts +0 -2
- package/declarations/types/record.type-test.d.ts.map +0 -1
- package/declarations/types/request.d.ts.map +0 -1
- package/declarations/types/request.type-test.d.ts +0 -2
- package/declarations/types/request.type-test.d.ts.map +0 -1
- package/declarations/types/runtime.d.ts.map +0 -1
- package/declarations/types/schema/concepts.d.ts.map +0 -1
- package/declarations/types/schema/fields.d.ts.map +0 -1
- package/declarations/types/schema/fields.type-test.d.ts.map +0 -1
- package/declarations/types/spec/document.d.ts.map +0 -1
- package/declarations/types/spec/error.d.ts.map +0 -1
- package/declarations/types/spec/json-api-raw.d.ts.map +0 -1
- package/declarations/types/symbols.d.ts.map +0 -1
- package/declarations/types/utils.d.ts.map +0 -1
- package/declarations/types.d.ts.map +0 -1
- package/declarations/utils/string.d.ts.map +0 -1
- package/dist/build-config/babel-macros.js.map +0 -1
- package/dist/build-config/canary-features.js.map +0 -1
- package/dist/build-config/debugging.js.map +0 -1
- package/dist/build-config/deprecations.js.map +0 -1
- package/dist/build-config/env.js.map +0 -1
- package/dist/build-config/macros.js.map +0 -1
- package/dist/build-config.js.map +0 -1
- package/dist/configure-B48bFHOl.js.map +0 -1
- package/dist/configure.js.map +0 -1
- package/dist/context-COmAnXUQ.js.map +0 -1
- package/dist/graph/-private.js.map +0 -1
- package/dist/handler-D1C3Innj.js.map +0 -1
- package/dist/index.js.map +0 -1
- package/dist/reactive/-private.js.map +0 -1
- package/dist/reactive.js.map +0 -1
- package/dist/request-state-CCOJIj5i.js.map +0 -1
- package/dist/request.js.map +0 -1
- package/dist/store/-private.js.map +0 -1
- package/dist/store.js.map +0 -1
- package/dist/symbols-epHW0Vm9.js.map +0 -1
- package/dist/types/-private.js.map +0 -1
- package/dist/types/cache/aliases.js.map +0 -1
- package/dist/types/cache/change.js.map +0 -1
- package/dist/types/cache/mutations.js.map +0 -1
- package/dist/types/cache/operations.js.map +0 -1
- package/dist/types/cache/relationship.js.map +0 -1
- package/dist/types/cache.js.map +0 -1
- package/dist/types/graph.js.map +0 -1
- package/dist/types/identifier.js.map +0 -1
- package/dist/types/json/raw.js.map +0 -1
- package/dist/types/params.js.map +0 -1
- package/dist/types/record.js.map +0 -1
- package/dist/types/request.js.map +0 -1
- package/dist/types/runtime.js.map +0 -1
- package/dist/types/schema/concepts.js.map +0 -1
- package/dist/types/schema/fields.js.map +0 -1
- package/dist/types/schema/fields.type-test.js.map +0 -1
- package/dist/types/spec/document.js.map +0 -1
- package/dist/types/spec/error.js.map +0 -1
- package/dist/types/spec/json-api-raw.js.map +0 -1
- package/dist/types/symbols.js.map +0 -1
- package/dist/types/utils.js.map +0 -1
- package/dist/types.js.map +0 -1
- package/dist/utils/string.js.map +0 -1
|
@@ -1,147 +1,146 @@
|
|
|
1
|
-
import type { Store } from
|
|
2
|
-
import type { StableDocumentIdentifier } from
|
|
3
|
-
import type { ImmutableRequestInfo, RequestInfo } from
|
|
4
|
-
import type { ResourceDocument } from
|
|
5
|
-
import type { Meta, PaginationLinks } from
|
|
1
|
+
import type { Store } from "../../store/-private/store-service.js";
|
|
2
|
+
import type { StableDocumentIdentifier } from "../../types/identifier.js";
|
|
3
|
+
import type { ImmutableRequestInfo, RequestInfo } from "../../types/request.js";
|
|
4
|
+
import type { ResourceDocument } from "../../types/spec/document.js";
|
|
5
|
+
import type { Meta, PaginationLinks } from "../../types/spec/json-api-raw.js";
|
|
6
6
|
/**
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
7
|
+
* A Document is a class that wraps the response content from a request to the API
|
|
8
|
+
* returned by `Cache.put` or `Cache.peek`, converting resource-identifiers into
|
|
9
|
+
* record instances.
|
|
10
|
+
*
|
|
11
|
+
* It is not directly instantiated by the user, and its properties should not
|
|
12
|
+
* be directly modified. Whether individual properties are mutable or not is
|
|
13
|
+
* determined by the record instance itself.
|
|
14
|
+
*
|
|
15
|
+
* @public
|
|
16
|
+
* @hideconstructor
|
|
17
|
+
*/
|
|
18
18
|
export declare class ReactiveDocument<T> {
|
|
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
|
-
|
|
19
|
+
#private;
|
|
20
|
+
/**
|
|
21
|
+
* The links object for this document, if any
|
|
22
|
+
*
|
|
23
|
+
* e.g.
|
|
24
|
+
*
|
|
25
|
+
* ```
|
|
26
|
+
* {
|
|
27
|
+
* self: '/articles?page[number]=3',
|
|
28
|
+
* }
|
|
29
|
+
* ```
|
|
30
|
+
*
|
|
31
|
+
* @property links
|
|
32
|
+
* @type {Object|undefined} - a links object
|
|
33
|
+
* @public
|
|
34
|
+
*/
|
|
35
|
+
readonly links?: PaginationLinks;
|
|
36
|
+
/**
|
|
37
|
+
* The primary data for this document, if any.
|
|
38
|
+
*
|
|
39
|
+
* If this document has no primary data (e.g. because it is an error document)
|
|
40
|
+
* this property will be `undefined`.
|
|
41
|
+
*
|
|
42
|
+
* For collections this will be an array of record instances,
|
|
43
|
+
* for single resource requests it will be a single record instance or null.
|
|
44
|
+
*
|
|
45
|
+
* @property data
|
|
46
|
+
* @public
|
|
47
|
+
* @type {Object|Array<object>|null|undefined} - a data object
|
|
48
|
+
*/
|
|
49
|
+
readonly data?: T;
|
|
50
|
+
/**
|
|
51
|
+
* The errors returned by the API for this request, if any
|
|
52
|
+
*
|
|
53
|
+
* @property errors
|
|
54
|
+
* @public
|
|
55
|
+
* @type {Object|undefined} - an errors object
|
|
56
|
+
*/
|
|
57
|
+
readonly errors?: object[];
|
|
58
|
+
/**
|
|
59
|
+
* The meta object for this document, if any
|
|
60
|
+
*
|
|
61
|
+
* @property meta
|
|
62
|
+
* @public
|
|
63
|
+
* @type {Object|undefined} - a meta object
|
|
64
|
+
*/
|
|
65
|
+
readonly meta?: Meta;
|
|
66
|
+
/**
|
|
67
|
+
* The identifier associated with this document, if any
|
|
68
|
+
*
|
|
69
|
+
* @property identifier
|
|
70
|
+
* @public
|
|
71
|
+
* @type {StableDocumentIdentifier|null}
|
|
72
|
+
*/
|
|
73
|
+
readonly identifier: StableDocumentIdentifier | null;
|
|
74
|
+
protected readonly _store: Store;
|
|
75
|
+
protected readonly _localCache: {
|
|
76
|
+
document: ResourceDocument;
|
|
77
|
+
request: ImmutableRequestInfo;
|
|
78
|
+
} | null;
|
|
79
|
+
constructor(store: Store, identifier: StableDocumentIdentifier | null, localCache: {
|
|
80
|
+
document: ResourceDocument;
|
|
81
|
+
request: ImmutableRequestInfo;
|
|
82
|
+
} | null);
|
|
83
|
+
/**
|
|
84
|
+
* Fetches the related link for this document, returning a promise that resolves
|
|
85
|
+
* with the document when the request completes. If no related link is present,
|
|
86
|
+
* will fallback to the self link if present
|
|
87
|
+
*
|
|
88
|
+
* @public
|
|
89
|
+
* @param {Object} options
|
|
90
|
+
* @return {Promise<Document>}
|
|
91
|
+
*/
|
|
92
|
+
fetch(options?: RequestInfo<ReactiveDocument<T>, T>): Promise<ReactiveDocument<T>>;
|
|
93
|
+
/**
|
|
94
|
+
* Fetches the next link for this document, returning a promise that resolves
|
|
95
|
+
* with the new document when the request completes, or null if there is no
|
|
96
|
+
* next link.
|
|
97
|
+
*
|
|
98
|
+
* @public
|
|
99
|
+
* @param {Object} options
|
|
100
|
+
* @return {Promise<Document | null>}
|
|
101
|
+
*/
|
|
102
|
+
next(options?: RequestInfo<ReactiveDocument<T>, T>): Promise<ReactiveDocument<T> | null>;
|
|
103
|
+
/**
|
|
104
|
+
* Fetches the prev link for this document, returning a promise that resolves
|
|
105
|
+
* with the new document when the request completes, or null if there is no
|
|
106
|
+
* prev link.
|
|
107
|
+
*
|
|
108
|
+
* @public
|
|
109
|
+
* @param {Object} options
|
|
110
|
+
* @return {Promise<Document | null>}
|
|
111
|
+
*/
|
|
112
|
+
prev(options: RequestInfo<ReactiveDocument<T>, T>): Promise<ReactiveDocument<T> | null>;
|
|
113
|
+
/**
|
|
114
|
+
* Fetches the first link for this document, returning a promise that resolves
|
|
115
|
+
* with the new document when the request completes, or null if there is no
|
|
116
|
+
* first link.
|
|
117
|
+
*
|
|
118
|
+
* @public
|
|
119
|
+
* @param {Object} options
|
|
120
|
+
* @return {Promise<Document | null>}
|
|
121
|
+
*/
|
|
122
|
+
first(options: RequestInfo<ReactiveDocument<T>, T>): Promise<ReactiveDocument<T> | null>;
|
|
123
|
+
/**
|
|
124
|
+
* Fetches the last link for this document, returning a promise that resolves
|
|
125
|
+
* with the new document when the request completes, or null if there is no
|
|
126
|
+
* last link.
|
|
127
|
+
*
|
|
128
|
+
* @public
|
|
129
|
+
* @param {Object} options
|
|
130
|
+
* @return {Promise<Document | null>}
|
|
131
|
+
*/
|
|
132
|
+
last(options: RequestInfo<ReactiveDocument<T>, T>): Promise<ReactiveDocument<T> | null>;
|
|
133
|
+
/**
|
|
134
|
+
* Implemented for `JSON.stringify` support.
|
|
135
|
+
*
|
|
136
|
+
* Returns the JSON representation of the document wrapper.
|
|
137
|
+
*
|
|
138
|
+
* This is a shallow serialization, it does not deeply serialize
|
|
139
|
+
* the document's contents, leaving that to the individual record
|
|
140
|
+
* instances to determine how to do, if at all.
|
|
141
|
+
*
|
|
142
|
+
* @public
|
|
143
|
+
* @return
|
|
144
|
+
*/
|
|
145
|
+
toJSON(): object;
|
|
146
146
|
}
|
|
147
|
-
//# sourceMappingURL=document.d.ts.map
|
|
@@ -1,40 +1,43 @@
|
|
|
1
|
-
import type { Store, StoreRequestInput } from
|
|
2
|
-
import type { Future } from
|
|
3
|
-
import { RelatedCollection as ManyArray } from
|
|
4
|
-
import type { Cache } from
|
|
5
|
-
import type { StableRecordIdentifier } from
|
|
6
|
-
import type { ArrayField, DerivedField, FieldSchema, GenericField, LegacyHasManyField, LocalField, ObjectField, SchemaArrayField, SchemaObjectField } from
|
|
7
|
-
import type { Links } from
|
|
8
|
-
import { RecordStore } from
|
|
9
|
-
import { ReactiveResource } from
|
|
10
|
-
import type { SchemaService } from
|
|
11
|
-
import { Parent } from
|
|
12
|
-
import { ManagedArray } from
|
|
13
|
-
import { ManagedObject } from
|
|
14
|
-
export declare const ManagedArrayMap: Map<ReactiveResource, Map<string, ManagedArray | ManyArray
|
|
15
|
-
export declare const ManagedObjectMap: Map<ReactiveResource, Map<string,
|
|
1
|
+
import type { Store, StoreRequestInput } from "../../../index.js";
|
|
2
|
+
import type { Future } from "../../../request.js";
|
|
3
|
+
import { RelatedCollection as ManyArray } from "../../../store/-private.js";
|
|
4
|
+
import type { Cache } from "../../../types/cache.js";
|
|
5
|
+
import type { StableRecordIdentifier } from "../../../types/identifier.js";
|
|
6
|
+
import type { ArrayField, DerivedField, FieldSchema, GenericField, LegacyHasManyField, LocalField, ObjectField, SchemaArrayField, SchemaObjectField } from "../../../types/schema/fields.js";
|
|
7
|
+
import type { Links } from "../../../types/spec/json-api-raw.js";
|
|
8
|
+
import { RecordStore } from "../../../types/symbols.js";
|
|
9
|
+
import { ReactiveResource } from "../record.js";
|
|
10
|
+
import type { SchemaService } from "../schema.js";
|
|
11
|
+
import { Parent } from "../symbols.js";
|
|
12
|
+
import { ManagedArray } from "./managed-array.js";
|
|
13
|
+
import { ManagedObject } from "./managed-object.js";
|
|
14
|
+
export declare const ManagedArrayMap: Map<ReactiveResource, Map<string, ManagedArray | ManyArray>>;
|
|
15
|
+
export declare const ManagedObjectMap: Map<ReactiveResource, Map<string, ManagedObject | ReactiveResource>>;
|
|
16
16
|
export declare function computeLocal(record: typeof Proxy<ReactiveResource>, field: LocalField, prop: string): unknown;
|
|
17
17
|
export declare function peekManagedArray(record: ReactiveResource, field: FieldSchema): ManyArray | ManagedArray | undefined;
|
|
18
18
|
export declare function peekManagedObject(record: ReactiveResource, field: ObjectField): ManagedObject | undefined;
|
|
19
19
|
export declare function peekManagedObject(record: ReactiveResource, field: SchemaObjectField): ReactiveResource | undefined;
|
|
20
20
|
export declare function computeField(schema: SchemaService, cache: Cache, record: ReactiveResource, identifier: StableRecordIdentifier, field: GenericField, prop: string | string[], editable: boolean): unknown;
|
|
21
21
|
export declare function computeArray(store: Store, schema: SchemaService, cache: Cache, record: ReactiveResource, identifier: StableRecordIdentifier, field: ArrayField | SchemaArrayField, path: string[], editable: boolean, legacy: boolean): ManagedArray | null;
|
|
22
|
-
export declare function computeObject(schema: SchemaService, cache: Cache, record: ReactiveResource, identifier: StableRecordIdentifier, field: ObjectField, path: string[], editable: boolean, legacy: boolean):
|
|
23
|
-
export declare function computeSchemaObject(store: Store, cache: Cache, record: ReactiveResource, identifier: StableRecordIdentifier, field: SchemaObjectField, path: string[], legacy: boolean, editable: boolean): ReactiveResource |
|
|
22
|
+
export declare function computeObject(schema: SchemaService, cache: Cache, record: ReactiveResource, identifier: StableRecordIdentifier, field: ObjectField, path: string[], editable: boolean, legacy: boolean): ManagedObject | null;
|
|
23
|
+
export declare function computeSchemaObject(store: Store, cache: Cache, record: ReactiveResource, identifier: StableRecordIdentifier, field: SchemaObjectField, path: string[], legacy: boolean, editable: boolean): ReactiveResource | null;
|
|
24
24
|
export declare function computeAttribute(cache: Cache, identifier: StableRecordIdentifier, prop: string, editable: boolean): unknown;
|
|
25
25
|
export declare function computeDerivation(schema: SchemaService, record: ReactiveResource, identifier: StableRecordIdentifier, field: DerivedField, prop: string): unknown;
|
|
26
|
+
interface ResourceRelationship<T extends ReactiveResource = ReactiveResource> {
|
|
27
|
+
lid: string;
|
|
28
|
+
[Parent]: ReactiveResource;
|
|
29
|
+
[RecordStore]: Store;
|
|
30
|
+
name: string;
|
|
31
|
+
data: T | null;
|
|
32
|
+
links: Links;
|
|
33
|
+
meta: Record<string, unknown>;
|
|
34
|
+
}
|
|
35
|
+
// TODO probably this should just be a Document
|
|
36
|
+
// but its separate until we work out the lid situation
|
|
26
37
|
declare class ResourceRelationship<T extends ReactiveResource = ReactiveResource> {
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
[RecordStore]: Store;
|
|
30
|
-
name: string;
|
|
31
|
-
data: T | null;
|
|
32
|
-
links: Links;
|
|
33
|
-
meta: Record<string, unknown>;
|
|
34
|
-
constructor(store: Store, cache: Cache, parent: ReactiveResource, identifier: StableRecordIdentifier, field: FieldSchema, name: string, editable: boolean);
|
|
35
|
-
fetch(options?: StoreRequestInput<T, T>): Future<T>;
|
|
38
|
+
constructor(store: Store, cache: Cache, parent: ReactiveResource, identifier: StableRecordIdentifier, field: FieldSchema, name: string, editable: boolean);
|
|
39
|
+
fetch(options?: StoreRequestInput<T, T>): Future<T>;
|
|
36
40
|
}
|
|
37
41
|
export declare function computeResource<T extends ReactiveResource>(store: Store, cache: Cache, parent: ReactiveResource, identifier: StableRecordIdentifier, field: FieldSchema, prop: string, editable: boolean): ResourceRelationship<T>;
|
|
38
|
-
export declare function computeHasMany(store: Store, schema: SchemaService, cache: Cache, record: ReactiveResource, identifier: StableRecordIdentifier, field: LegacyHasManyField, path: string[], editable: boolean, legacy: boolean): ManyArray
|
|
42
|
+
export declare function computeHasMany(store: Store, schema: SchemaService, cache: Cache, record: ReactiveResource, identifier: StableRecordIdentifier, field: LegacyHasManyField, path: string[], editable: boolean, legacy: boolean): ManyArray | null;
|
|
39
43
|
export {};
|
|
40
|
-
//# sourceMappingURL=compute.d.ts.map
|
|
@@ -1,9 +1,8 @@
|
|
|
1
|
-
import type { SignalStore, WarpDriveSignal } from
|
|
2
|
-
import type { ExtensionDef } from
|
|
1
|
+
import type { SignalStore, WarpDriveSignal } from "../../../store/-private/new-core-tmp/reactivity/internal.js";
|
|
2
|
+
import type { ExtensionDef } from "../schema.js";
|
|
3
3
|
export type ProxiedMethod = (...args: unknown[]) => unknown;
|
|
4
4
|
export declare function expectNever(value: never): void;
|
|
5
5
|
export declare function isExtensionProp(extensions: Map<string | symbol, ExtensionDef> | null, prop: string | number | symbol): prop is string | symbol;
|
|
6
6
|
export declare function performObjectExtensionGet(receiver: object, extensions: Map<string | symbol, ExtensionDef>, signals: SignalStore, prop: string | symbol): unknown;
|
|
7
7
|
export declare function performExtensionSet(receiver: object, extensions: Map<string | symbol, ExtensionDef>, signals: SignalStore, prop: string | symbol, value: unknown): boolean;
|
|
8
8
|
export declare function performArrayExtensionGet(receiver: object, extensions: Map<string | symbol, ExtensionDef>, signals: SignalStore, prop: string | symbol, _SIGNAL: WarpDriveSignal, boundFns: Map<string | symbol | number, ProxiedMethod>, transaction: (v: boolean) => void): unknown;
|
|
9
|
-
//# sourceMappingURL=extension.d.ts.map
|
|
@@ -1,23 +1,22 @@
|
|
|
1
|
-
import type { Store } from
|
|
2
|
-
import type { WarpDriveSignal } from
|
|
3
|
-
import { ARRAY_SIGNAL } from
|
|
4
|
-
import type { Cache } from
|
|
5
|
-
import type { StableRecordIdentifier } from
|
|
6
|
-
import type { ArrayField, SchemaArrayField } from
|
|
7
|
-
import { ReactiveResource } from
|
|
8
|
-
import type { SchemaService } from
|
|
9
|
-
import { Editable, Legacy,
|
|
10
|
-
export interface ManagedArray extends Omit<Array<unknown>,
|
|
11
|
-
|
|
1
|
+
import type { Store } from "../../../index.js";
|
|
2
|
+
import type { WarpDriveSignal } from "../../../store/-private.js";
|
|
3
|
+
import { ARRAY_SIGNAL } from "../../../store/-private.js";
|
|
4
|
+
import type { Cache } from "../../../types/cache.js";
|
|
5
|
+
import type { StableRecordIdentifier } from "../../../types/identifier.js";
|
|
6
|
+
import type { ArrayField, SchemaArrayField } from "../../../types/schema/fields.js";
|
|
7
|
+
import { ReactiveResource } from "../record.js";
|
|
8
|
+
import type { SchemaService } from "../schema.js";
|
|
9
|
+
import { Editable, Legacy, SOURCE } from "../symbols.js";
|
|
10
|
+
export interface ManagedArray extends Omit<Array<unknown>, "[]"> {
|
|
11
|
+
[SOURCE]: unknown[];
|
|
12
|
+
identifier: StableRecordIdentifier;
|
|
13
|
+
path: string[];
|
|
14
|
+
owner: ReactiveResource;
|
|
15
|
+
[ARRAY_SIGNAL]: WarpDriveSignal;
|
|
16
|
+
[Editable]: boolean;
|
|
17
|
+
[Legacy]: boolean;
|
|
12
18
|
}
|
|
19
|
+
// eslint-disable-next-line @typescript-eslint/no-extraneous-class
|
|
13
20
|
export declare class ManagedArray {
|
|
14
|
-
|
|
15
|
-
identifier: StableRecordIdentifier;
|
|
16
|
-
path: string[];
|
|
17
|
-
owner: ReactiveResource;
|
|
18
|
-
[ARRAY_SIGNAL]: WarpDriveSignal;
|
|
19
|
-
[Editable]: boolean;
|
|
20
|
-
[Legacy]: boolean;
|
|
21
|
-
constructor(store: Store, schema: SchemaService, cache: Cache, field: ArrayField | SchemaArrayField, data: unknown[], identifier: StableRecordIdentifier, path: string[], owner: ReactiveResource, isSchemaArray: boolean, editable: boolean, legacy: boolean);
|
|
21
|
+
constructor(store: Store, schema: SchemaService, cache: Cache, field: ArrayField | SchemaArrayField, data: unknown[], identifier: StableRecordIdentifier, path: string[], owner: ReactiveResource, isSchemaArray: boolean, editable: boolean, legacy: boolean);
|
|
22
22
|
}
|
|
23
|
-
//# sourceMappingURL=managed-array.d.ts.map
|
|
@@ -1,21 +1,21 @@
|
|
|
1
|
-
import { OBJECT_SIGNAL, type WarpDriveSignal } from
|
|
2
|
-
import type { Cache } from
|
|
3
|
-
import type { StableRecordIdentifier } from
|
|
4
|
-
import type { ObjectField, SchemaObjectField } from
|
|
5
|
-
import type { ReactiveResource } from
|
|
6
|
-
import type { SchemaService } from
|
|
7
|
-
import { Editable, EmbeddedPath, Legacy,
|
|
1
|
+
import { OBJECT_SIGNAL, type WarpDriveSignal } from "../../../store/-private.js";
|
|
2
|
+
import type { Cache } from "../../../types/cache.js";
|
|
3
|
+
import type { StableRecordIdentifier } from "../../../types/identifier.js";
|
|
4
|
+
import type { ObjectField, SchemaObjectField } from "../../../types/schema/fields.js";
|
|
5
|
+
import type { ReactiveResource } from "../record.js";
|
|
6
|
+
import type { SchemaService } from "../schema.js";
|
|
7
|
+
import { Editable, EmbeddedPath, Legacy, Parent, SOURCE } from "../symbols.js";
|
|
8
8
|
export declare function notifyObject(obj: ManagedObject): void;
|
|
9
|
+
// const ignoredGlobalFields = new Set<string>(['setInterval', 'nodeType', 'nodeName', 'length', 'document', STRUCTURED]);
|
|
9
10
|
export interface ManagedObject {
|
|
10
|
-
|
|
11
|
+
[SOURCE]: object;
|
|
12
|
+
[Parent]: StableRecordIdentifier;
|
|
13
|
+
[EmbeddedPath]: string[];
|
|
14
|
+
[OBJECT_SIGNAL]: WarpDriveSignal;
|
|
15
|
+
[Editable]: boolean;
|
|
16
|
+
[Legacy]: boolean;
|
|
11
17
|
}
|
|
18
|
+
// eslint-disable-next-line @typescript-eslint/no-extraneous-class
|
|
12
19
|
export declare class ManagedObject {
|
|
13
|
-
|
|
14
|
-
[Parent]: StableRecordIdentifier;
|
|
15
|
-
[EmbeddedPath]: string[];
|
|
16
|
-
[OBJECT_SIGNAL]: WarpDriveSignal;
|
|
17
|
-
[Editable]: boolean;
|
|
18
|
-
[Legacy]: boolean;
|
|
19
|
-
constructor(schema: SchemaService, cache: Cache, field: ObjectField | SchemaObjectField, data: object, identifier: StableRecordIdentifier, path: string[], owner: ReactiveResource, editable: boolean, legacy: boolean);
|
|
20
|
+
constructor(schema: SchemaService, cache: Cache, field: ObjectField | SchemaObjectField, data: object, identifier: StableRecordIdentifier, path: string[], owner: ReactiveResource, editable: boolean, legacy: boolean);
|
|
20
21
|
}
|
|
21
|
-
//# sourceMappingURL=managed-object.d.ts.map
|
|
@@ -1,20 +1,19 @@
|
|
|
1
|
-
import type { Store } from
|
|
2
|
-
import type { RelatedCollection as ManyArray } from
|
|
3
|
-
import type { LocalRelationshipOperation } from
|
|
4
|
-
import type { StableRecordIdentifier } from
|
|
5
|
-
import type { ReactiveResource } from
|
|
1
|
+
import type { Store } from "../../../index.js";
|
|
2
|
+
import type { RelatedCollection as ManyArray } from "../../../store/-private.js";
|
|
3
|
+
import type { LocalRelationshipOperation } from "../../../types/graph.js";
|
|
4
|
+
import type { StableRecordIdentifier } from "../../../types/identifier.js";
|
|
5
|
+
import type { ReactiveResource } from "../record.js";
|
|
6
6
|
export interface FindHasManyOptions {
|
|
7
|
-
|
|
8
|
-
|
|
7
|
+
reload?: boolean;
|
|
8
|
+
backgroundReload?: boolean;
|
|
9
9
|
}
|
|
10
10
|
export declare class ManyArrayManager {
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
11
|
+
record: ReactiveResource;
|
|
12
|
+
store: Store;
|
|
13
|
+
identifier: StableRecordIdentifier;
|
|
14
|
+
editable: boolean;
|
|
15
|
+
constructor(record: ReactiveResource, editable: boolean);
|
|
16
|
+
_syncArray(array: ManyArray): void;
|
|
17
|
+
reloadHasMany<T>(key: string, options?: FindHasManyOptions): Promise<ManyArray<T>>;
|
|
18
|
+
mutate(mutation: LocalRelationshipOperation): void;
|
|
19
19
|
}
|
|
20
|
-
//# sourceMappingURL=many-array-manager.d.ts.map
|
|
@@ -1,6 +1,5 @@
|
|
|
1
|
-
import type { Store } from
|
|
2
|
-
import type { StableRecordIdentifier } from
|
|
3
|
-
import { ReactiveResource } from
|
|
1
|
+
import type { Store } from "../../index.js";
|
|
2
|
+
import type { StableRecordIdentifier } from "../../types.js";
|
|
3
|
+
import { ReactiveResource } from "./record.js";
|
|
4
4
|
export declare function instantiateRecord(store: Store, identifier: StableRecordIdentifier, createArgs?: Record<string, unknown>): ReactiveResource;
|
|
5
5
|
export declare function teardownRecord(record: unknown): void;
|
|
6
|
-
//# sourceMappingURL=hooks.d.ts.map
|
|
@@ -1,62 +1,64 @@
|
|
|
1
|
-
import type { Store } from
|
|
2
|
-
import type { StableRecordIdentifier } from
|
|
3
|
-
import type { SchemaArrayField, SchemaObjectField } from
|
|
4
|
-
import { RecordStore } from
|
|
5
|
-
import { Checkout, Destroy, Editable, EmbeddedField, EmbeddedPath, Identifier, Legacy, Parent } from
|
|
6
|
-
export { Editable, Legacy, Checkout } from
|
|
1
|
+
import type { Store } from "../../index.js";
|
|
2
|
+
import type { StableRecordIdentifier } from "../../types/identifier.js";
|
|
3
|
+
import type { SchemaArrayField, SchemaObjectField } from "../../types/schema/fields.js";
|
|
4
|
+
import { RecordStore } from "../../types/symbols.js";
|
|
5
|
+
import { Checkout, Destroy, Editable, EmbeddedField, EmbeddedPath, Identifier, Legacy, Parent } from "./symbols.js";
|
|
6
|
+
export { Editable, Legacy, Checkout } from "./symbols.js";
|
|
7
|
+
export interface ReactiveResource {
|
|
8
|
+
[Symbol.toStringTag]: `ReactiveResource<${string}>`;
|
|
9
|
+
/** @internal */
|
|
10
|
+
[RecordStore]: Store;
|
|
11
|
+
/** @internal */
|
|
12
|
+
[Identifier]: StableRecordIdentifier;
|
|
13
|
+
/** @internal */
|
|
14
|
+
[Parent]: StableRecordIdentifier;
|
|
15
|
+
/** @internal */
|
|
16
|
+
[EmbeddedField]: SchemaArrayField | SchemaObjectField | null;
|
|
17
|
+
/** @internal */
|
|
18
|
+
[EmbeddedPath]: string[] | null;
|
|
19
|
+
/** @internal */
|
|
20
|
+
[Editable]: boolean;
|
|
21
|
+
/** @internal */
|
|
22
|
+
[Legacy]: boolean;
|
|
23
|
+
/** @internal */
|
|
24
|
+
___notifications: object;
|
|
25
|
+
/** @internal */
|
|
26
|
+
[Destroy](): void;
|
|
27
|
+
/**
|
|
28
|
+
* Create an editable copy of the record
|
|
29
|
+
*
|
|
30
|
+
* ReactiveResource instances are not editable by default. This method creates an editable copy of the record. To use,
|
|
31
|
+
* import the `Checkout` symbol from `@warp-drive/schema-record` and call it on the record.
|
|
32
|
+
*
|
|
33
|
+
* ```ts
|
|
34
|
+
* import { Checkout } from '@warp-drive/schema-record';
|
|
35
|
+
*
|
|
36
|
+
* const record = store.peekRecord('user', '1');
|
|
37
|
+
* const editableRecord = await record[Checkout]();
|
|
38
|
+
* ```
|
|
39
|
+
*
|
|
40
|
+
* @returns a promise that resolves to the editable record
|
|
41
|
+
* @throws if the record is already editable or if the record is embedded
|
|
42
|
+
*
|
|
43
|
+
*/
|
|
44
|
+
[Checkout]<T>(): Promise<T>;
|
|
45
|
+
}
|
|
7
46
|
/**
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
47
|
+
* A class that uses a the ResourceSchema for a ResourceType
|
|
48
|
+
* and a ResouceKey to transform data from the cache into a rich, reactive
|
|
49
|
+
* object.
|
|
50
|
+
*
|
|
51
|
+
* This class is not directly instantiable. To use it, you should
|
|
52
|
+
* configure the store's `instantiateRecord` and `teardownRecord` hooks
|
|
53
|
+
* with the matching hooks provided by this package.
|
|
54
|
+
*
|
|
55
|
+
* @hideconstructor
|
|
56
|
+
* @public
|
|
57
|
+
*/
|
|
58
|
+
// eslint-disable-next-line @typescript-eslint/no-extraneous-class
|
|
19
59
|
export declare class ReactiveResource {
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
/** @internal */
|
|
25
|
-
[Parent]: StableRecordIdentifier;
|
|
26
|
-
/** @internal */
|
|
27
|
-
[EmbeddedField]: SchemaArrayField | SchemaObjectField | null;
|
|
28
|
-
/** @internal */
|
|
29
|
-
[EmbeddedPath]: string[] | null;
|
|
30
|
-
/** @internal */
|
|
31
|
-
[Editable]: boolean;
|
|
32
|
-
/** @internal */
|
|
33
|
-
[Legacy]: boolean;
|
|
34
|
-
[Symbol.toStringTag]: `ReactiveResource<${string}>`;
|
|
35
|
-
/** @internal */
|
|
36
|
-
___notifications: object;
|
|
37
|
-
constructor(store: Store, identifier: StableRecordIdentifier, Mode: {
|
|
38
|
-
[Editable]: boolean;
|
|
39
|
-
[Legacy]: boolean;
|
|
40
|
-
}, isEmbedded?: boolean, embeddedField?: SchemaArrayField | SchemaObjectField | null, embeddedPath?: string[] | null);
|
|
41
|
-
/** @internal */
|
|
42
|
-
[Destroy](): void;
|
|
43
|
-
/**
|
|
44
|
-
* Create an editable copy of the record
|
|
45
|
-
*
|
|
46
|
-
* ReactiveResource instances are not editable by default. This method creates an editable copy of the record. To use,
|
|
47
|
-
* import the `Checkout` symbol from `@warp-drive/schema-record` and call it on the record.
|
|
48
|
-
*
|
|
49
|
-
* ```ts
|
|
50
|
-
* import { Checkout } from '@warp-drive/schema-record';
|
|
51
|
-
*
|
|
52
|
-
* const record = store.peekRecord('user', '1');
|
|
53
|
-
* const editableRecord = await record[Checkout]();
|
|
54
|
-
* ```
|
|
55
|
-
*
|
|
56
|
-
* @returns a promise that resolves to the editable record
|
|
57
|
-
* @throws if the record is already editable or if the record is embedded
|
|
58
|
-
*
|
|
59
|
-
*/
|
|
60
|
-
[Checkout](): Promise<ReactiveResource>;
|
|
60
|
+
constructor(store: Store, identifier: StableRecordIdentifier, Mode: {
|
|
61
|
+
[Editable]: boolean;
|
|
62
|
+
[Legacy]: boolean;
|
|
63
|
+
}, isEmbedded?: boolean, embeddedField?: SchemaArrayField | SchemaObjectField | null, embeddedPath?: string[] | null);
|
|
61
64
|
}
|
|
62
|
-
//# sourceMappingURL=record.d.ts.map
|