@arrai-innovations/reactive-helpers 21.1.2 → 22.1.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.
Files changed (78) hide show
  1. package/LICENSE +28 -0
  2. package/README.md +109 -21
  3. package/config/commonCrud.js +7 -10
  4. package/config/listCrud.js +33 -33
  5. package/config/objectCrud.js +64 -59
  6. package/package.json +103 -89
  7. package/types/config/listCrud.d.ts +83 -28
  8. package/types/config/objectCrud.d.ts +139 -49
  9. package/types/tests/benchmarks/fixtures.d.ts +60 -0
  10. package/types/tests/benchmarks/listLayers.bench.d.ts +1 -0
  11. package/types/tests/benchmarks/listPush.bench.d.ts +1 -0
  12. package/types/tests/benchmarks/listStream.bench.d.ts +1 -0
  13. package/types/tests/unit/use/lifecycleCleanup.spec.d.ts +1 -0
  14. package/types/tests/unit/use/listPerformance.spec.d.ts +1 -0
  15. package/types/tests/unit/utils/cancellablePromise.spec.d.ts +1 -0
  16. package/types/use/cancellableIntent.d.ts +36 -33
  17. package/types/use/combineClasses.d.ts +5 -2
  18. package/types/use/error.d.ts +39 -19
  19. package/types/use/list.d.ts +27 -26
  20. package/types/use/listCalculated.d.ts +38 -55
  21. package/types/use/listFilter.d.ts +25 -33
  22. package/types/use/listInstance.d.ts +94 -81
  23. package/types/use/listRelated.d.ts +37 -57
  24. package/types/use/listSearch.d.ts +54 -52
  25. package/types/use/listSort.d.ts +31 -40
  26. package/types/use/listSubscription.d.ts +33 -36
  27. package/types/use/loading.d.ts +20 -10
  28. package/types/use/loadingError.d.ts +12 -3
  29. package/types/use/object.d.ts +8 -5
  30. package/types/use/objectCalculated.d.ts +46 -39
  31. package/types/use/objectInstance.d.ts +70 -74
  32. package/types/use/objectRelated.d.ts +51 -41
  33. package/types/use/objectSubscription.d.ts +38 -48
  34. package/types/use/proxyError.d.ts +15 -6
  35. package/types/use/proxyLoading.d.ts +11 -5
  36. package/types/use/proxyLoadingError.d.ts +19 -7
  37. package/types/use/search.d.ts +33 -29
  38. package/types/utils/assignReactiveObject.d.ts +3 -0
  39. package/types/utils/cancellableFetch.d.ts +2 -3
  40. package/types/utils/cancellablePromise.d.ts +42 -8
  41. package/types/utils/classes.d.ts +7 -1
  42. package/types/utils/deepUnref.d.ts +1 -1
  43. package/types/utils/getFakePk.d.ts +2 -2
  44. package/types/utils/isReactiveTyped.d.ts +2 -0
  45. package/types/utils/keyDiff.d.ts +4 -6
  46. package/types/utils/relatedCalculatedHelpers.d.ts +2 -0
  47. package/types/utils/watches.d.ts +1 -1
  48. package/use/cancellableIntent.js +36 -9
  49. package/use/combineClasses.js +2 -2
  50. package/use/error.js +10 -14
  51. package/use/list.js +6 -18
  52. package/use/listCalculated.js +28 -38
  53. package/use/listFilter.js +12 -24
  54. package/use/listInstance.js +101 -60
  55. package/use/listRelated.js +18 -37
  56. package/use/listSearch.js +9 -18
  57. package/use/listSort.js +95 -64
  58. package/use/listSubscription.js +19 -25
  59. package/use/loading.js +5 -7
  60. package/use/loadingError.js +3 -3
  61. package/use/object.js +14 -27
  62. package/use/objectCalculated.js +21 -25
  63. package/use/objectInstance.js +55 -50
  64. package/use/objectRelated.js +19 -25
  65. package/use/objectSubscription.js +18 -30
  66. package/use/proxyError.js +10 -10
  67. package/use/proxyLoading.js +5 -5
  68. package/use/proxyLoadingError.js +13 -8
  69. package/use/search.js +5 -11
  70. package/utils/assignReactiveObject.js +3 -3
  71. package/utils/cancellableFetch.js +3 -3
  72. package/utils/cancellablePromise.js +25 -8
  73. package/utils/classes.js +2 -2
  74. package/utils/deepUnref.js +1 -5
  75. package/utils/getFakePk.js +2 -2
  76. package/utils/isReactiveTyped.js +2 -0
  77. package/utils/keyDiff.js +1 -3
  78. package/utils/relatedCalculatedHelpers.js +2 -0
