@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.
- package/LICENSE +28 -0
- package/README.md +109 -21
- package/config/commonCrud.js +7 -10
- package/config/listCrud.js +33 -33
- package/config/objectCrud.js +64 -59
- package/package.json +103 -89
- package/types/config/listCrud.d.ts +83 -28
- package/types/config/objectCrud.d.ts +139 -49
- package/types/tests/benchmarks/fixtures.d.ts +60 -0
- package/types/tests/benchmarks/listLayers.bench.d.ts +1 -0
- package/types/tests/benchmarks/listPush.bench.d.ts +1 -0
- package/types/tests/benchmarks/listStream.bench.d.ts +1 -0
- package/types/tests/unit/use/lifecycleCleanup.spec.d.ts +1 -0
- package/types/tests/unit/use/listPerformance.spec.d.ts +1 -0
- package/types/tests/unit/utils/cancellablePromise.spec.d.ts +1 -0
- package/types/use/cancellableIntent.d.ts +36 -33
- package/types/use/combineClasses.d.ts +5 -2
- package/types/use/error.d.ts +39 -19
- package/types/use/list.d.ts +27 -26
- package/types/use/listCalculated.d.ts +38 -55
- package/types/use/listFilter.d.ts +25 -33
- package/types/use/listInstance.d.ts +94 -81
- package/types/use/listRelated.d.ts +37 -57
- package/types/use/listSearch.d.ts +54 -52
- package/types/use/listSort.d.ts +31 -40
- package/types/use/listSubscription.d.ts +33 -36
- 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 +46 -39
- package/types/use/objectInstance.d.ts +70 -74
- package/types/use/objectRelated.d.ts +51 -41
- package/types/use/objectSubscription.d.ts +38 -48
- 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/cancellableFetch.d.ts +2 -3
- package/types/utils/cancellablePromise.d.ts +42 -8
- package/types/utils/classes.d.ts +7 -1
- package/types/utils/deepUnref.d.ts +1 -1
- package/types/utils/getFakePk.d.ts +2 -2
- 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 +36 -9
- package/use/combineClasses.js +2 -2
- package/use/error.js +10 -14
- package/use/list.js +6 -18
- package/use/listCalculated.js +28 -38
- package/use/listFilter.js +12 -24
- package/use/listInstance.js +101 -60
- package/use/listRelated.js +18 -37
- package/use/listSearch.js +9 -18
- package/use/listSort.js +95 -64
- package/use/listSubscription.js +19 -25
- package/use/loading.js +5 -7
- package/use/loadingError.js +3 -3
- package/use/object.js +14 -27
- package/use/objectCalculated.js +21 -25
- package/use/objectInstance.js +55 -50
- package/use/objectRelated.js +19 -25
- package/use/objectSubscription.js +18 -30
- package/use/proxyError.js +10 -10
- package/use/proxyLoading.js +5 -5
- package/use/proxyLoadingError.js +13 -8
- package/use/search.js +5 -11
- package/utils/assignReactiveObject.js +3 -3
- package/utils/cancellableFetch.js +3 -3
- package/utils/cancellablePromise.js +25 -8
- package/utils/classes.js +2 -2
- package/utils/deepUnref.js +1 -5
- package/utils/getFakePk.js +2 -2
- package/utils/isReactiveTyped.js +2 -0
- package/utils/keyDiff.js +1 -3
- package/utils/relatedCalculatedHelpers.js +2 -0
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -22,9 +22,7 @@
|
|
|
22
22
|
* @typedef {() => boolean} IsCurrentRunFn - A function that checks if the current run ID matches the last run ID.
|
|
23
23
|
*/
|
|
24
24
|
/**
|
|
25
|
-
* The common run tracking arguments.
|
|
26
|
-
*
|
|
27
|
-
* @typedef {object} CommonRunTracking
|
|
25
|
+
* @typedef {object} CommonRunTracking - The common run tracking arguments.
|
|
28
26
|
* @property {RunId} runId - The unique identifier for your run.
|
|
29
27
|
* @property {IsCurrentRunFn} isCurrentRun - A function that checks if the current run ID matches your run ID.
|
|
30
28
|
*/
|
|
@@ -42,9 +40,7 @@
|
|
|
42
40
|
* @property {boolean} [clearActiveOnResolved=true] - Whether to clear the active state when the promise resolves.
|
|
43
41
|
*/
|
|
44
42
|
/**
|
|
45
|
-
* Cancel function signature for cancellable intent.
|
|
46
|
-
*
|
|
47
|
-
* @typedef {Function} CancelFn
|
|
43
|
+
* @typedef {Function} CancelFn - Cancel function signature for cancellable intent.
|
|
48
44
|
* @param {any} reason - The reason for cancellation.
|
|
49
45
|
* @param {boolean} [forceClearActive=false] - Whether to force clear the active state.
|
|
50
46
|
* @returns {Promise<void>} - A promise that resolves when the cancellation is complete.
|
|
@@ -61,12 +57,19 @@
|
|
|
61
57
|
/**
|
|
62
58
|
* Calls your awaitable function with the arguments you pass in when the watch arguments change and are all truthy.
|
|
63
59
|
* Watch arguments should be a reactive object.
|
|
64
|
-
*
|
|
60
|
+
*
|
|
61
|
+
* If the watch arguments change again before the promise resolves, the in-flight promise is cancelled only when it
|
|
62
|
+
* carries a `cancel` method (a `MaybeCancellablePromise`); a plain promise is left to run to completion. That
|
|
63
|
+
* distinction is visible through the composables built on this one. `useObjectSubscription` calls
|
|
64
|
+
* `objectInstance.retrieve()` again for the new key, and that call returns the promise already in flight for the
|
|
65
|
+
* previous key, so the stale record is assigned and the new key is never fetched. `useListSubscription` guards its
|
|
66
|
+
* list intent on the list's own loading state, so the superseded run is left to finish and the list is then listed
|
|
67
|
+
* again with the current arguments.
|
|
65
68
|
*
|
|
66
69
|
* @example
|
|
67
70
|
* ```vue
|
|
68
71
|
* <script setup>
|
|
69
|
-
* import { useCancellableIntent } from "@
|
|
72
|
+
* import { useCancellableIntent } from "@arrai-innovations/reactive-helpers";
|
|
70
73
|
* import { ref, computed, onMounted, onUnmounted } from "vue";
|
|
71
74
|
*
|
|
72
75
|
* const myValue = ref(0);
|
|
@@ -114,50 +117,50 @@ export class CancellableIntentError extends Error {
|
|
|
114
117
|
code: string;
|
|
115
118
|
}
|
|
116
119
|
/**
|
|
117
|
-
*
|
|
120
|
+
* A unique identifier for a single execution ("run") of an intent.
|
|
118
121
|
* This is incremented each time `watchArguments` change and the intent re-triggers.
|
|
119
122
|
* Enables distinguishing results or effects from overlapping async runs.
|
|
120
123
|
*/
|
|
121
124
|
export type RunId = number;
|
|
122
125
|
/**
|
|
123
|
-
*
|
|
126
|
+
* The raw state of the cancellable intent.
|
|
124
127
|
*/
|
|
125
128
|
export type CancellableIntentMyState = {
|
|
126
129
|
/**
|
|
127
|
-
*
|
|
130
|
+
* Whether there are active intents.
|
|
128
131
|
*/
|
|
129
132
|
active: import("vue").ComputedRef<boolean> | undefined;
|
|
130
133
|
/**
|
|
131
|
-
*
|
|
134
|
+
* Whether there are resolving intents.
|
|
132
135
|
*/
|
|
133
136
|
resolving: import("vue").ComputedRef<boolean> | undefined;
|
|
134
137
|
/**
|
|
135
|
-
*
|
|
138
|
+
* Whether to clear the active state when the promise resolves.
|
|
136
139
|
*/
|
|
137
140
|
clearActiveOnResolved: boolean;
|
|
138
141
|
/**
|
|
139
|
-
*
|
|
142
|
+
* The most recent run ID issued for a triggered intent. Useful for associating async results with their originating trigger.
|
|
140
143
|
*/
|
|
141
144
|
lastRunId: RunId | null;
|
|
142
145
|
/**
|
|
143
|
-
*
|
|
146
|
+
* The watch arguments.
|
|
144
147
|
*/
|
|
145
148
|
watchArguments: import("vue").DeepReadonly<object>;
|
|
146
149
|
/**
|
|
147
|
-
*
|
|
150
|
+
* The guard arguments.
|
|
148
151
|
*/
|
|
149
152
|
guardArguments: import("vue").DeepReadonly<object>;
|
|
150
153
|
};
|
|
151
154
|
/**
|
|
152
|
-
*
|
|
155
|
+
* The raw state of the cancellable intent.
|
|
153
156
|
*/
|
|
154
157
|
export type CancellableIntentRawState = CancellableIntentMyState & import("./error.js").ErrorProperties;
|
|
155
158
|
/**
|
|
156
|
-
*
|
|
159
|
+
* The state of the cancellable intent.
|
|
157
160
|
*/
|
|
158
161
|
export type CancellableIntentState = import("vue").Reactive<CancellableIntentRawState>;
|
|
159
162
|
/**
|
|
160
|
-
*
|
|
163
|
+
* A function that checks if the current run ID matches the last run ID.
|
|
161
164
|
*/
|
|
162
165
|
export type IsCurrentRunFn = () => boolean;
|
|
163
166
|
/**
|
|
@@ -165,42 +168,42 @@ export type IsCurrentRunFn = () => boolean;
|
|
|
165
168
|
*/
|
|
166
169
|
export type CommonRunTracking = {
|
|
167
170
|
/**
|
|
168
|
-
*
|
|
171
|
+
* The unique identifier for your run.
|
|
169
172
|
*/
|
|
170
173
|
runId: RunId;
|
|
171
174
|
/**
|
|
172
|
-
*
|
|
175
|
+
* A function that checks if the current run ID matches your run ID.
|
|
173
176
|
*/
|
|
174
177
|
isCurrentRun: IsCurrentRunFn;
|
|
175
178
|
};
|
|
176
179
|
/**
|
|
177
|
-
*
|
|
180
|
+
* A function that returns a promise that can be cancelled. The return value of the promise is not used.
|
|
178
181
|
*/
|
|
179
182
|
export type AwaitableWithCancel = (runTracking: CommonRunTracking) => import("../utils/cancellablePromise.js").MaybeCancellablePromise<unknown>;
|
|
180
183
|
/**
|
|
181
|
-
*
|
|
184
|
+
* The reactive object to watch for changes.
|
|
182
185
|
*/
|
|
183
186
|
export type WatchGuardArguments = import("vue").UnwrapNestedRefs<object> | {
|
|
184
187
|
[key: string]: import("vue").Ref<any>;
|
|
185
188
|
};
|
|
186
189
|
/**
|
|
187
|
-
*
|
|
190
|
+
* The options for the cancellable intent.
|
|
188
191
|
*/
|
|
189
192
|
export type CancellableIntentOptions = {
|
|
190
193
|
/**
|
|
191
|
-
*
|
|
194
|
+
* The function that returns a promise that can be cancelled. Receives the run ID as an argument.
|
|
192
195
|
*/
|
|
193
196
|
awaitableWithCancel: AwaitableWithCancel;
|
|
194
197
|
/**
|
|
195
|
-
*
|
|
198
|
+
* The reactive object to watch for changes.
|
|
196
199
|
*/
|
|
197
200
|
watchArguments?: WatchGuardArguments;
|
|
198
201
|
/**
|
|
199
|
-
*
|
|
202
|
+
* The reactive object to watch for truthiness before running the intent.
|
|
200
203
|
*/
|
|
201
204
|
guardArguments?: WatchGuardArguments;
|
|
202
205
|
/**
|
|
203
|
-
*
|
|
206
|
+
* Whether to clear the active state when the promise resolves.
|
|
204
207
|
*/
|
|
205
208
|
clearActiveOnResolved?: boolean;
|
|
206
209
|
};
|
|
@@ -209,23 +212,23 @@ export type CancellableIntentOptions = {
|
|
|
209
212
|
*/
|
|
210
213
|
export type CancelFn = Function;
|
|
211
214
|
/**
|
|
212
|
-
*
|
|
215
|
+
* The instance of the cancellable intent.
|
|
213
216
|
*/
|
|
214
217
|
export type MyCancellableIntent = {
|
|
215
218
|
/**
|
|
216
|
-
*
|
|
219
|
+
* The state of the cancellable intent.
|
|
217
220
|
*/
|
|
218
221
|
state: CancellableIntentState;
|
|
219
222
|
/**
|
|
220
|
-
*
|
|
223
|
+
* Stop the cancellable intent.
|
|
221
224
|
*/
|
|
222
225
|
stop: () => void;
|
|
223
226
|
/**
|
|
224
|
-
*
|
|
227
|
+
* Cancel the cancellable intent.
|
|
225
228
|
*/
|
|
226
229
|
cancel: CancelFn;
|
|
227
230
|
};
|
|
228
231
|
/**
|
|
229
|
-
*
|
|
232
|
+
* The instance of the cancellable intent.
|
|
230
233
|
*/
|
|
231
234
|
export type CancellableIntent = MyCancellableIntent & import("./error.js").ErrorReadOnlyFunctions;
|
|
@@ -4,7 +4,7 @@
|
|
|
4
4
|
* string[] |
|
|
5
5
|
* { [key: string]: boolean | import("vue").Ref<boolean> } |
|
|
6
6
|
* import("vue").Ref<string | string[]>
|
|
7
|
-
* )} CSSClasses
|
|
7
|
+
* )} CSSClasses - The accepted ways of specifying CSS classes to useCombineClasses (a string, array, class-map, or ref thereof).
|
|
8
8
|
*/
|
|
9
9
|
/**
|
|
10
10
|
* Normalize various ways of specifying CSS classes into an object for use in Vue.js with reactivity. If refs are
|
|
@@ -14,7 +14,7 @@
|
|
|
14
14
|
* @example
|
|
15
15
|
* ```vue
|
|
16
16
|
* <script setup>
|
|
17
|
-
* import { useCombineClasses } from "@
|
|
17
|
+
* import { useCombineClasses } from "@arrai-innovations/reactive-helpers";
|
|
18
18
|
* import { ref } from "vue";
|
|
19
19
|
* const myClasses = useCombineClasses(
|
|
20
20
|
* "class1",
|
|
@@ -37,6 +37,9 @@
|
|
|
37
37
|
* preserve order of operations in reactive contexts.
|
|
38
38
|
*/
|
|
39
39
|
export function useCombineClasses(...classes: (CSSClasses)[]): import("vue").Ref<import("../utils/classes.js").CombinedClasses>;
|
|
40
|
+
/**
|
|
41
|
+
* The accepted ways of specifying CSS classes to useCombineClasses (a string, array, class-map, or ref thereof).
|
|
42
|
+
*/
|
|
40
43
|
export type CSSClasses = (string | string[] | {
|
|
41
44
|
[key: string]: boolean | import("vue").Ref<boolean>;
|
|
42
45
|
} | import("vue").Ref<string | string[]>);
|
package/types/use/error.d.ts
CHANGED
|
@@ -1,33 +1,29 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* @typedef {() => void} ClearErrorFn
|
|
3
|
-
* @typedef {import("vue").Ref<Error|null>} ErrorRef
|
|
4
|
-
* @typedef {import("vue").Ref<boolean>} ErroredRef
|
|
5
|
-
* @typedef {Readonly<ErrorRef>} ErrorReadonlyRef
|
|
6
|
-
* @typedef {Readonly<ErroredRef>} ErroredReadonlyRef
|
|
2
|
+
* @typedef {() => void} ClearErrorFn - Signature for the function that clears the current error state.
|
|
3
|
+
* @typedef {import("vue").Ref<Error|null>} ErrorRef - A Vue ref holding the current error, or null when there is none.
|
|
4
|
+
* @typedef {import("vue").Ref<boolean>} ErroredRef - A Vue ref to the boolean indicating whether an error has occurred.
|
|
5
|
+
* @typedef {Readonly<ErrorRef>} ErrorReadonlyRef - A readonly Vue ref holding the current error, or null when there is none.
|
|
6
|
+
* @typedef {Readonly<ErroredRef>} ErroredReadonlyRef - A readonly Vue ref to the boolean indicating whether an error has occurred.
|
|
7
7
|
*/
|
|
8
8
|
/**
|
|
9
|
-
* @typedef {object} ErrorProperties
|
|
9
|
+
* @typedef {object} ErrorProperties - The reactive error-state members (error and errored) contributed by the useError composable.
|
|
10
10
|
* @property {ErrorReadonlyRef} error - The error that occurred.
|
|
11
11
|
* @property {ErroredReadonlyRef} errored - Whether an error has occurred.
|
|
12
12
|
*/
|
|
13
13
|
/**
|
|
14
|
-
* @typedef {object} ErrorFunctions
|
|
14
|
+
* @typedef {object} ErrorFunctions - The error-state actions (setError, clearError) contributed by the useError composable.
|
|
15
15
|
* @property {(error: Error) => void} setError - Set the error state.
|
|
16
16
|
* @property {ClearErrorFn} clearError - Clear the error state.
|
|
17
17
|
*/
|
|
18
18
|
/**
|
|
19
|
-
* Proxies can still clear errors but cannot set them directly.
|
|
20
|
-
*
|
|
21
|
-
* @typedef {object} ErrorReadOnlyFunctions
|
|
19
|
+
* @typedef {object} ErrorReadOnlyFunctions - Proxies can still clear errors but cannot set them directly.
|
|
22
20
|
* @property {ClearErrorFn} clearError - Clear the error state.
|
|
23
21
|
*/
|
|
24
22
|
/**
|
|
25
|
-
* @typedef {ErrorProperties & ErrorReadOnlyFunctions} ReadonlyErrorStatus
|
|
23
|
+
* @typedef {ErrorProperties & ErrorReadOnlyFunctions} ReadonlyErrorStatus - The readonly error-state API (error and errored plus clearError) exposed to consumers and proxies.
|
|
26
24
|
*/
|
|
27
25
|
/**
|
|
28
|
-
* The error state API.
|
|
29
|
-
*
|
|
30
|
-
* @typedef {ErrorProperties & ErrorFunctions} ErrorStatus
|
|
26
|
+
* @typedef {ErrorProperties & ErrorFunctions} ErrorStatus - The error state API.
|
|
31
27
|
*/
|
|
32
28
|
/**
|
|
33
29
|
* A composable function for managing error state.
|
|
@@ -35,28 +31,49 @@
|
|
|
35
31
|
* @returns {ErrorStatus} - An object containing reactive fields and actions for error state.
|
|
36
32
|
*/
|
|
37
33
|
export function useError(): ErrorStatus;
|
|
34
|
+
/**
|
|
35
|
+
* Signature for the function that clears the current error state.
|
|
36
|
+
*/
|
|
38
37
|
export type ClearErrorFn = () => void;
|
|
38
|
+
/**
|
|
39
|
+
* A Vue ref holding the current error, or null when there is none.
|
|
40
|
+
*/
|
|
39
41
|
export type ErrorRef = import("vue").Ref<Error | null>;
|
|
42
|
+
/**
|
|
43
|
+
* A Vue ref to the boolean indicating whether an error has occurred.
|
|
44
|
+
*/
|
|
40
45
|
export type ErroredRef = import("vue").Ref<boolean>;
|
|
46
|
+
/**
|
|
47
|
+
* A readonly Vue ref holding the current error, or null when there is none.
|
|
48
|
+
*/
|
|
41
49
|
export type ErrorReadonlyRef = Readonly<ErrorRef>;
|
|
50
|
+
/**
|
|
51
|
+
* A readonly Vue ref to the boolean indicating whether an error has occurred.
|
|
52
|
+
*/
|
|
42
53
|
export type ErroredReadonlyRef = Readonly<ErroredRef>;
|
|
54
|
+
/**
|
|
55
|
+
* The reactive error-state members (error and errored) contributed by the useError composable.
|
|
56
|
+
*/
|
|
43
57
|
export type ErrorProperties = {
|
|
44
58
|
/**
|
|
45
|
-
*
|
|
59
|
+
* The error that occurred.
|
|
46
60
|
*/
|
|
47
61
|
error: ErrorReadonlyRef;
|
|
48
62
|
/**
|
|
49
|
-
*
|
|
63
|
+
* Whether an error has occurred.
|
|
50
64
|
*/
|
|
51
65
|
errored: ErroredReadonlyRef;
|
|
52
66
|
};
|
|
67
|
+
/**
|
|
68
|
+
* The error-state actions (setError, clearError) contributed by the useError composable.
|
|
69
|
+
*/
|
|
53
70
|
export type ErrorFunctions = {
|
|
54
71
|
/**
|
|
55
|
-
*
|
|
72
|
+
* Set the error state.
|
|
56
73
|
*/
|
|
57
74
|
setError: (error: Error) => void;
|
|
58
75
|
/**
|
|
59
|
-
*
|
|
76
|
+
* Clear the error state.
|
|
60
77
|
*/
|
|
61
78
|
clearError: ClearErrorFn;
|
|
62
79
|
};
|
|
@@ -65,10 +82,13 @@ export type ErrorFunctions = {
|
|
|
65
82
|
*/
|
|
66
83
|
export type ErrorReadOnlyFunctions = {
|
|
67
84
|
/**
|
|
68
|
-
*
|
|
85
|
+
* Clear the error state.
|
|
69
86
|
*/
|
|
70
87
|
clearError: ClearErrorFn;
|
|
71
88
|
};
|
|
89
|
+
/**
|
|
90
|
+
* The readonly error-state API (error and errored plus clearError) exposed to consumers and proxies.
|
|
91
|
+
*/
|
|
72
92
|
export type ReadonlyErrorStatus = ErrorProperties & ErrorReadOnlyFunctions;
|
|
73
93
|
/**
|
|
74
94
|
* The error state API.
|
package/types/use/list.d.ts
CHANGED
|
@@ -30,81 +30,84 @@ export function useList({ props, handlers, searchThrottle, sortThrottleWait, sea
|
|
|
30
30
|
*/
|
|
31
31
|
export type ListRawProps = {
|
|
32
32
|
/**
|
|
33
|
-
*
|
|
33
|
+
* The arguments to pass to the registered list crud handlers, related to the list itself.
|
|
34
34
|
*/
|
|
35
35
|
params: object;
|
|
36
36
|
/**
|
|
37
|
-
*
|
|
37
|
+
* The primary key for the list items.
|
|
38
38
|
*/
|
|
39
39
|
pkKey: string;
|
|
40
40
|
/**
|
|
41
|
-
*
|
|
41
|
+
* General arguments to pass to the registered list crud handlers, often related to endpoints.
|
|
42
42
|
*/
|
|
43
43
|
target: object;
|
|
44
44
|
/**
|
|
45
|
-
*
|
|
45
|
+
* Indicates whether the list should be fetched immediately.
|
|
46
46
|
*/
|
|
47
47
|
intendToList: boolean;
|
|
48
48
|
/**
|
|
49
|
-
*
|
|
49
|
+
* Indicates whether changes to the list should be subscribed to.
|
|
50
50
|
*/
|
|
51
51
|
intendToSubscribe: boolean;
|
|
52
52
|
/**
|
|
53
|
-
*
|
|
53
|
+
* Defines rules for associating related objects with list items.
|
|
54
54
|
*/
|
|
55
55
|
relatedObjectsRules: import("./listRelated.js").ListRelatedRules;
|
|
56
56
|
/**
|
|
57
|
-
*
|
|
57
|
+
* Defines rules for dynamically calculating properties of list items.
|
|
58
58
|
*/
|
|
59
59
|
calculatedObjectsRules: import("./listCalculated.js").ListCalculatedRules;
|
|
60
60
|
/**
|
|
61
|
-
*
|
|
61
|
+
* Function or rule to determine if an item should be included based on inclusion criteria.
|
|
62
62
|
*/
|
|
63
63
|
allowedFilter: import("./listFilter.js").ListFilterAllowedFilter;
|
|
64
64
|
/**
|
|
65
|
-
*
|
|
65
|
+
* Function or rule to determine if an item should be excluded based on exclusion criteria.
|
|
66
66
|
*/
|
|
67
67
|
excludedFilter: import("./listFilter.js").ListFilterExcludedFilter;
|
|
68
68
|
/**
|
|
69
|
-
*
|
|
69
|
+
* Defines the properties and conditions used to filter the list via text search.
|
|
70
70
|
*/
|
|
71
71
|
textSearchRules: import("./listSearch.js").TextSearchRules;
|
|
72
72
|
/**
|
|
73
|
-
*
|
|
73
|
+
* Current text query used for filtering the list.
|
|
74
74
|
*/
|
|
75
75
|
textSearchValue: string;
|
|
76
76
|
/**
|
|
77
|
-
*
|
|
77
|
+
* FlexSearch document configuration options for advanced searching capabilities.
|
|
78
78
|
*/
|
|
79
79
|
customDocumentOptions: object;
|
|
80
80
|
/**
|
|
81
|
-
*
|
|
81
|
+
* Additional search options for FlexSearch.
|
|
82
82
|
*/
|
|
83
83
|
customSearchOptions: object;
|
|
84
84
|
/**
|
|
85
|
-
*
|
|
85
|
+
* Sorting rules that define the order of list items.
|
|
86
86
|
*/
|
|
87
87
|
orderByRules: import("./listSort.js").OrderByRule[];
|
|
88
88
|
};
|
|
89
|
+
/**
|
|
90
|
+
* The configuration options used to create a fully managed list via useList.
|
|
91
|
+
*/
|
|
89
92
|
export type ListOptions = {
|
|
90
93
|
/**
|
|
91
|
-
*
|
|
94
|
+
* The properties for configuring the list.
|
|
92
95
|
*/
|
|
93
96
|
props: ListRawProps;
|
|
94
97
|
/**
|
|
95
|
-
*
|
|
98
|
+
* Additional handlers to be included in the list manager.
|
|
96
99
|
*/
|
|
97
100
|
handlers?: import("../config/listCrud.js").ListCrudHandlers;
|
|
98
101
|
/**
|
|
99
|
-
*
|
|
102
|
+
* The throttle time for text search.
|
|
100
103
|
*/
|
|
101
104
|
searchThrottle?: number;
|
|
102
105
|
/**
|
|
103
|
-
*
|
|
106
|
+
* The throttle time for sorting.
|
|
104
107
|
*/
|
|
105
108
|
sortThrottleWait?: number;
|
|
106
109
|
/**
|
|
107
|
-
*
|
|
110
|
+
* Indicates whether all items should be shown when the search query is empty.
|
|
108
111
|
*/
|
|
109
112
|
searchShowAllWhenEmpty?: boolean;
|
|
110
113
|
};
|
|
@@ -125,25 +128,23 @@ export type ListManaged = {
|
|
|
125
128
|
*/
|
|
126
129
|
export type ListFunctions = (import("./listInstance.js").ListInstanceFunctions & import("./listSubscription.js").ListSubscriptionFunctions);
|
|
127
130
|
/**
|
|
128
|
-
* Encapsulates properties relevant to the overall management of list-related hooks, including state, direct access to hooks,
|
|
129
|
-
* and scoped effects.
|
|
131
|
+
* Encapsulates properties relevant to the overall management of list-related hooks, including state, direct access to hooks, and scoped effects.
|
|
130
132
|
*/
|
|
131
133
|
export type ListManagerProperties = {
|
|
132
134
|
/**
|
|
133
|
-
*
|
|
135
|
+
* A readonly reference to the managed list hooks.
|
|
134
136
|
*/
|
|
135
137
|
managed: ListManaged;
|
|
136
138
|
/**
|
|
137
|
-
*
|
|
139
|
+
* Represents the final reactive state in the list processing chain.
|
|
138
140
|
*/
|
|
139
141
|
state: import("./listSort.js").ListSortState;
|
|
140
142
|
/**
|
|
141
|
-
*
|
|
143
|
+
* A function to stop the effect scope and clean up resources.
|
|
142
144
|
*/
|
|
143
145
|
stop: () => void;
|
|
144
146
|
};
|
|
145
147
|
/**
|
|
146
|
-
* Combines functionality and properties to represent a fully managed list instance,
|
|
147
|
-
* orchestrating various functionalities such as sorting, searching, filtering, and state management.
|
|
148
|
+
* Combines functionality and properties to represent a fully managed list instance, orchestrating various functionalities such as sorting, searching, filtering, and state management.
|
|
148
149
|
*/
|
|
149
150
|
export type ListManager = ListFunctions & ListManagerProperties;
|