@arrai-innovations/reactive-helpers 21.1.2 → 22.0.0
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/LICENSE +28 -0
- package/README.md +109 -21
- package/config/commonCrud.js +4 -6
- package/config/listCrud.js +20 -22
- package/config/objectCrud.js +30 -37
- package/package.json +93 -89
- package/types/config/listCrud.d.ts +83 -26
- package/types/config/objectCrud.d.ts +123 -44
- package/types/use/cancellableIntent.d.ts +27 -31
- package/types/use/combineClasses.d.ts +4 -1
- package/types/use/error.d.ts +39 -19
- package/types/use/list.d.ts +27 -26
- package/types/use/listCalculated.d.ts +21 -39
- package/types/use/listFilter.d.ts +25 -33
- package/types/use/listInstance.d.ts +88 -80
- package/types/use/listRelated.d.ts +26 -46
- package/types/use/listSearch.d.ts +54 -52
- package/types/use/listSort.d.ts +25 -39
- package/types/use/listSubscription.d.ts +28 -35
- package/types/use/loading.d.ts +20 -10
- package/types/use/loadingError.d.ts +12 -3
- package/types/use/object.d.ts +8 -5
- package/types/use/objectCalculated.d.ts +30 -27
- package/types/use/objectInstance.d.ts +67 -73
- package/types/use/objectRelated.d.ts +41 -33
- package/types/use/objectSubscription.d.ts +32 -43
- package/types/use/proxyError.d.ts +15 -6
- package/types/use/proxyLoading.d.ts +11 -5
- package/types/use/proxyLoadingError.d.ts +19 -7
- package/types/use/search.d.ts +33 -29
- package/types/utils/assignReactiveObject.d.ts +3 -0
- package/types/utils/cancellablePromise.d.ts +5 -5
- package/types/utils/classes.d.ts +7 -1
- package/types/utils/deepUnref.d.ts +1 -1
- package/types/utils/isReactiveTyped.d.ts +2 -0
- package/types/utils/keyDiff.d.ts +4 -6
- package/types/utils/relatedCalculatedHelpers.d.ts +2 -0
- package/types/utils/watches.d.ts +1 -1
- package/use/cancellableIntent.js +27 -7
- package/use/combineClasses.js +1 -1
- package/use/error.js +10 -14
- package/use/list.js +6 -18
- package/use/listCalculated.js +7 -22
- package/use/listFilter.js +8 -21
- package/use/listInstance.js +25 -44
- package/use/listRelated.js +9 -28
- package/use/listSearch.js +8 -17
- package/use/listSort.js +27 -41
- package/use/listSubscription.js +10 -25
- package/use/loading.js +5 -7
- package/use/loadingError.js +3 -3
- package/use/object.js +7 -19
- package/use/objectCalculated.js +9 -15
- package/use/objectInstance.js +46 -47
- package/use/objectRelated.js +13 -20
- package/use/objectSubscription.js +11 -25
- package/use/proxyError.js +10 -10
- package/use/proxyLoading.js +5 -5
- package/use/proxyLoadingError.js +10 -8
- package/use/search.js +5 -11
- package/utils/assignReactiveObject.js +3 -3
- package/utils/cancellablePromise.js +4 -4
- package/utils/classes.js +2 -2
- package/utils/deepUnref.js +1 -5
- package/utils/isReactiveTyped.js +2 -0
- package/utils/keyDiff.js +1 -3
- package/utils/relatedCalculatedHelpers.js +2 -0
|
@@ -1,29 +1,24 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* @typedef {object} ObjectRelatedProperties
|
|
2
|
+
* @typedef {object} ObjectRelatedProperties - The members (state, parentState, stop) contributed by the object related composable.
|
|
3
3
|
* @property {ObjectRelatedState} state - The state of the object related instance.
|
|
4
4
|
* @property {ObjectRelatedParentState} parentState - The parent state.
|
|
5
5
|
* @property {() => void} stop - Stops all effects of the object related instance.
|
|
6
6
|
*
|
|
7
7
|
*/
|
|
8
8
|
/**
|
|
9
|
-
* An instance of an object related reactive object.
|
|
10
|
-
*
|
|
11
|
-
* @typedef {ObjectRelatedProperties} ObjectRelated
|
|
9
|
+
* @typedef {ObjectRelatedProperties} ObjectRelated - An instance of an object related reactive object.
|
|
12
10
|
*/
|
|
13
11
|
/**
|
|
14
|
-
* Non-parent state options for useObjectRelated.
|
|
15
|
-
*
|
|
16
|
-
* @typedef {object} ObjectRelatedRawProps
|
|
12
|
+
* @typedef {object} ObjectRelatedRawProps - Non-parent state options for useObjectRelated.
|
|
17
13
|
* @property {import('vue').Ref<ObjectRelatedRawRules>} relatedObjectRules - The rules for defining relationships for the managed object to other collections of objects.
|
|
18
14
|
*/
|
|
19
15
|
/**
|
|
20
|
-
* Options for useObjectRelated.
|
|
21
|
-
*
|
|
22
16
|
* @typedef {{
|
|
23
17
|
* parentState: ObjectRelatedParentState,
|
|
24
|
-
* } & ObjectRelatedRawProps} ObjectRelatedOptions
|
|
18
|
+
* } & ObjectRelatedRawProps} ObjectRelatedOptions - Options for useObjectRelated.
|
|
25
19
|
*/
|
|
26
20
|
/**
|
|
21
|
+
* Creates multiple object related instances keyed by name from a map of options.
|
|
27
22
|
*
|
|
28
23
|
* @param {{
|
|
29
24
|
* [key: string]: ObjectRelatedOptions
|
|
@@ -119,24 +114,20 @@ export function useObjectRelated({ parentState, relatedObjectRules }: ObjectRela
|
|
|
119
114
|
* @module use/objectRelated.js
|
|
120
115
|
*/
|
|
121
116
|
/**
|
|
122
|
-
* The rule for defining relationships for the managed object to other collections of objects.
|
|
123
|
-
*
|
|
124
|
-
* @typedef {object} ObjectRelatedRule
|
|
117
|
+
* @typedef {object} ObjectRelatedRule - The rule for defining relationships for the managed object to other collections of objects.
|
|
125
118
|
* @property {string} pkKey - The key in the managed object that corresponds to the key in the related object.
|
|
126
119
|
* @property {import('./listInstance.js').ObjectsByPk} objects - The related objects, indexed by the key in the related object.
|
|
127
120
|
* @property {string[]} order - The order of the related objects, if the related objects are an array.
|
|
128
121
|
*/
|
|
129
122
|
/**
|
|
130
|
-
* The rules for defining relationships for the managed object to other collections of objects.
|
|
131
|
-
*
|
|
132
123
|
* @typedef {{
|
|
133
124
|
* [rule: string]: ObjectRelatedRule,
|
|
134
|
-
* }} ObjectRelatedRawRules
|
|
125
|
+
* }} ObjectRelatedRawRules - The rules for defining relationships for the managed object to other collections of objects.
|
|
135
126
|
*/
|
|
136
127
|
/**
|
|
137
128
|
*
|
|
138
129
|
*
|
|
139
|
-
* @typedef {object} ObjectRelatedRawState
|
|
130
|
+
* @typedef {object} ObjectRelatedRawState - The raw reactive state of the object related composable, holding its rules, computed relations, and running flags.
|
|
140
131
|
* @property {ObjectRelatedRawRules} relatedObjectRules - The rules for defining relationships for the managed object to other collections of objects.
|
|
141
132
|
* @property {{
|
|
142
133
|
* [rule: string]: import('vue').ComputedRef<any>,
|
|
@@ -152,12 +143,12 @@ export function useObjectRelated({ parentState, relatedObjectRules }: ObjectRela
|
|
|
152
143
|
* @typedef {(
|
|
153
144
|
* import('./objectInstance.js').ObjectInstanceRawState &
|
|
154
145
|
* Partial<import('./objectSubscription.js').ObjectSubscriptionRawState>
|
|
155
|
-
* )} ObjectRelatedParentRawState
|
|
146
|
+
* )} ObjectRelatedParentRawState - The raw, pre-unwrapped parent state consumed by the object related mixin (object instance plus optional subscription state).
|
|
156
147
|
*/
|
|
157
148
|
/**
|
|
158
149
|
*
|
|
159
150
|
*
|
|
160
|
-
* @typedef {import('vue').UnwrapNestedRefs<ObjectRelatedParentRawState>} ObjectRelatedParentState
|
|
151
|
+
* @typedef {import('vue').UnwrapNestedRefs<ObjectRelatedParentRawState>} ObjectRelatedParentState - The unwrapped reactive parent state consumed by the object related mixin.
|
|
161
152
|
*/
|
|
162
153
|
/**
|
|
163
154
|
*
|
|
@@ -165,21 +156,26 @@ export function useObjectRelated({ parentState, relatedObjectRules }: ObjectRela
|
|
|
165
156
|
* @typedef {import('vue').UnwrapNestedRefs<(
|
|
166
157
|
* ObjectRelatedParentRawState &
|
|
167
158
|
* ObjectRelatedRawState
|
|
168
|
-
* )>} ObjectRelatedState
|
|
159
|
+
* )>} ObjectRelatedState - The unwrapped reactive state of the object related composable, combining the parent state with its own related state.
|
|
169
160
|
*/
|
|
161
|
+
/** @internal */
|
|
170
162
|
export const objectRelatedStateKeys: string[];
|
|
163
|
+
/** @internal */
|
|
171
164
|
export const objectRelatedFunctions: any[];
|
|
165
|
+
/**
|
|
166
|
+
* The members (state, parentState, stop) contributed by the object related composable.
|
|
167
|
+
*/
|
|
172
168
|
export type ObjectRelatedProperties = {
|
|
173
169
|
/**
|
|
174
|
-
*
|
|
170
|
+
* The state of the object related instance.
|
|
175
171
|
*/
|
|
176
172
|
state: ObjectRelatedState;
|
|
177
173
|
/**
|
|
178
|
-
*
|
|
174
|
+
* The parent state.
|
|
179
175
|
*/
|
|
180
176
|
parentState: ObjectRelatedParentState;
|
|
181
177
|
/**
|
|
182
|
-
*
|
|
178
|
+
* Stops all effects of the object related instance.
|
|
183
179
|
*/
|
|
184
180
|
stop: () => void;
|
|
185
181
|
};
|
|
@@ -192,7 +188,7 @@ export type ObjectRelated = ObjectRelatedProperties;
|
|
|
192
188
|
*/
|
|
193
189
|
export type ObjectRelatedRawProps = {
|
|
194
190
|
/**
|
|
195
|
-
*
|
|
191
|
+
* The rules for defining relationships for the managed object to other collections of objects.
|
|
196
192
|
*/
|
|
197
193
|
relatedObjectRules: import("vue").Ref<ObjectRelatedRawRules>;
|
|
198
194
|
};
|
|
@@ -207,15 +203,15 @@ export type ObjectRelatedOptions = {
|
|
|
207
203
|
*/
|
|
208
204
|
export type ObjectRelatedRule = {
|
|
209
205
|
/**
|
|
210
|
-
*
|
|
206
|
+
* The key in the managed object that corresponds to the key in the related object.
|
|
211
207
|
*/
|
|
212
208
|
pkKey: string;
|
|
213
209
|
/**
|
|
214
|
-
*
|
|
210
|
+
* The related objects, indexed by the key in the related object.
|
|
215
211
|
*/
|
|
216
212
|
objects: import("./listInstance.js").ObjectsByPk;
|
|
217
213
|
/**
|
|
218
|
-
*
|
|
214
|
+
* The order of the related objects, if the related objects are an array.
|
|
219
215
|
*/
|
|
220
216
|
order: string[];
|
|
221
217
|
};
|
|
@@ -225,34 +221,46 @@ export type ObjectRelatedRule = {
|
|
|
225
221
|
export type ObjectRelatedRawRules = {
|
|
226
222
|
[rule: string]: ObjectRelatedRule;
|
|
227
223
|
};
|
|
224
|
+
/**
|
|
225
|
+
* The raw reactive state of the object related composable, holding its rules, computed relations, and running flags.
|
|
226
|
+
*/
|
|
228
227
|
export type ObjectRelatedRawState = {
|
|
229
228
|
/**
|
|
230
|
-
*
|
|
229
|
+
* The rules for defining relationships for the managed object to other collections of objects.
|
|
231
230
|
*/
|
|
232
231
|
relatedObjectRules: ObjectRelatedRawRules;
|
|
233
232
|
/**
|
|
234
|
-
*
|
|
233
|
+
* The related objects, indexed by the key in the related object.
|
|
235
234
|
*/
|
|
236
235
|
relatedObject: {
|
|
237
236
|
[rule: string]: import("vue").ComputedRef<any>;
|
|
238
237
|
};
|
|
239
238
|
/**
|
|
240
|
-
*
|
|
239
|
+
* Whether the related object watch is running.
|
|
241
240
|
*/
|
|
242
241
|
relatedObjectWatchRunning: boolean;
|
|
243
242
|
/**
|
|
244
|
-
*
|
|
243
|
+
* Whether the parent state object watch is running.
|
|
245
244
|
*/
|
|
246
245
|
parentStateObjectWatchRunning: boolean;
|
|
247
246
|
/**
|
|
248
|
-
*
|
|
247
|
+
* Whether the related objects are loading.
|
|
249
248
|
*/
|
|
250
249
|
relatedRunning: boolean;
|
|
251
250
|
/**
|
|
252
|
-
*
|
|
251
|
+
* Whether the related objects are loading or the parent state is loading.
|
|
253
252
|
*/
|
|
254
253
|
running: boolean;
|
|
255
254
|
};
|
|
255
|
+
/**
|
|
256
|
+
* The raw, pre-unwrapped parent state consumed by the object related mixin (object instance plus optional subscription state).
|
|
257
|
+
*/
|
|
256
258
|
export type ObjectRelatedParentRawState = (import("./objectInstance.js").ObjectInstanceRawState & Partial<import("./objectSubscription.js").ObjectSubscriptionRawState>);
|
|
259
|
+
/**
|
|
260
|
+
* The unwrapped reactive parent state consumed by the object related mixin.
|
|
261
|
+
*/
|
|
257
262
|
export type ObjectRelatedParentState = import("vue").UnwrapNestedRefs<ObjectRelatedParentRawState>;
|
|
263
|
+
/**
|
|
264
|
+
* The unwrapped reactive state of the object related composable, combining the parent state with its own related state.
|
|
265
|
+
*/
|
|
258
266
|
export type ObjectRelatedState = import("vue").UnwrapNestedRefs<(ObjectRelatedParentRawState & ObjectRelatedRawState)>;
|
|
@@ -1,29 +1,21 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* The raw state of the object subscription.
|
|
3
|
-
*
|
|
4
|
-
* @typedef {object} ObjectSubscriptionRawState
|
|
2
|
+
* @typedef {object} ObjectSubscriptionRawState - The raw state of the object subscription.
|
|
5
3
|
* @property {import('vue').Ref<boolean>} intendToRetrieve - Whether the object intends to retrieve.
|
|
6
4
|
* @property {import('vue').Ref<boolean>} intendToSubscribe - Whether the object intends to subscribe.
|
|
7
5
|
* @property {import('vue').Ref<boolean|undefined>} subscribed - Whether the object is subscribed.
|
|
8
6
|
*/
|
|
9
7
|
/**
|
|
10
|
-
* The state of the object subscription, including both subscription and object instance states.
|
|
11
|
-
*
|
|
12
8
|
* @typedef {import('vue').Reactive<
|
|
13
9
|
* ObjectSubscriptionRawState &
|
|
14
10
|
* import('./objectInstance.js').ObjectInstanceRawState
|
|
15
|
-
* >} ObjectSubscriptionState
|
|
11
|
+
* >} ObjectSubscriptionState - The state of the object subscription, including both subscription and object instance states.
|
|
16
12
|
*/
|
|
17
13
|
/**
|
|
18
|
-
* Functions available for object subscription management.
|
|
19
|
-
*
|
|
20
|
-
* @typedef {object} ObjectSubscriptionFunctions
|
|
14
|
+
* @typedef {object} ObjectSubscriptionFunctions - Functions available for object subscription management.
|
|
21
15
|
* @property {() => void} clearError - Clears any errors related to the subscription, and resets the loading state.
|
|
22
16
|
*/
|
|
23
17
|
/**
|
|
24
|
-
* Properties of the object subscription.
|
|
25
|
-
*
|
|
26
|
-
* @typedef {object} ObjectSubscriptionProperties
|
|
18
|
+
* @typedef {object} ObjectSubscriptionProperties - Properties of the object subscription.
|
|
27
19
|
* @property {ObjectSubscriptionState} state - The object instance properties.
|
|
28
20
|
* @property {import('./objectInstance.js').ObjectInstance} objectInstance - The object instance.
|
|
29
21
|
* @property {import('./cancellableIntent.js').CancellableIntent} subscribeIntent - The subscribe intent.
|
|
@@ -31,19 +23,15 @@
|
|
|
31
23
|
* @property {() => void} stop - Stops the subscription reactive effects.
|
|
32
24
|
*/
|
|
33
25
|
/**
|
|
34
|
-
* The object subscription instance, combining state, properties, and functions.
|
|
35
|
-
*
|
|
36
|
-
* @typedef {ObjectSubscriptionProperties & ObjectSubscriptionFunctions} ObjectSubscription
|
|
26
|
+
* @typedef {ObjectSubscriptionProperties & ObjectSubscriptionFunctions} ObjectSubscription - The object subscription instance, combining state, properties, and functions.
|
|
37
27
|
*/
|
|
38
28
|
/**
|
|
39
|
-
* Raw props for the object subscription.
|
|
40
|
-
*
|
|
41
|
-
* @typedef {object} ObjectSubscriptionRawProps
|
|
29
|
+
* @typedef {object} ObjectSubscriptionRawProps - Raw props for the object subscription.
|
|
42
30
|
* @property {boolean|undefined} intendToRetrieve - Whether the object intends to retrieve.
|
|
43
31
|
* @property {boolean|undefined} intendToSubscribe - Whether the object intends to subscribe.
|
|
44
32
|
*/
|
|
45
33
|
/**
|
|
46
|
-
* @typedef {object} ObjectSubscriptionOwnOptions
|
|
34
|
+
* @typedef {object} ObjectSubscriptionOwnOptions - The options specific to an object subscription (reactive props, an optional instance to reuse, and handlers).
|
|
47
35
|
* @property {import('./objectInstance.js').ObjectInstance} [objectInstance] - An object instance to use instead of creating a new one.
|
|
48
36
|
* @property {import('vue').UnwrapNestedRefs<(
|
|
49
37
|
* ObjectSubscriptionRawProps & import('./objectInstance.js').ObjectInstanceRawProps
|
|
@@ -51,9 +39,7 @@
|
|
|
51
39
|
* @property {import('../config/objectCrud.js').ObjectCrudHandlers} [handlers] - The handlers to be passed to useObjectInstance.
|
|
52
40
|
*/
|
|
53
41
|
/**
|
|
54
|
-
* Options for initializing an object subscription, including reactive props and non-reactive handlers.
|
|
55
|
-
*
|
|
56
|
-
* @typedef {ObjectSubscriptionOwnOptions & import('./objectInstance.js').ObjectInstanceOptions} ObjectSubscriptionOptions
|
|
42
|
+
* @typedef {ObjectSubscriptionOwnOptions & import('./objectInstance.js').ObjectInstanceOptions} ObjectSubscriptionOptions - Options for initializing an object subscription, including reactive props and non-reactive handlers.
|
|
57
43
|
*/
|
|
58
44
|
/**
|
|
59
45
|
* Initializes multiple object subscriptions based on provided arguments.
|
|
@@ -67,9 +53,7 @@ export function useObjectSubscriptions(subscriptionArgs: {
|
|
|
67
53
|
[key: string]: ObjectSubscription;
|
|
68
54
|
};
|
|
69
55
|
/**
|
|
70
|
-
* The context bound to shared objectSubscription functions.
|
|
71
|
-
*
|
|
72
|
-
* @typedef {object} ObjectSubscriptionContext
|
|
56
|
+
* @typedef {object} ObjectSubscriptionContext - The context bound to shared objectSubscription functions.
|
|
73
57
|
* @property {ObjectSubscriptionState} state - The object subscription state.
|
|
74
58
|
* @property {import('./objectInstance.js').ObjectInstance} objectInstance - The object instance.
|
|
75
59
|
* @property {import('./cancellableIntent.js').CancellableIntent} subscribeIntent - The subscribe intent.
|
|
@@ -137,22 +121,24 @@ export class ObjectSubscriptionError extends Error {
|
|
|
137
121
|
constructor(message: string, code: string);
|
|
138
122
|
code: string;
|
|
139
123
|
}
|
|
124
|
+
/** @internal */
|
|
140
125
|
export const objectSubscriptionStateKeys: string[];
|
|
126
|
+
/** @internal */
|
|
141
127
|
export const objectSubscriptionFunctions: string[];
|
|
142
128
|
/**
|
|
143
129
|
* The raw state of the object subscription.
|
|
144
130
|
*/
|
|
145
131
|
export type ObjectSubscriptionRawState = {
|
|
146
132
|
/**
|
|
147
|
-
*
|
|
133
|
+
* Whether the object intends to retrieve.
|
|
148
134
|
*/
|
|
149
135
|
intendToRetrieve: import("vue").Ref<boolean>;
|
|
150
136
|
/**
|
|
151
|
-
*
|
|
137
|
+
* Whether the object intends to subscribe.
|
|
152
138
|
*/
|
|
153
139
|
intendToSubscribe: import("vue").Ref<boolean>;
|
|
154
140
|
/**
|
|
155
|
-
*
|
|
141
|
+
* Whether the object is subscribed.
|
|
156
142
|
*/
|
|
157
143
|
subscribed: import("vue").Ref<boolean | undefined>;
|
|
158
144
|
};
|
|
@@ -165,7 +151,7 @@ export type ObjectSubscriptionState = import("vue").Reactive<ObjectSubscriptionR
|
|
|
165
151
|
*/
|
|
166
152
|
export type ObjectSubscriptionFunctions = {
|
|
167
153
|
/**
|
|
168
|
-
*
|
|
154
|
+
* Clears any errors related to the subscription, and resets the loading state.
|
|
169
155
|
*/
|
|
170
156
|
clearError: () => void;
|
|
171
157
|
};
|
|
@@ -174,23 +160,23 @@ export type ObjectSubscriptionFunctions = {
|
|
|
174
160
|
*/
|
|
175
161
|
export type ObjectSubscriptionProperties = {
|
|
176
162
|
/**
|
|
177
|
-
*
|
|
163
|
+
* The object instance properties.
|
|
178
164
|
*/
|
|
179
165
|
state: ObjectSubscriptionState;
|
|
180
166
|
/**
|
|
181
|
-
*
|
|
167
|
+
* The object instance.
|
|
182
168
|
*/
|
|
183
169
|
objectInstance: import("./objectInstance.js").ObjectInstance;
|
|
184
170
|
/**
|
|
185
|
-
*
|
|
171
|
+
* The subscribe intent.
|
|
186
172
|
*/
|
|
187
173
|
subscribeIntent: import("./cancellableIntent.js").CancellableIntent;
|
|
188
174
|
/**
|
|
189
|
-
*
|
|
175
|
+
* The retrieve intent.
|
|
190
176
|
*/
|
|
191
177
|
retrieveIntent: import("./cancellableIntent.js").CancellableIntent;
|
|
192
178
|
/**
|
|
193
|
-
*
|
|
179
|
+
* Stops the subscription reactive effects.
|
|
194
180
|
*/
|
|
195
181
|
stop: () => void;
|
|
196
182
|
};
|
|
@@ -203,25 +189,28 @@ export type ObjectSubscription = ObjectSubscriptionProperties & ObjectSubscripti
|
|
|
203
189
|
*/
|
|
204
190
|
export type ObjectSubscriptionRawProps = {
|
|
205
191
|
/**
|
|
206
|
-
*
|
|
192
|
+
* Whether the object intends to retrieve.
|
|
207
193
|
*/
|
|
208
194
|
intendToRetrieve: boolean | undefined;
|
|
209
195
|
/**
|
|
210
|
-
*
|
|
196
|
+
* Whether the object intends to subscribe.
|
|
211
197
|
*/
|
|
212
198
|
intendToSubscribe: boolean | undefined;
|
|
213
199
|
};
|
|
200
|
+
/**
|
|
201
|
+
* The options specific to an object subscription (reactive props, an optional instance to reuse, and handlers).
|
|
202
|
+
*/
|
|
214
203
|
export type ObjectSubscriptionOwnOptions = {
|
|
215
204
|
/**
|
|
216
|
-
*
|
|
205
|
+
* An object instance to use instead of creating a new one.
|
|
217
206
|
*/
|
|
218
207
|
objectInstance?: import("./objectInstance.js").ObjectInstance;
|
|
219
208
|
/**
|
|
220
|
-
*
|
|
209
|
+
* The reactive args to be passed to useObjectInstance.
|
|
221
210
|
*/
|
|
222
211
|
props: import("vue").UnwrapNestedRefs<(ObjectSubscriptionRawProps & import("./objectInstance.js").ObjectInstanceRawProps)>;
|
|
223
212
|
/**
|
|
224
|
-
*
|
|
213
|
+
* The handlers to be passed to useObjectInstance.
|
|
225
214
|
*/
|
|
226
215
|
handlers?: import("../config/objectCrud.js").ObjectCrudHandlers;
|
|
227
216
|
};
|
|
@@ -234,19 +223,19 @@ export type ObjectSubscriptionOptions = ObjectSubscriptionOwnOptions & import(".
|
|
|
234
223
|
*/
|
|
235
224
|
export type ObjectSubscriptionContext = {
|
|
236
225
|
/**
|
|
237
|
-
*
|
|
226
|
+
* The object subscription state.
|
|
238
227
|
*/
|
|
239
228
|
state: ObjectSubscriptionState;
|
|
240
229
|
/**
|
|
241
|
-
*
|
|
230
|
+
* The object instance.
|
|
242
231
|
*/
|
|
243
232
|
objectInstance: import("./objectInstance.js").ObjectInstance;
|
|
244
233
|
/**
|
|
245
|
-
*
|
|
234
|
+
* The subscribe intent.
|
|
246
235
|
*/
|
|
247
236
|
subscribeIntent: import("./cancellableIntent.js").CancellableIntent;
|
|
248
237
|
/**
|
|
249
|
-
*
|
|
238
|
+
* The retrieve intent.
|
|
250
239
|
*/
|
|
251
240
|
retrieveIntent: import("./cancellableIntent.js").CancellableIntent;
|
|
252
241
|
};
|
|
@@ -1,16 +1,16 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* @typedef {import('./error.js').ReadonlyErrorStatus | import("vue").Reactive<import('./error.js').ReadonlyErrorStatus>} WatchableError
|
|
3
|
-
* @typedef {import('vue').
|
|
2
|
+
* @typedef {import('./error.js').ReadonlyErrorStatus | import("vue").Reactive<import('./error.js').ReadonlyErrorStatus>} WatchableError - An error source (a possibly-reactive readonly error status) that useProxyError can aggregate.
|
|
3
|
+
* @typedef {import('vue').MaybeRefOrGetter<WatchableError>} MaybeRefWatchableError - A watchable error source that may itself be wrapped in a ref or getter.
|
|
4
4
|
*/
|
|
5
5
|
/**
|
|
6
6
|
* A composable function for aggregating error state across multiple sources.
|
|
7
7
|
*
|
|
8
|
-
* @param {import('vue').
|
|
8
|
+
* @param {import('vue').MaybeRefOrGetter<MaybeRefWatchableError[]>} errors - The error states to monitor.
|
|
9
9
|
* @returns {import('./error.js').ReadonlyErrorStatus} An object containing aggregated reactive fields and actions for error state.
|
|
10
10
|
*/
|
|
11
|
-
export function useProxyError(errors: import("vue").
|
|
11
|
+
export function useProxyError(errors: import("vue").MaybeRefOrGetter<MaybeRefWatchableError[]>): import("./error.js").ReadonlyErrorStatus;
|
|
12
12
|
/**
|
|
13
|
-
* @typedef {{ state: import('vue').Reactive<import('./error.js').ErrorProperties> } & import('./error.js').ErrorReadOnlyFunctions} SeparateStateError
|
|
13
|
+
* @typedef {{ state: import('vue').Reactive<import('./error.js').ErrorProperties> } & import('./error.js').ErrorReadOnlyFunctions} SeparateStateError - An error source whose reactive properties live under a state member, alongside its clearError action.
|
|
14
14
|
*/
|
|
15
15
|
/**
|
|
16
16
|
* Adapt an object with reactive error state into a WatchableError shape.
|
|
@@ -23,8 +23,17 @@ export function useProxyError(errors: import("vue").MaybeRef<MaybeRefWatchableEr
|
|
|
23
23
|
* @returns {WatchableError} - The adapted WatchableError object.
|
|
24
24
|
*/
|
|
25
25
|
export function asWatchableError(source: import("vue").MaybeRef<SeparateStateError | WatchableError>): WatchableError;
|
|
26
|
+
/**
|
|
27
|
+
* An error source (a possibly-reactive readonly error status) that useProxyError can aggregate.
|
|
28
|
+
*/
|
|
26
29
|
export type WatchableError = import("./error.js").ReadonlyErrorStatus | import("vue").Reactive<import("./error.js").ReadonlyErrorStatus>;
|
|
27
|
-
|
|
30
|
+
/**
|
|
31
|
+
* A watchable error source that may itself be wrapped in a ref or getter.
|
|
32
|
+
*/
|
|
33
|
+
export type MaybeRefWatchableError = import("vue").MaybeRefOrGetter<WatchableError>;
|
|
34
|
+
/**
|
|
35
|
+
* An error source whose reactive properties live under a state member, alongside its clearError action.
|
|
36
|
+
*/
|
|
28
37
|
export type SeparateStateError = {
|
|
29
38
|
state: import("vue").Reactive<import("./error.js").ErrorProperties>;
|
|
30
39
|
} & import("./error.js").ErrorReadOnlyFunctions;
|
|
@@ -1,15 +1,15 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* @typedef {import('./loading.js').LoadingProperties | import("vue").Reactive<import('./loading.js').LoadingProperties>} WatchableLoading
|
|
3
|
-
* @typedef {import('vue').
|
|
2
|
+
* @typedef {import('./loading.js').LoadingProperties | import("vue").Reactive<import('./loading.js').LoadingProperties>} WatchableLoading - A loading source (possibly-reactive loading properties) that useProxyLoading can aggregate.
|
|
3
|
+
* @typedef {import('vue').MaybeRefOrGetter<WatchableLoading>} MaybeRefWatchableLoading - A watchable loading source that may itself be wrapped in a ref or getter.
|
|
4
4
|
* @typedef {import('./loading.js').LoadingProperties} ReadonlyLoadingStatus
|
|
5
5
|
*/
|
|
6
6
|
/**
|
|
7
7
|
* A composable function for aggregating loading state across multiple sources.
|
|
8
8
|
*
|
|
9
|
-
* @param {import('vue').
|
|
9
|
+
* @param {import('vue').MaybeRefOrGetter<MaybeRefWatchableLoading[]>} loadings - The loading states to monitor.
|
|
10
10
|
* @returns {ReadonlyLoadingStatus} An object containing the aggregated loading field.
|
|
11
11
|
*/
|
|
12
|
-
export function useProxyLoading(loadings: import("vue").
|
|
12
|
+
export function useProxyLoading(loadings: import("vue").MaybeRefOrGetter<MaybeRefWatchableLoading[]>): ReadonlyLoadingStatus;
|
|
13
13
|
/**
|
|
14
14
|
* Adapt an object with reactive loading state into a WatchableLoading shape.
|
|
15
15
|
* Accepts either an object with a `state` property or an object that already exposes `loading`.
|
|
@@ -20,6 +20,12 @@ export function useProxyLoading(loadings: import("vue").MaybeRef<MaybeRefWatchab
|
|
|
20
20
|
export function asWatchableLoading(source: import("vue").MaybeRef<{
|
|
21
21
|
state: WatchableLoading;
|
|
22
22
|
} | WatchableLoading>): WatchableLoading;
|
|
23
|
+
/**
|
|
24
|
+
* A loading source (possibly-reactive loading properties) that useProxyLoading can aggregate.
|
|
25
|
+
*/
|
|
23
26
|
export type WatchableLoading = import("./loading.js").LoadingProperties | import("vue").Reactive<import("./loading.js").LoadingProperties>;
|
|
24
|
-
|
|
27
|
+
/**
|
|
28
|
+
* A watchable loading source that may itself be wrapped in a ref or getter.
|
|
29
|
+
*/
|
|
30
|
+
export type MaybeRefWatchableLoading = import("vue").MaybeRefOrGetter<WatchableLoading>;
|
|
25
31
|
export type ReadonlyLoadingStatus = import("./loading.js").LoadingProperties;
|
|
@@ -1,17 +1,17 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* @typedef {import('./proxyLoading.js').WatchableLoading & import('./proxyError.js').WatchableError} WatchableLoadingError
|
|
3
|
-
* @typedef {import('vue').
|
|
4
|
-
* @typedef {import('./loading.js').LoadingProperties & import('./error.js').ReadonlyErrorStatus} ProxyLoadingError
|
|
2
|
+
* @typedef {import('./proxyLoading.js').WatchableLoading & import('./proxyError.js').WatchableError} WatchableLoadingError - A combined loading-and-error source that useProxyLoadingError can aggregate.
|
|
3
|
+
* @typedef {import('vue').MaybeRefOrGetter<WatchableLoadingError>} MaybeRefWatchableLoadingError - A watchable combined loading-and-error source that may itself be wrapped in a ref or getter.
|
|
4
|
+
* @typedef {import('./loading.js').LoadingProperties & import('./error.js').ReadonlyErrorStatus} ProxyLoadingError - The aggregated loading and error state returned by useProxyLoadingError.
|
|
5
5
|
*/
|
|
6
6
|
/**
|
|
7
7
|
* A composable function combining aggregated loading and error state. Use `asWatchableLoadingError` to convert <List|Object><Instance|Subscription> to WatchableLoadingError.
|
|
8
8
|
*
|
|
9
|
-
* @param {import('vue').
|
|
9
|
+
* @param {import('vue').MaybeRefOrGetter<MaybeRefWatchableLoadingError[]>} loadingErrors - The loading and error states to monitor.
|
|
10
10
|
* @returns {ProxyLoadingError} - An object containing aggregated reactive fields and actions for both loading and error state.
|
|
11
11
|
*/
|
|
12
|
-
export function useProxyLoadingError(loadingErrors: import("vue").
|
|
12
|
+
export function useProxyLoadingError(loadingErrors: import("vue").MaybeRefOrGetter<MaybeRefWatchableLoadingError[]>): ProxyLoadingError;
|
|
13
13
|
/**
|
|
14
|
-
* @typedef {{ state: import('vue').Reactive<import('./error.js').ErrorProperties> } & import('./error.js').ErrorReadOnlyFunctions} SeparateStateLoadingError
|
|
14
|
+
* @typedef {{ state: import('vue').Reactive<import('./error.js').ErrorProperties> } & import('./error.js').ErrorReadOnlyFunctions} SeparateStateLoadingError - A combined loading-and-error source whose reactive properties live under a state member, alongside its clearError action.
|
|
15
15
|
*/
|
|
16
16
|
/**
|
|
17
17
|
* Adapt an object that exposes loading/error state and clearError into a WatchableLoadingError shape.
|
|
@@ -20,9 +20,21 @@ export function useProxyLoadingError(loadingErrors: import("vue").MaybeRef<Maybe
|
|
|
20
20
|
* @returns {WatchableLoadingError} - The adapted WatchableLoadingError object.
|
|
21
21
|
*/
|
|
22
22
|
export function asWatchableLoadingError(source: import("vue").MaybeRef<SeparateStateLoadingError | WatchableLoadingError>): WatchableLoadingError;
|
|
23
|
+
/**
|
|
24
|
+
* A combined loading-and-error source that useProxyLoadingError can aggregate.
|
|
25
|
+
*/
|
|
23
26
|
export type WatchableLoadingError = import("./proxyLoading.js").WatchableLoading & import("./proxyError.js").WatchableError;
|
|
24
|
-
|
|
27
|
+
/**
|
|
28
|
+
* A watchable combined loading-and-error source that may itself be wrapped in a ref or getter.
|
|
29
|
+
*/
|
|
30
|
+
export type MaybeRefWatchableLoadingError = import("vue").MaybeRefOrGetter<WatchableLoadingError>;
|
|
31
|
+
/**
|
|
32
|
+
* The aggregated loading and error state returned by useProxyLoadingError.
|
|
33
|
+
*/
|
|
25
34
|
export type ProxyLoadingError = import("./loading.js").LoadingProperties & import("./error.js").ReadonlyErrorStatus;
|
|
35
|
+
/**
|
|
36
|
+
* A combined loading-and-error source whose reactive properties live under a state member, alongside its clearError action.
|
|
37
|
+
*/
|
|
26
38
|
export type SeparateStateLoadingError = {
|
|
27
39
|
state: import("vue").Reactive<import("./error.js").ErrorProperties>;
|
|
28
40
|
} & import("./error.js").ErrorReadOnlyFunctions;
|