@@ -9,8 +9,17 @@ export function getListCrud(target: import("vue").UnwrapNestedRefs<ListCrudHandl
9
9
  props?: import("vue").UnwrapNestedRefs<ListTargetOption>;
10
10
  handlers?: ListCrudHandlers;
11
11
  }): void;
12
+ /**
13
+ * Signature for the handler that clears the objects held by the list.
14
+ */
12
15
  export type ClearObjectsFn = import("../use/listInstance.js").ClearListFn;
16
+ /**
17
+ * Signature for the handler that updates the list's pagination information.
18
+ */
13
19
  export type SetPaginateInfo = import("../use/listInstance.js").SetPaginateInfoFn;
20
+ /**
21
+ * Signature for the handler that updates the list's column totals.
22
+ */
14
23
  export type SetColumnTotals = import("../use/listInstance.js").SetColumnTotalsFn;
15
24
  /**
16
25
  * Additional arguments that can be passed to list crud handlers.
@@ -18,132 +27,178 @@ export type SetColumnTotals = import("../use/listInstance.js").SetColumnTotalsFn
18
27
  export type AdditionalListArgs = {
19
28
  [key: string]: any;
20
29
  };
30
+ /**
31
+ * Raw arguments for a list operation before run-tracking and additional list CRUD arguments are merged in.
32
+ */
21
33
  export type ListArgsRaw = {
22
34
  /**
23
- * - The arguments to be passed to the crud handlers.
35
+ * The arguments to be passed to the crud handlers.
24
36
  */
25
37
  target: import("../config/objectCrud.js").TargetArgs;
26
38
  /**
27
- * - The key name of the primary key.
39
+ * The key name of the primary key.
28
40
  */
29
41
  pkKey: string;
30
42
  /**
31
- * - The arguments to be passed for list crud handlers.
43
+ * Your listing or retrieval arguments, passed through to the crud handlers.
32
44
  */
33
45
  params: object;
34
46
  /**
35
- * - The method to call with new page(s) of data received.
47
+ * The method to call with new page(s) of data received.
36
48
  */
37
49
  pushObjects: import("../use/listInstance.js").PushObjectsFn;
38
50
  /**
39
- * - The method to call to clear the objects.
51
+ * The method to call to clear the objects.
40
52
  */
41
53
  clearObjects: ClearObjectsFn;
42
54
  /**
43
- * - A ref to a boolean indicating whether the request has
44
- * been cancelled.
55
+ * A readonly ref that becomes true once the request is cancelled.
45
56
  */
46
57
  isCancelled: Readonly<import("vue").Ref<boolean>>;
47
58
  /**
48
- * - The method to update pagination information.
59
+ * The method to update pagination information.
49
60
  */
50
61
  setPaginateInfo: SetPaginateInfo;
51
62
  /**
52
- * - The method to update column totals.
63
+ * The method to update column totals.
53
64
  */
54
65
  setColumnTotals: SetColumnTotals;
55
66
  };
67
+ /**
68
+ * Arguments for a list operation, combining the raw arguments with run-tracking and any additional list CRUD arguments.
69
+ */
56
70
  export type ListArgs = ListArgsRaw & Partial<import("../use/cancellableIntent.js").CommonRunTracking> & AdditionalListArgs;
71
+ /**
72
+ * Raw arguments for a bulk-delete operation before additional list CRUD arguments are merged in.
73
+ */
57
74
  export type BulkDeleteArgsRaw = {
58
75
  /**
59
- * - The arguments to be passed to the crud handlers.
76
+ * The arguments to be passed to the crud handlers.
60
77
  */
61
78
  target: import("../config/objectCrud.js").TargetArgs;
62
79
  /**
63
- * - The ids of the objects to be deleted.
80
+ * The pks of the objects to be deleted.
64
81
  */
65
82
  pks: import("./commonCrud.js").Pk[];
66
83
  /**
67
- * - The key name of the primary key.
84
+ * The key name of the primary key.
68
85
  */
69
86
  pkKey: string;
70
87
  };
88
+ /**
89
+ * Arguments for a bulk-delete operation, combining the raw arguments with any additional list CRUD arguments.
90
+ */
71
91
  export type BulkDeleteArgs = BulkDeleteArgsRaw & AdditionalListArgs;
92
+ /**
93
+ * Callback that applies a created, updated, or deleted object event received from a subscription to the list.
94
+ */
72
95
  export type applyObjectEvent = (newOrUpdatedOrDeleteObject: import("../use/objectInstance.js").ExistingCrudObject | string, action: "create" | "update" | "delete") => void;
96
+ /**
97
+ * Raw arguments for a list subscribe operation before run-tracking and additional list CRUD arguments are merged in.
98
+ */
73
99
  export type ListSubscribeArgsRaw = {
74
100
  /**
75
- * - The arguments to be passed to the crud handlers.
101
+ * The arguments to be passed to the crud handlers.
76
102
  */
77
103
  target: import("../config/objectCrud.js").TargetArgs;
78
104
  /**
79
- * - The key name of the primary key.
105
+ * The key name of the primary key.
80
106
  */
81
107
  pkKey: string;
82
108
  /**
83
- * - The arguments to be passed for list crud handlers.
109
+ * Your listing or retrieval arguments, passed through to the crud handlers.
84
110
  */
85
111
  params: object;
86
112
  /**
87
- * - The method to call when new data is received.
113
+ * The method to call when new data is received.
88
114
  */
89
115
  applyObjectEvent: applyObjectEvent;
90
116
  /**
91
- * - A ref to a boolean indicating whether the request has
92
- * been cancelled.
117
+ * A readonly ref that becomes true once the request is cancelled.
93
118
  */
94
119
  isCancelled: Readonly<import("vue").Ref<boolean>>;
95
120
  };
121
+ /**
122
+ * Arguments for a list subscribe operation, combining the raw arguments with run-tracking and any additional list CRUD arguments.
123
+ */
96
124
  export type ListSubscribeArgs = ListSubscribeArgsRaw & Partial<import("../use/cancellableIntent.js").CommonRunTracking> & AdditionalListArgs;
125
+ /**
126
+ * Raw arguments for a list execute-action operation before additional list CRUD arguments are merged in.
127
+ */
97
128
  export type ExecuteActionArgsRaw = {
98
129
  /**
99
- * - The arguments to be passed to the crud handlers.
130
+ * The arguments to be passed to the crud handlers.
100
131
  */
101
132
  target: import("../config/objectCrud.js").TargetArgs;
102
133
  /**
103
- * - The ids of the objects to be acted upon.
134
+ * The pks of the objects to be acted upon.
104
135
  */
105
136
  pks: import("./commonCrud.js").Pk[];
106
137
  /**
107
- * - The key name of the primary key.
138
+ * The key name of the primary key.
108
139
  */
109
140
  pkKey: string;
110
141
  /**
111
- * - The action to execute.
142
+ * The action to execute.
112
143
  */
113
144
  action: string;
114
145
  };
146
+ /**
147
+ * Arguments for a list execute-action operation, combining the raw arguments with any additional list CRUD arguments.
148
+ */
115
149
  export type ExecuteActionArgs = ExecuteActionArgsRaw & AdditionalListArgs;
150
+ /**
151
+ * Signature for the handler that lists objects from the backing store.
152
+ */
116
153
  export type CrudListFn = (args: ListArgs) => import("../utils/cancellablePromise.js").MaybeCancellablePromise<void>;
154
+ /**
155
+ * Signature for the handler that bulk-deletes objects from the backing store.
156
+ */
117
157
  export type CrudBulkDeleteFn = (args: BulkDeleteArgs) => Promise<boolean>;
158
+ /**
159
+ * Signature for the handler that subscribes to list changes in the backing store.
160
+ */
118
161
  export type CrudListSubscribeFn = (args: ListSubscribeArgs) => import("../utils/cancellablePromise.js").CancellablePromise<void>;
162
+ /**
163
+ * Signature for the handler that executes an action on a list of objects in the backing store.
164
+ */
119
165
  export type CrudExecuteActionFn = (args: ExecuteActionArgs) => Promise<object | string | null>;
166
+ /**
167
+ * The set of optional CRUD handler functions (list, bulkDelete, executeAction, subscribe) for a list.
168
+ */
120
169
  export type ListCrudHandlers = {
121
170
  /**
122
- * - The list function to get a list of items.
171
+ * The list function to get a list of items.
123
172
  */
124
173
  list?: CrudListFn;
125
174
  /**
126
- * - The delete function to bulk delete a list of items.
175
+ * The delete function to bulk delete a list of items.
127
176
  */
128
177
  bulkDelete?: CrudBulkDeleteFn;
129
178
  /**
130
- * - The function to execute a certain action on a list of items.
179
+ * The function to execute a certain action on a list of items.
131
180
  */
132
181
  executeAction?: CrudExecuteActionFn;
133
182
  /**
134
- * - The subscribe function to get a subscription to a list of items.
183
+ * The subscribe function to get a subscription to a list of items.
135
184
  */
136
185
  subscribe?: CrudListSubscribeFn;
137
186
  };
187
+ /**
188
+ * The default target arguments passed through to the list CRUD handlers.
189
+ */
138
190
  export type ListTarget = {
139
191
  /**
140
- * - The default arguments for the crud handlers.
192
+ * The default arguments for the crud handlers.
141
193
  */
142
194
  args: object;
143
195
  };
196
+ /**
197
+ * Optional target arguments passed through to the list CRUD handlers.
198
+ */
144
199
  export type ListTargetOption = {
145
200
  /**
146
- * - The default arguments for the crud handlers.
201
+ * The default arguments for the crud handlers.
147
202
  */
148
203
  target?: object;
149
204
  };
@@ -9,6 +9,9 @@ export function getObjectCrud(target: import("vue").UnwrapNestedRefs<ObjectTarge
9
9
  props?: import("vue").UnwrapNestedRefs<ObjectTargetOption>;
10
10
  handlers?: ObjectCrudHandlers;
11
11
  }): void;
12
+ /**
13
+ * Implementation-specific arguments passed through to the CRUD handlers, such as endpoint identifiers.
14
+ */
12
15
  export type TargetArgs = {
13
16
  [key: string]: any;
14
17
  };
@@ -23,230 +26,317 @@ export type AdditionalCrudArgs = {
23
26
  */
24
27
  export type ObjectTargetProperties = {
25
28
  /**
26
- * - The arguments to be passed to the crud handlers.
29
+ * The arguments to be passed to the crud handlers.
27
30
  */
28
31
  args: TargetArgs;
29
32
  };
33
+ /**
34
+ * Optional target arguments passed through to the object CRUD handlers.
35
+ */
30
36
  export type ObjectTargetOption = {
31
37
  /**
32
- * - The arguments to be passed to the crud handlers.
38
+ * The arguments to be passed to the crud handlers.
33
39
  */
34
40
  target?: TargetArgs;
35
41
  };
42
+ /**
43
+ * Raw arguments for an object create operation before additional CRUD arguments are merged in.
44
+ */
36
45
  export type CreateArgsRaw = {
37
46
  /**
38
- * - The arguments to be passed to the crud handlers.
47
+ * The arguments to be passed to the crud handlers.
39
48
  */
40
49
  target: TargetArgs;
41
50
  /**
42
- * - The data to be acted upon.
51
+ * The new object to create; it carries no primary key yet.
43
52
  */
44
53
  object: {
45
54
  [key: string]: any;
46
55
  };
47
56
  /**
48
- * - The arguments to be passed to the retrieve function.
57
+ * Your listing or retrieval arguments, passed through to the crud handlers.
49
58
  */
50
59
  params: {
51
60
  [key: string]: any;
52
61
  };
53
62
  /**
54
- * - The key name of the primary key.
63
+ * The key name of the primary key.
55
64
  */
56
65
  pkKey: string;
57
66
  /**
58
- * - A ref to indicate if the request was cancelled.
67
+ * A readonly ref that becomes true once the request is cancelled.
59
68
  */
60
69
  isCancelled: Readonly<import("vue").Ref<boolean>>;
61
70
  };
71
+ /**
72
+ * Arguments for an object create operation, combining the raw arguments with any additional CRUD arguments.
73
+ */
62
74
  export type CreateArgs = CreateArgsRaw & AdditionalCrudArgs;
75
+ /**
76
+ * Raw arguments for an object retrieve operation before run-tracking and additional CRUD arguments are merged in.
77
+ */
63
78
  export type RetrieveArgsRaw = {
64
79
  /**
65
- * - The arguments to be passed to the crud handlers.
80
+ * The arguments to be passed to the crud handlers.
66
81
  */
67
82
  target: TargetArgs;
68
83
  /**
69
- * - The pk of the object to be acted upon.
84
+ * The pk of the object to be acted upon.
70
85
  */
71
86
  pk: import("./commonCrud.js").Pk;
72
87
  /**
73
- * - The key name of the primary key.
88
+ * The key name of the primary key.
74
89
  */
75
90
  pkKey: string;
76
91
  /**
77
- * - The arguments to be passed to the retrieve function.
92
+ * Your listing or retrieval arguments, passed through to the crud handlers.
78
93
  */
79
94
  params: {
80
95
  [key: string]: any;
81
96
  };
82
97
  /**
83
- * - A ref to indicate if the request was cancelled.
98
+ * A readonly ref that becomes true once the request is cancelled.
84
99
  */
85
100
  isCancelled: Readonly<import("vue").Ref<boolean>>;
86
101
  };
102
+ /**
103
+ * Arguments for an object retrieve operation, combining the raw arguments with run-tracking and any additional CRUD arguments.
104
+ */
87
105
  export type RetrieveArgs = RetrieveArgsRaw & Partial<import("../use/cancellableIntent.js").CommonRunTracking> & AdditionalCrudArgs;
106
+ /**
107
+ * Raw arguments for an object update operation before additional CRUD arguments are merged in.
108
+ */
88
109
  export type UpdateArgsRaw = {
89
110
  /**
90
- * - The arguments to be passed to the crud handlers.
111
+ * The arguments to be passed to the crud handlers.
91
112
  */
92
113
  target: TargetArgs;
93
114
  /**
94
- * - The data to be acted upon.
115
+ * The complete object to update; its primary key rides inside it, at `object[pkKey]`.
95
116
  */
96
117
  object: import("../use/objectInstance.js").ExistingCrudObject;
97
118
  /**
98
- * - The arguments to be passed to the retrieve function.
119
+ * Your listing or retrieval arguments, passed through to the crud handlers.
99
120
  */
100
121
  params: {
101
122
  [key: string]: any;
102
123
  };
103
124
  /**
104
- * - The key name of the primary key.
125
+ * The key name of the primary key.
105
126
  */
106
127
  pkKey: string;
107
128
  /**
108
- * - A ref to indicate if the request was cancelled.
129
+ * A readonly ref that becomes true once the request is cancelled.
109
130
  */
110
131
  isCancelled: Readonly<import("vue").Ref<boolean>>;
111
132
  };
133
+ /**
134
+ * Arguments for an object update operation, combining the raw arguments with any additional CRUD arguments.
135
+ */
112
136
  export type UpdateArgs = UpdateArgsRaw & AdditionalCrudArgs;
137
+ /**
138
+ * Raw arguments for an object delete operation before additional CRUD arguments are merged in.
139
+ */
113
140
  export type DeleteArgsRaw = {
114
141
  /**
115
- * - The arguments to be passed to the crud handlers.
142
+ * The arguments to be passed to the crud handlers.
116
143
  */
117
144
  target: TargetArgs;
118
145
  /**
119
- * - The pk of the object to be acted upon.
146
+ * The pk of the object to be acted upon.
120
147
  */
121
148
  pk: import("./commonCrud.js").Pk;
122
149
  /**
123
- * - The key name of the primary key.
150
+ * The key name of the primary key.
124
151
  */
125
152
  pkKey: string;
153
+ /**
154
+ * A readonly ref that becomes true once the request is cancelled.
155
+ */
156
+ isCancelled: Readonly<import("vue").Ref<boolean>>;
126
157
  };
158
+ /**
159
+ * Arguments for an object delete operation, combining the raw arguments with any additional CRUD arguments.
160
+ */
127
161
  export type DeleteArgs = DeleteArgsRaw & AdditionalCrudArgs;
162
+ /**
163
+ * Raw arguments for an object patch (partial update) operation before additional CRUD arguments are merged in.
164
+ */
128
165
  export type PartialArgsRaw = {
129
166
  /**
130
- * - The arguments to be passed to the crud handlers.
167
+ * The arguments to be passed to the crud handlers.
131
168
  */
132
169
  target: TargetArgs;
133
170
  /**
134
- * - The pk of the object to be acted upon.
171
+ * The pk of the object to be acted upon.
135
172
  */
136
173
  pk: import("./commonCrud.js").Pk;
137
174
  /**
138
- * - The key name of the primary key.
175
+ * The key name of the primary key.
139
176
  */
140
177
  pkKey: string;
141
178
  /**
142
- * - The data to be acted upon.
179
+ * The changed fields only.
143
180
  */
144
181
  partialObject: {
145
182
  [key: string]: any;
146
183
  };
147
184
  /**
148
- * - The arguments to be passed to the retrieve function.
185
+ * Your listing or retrieval arguments, passed through to the crud handlers.
149
186
  */
150
187
  params: {
151
188
  [key: string]: any;
152
189
  };
153
190
  /**
154
- * - A ref to indicate if the request was cancelled.
191
+ * A readonly ref that becomes true once the request is cancelled.
155
192
  */
156
193
  isCancelled: Readonly<import("vue").Ref<boolean>>;
157
194
  };
195
+ /**
196
+ * Arguments for an object patch (partial update) operation, combining the raw arguments with any additional CRUD arguments.
197
+ */
158
198
  export type PartialArgs = PartialArgsRaw & AdditionalCrudArgs;
199
+ /**
200
+ * Raw arguments for a single-object execute-action operation before additional CRUD arguments are merged in.
201
+ */
159
202
  export type ObjectExecuteActionArgsRaw = {
160
203
  /**
161
- * - The arguments to be passed to the crud handlers.
204
+ * The arguments to be passed to the crud handlers.
162
205
  */
163
- target: import("../config/objectCrud.js").TargetArgs;
206
+ target: TargetArgs;
164
207
  /**
165
- * - The id of the objects to be acted upon.
208
+ * The pk of the object to be acted upon.
166
209
  */
167
- pk: string;
210
+ pk: import("./commonCrud.js").Pk;
168
211
  /**
169
- * - The key name of the primary key.
212
+ * The key name of the primary key.
170
213
  */
171
214
  pkKey: string;
172
215
  /**
173
- * - The action to execute.
216
+ * The action to execute.
174
217
  */
175
218
  action: string;
176
219
  /**
177
- * - A ref to indicate if the request was cancelled.
220
+ * A readonly ref that becomes true once the request is cancelled.
178
221
  */
179
222
  isCancelled: Readonly<import("vue").Ref<boolean>>;
180
223
  };
224
+ /**
225
+ * Arguments for a single-object execute-action operation, combining the raw arguments with any additional CRUD arguments.
226
+ */
181
227
  export type ObjectExecuteActionArgs = ObjectExecuteActionArgsRaw & AdditionalCrudArgs;
228
+ /**
229
+ * Callback invoked with the changed object and the action (create, update, or delete) when a subscribed object changes.
230
+ */
182
231
  export type CrudSubscribeCallback = (data: import("../use/objectInstance.js").ExistingCrudObject, action: "delete" | "update" | "create") => any;
232
+ /**
233
+ * Raw arguments for a single-object subscribe operation before run-tracking and additional CRUD arguments are merged in.
234
+ */
183
235
  export type ObjectSubscribeArgsRaw = {
184
236
  /**
185
- * - The arguments to be passed to the crud handlers.
237
+ * The arguments to be passed to the crud handlers.
186
238
  */
187
239
  target: TargetArgs;
188
240
  /**
189
- * - The pk of the object to be acted upon.
241
+ * The pk of the object to be acted upon.
190
242
  */
191
243
  pk: import("./commonCrud.js").Pk;
192
244
  /**
193
- * - The key name of the primary key.
245
+ * The key name of the primary key.
194
246
  */
195
247
  pkKey: string;
196
248
  /**
197
- * - The arguments to be passed to the retrieve function.
249
+ * Your listing or retrieval arguments, passed through to the crud handlers.
198
250
  */
199
251
  params: {
200
252
  [key: string]: any;
201
253
  };
202
254
  /**
203
- * - The callback to be called when the object is updated.
255
+ * The callback to be called when the object is updated.
204
256
  */
205
257
  callback: CrudSubscribeCallback;
206
258
  /**
207
- * - A ref to indicate if the request was cancelled.
259
+ * A readonly ref that becomes true once the request is cancelled.
208
260
  */
209
261
  isCancelled: Readonly<import("vue").Ref<boolean>>;
210
262
  };
263
+ /**
264
+ * Arguments for a single-object subscribe operation, combining the raw arguments with run-tracking and any additional CRUD arguments.
265
+ */
211
266
  export type ObjectSubscribeArgs = ObjectSubscribeArgsRaw & import("../use/cancellableIntent.js").CommonRunTracking & AdditionalCrudArgs;
212
- export type CrudResponse = import("../utils/cancellablePromise.js").MaybeCancellablePromise<object | string>;
267
+ /**
268
+ * -
269
+ * The value returned by an object CRUD handler whose resolved value becomes the record: create, retrieve, update, and
270
+ * patch. A possibly-cancellable promise resolving to the complete record. The instance mirrors the resolved value
271
+ * into `state.object`, so a partial record drops the fields it omits, and a resolved value that is not an object (a
272
+ * bare primary key string, for instance) fails the assignment and is stored in `state.error`.
273
+ */
274
+ export type CrudResponse = import("../utils/cancellablePromise.js").MaybeCancellablePromise<object>;
275
+ /**
276
+ * -
277
+ * The value returned by an object CRUD handler whose resolved value is ignored: delete, and executeAction. A
278
+ * possibly-cancellable promise whose resolution signals success and nothing more, so it may resolve a record, a
279
+ * primary key string, or nothing at all.
280
+ */
281
+ export type CrudCompletionResponse = import("../utils/cancellablePromise.js").MaybeCancellablePromise<object | string | void>;
282
+ /**
283
+ * Signature for the handler that creates an object in the backing store.
284
+ */
213
285
  export type CrudCreateFn = (args: CreateArgs) => CrudResponse;
286
+ /**
287
+ * Signature for the handler that retrieves an object from the backing store.
288
+ */
214
289
  export type CrudRetrieveFn = (args: RetrieveArgs) => CrudResponse;
290
+ /**
291
+ * Signature for the handler that updates an object in the backing store.
292
+ */
215
293
  export type CrudUpdateFn = (args: UpdateArgs) => CrudResponse;
294
+ /**
295
+ * Signature for the handler that partially updates (patches) an object in the backing store.
296
+ */
216
297
  export type CrudPatchFn = (args: PartialArgs) => CrudResponse;
217
- export type CrudDeleteFn = (args: DeleteArgs) => CrudResponse;
218
- export type CrudObjectExecuteActionFn = (args: ObjectExecuteActionArgs) => CrudResponse;
298
+ /**
299
+ * Signature for the handler that deletes an object from the backing store.
300
+ */
301
+ export type CrudDeleteFn = (args: DeleteArgs) => CrudCompletionResponse;
302
+ /**
303
+ * Signature for the handler that executes an action on a single object in the backing store.
304
+ */
305
+ export type CrudObjectExecuteActionFn = (args: ObjectExecuteActionArgs) => CrudCompletionResponse;
306
+ /**
307
+ * Signature for the handler that subscribes to changes on a single object in the backing store.
308
+ */
219
309
  export type CrudObjectSubscribeFn = (args: ObjectSubscribeArgs) => import("../utils/cancellablePromise.js").CancellablePromise<void>;
220
310
  /**
221
311
  * Defines the CRUD-related handlers and additional utilities provided by the object instance.
222
312
  */
223
313
  export type ObjectCrudHandlers = {
224
314
  /**
225
- * - A function to be used instead of the default crud create function.
315
+ * A function to be used instead of the default crud create function.
226
316
  */
227
317
  create?: CrudCreateFn;
228
318
  /**
229
- * - A function to be used instead of the default crud retrieve function.
319
+ * A function to be used instead of the default crud retrieve function.
230
320
  */
231
321
  retrieve?: CrudRetrieveFn;
232
322
  /**
233
- * - A function to be used instead of the default crud update function.
323
+ * A function to be used instead of the default crud update function.
234
324
  */
235
325
  update?: CrudUpdateFn;
236
326
  /**
237
- * - A function to be used instead of the default crud delete function.
327
+ * A function to be used instead of the default crud delete function.
238
328
  */
239
329
  delete?: CrudDeleteFn;
240
330
  /**
241
- * - A function to be used instead of the default crud patch function.
331
+ * A function to be used instead of the default crud patch function.
242
332
  */
243
333
  patch?: CrudPatchFn;
244
334
  /**
245
- * - A function to be used instead of the default crud subscribe function.
335
+ * A function to be used instead of the default crud subscribe function.
246
336
  */
247
337
  subscribe?: CrudObjectSubscribeFn;
248
338
  /**
249
- * - The function to execute a certain action on an object.
339
+ * The function to execute a certain action on an object.
250
340
  */
251
341
  executeAction?: CrudObjectExecuteActionFn;
252
342
  };
@@ -0,0 +1,60 @@
1
+ export namespace benchmarkOptions {
2
+ let iterations: number;
3
+ let time: number;
4
+ let warmupIterations: number;
5
+ let warmupTime: number;
6
+ }
7
+ export function makeRows(count: number, start?: number): {
8
+ id: number;
9
+ name: string;
10
+ }[];
11
+ export function makeRichRows(count: number, start?: number): {
12
+ id: number;
13
+ name: string;
14
+ organization: number;
15
+ }[];
16
+ /** Related objects the populated related rule resolves against. */
17
+ export const relatedOrganizations: {
18
+ [k: string]: {
19
+ id: number;
20
+ name: string;
21
+ };
22
+ };
23
+ export namespace emptyRules {
24
+ let allowedFilter: any;
25
+ let calculatedObjectsRules: {};
26
+ let excludedFilter: any;
27
+ let orderByRules: any[];
28
+ let relatedObjectsRules: {};
29
+ let textSearchRules: any[];
30
+ let textSearchValue: string;
31
+ }
32
+ export namespace populatedRules {
33
+ export function allowedFilter_1(object: any): boolean;
34
+ export { allowedFilter_1 as allowedFilter };
35
+ export namespace calculatedObjectsRules_1 {
36
+ function doubled(object: any): number;
37
+ }
38
+ export { calculatedObjectsRules_1 as calculatedObjectsRules };
39
+ let excludedFilter_1: any;
40
+ export { excludedFilter_1 as excludedFilter };
41
+ let orderByRules_1: {
42
+ key: string;
43
+ desc: boolean;
44
+ localeCompare: boolean;
45
+ }[];
46
+ export { orderByRules_1 as orderByRules };
47
+ export namespace relatedObjectsRules_1 {
48
+ namespace org {
49
+ export let pkKey: string;
50
+ export { relatedOrganizations as objects };
51
+ }
52
+ }
53
+ export { relatedObjectsRules_1 as relatedObjectsRules };
54
+ let textSearchRules_1: any[];
55
+ export { textSearchRules_1 as textSearchRules };
56
+ let textSearchValue_1: string;
57
+ export { textSearchValue_1 as textSearchValue };
58
+ }
59
+ export function makeList(rules?: object): ReturnType<typeof useList>;
60
+ import { useList } from "../../use/list.js";
@@ -0,0 +1 @@
1
+ export {};
@@ -0,0 +1 @@
1
+ export {};
@@ -0,0 +1 @@
1
+ export {};
@@ -0,0 +1 @@
1
+ export {};
@@ -0,0 +1 @@
1
+ export {};