@arrai-innovations/reactive-helpers 18.0.0 → 18.0.2
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/package.json +20 -6
- package/types/config/listCrud.d.ts +153 -0
- package/types/config/listCrud.d.ts.map +1 -0
- package/types/config/objectCrud.d.ts +171 -0
- package/types/config/objectCrud.d.ts.map +1 -0
- package/types/index.d.ts +37 -0
- package/types/index.d.ts.map +1 -0
- package/types/tests/unit/config/listCrud.spec.d.ts +2 -0
- package/types/tests/unit/config/listCrud.spec.d.ts.map +1 -0
- package/types/tests/unit/config/objectCrud.spec.d.ts +2 -0
- package/types/tests/unit/config/objectCrud.spec.d.ts.map +1 -0
- package/types/tests/unit/crudPromise.d.ts +25 -0
- package/types/tests/unit/crudPromise.d.ts.map +1 -0
- package/types/tests/unit/expectHelpers.d.ts +2 -0
- package/types/tests/unit/expectHelpers.d.ts.map +1 -0
- package/types/tests/unit/mockOnUnmounted.d.ts +2 -0
- package/types/tests/unit/mockOnUnmounted.d.ts.map +1 -0
- package/types/tests/unit/poll.d.ts +2 -0
- package/types/tests/unit/poll.d.ts.map +1 -0
- package/types/tests/unit/use/cancellableIntent.spec.d.ts +2 -0
- package/types/tests/unit/use/cancellableIntent.spec.d.ts.map +1 -0
- package/types/tests/unit/use/listCalculated.spec.d.ts +2 -0
- package/types/tests/unit/use/listCalculated.spec.d.ts.map +1 -0
- package/types/tests/unit/use/listFilter.spec.d.ts +2 -0
- package/types/tests/unit/use/listFilter.spec.d.ts.map +1 -0
- package/types/tests/unit/use/listInstance.spec.d.ts +2 -0
- package/types/tests/unit/use/listInstance.spec.d.ts.map +1 -0
- package/types/tests/unit/use/listRelated.spec.d.ts +2 -0
- package/types/tests/unit/use/listRelated.spec.d.ts.map +1 -0
- package/types/tests/unit/use/listSearch.spec.d.ts +2 -0
- package/types/tests/unit/use/listSearch.spec.d.ts.map +1 -0
- package/types/tests/unit/use/listSort.spec.d.ts +2 -0
- package/types/tests/unit/use/listSort.spec.d.ts.map +1 -0
- package/types/tests/unit/use/listSubscription.spec.d.ts +2 -0
- package/types/tests/unit/use/listSubscription.spec.d.ts.map +1 -0
- package/types/tests/unit/use/loadingError.spec.d.ts +2 -0
- package/types/tests/unit/use/loadingError.spec.d.ts.map +1 -0
- package/types/tests/unit/use/objectInstance.spec.d.ts +2 -0
- package/types/tests/unit/use/objectInstance.spec.d.ts.map +1 -0
- package/types/tests/unit/use/objectSubscription.spec.d.ts +2 -0
- package/types/tests/unit/use/objectSubscription.spec.d.ts.map +1 -0
- package/types/tests/unit/use/proxyLoadingError.spec.d.ts +2 -0
- package/types/tests/unit/use/proxyLoadingError.spec.d.ts.map +1 -0
- package/types/tests/unit/use/search.spec.d.ts +2 -0
- package/types/tests/unit/use/search.spec.d.ts.map +1 -0
- package/types/tests/unit/utils/assignReactiveObject.spec.d.ts +2 -0
- package/types/tests/unit/utils/assignReactiveObject.spec.d.ts.map +1 -0
- package/types/tests/unit/utils/classes.spec.d.ts +2 -0
- package/types/tests/unit/utils/classes.spec.d.ts.map +1 -0
- package/types/tests/unit/utils/deleteKey.spec.d.ts +2 -0
- package/types/tests/unit/utils/deleteKey.spec.d.ts.map +1 -0
- package/types/tests/unit/utils/flattenPaths.spec.d.ts +2 -0
- package/types/tests/unit/utils/flattenPaths.spec.d.ts.map +1 -0
- package/types/tests/unit/utils/keyDiff.spec.d.ts +2 -0
- package/types/tests/unit/utils/keyDiff.spec.d.ts.map +1 -0
- package/types/tests/unit/utils/set.spec.d.ts +2 -0
- package/types/tests/unit/utils/set.spec.d.ts.map +1 -0
- package/types/tests/unit/utils/watches.spec.d.ts +2 -0
- package/types/tests/unit/utils/watches.spec.d.ts.map +1 -0
- package/types/use/cancellableIntent.d.ts +129 -0
- package/types/use/cancellableIntent.d.ts.map +1 -0
- package/types/use/combineClasses.d.ts +43 -0
- package/types/use/combineClasses.d.ts.map +1 -0
- package/types/use/list.d.ts +176 -0
- package/types/use/list.d.ts.map +1 -0
- package/types/use/listCalculated.d.ts +192 -0
- package/types/use/listCalculated.d.ts.map +1 -0
- package/types/use/listFilter.d.ts +203 -0
- package/types/use/listFilter.d.ts.map +1 -0
- package/types/use/listInstance.d.ts +357 -0
- package/types/use/listInstance.d.ts.map +1 -0
- package/types/use/listKeys.d.ts +15 -0
- package/types/use/listKeys.d.ts.map +1 -0
- package/types/use/listRelated.d.ts +239 -0
- package/types/use/listRelated.d.ts.map +1 -0
- package/types/use/listSearch.d.ts +298 -0
- package/types/use/listSearch.d.ts.map +1 -0
- package/types/use/listSort.d.ts +235 -0
- package/types/use/listSort.d.ts.map +1 -0
- package/types/use/listSubscription.d.ts +218 -0
- package/types/use/listSubscription.d.ts.map +1 -0
- package/types/use/loadingError.d.ts +81 -0
- package/types/use/loadingError.d.ts.map +1 -0
- package/types/use/object.d.ts +67 -0
- package/types/use/object.d.ts.map +1 -0
- package/types/use/objectCalculated.d.ts +215 -0
- package/types/use/objectCalculated.d.ts.map +1 -0
- package/types/use/objectInstance.d.ts +289 -0
- package/types/use/objectInstance.d.ts.map +1 -0
- package/types/use/objectRelated.d.ts +264 -0
- package/types/use/objectRelated.d.ts.map +1 -0
- package/types/use/objectSubscription.d.ts +249 -0
- package/types/use/objectSubscription.d.ts.map +1 -0
- package/types/use/paginatedListInstance.d.ts +51 -0
- package/types/use/paginatedListInstance.d.ts.map +1 -0
- package/types/use/proxyLoadingError.d.ts +36 -0
- package/types/use/proxyLoadingError.d.ts.map +1 -0
- package/types/use/search.d.ts +144 -0
- package/types/use/search.d.ts.map +1 -0
- package/types/use/watchesRunning.d.ts +63 -0
- package/types/use/watchesRunning.d.ts.map +1 -0
- package/types/utils/assignReactiveObject.d.ts +115 -0
- package/types/utils/assignReactiveObject.d.ts.map +1 -0
- package/types/utils/classes.d.ts +22 -0
- package/types/utils/classes.d.ts.map +1 -0
- package/types/utils/compact.d.ts +4 -0
- package/types/utils/compact.d.ts.map +1 -0
- package/types/utils/deleteKey.d.ts +16 -0
- package/types/utils/deleteKey.d.ts.map +1 -0
- package/types/utils/flattenPaths.d.ts +23 -0
- package/types/utils/flattenPaths.d.ts.map +1 -0
- package/types/utils/getFakePk.d.ts +13 -0
- package/types/utils/getFakePk.d.ts.map +1 -0
- package/types/utils/keepAliveTry.d.ts +15 -0
- package/types/utils/keepAliveTry.d.ts.map +1 -0
- package/types/utils/keyDiff.d.ts +63 -0
- package/types/utils/keyDiff.d.ts.map +1 -0
- package/types/utils/loadingCombine.d.ts +9 -0
- package/types/utils/loadingCombine.d.ts.map +1 -0
- package/types/utils/proxyRunning.d.ts +9 -0
- package/types/utils/proxyRunning.d.ts.map +1 -0
- package/types/utils/relatedCalculatedHelpers.d.ts +5 -0
- package/types/utils/relatedCalculatedHelpers.d.ts.map +1 -0
- package/types/utils/set.d.ts +7 -0
- package/types/utils/set.d.ts.map +1 -0
- package/types/utils/transformWalk.d.ts +2 -0
- package/types/utils/transformWalk.d.ts.map +1 -0
- package/types/utils/watches.d.ts +155 -0
- package/types/utils/watches.d.ts.map +1 -0
- package/use/loadingError.js +1 -1
- package/.circleci/config.yml +0 -88
- package/.commitlintrc.json +0 -25
- package/.editorconfig +0 -5
- package/.husky/commit-msg +0 -3
- package/.husky/pre-commit +0 -3
- package/.idea/codeStyles/codeStyleConfig.xml +0 -5
- package/.idea/encodings.xml +0 -6
- package/.idea/inspectionProfiles/Project_Default.xml +0 -7
- package/.idea/modules.xml +0 -8
- package/.idea/prettier.xml +0 -8
- package/.idea/reactive-helpers.iml +0 -15
- package/.prettierignore +0 -5
- package/.prettierrc.cjs +0 -5
- package/.vscode/extensions.json +0 -3
- package/docs/README.md +0 -45
- package/docs/config/listCrud.md +0 -422
- package/docs/config/objectCrud.md +0 -427
- package/docs/use/cancellableIntent.md +0 -165
- package/docs/use/combineClasses.md +0 -62
- package/docs/use/list.md +0 -361
- package/docs/use/listCalculated.md +0 -794
- package/docs/use/listFilter.md +0 -897
- package/docs/use/listInstance.md +0 -559
- package/docs/use/listKeys.md +0 -91
- package/docs/use/listRelated.md +0 -706
- package/docs/use/listSearch.md +0 -903
- package/docs/use/listSort.md +0 -1171
- package/docs/use/listSubscription.md +0 -393
- package/docs/use/loadingError.md +0 -115
- package/docs/use/object.md +0 -668
- package/docs/use/objectCalculated.md +0 -741
- package/docs/use/objectInstance.md +0 -685
- package/docs/use/objectRelated.md +0 -723
- package/docs/use/objectSubscription.md +0 -538
- package/docs/use/paginatedListInstance.md +0 -155
- package/docs/use/proxyLoadingError.md +0 -51
- package/docs/use/search.md +0 -321
- package/docs/use/watchesRunning.md +0 -84
- package/docs/utils/assignReactiveObject.md +0 -413
- package/docs/utils/classes.md +0 -139
- package/docs/utils/compact.md +0 -67
- package/docs/utils/deleteKey.md +0 -61
- package/docs/utils/flattenPaths.md +0 -53
- package/docs/utils/getFakePk.md +0 -39
- package/docs/utils/keepAliveTry.md +0 -59
- package/docs/utils/keyDiff.md +0 -117
- package/docs/utils/loadingCombine.md +0 -30
- package/docs/utils/proxyRunning.md +0 -39
- package/docs/utils/relatedCalculatedHelpers.md +0 -93
- package/docs/utils/set.md +0 -223
- package/docs/utils/transformWalk.md +0 -68
- package/docs/utils/watches.md +0 -489
- package/eslint.config.js +0 -125
- package/lint-staged.config.js +0 -10
- package/makeTypeDoc.sh +0 -25
- package/make_type_doc.js +0 -59
- package/tests/unit/config/listCrud.spec.js +0 -114
- package/tests/unit/config/objectCrud.spec.js +0 -160
- package/tests/unit/crudPromise.js +0 -40
- package/tests/unit/expectHelpers.js +0 -6
- package/tests/unit/mockOnUnmounted.js +0 -9
- package/tests/unit/poll.js +0 -50
- package/tests/unit/use/cancellableIntent.spec.js +0 -152
- package/tests/unit/use/listCalculated.spec.js +0 -135
- package/tests/unit/use/listFilter.spec.js +0 -484
- package/tests/unit/use/listInstance.spec.js +0 -1166
- package/tests/unit/use/listRelated.spec.js +0 -260
- package/tests/unit/use/listSearch.spec.js +0 -586
- package/tests/unit/use/listSort.spec.js +0 -418
- package/tests/unit/use/listSubscription.spec.js +0 -845
- package/tests/unit/use/loadingError.spec.js +0 -43
- package/tests/unit/use/objectInstance.spec.js +0 -1525
- package/tests/unit/use/objectSubscription.spec.js +0 -849
- package/tests/unit/use/proxyLoadingError.spec.js +0 -64
- package/tests/unit/use/search.spec.js +0 -248
- package/tests/unit/utils/assignReactiveObject.spec.js +0 -593
- package/tests/unit/utils/classes.spec.js +0 -427
- package/tests/unit/utils/deleteKey.spec.js +0 -265
- package/tests/unit/utils/flattenPaths.spec.js +0 -126
- package/tests/unit/utils/keyDiff.spec.js +0 -110
- package/tests/unit/utils/set.spec.js +0 -81
- package/tests/unit/utils/watches.spec.js +0 -276
- package/tsconfig.json +0 -19
- package/typedoc-local-plugins/customize-output.js +0 -13
- package/typedoc.json +0 -11
- package/vitest.config.js +0 -11
package/docs/utils/watches.md
DELETED
|
@@ -1,489 +0,0 @@
|
|
|
1
|
-
[**@arrai-innovations/reactive-helpers**](../README.md)
|
|
2
|
-
|
|
3
|
-
***
|
|
4
|
-
|
|
5
|
-
[@arrai-innovations/reactive-helpers](../README.md) / utils/watches
|
|
6
|
-
|
|
7
|
-
# utils/watches
|
|
8
|
-
|
|
9
|
-
## Classes
|
|
10
|
-
|
|
11
|
-
### AwaitNot
|
|
12
|
-
|
|
13
|
-
Manages an asynchronous watch on a property, waiting for it to toggle between true and false states.
|
|
14
|
-
This class uses immediate watchers to react to changes and supports a timeout to limit waiting duration.
|
|
15
|
-
|
|
16
|
-
#### Constructors
|
|
17
|
-
|
|
18
|
-
##### new AwaitNot()
|
|
19
|
-
|
|
20
|
-
> **new AwaitNot**(`options`): [`AwaitNot`](watches.md#awaitnot)
|
|
21
|
-
|
|
22
|
-
Initializes the AwaitNot with specified options for reactive property watching and timeout settings.
|
|
23
|
-
|
|
24
|
-
###### Parameters
|
|
25
|
-
|
|
26
|
-
###### options
|
|
27
|
-
|
|
28
|
-
Configuration options for AwaitNot.
|
|
29
|
-
|
|
30
|
-
###### couldAlreadyBeFalse
|
|
31
|
-
|
|
32
|
-
`boolean` = `false`
|
|
33
|
-
|
|
34
|
-
Indicates if the property could already be in the false state at initialization.
|
|
35
|
-
|
|
36
|
-
###### obj
|
|
37
|
-
|
|
38
|
-
`any`
|
|
39
|
-
|
|
40
|
-
The object containing the property to watch.
|
|
41
|
-
|
|
42
|
-
###### prop
|
|
43
|
-
|
|
44
|
-
`string`
|
|
45
|
-
|
|
46
|
-
The property name to watch within the object.
|
|
47
|
-
|
|
48
|
-
###### ref
|
|
49
|
-
|
|
50
|
-
`Ref`
|
|
51
|
-
|
|
52
|
-
A Vue ref to directly watch if provided.
|
|
53
|
-
|
|
54
|
-
###### timeout
|
|
55
|
-
|
|
56
|
-
`number` = `1000`
|
|
57
|
-
|
|
58
|
-
The timeout in milliseconds before the promise is rejected.
|
|
59
|
-
|
|
60
|
-
###### Returns
|
|
61
|
-
|
|
62
|
-
[`AwaitNot`](watches.md#awaitnot)
|
|
63
|
-
|
|
64
|
-
#### Properties
|
|
65
|
-
|
|
66
|
-
##### couldAlreadyBeFalse
|
|
67
|
-
|
|
68
|
-
> **couldAlreadyBeFalse**: `boolean`
|
|
69
|
-
|
|
70
|
-
##### falseISW
|
|
71
|
-
|
|
72
|
-
> **falseISW**: [`ImmediateStopWatch`](watches.md#immediatestopwatch)
|
|
73
|
-
|
|
74
|
-
##### promise
|
|
75
|
-
|
|
76
|
-
> **promise**: `Promise`\<`any`\>
|
|
77
|
-
|
|
78
|
-
##### ref
|
|
79
|
-
|
|
80
|
-
> **ref**: `Readonly`\<`Ref`\>
|
|
81
|
-
|
|
82
|
-
##### reject()
|
|
83
|
-
|
|
84
|
-
> **reject**: (`reason`?) => `void`
|
|
85
|
-
|
|
86
|
-
###### Parameters
|
|
87
|
-
|
|
88
|
-
###### reason?
|
|
89
|
-
|
|
90
|
-
`any`
|
|
91
|
-
|
|
92
|
-
###### Returns
|
|
93
|
-
|
|
94
|
-
`void`
|
|
95
|
-
|
|
96
|
-
##### resolve()
|
|
97
|
-
|
|
98
|
-
> **resolve**: (`value`) => `void`
|
|
99
|
-
|
|
100
|
-
###### Parameters
|
|
101
|
-
|
|
102
|
-
###### value
|
|
103
|
-
|
|
104
|
-
`any`
|
|
105
|
-
|
|
106
|
-
###### Returns
|
|
107
|
-
|
|
108
|
-
`void`
|
|
109
|
-
|
|
110
|
-
##### timeout
|
|
111
|
-
|
|
112
|
-
> **timeout**: [`AwaitTimeout`](watches.md#awaittimeout)
|
|
113
|
-
|
|
114
|
-
##### timeoutError
|
|
115
|
-
|
|
116
|
-
> **timeoutError**: [`AwaitNotError`](watches.md#awaitnoterror)
|
|
117
|
-
|
|
118
|
-
##### trueISW
|
|
119
|
-
|
|
120
|
-
> **trueISW**: [`ImmediateStopWatch`](watches.md#immediatestopwatch)
|
|
121
|
-
|
|
122
|
-
#### Methods
|
|
123
|
-
|
|
124
|
-
##### start()
|
|
125
|
-
|
|
126
|
-
> **start**(): `void`
|
|
127
|
-
|
|
128
|
-
Starts the process of watching the property for changes between true and false.
|
|
129
|
-
It sets up the necessary watchers and a timeout if specified.
|
|
130
|
-
|
|
131
|
-
###### Returns
|
|
132
|
-
|
|
133
|
-
`void`
|
|
134
|
-
|
|
135
|
-
##### stop()
|
|
136
|
-
|
|
137
|
-
> **stop**(): `void`
|
|
138
|
-
|
|
139
|
-
Stops all watchers and the timeout, cleaning up resources.
|
|
140
|
-
|
|
141
|
-
###### Returns
|
|
142
|
-
|
|
143
|
-
`void`
|
|
144
|
-
|
|
145
|
-
***
|
|
146
|
-
|
|
147
|
-
### AwaitNotError
|
|
148
|
-
|
|
149
|
-
The error thrown when an AwaitNot operation times out.
|
|
150
|
-
|
|
151
|
-
#### Extends
|
|
152
|
-
|
|
153
|
-
- `Error`
|
|
154
|
-
|
|
155
|
-
#### Constructors
|
|
156
|
-
|
|
157
|
-
##### new AwaitNotError()
|
|
158
|
-
|
|
159
|
-
> **new AwaitNotError**(`message`, `code`): [`AwaitNotError`](watches.md#awaitnoterror)
|
|
160
|
-
|
|
161
|
-
###### Parameters
|
|
162
|
-
|
|
163
|
-
###### message
|
|
164
|
-
|
|
165
|
-
`any`
|
|
166
|
-
|
|
167
|
-
###### code
|
|
168
|
-
|
|
169
|
-
`any`
|
|
170
|
-
|
|
171
|
-
###### Returns
|
|
172
|
-
|
|
173
|
-
[`AwaitNotError`](watches.md#awaitnoterror)
|
|
174
|
-
|
|
175
|
-
###### Overrides
|
|
176
|
-
|
|
177
|
-
`Error.constructor`
|
|
178
|
-
|
|
179
|
-
#### Properties
|
|
180
|
-
|
|
181
|
-
##### code
|
|
182
|
-
|
|
183
|
-
> **code**: `any`
|
|
184
|
-
|
|
185
|
-
The error code.
|
|
186
|
-
|
|
187
|
-
##### name
|
|
188
|
-
|
|
189
|
-
> **name**: `string`
|
|
190
|
-
|
|
191
|
-
The error name.
|
|
192
|
-
|
|
193
|
-
###### Inherited from
|
|
194
|
-
|
|
195
|
-
`Error.name`
|
|
196
|
-
|
|
197
|
-
***
|
|
198
|
-
|
|
199
|
-
### AwaitTimeout
|
|
200
|
-
|
|
201
|
-
A utility class for managing a promise that resolves or rejects based on a set timeout or an explicit stop action.
|
|
202
|
-
This class is useful for implementing timeouts in asynchronous operations, where you might need to reject a promise
|
|
203
|
-
if an operation takes too long or cancel the timeout based on certain conditions.
|
|
204
|
-
|
|
205
|
-
#### Constructors
|
|
206
|
-
|
|
207
|
-
##### new AwaitTimeout()
|
|
208
|
-
|
|
209
|
-
> **new AwaitTimeout**(`options`): [`AwaitTimeout`](watches.md#awaittimeout)
|
|
210
|
-
|
|
211
|
-
Creates an instance of AwaitTimeout with a specified timeout duration.
|
|
212
|
-
|
|
213
|
-
###### Parameters
|
|
214
|
-
|
|
215
|
-
###### options
|
|
216
|
-
|
|
217
|
-
The options for the AwaitTimeout.
|
|
218
|
-
|
|
219
|
-
###### timeout
|
|
220
|
-
|
|
221
|
-
`number` = `1000`
|
|
222
|
-
|
|
223
|
-
The timeout in milliseconds.
|
|
224
|
-
|
|
225
|
-
###### Returns
|
|
226
|
-
|
|
227
|
-
[`AwaitTimeout`](watches.md#awaittimeout)
|
|
228
|
-
|
|
229
|
-
#### Properties
|
|
230
|
-
|
|
231
|
-
##### cancelledError
|
|
232
|
-
|
|
233
|
-
> **cancelledError**: [`AwaitTimeoutError`](watches.md#awaittimeouterror)
|
|
234
|
-
|
|
235
|
-
##### promise
|
|
236
|
-
|
|
237
|
-
> **promise**: `Promise`\<`any`\>
|
|
238
|
-
|
|
239
|
-
##### reject()
|
|
240
|
-
|
|
241
|
-
> **reject**: (`reason`?) => `void`
|
|
242
|
-
|
|
243
|
-
###### Parameters
|
|
244
|
-
|
|
245
|
-
###### reason?
|
|
246
|
-
|
|
247
|
-
`any`
|
|
248
|
-
|
|
249
|
-
###### Returns
|
|
250
|
-
|
|
251
|
-
`void`
|
|
252
|
-
|
|
253
|
-
##### resolve()
|
|
254
|
-
|
|
255
|
-
> **resolve**: (`value`) => `void`
|
|
256
|
-
|
|
257
|
-
###### Parameters
|
|
258
|
-
|
|
259
|
-
###### value
|
|
260
|
-
|
|
261
|
-
`any`
|
|
262
|
-
|
|
263
|
-
###### Returns
|
|
264
|
-
|
|
265
|
-
`void`
|
|
266
|
-
|
|
267
|
-
##### timeout
|
|
268
|
-
|
|
269
|
-
> **timeout**: `number`
|
|
270
|
-
|
|
271
|
-
##### timeoutId
|
|
272
|
-
|
|
273
|
-
> **timeoutId**: `Timeout`
|
|
274
|
-
|
|
275
|
-
#### Methods
|
|
276
|
-
|
|
277
|
-
##### start()
|
|
278
|
-
|
|
279
|
-
> **start**(): `void`
|
|
280
|
-
|
|
281
|
-
Starts the timeout process. If the timeout duration is reached without being stopped, the promise resolves.
|
|
282
|
-
|
|
283
|
-
###### Returns
|
|
284
|
-
|
|
285
|
-
`void`
|
|
286
|
-
|
|
287
|
-
##### stop()
|
|
288
|
-
|
|
289
|
-
> **stop**(): `void`
|
|
290
|
-
|
|
291
|
-
Stops the timeout if it is active, rejecting the promise with a "Cancelled" error. Clears all pending actions.
|
|
292
|
-
|
|
293
|
-
###### Returns
|
|
294
|
-
|
|
295
|
-
`void`
|
|
296
|
-
|
|
297
|
-
***
|
|
298
|
-
|
|
299
|
-
### AwaitTimeoutError
|
|
300
|
-
|
|
301
|
-
The error thrown when an AwaitTimeout operation times out.
|
|
302
|
-
|
|
303
|
-
#### Extends
|
|
304
|
-
|
|
305
|
-
- `Error`
|
|
306
|
-
|
|
307
|
-
#### Constructors
|
|
308
|
-
|
|
309
|
-
##### new AwaitTimeoutError()
|
|
310
|
-
|
|
311
|
-
> **new AwaitTimeoutError**(`message`, `code`): [`AwaitTimeoutError`](watches.md#awaittimeouterror)
|
|
312
|
-
|
|
313
|
-
###### Parameters
|
|
314
|
-
|
|
315
|
-
###### message
|
|
316
|
-
|
|
317
|
-
`any`
|
|
318
|
-
|
|
319
|
-
###### code
|
|
320
|
-
|
|
321
|
-
`any`
|
|
322
|
-
|
|
323
|
-
###### Returns
|
|
324
|
-
|
|
325
|
-
[`AwaitTimeoutError`](watches.md#awaittimeouterror)
|
|
326
|
-
|
|
327
|
-
###### Overrides
|
|
328
|
-
|
|
329
|
-
`Error.constructor`
|
|
330
|
-
|
|
331
|
-
#### Properties
|
|
332
|
-
|
|
333
|
-
##### code
|
|
334
|
-
|
|
335
|
-
> **code**: `any`
|
|
336
|
-
|
|
337
|
-
The error code.
|
|
338
|
-
|
|
339
|
-
##### name
|
|
340
|
-
|
|
341
|
-
> **name**: `string`
|
|
342
|
-
|
|
343
|
-
###### Inherited from
|
|
344
|
-
|
|
345
|
-
`Error.name`
|
|
346
|
-
|
|
347
|
-
***
|
|
348
|
-
|
|
349
|
-
### ImmediateStopWatch
|
|
350
|
-
|
|
351
|
-
Provides a mechanism for immediately starting and potentially stopping a Vue.js watcher
|
|
352
|
-
during its first invocation. This is useful when the need arises to terminate the watch
|
|
353
|
-
based on conditions encountered during the initial execution of the watch function.
|
|
354
|
-
|
|
355
|
-
#### Constructors
|
|
356
|
-
|
|
357
|
-
##### new ImmediateStopWatch()
|
|
358
|
-
|
|
359
|
-
> **new ImmediateStopWatch**(): [`ImmediateStopWatch`](watches.md#immediatestopwatch)
|
|
360
|
-
|
|
361
|
-
###### Returns
|
|
362
|
-
|
|
363
|
-
[`ImmediateStopWatch`](watches.md#immediatestopwatch)
|
|
364
|
-
|
|
365
|
-
#### Properties
|
|
366
|
-
|
|
367
|
-
##### stopWatch
|
|
368
|
-
|
|
369
|
-
> **stopWatch**: `WatchHandle`
|
|
370
|
-
|
|
371
|
-
#### Methods
|
|
372
|
-
|
|
373
|
-
##### start()
|
|
374
|
-
|
|
375
|
-
> **start**(`watchSources`, `watchFunc`, `watchFuncArgs`?, `watchOptions`?): `void`
|
|
376
|
-
|
|
377
|
-
Starts the watch.
|
|
378
|
-
|
|
379
|
-
###### Parameters
|
|
380
|
-
|
|
381
|
-
###### watchSources
|
|
382
|
-
|
|
383
|
-
The source(s) to watch.
|
|
384
|
-
|
|
385
|
-
`WatchSource`\<`any`\> | `WatchSource`\<`any`\>[]
|
|
386
|
-
|
|
387
|
-
###### watchFunc
|
|
388
|
-
|
|
389
|
-
`WatchCallback`\<`any`, `any`\>
|
|
390
|
-
|
|
391
|
-
The callback to execute when the source changes.
|
|
392
|
-
|
|
393
|
-
###### watchFuncArgs?
|
|
394
|
-
|
|
395
|
-
`any`[] = `[]`
|
|
396
|
-
|
|
397
|
-
Optional arguments to pass to the watch function.
|
|
398
|
-
|
|
399
|
-
###### watchOptions?
|
|
400
|
-
|
|
401
|
-
`WatchOptions` = `{}`
|
|
402
|
-
|
|
403
|
-
Optional watch options.
|
|
404
|
-
|
|
405
|
-
###### Returns
|
|
406
|
-
|
|
407
|
-
`void`
|
|
408
|
-
|
|
409
|
-
##### stop()
|
|
410
|
-
|
|
411
|
-
> **stop**(): `void`
|
|
412
|
-
|
|
413
|
-
Stops the watch.
|
|
414
|
-
|
|
415
|
-
###### Returns
|
|
416
|
-
|
|
417
|
-
`void`
|
|
418
|
-
|
|
419
|
-
## Functions
|
|
420
|
-
|
|
421
|
-
### doAwaitNot()
|
|
422
|
-
|
|
423
|
-
> **doAwaitNot**(`options`): `Promise`\<`any`\>
|
|
424
|
-
|
|
425
|
-
Helper function to get the resulting promise from an AwaitNot instance.
|
|
426
|
-
|
|
427
|
-
#### Parameters
|
|
428
|
-
|
|
429
|
-
##### options
|
|
430
|
-
|
|
431
|
-
Configuration options for AwaitNot.
|
|
432
|
-
|
|
433
|
-
###### couldAlreadyBeFalse
|
|
434
|
-
|
|
435
|
-
`boolean` = `true`
|
|
436
|
-
|
|
437
|
-
Indicates if the property could already be in the false state at initialization.
|
|
438
|
-
|
|
439
|
-
###### obj
|
|
440
|
-
|
|
441
|
-
`any`
|
|
442
|
-
|
|
443
|
-
The object containing the property to watch.
|
|
444
|
-
|
|
445
|
-
###### prop
|
|
446
|
-
|
|
447
|
-
`string`
|
|
448
|
-
|
|
449
|
-
The property name to watch within the object.
|
|
450
|
-
|
|
451
|
-
###### ref
|
|
452
|
-
|
|
453
|
-
`Ref`
|
|
454
|
-
|
|
455
|
-
A Vue ref to directly watch if provided.
|
|
456
|
-
|
|
457
|
-
###### timeout
|
|
458
|
-
|
|
459
|
-
`number` = `1000`
|
|
460
|
-
|
|
461
|
-
The timeout in milliseconds before the promise is rejected.
|
|
462
|
-
|
|
463
|
-
#### Returns
|
|
464
|
-
|
|
465
|
-
`Promise`\<`any`\>
|
|
466
|
-
|
|
467
|
-
A promise that resolves when the property toggles from true to false.
|
|
468
|
-
|
|
469
|
-
***
|
|
470
|
-
|
|
471
|
-
### doAwaitTimeout()
|
|
472
|
-
|
|
473
|
-
> **doAwaitTimeout**(`timeout`): `Promise`\<`any`\>
|
|
474
|
-
|
|
475
|
-
Helper function to get the resulting promise from an AwaitTimeout instance.
|
|
476
|
-
|
|
477
|
-
#### Parameters
|
|
478
|
-
|
|
479
|
-
##### timeout
|
|
480
|
-
|
|
481
|
-
`number`
|
|
482
|
-
|
|
483
|
-
The timeout in milliseconds.
|
|
484
|
-
|
|
485
|
-
#### Returns
|
|
486
|
-
|
|
487
|
-
`Promise`\<`any`\>
|
|
488
|
-
|
|
489
|
-
A promise that resolves after the specified timeout.
|
package/eslint.config.js
DELETED
|
@@ -1,125 +0,0 @@
|
|
|
1
|
-
import js from "@eslint/js";
|
|
2
|
-
import globals from "globals";
|
|
3
|
-
import pluginVue from "eslint-plugin-vue";
|
|
4
|
-
import eslintConfigPrettier from "eslint-config-prettier";
|
|
5
|
-
import jsdoc from "eslint-plugin-jsdoc";
|
|
6
|
-
import { FlatCompat } from "@eslint/eslintrc";
|
|
7
|
-
import vitest from "eslint-plugin-vitest";
|
|
8
|
-
|
|
9
|
-
const compat = new FlatCompat({ baseDirectory: import.meta.dirname });
|
|
10
|
-
export default [
|
|
11
|
-
{ ignores: [".prettierrc.js", "typedoc-local-plugins", "docs"] },
|
|
12
|
-
{
|
|
13
|
-
languageOptions: {
|
|
14
|
-
globals: {
|
|
15
|
-
...globals.browser,
|
|
16
|
-
...globals.node,
|
|
17
|
-
...globals.es2023,
|
|
18
|
-
},
|
|
19
|
-
},
|
|
20
|
-
},
|
|
21
|
-
// non-tests
|
|
22
|
-
{
|
|
23
|
-
name: "non-tests",
|
|
24
|
-
files: ["config/**/*.js", "use/**/*.js", "utils/**/*.js", "index.js"],
|
|
25
|
-
plugins: {
|
|
26
|
-
...pluginVue.configs["flat/recommended"].reduce((acc, config) => {
|
|
27
|
-
return { ...acc, plugins: { ...acc.plugins, ...config.plugins } };
|
|
28
|
-
}).plugins,
|
|
29
|
-
...compat.extends("@vue/eslint-config-prettier/skip-formatting").reduce((acc, config) => {
|
|
30
|
-
return { ...acc, plugins: { ...acc.plugins, ...config.plugins } };
|
|
31
|
-
}, {}).plugins,
|
|
32
|
-
...jsdoc.configs["flat/recommended-typescript-flavor-error"].plugins,
|
|
33
|
-
},
|
|
34
|
-
settings: {
|
|
35
|
-
jsdoc: {
|
|
36
|
-
mode: "typescript",
|
|
37
|
-
},
|
|
38
|
-
},
|
|
39
|
-
rules: {
|
|
40
|
-
...js.configs.recommended.rules,
|
|
41
|
-
...pluginVue.configs["flat/recommended"].reduce((acc, config) => {
|
|
42
|
-
return { ...acc, rules: { ...acc.rules, ...config.rules } };
|
|
43
|
-
}, {}).rules,
|
|
44
|
-
...eslintConfigPrettier.rules,
|
|
45
|
-
...compat.extends("@vue/eslint-config-prettier/skip-formatting").reduce((acc, config) => {
|
|
46
|
-
return {
|
|
47
|
-
...acc,
|
|
48
|
-
rules: {
|
|
49
|
-
...acc.rules,
|
|
50
|
-
...config.rules,
|
|
51
|
-
},
|
|
52
|
-
};
|
|
53
|
-
}, {}).rules,
|
|
54
|
-
...jsdoc.configs["flat/recommended-typescript-flavor-error"].rules,
|
|
55
|
-
"no-console": "off",
|
|
56
|
-
"no-debugger": process.env.NODE_ENV === "production" ? "error" : "off",
|
|
57
|
-
"space-before-function-paren": [
|
|
58
|
-
"error",
|
|
59
|
-
{
|
|
60
|
-
anonymous: "always",
|
|
61
|
-
named: "never",
|
|
62
|
-
asyncArrow: "always",
|
|
63
|
-
},
|
|
64
|
-
],
|
|
65
|
-
"jsdoc/require-jsdoc": [
|
|
66
|
-
"error",
|
|
67
|
-
{
|
|
68
|
-
publicOnly: true,
|
|
69
|
-
enableFixer: false,
|
|
70
|
-
},
|
|
71
|
-
],
|
|
72
|
-
"jsdoc/check-param-names": "error",
|
|
73
|
-
"jsdoc/check-property-names": "error",
|
|
74
|
-
"jsdoc/check-tag-names": [
|
|
75
|
-
"error",
|
|
76
|
-
{
|
|
77
|
-
definedTags: [
|
|
78
|
-
// using typescript flavour for jsdoc, but not using typescript
|
|
79
|
-
// we still need to define these tags
|
|
80
|
-
"typedef",
|
|
81
|
-
"type",
|
|
82
|
-
],
|
|
83
|
-
},
|
|
84
|
-
],
|
|
85
|
-
"jsdoc/empty-tags": "error",
|
|
86
|
-
"jsdoc/multiline-blocks": "error",
|
|
87
|
-
"jsdoc/no-defaults": "off",
|
|
88
|
-
"jsdoc/require-asterisk-prefix": "error",
|
|
89
|
-
"jsdoc/require-description-complete-sentence": "error",
|
|
90
|
-
"jsdoc/require-hyphen-before-param-description": "error",
|
|
91
|
-
"jsdoc/require-param": "error",
|
|
92
|
-
"jsdoc/require-property": [
|
|
93
|
-
"error",
|
|
94
|
-
{
|
|
95
|
-
enableFixer: false,
|
|
96
|
-
},
|
|
97
|
-
],
|
|
98
|
-
"jsdoc/tag-lines": [
|
|
99
|
-
"error",
|
|
100
|
-
"always",
|
|
101
|
-
{
|
|
102
|
-
count: 0,
|
|
103
|
-
startLines: 1,
|
|
104
|
-
endLines: 1,
|
|
105
|
-
},
|
|
106
|
-
],
|
|
107
|
-
},
|
|
108
|
-
},
|
|
109
|
-
// tests
|
|
110
|
-
{
|
|
111
|
-
name: "tests",
|
|
112
|
-
files: ["tests/**/*.js"],
|
|
113
|
-
plugins: { vitest },
|
|
114
|
-
languageOptions: {
|
|
115
|
-
globals: {
|
|
116
|
-
...vitest.environments.env.globals,
|
|
117
|
-
},
|
|
118
|
-
},
|
|
119
|
-
rules: {
|
|
120
|
-
...vitest.configs.recommended.rules,
|
|
121
|
-
"vitest/no-conditional-expect": "off",
|
|
122
|
-
"vitest/valid-expect": "off", // we want to use expect(value, message).toBe(expected), which is not supported by this rule
|
|
123
|
-
},
|
|
124
|
-
},
|
|
125
|
-
];
|
package/lint-staged.config.js
DELETED
|
@@ -1,10 +0,0 @@
|
|
|
1
|
-
export default {
|
|
2
|
-
"**/*.{js,cjs,mjs,ts,jsx,tsx}": [
|
|
3
|
-
"npx --no-install eslint --cache --fix",
|
|
4
|
-
"npx --no-install prettier --write",
|
|
5
|
-
"npm run docs",
|
|
6
|
-
],
|
|
7
|
-
"**/*.{markdown,md}": ["npx --no-install doctoc --github -u ."],
|
|
8
|
-
"**/*.{less,scss,css,vue,markdown,json,md,yml,yaml,html}": ["npx --no-install prettier --write"],
|
|
9
|
-
".circleci/config.yml": ["circleci config validate"],
|
|
10
|
-
};
|
package/makeTypeDoc.sh
DELETED
|
@@ -1,25 +0,0 @@
|
|
|
1
|
-
#!/bin/bash
|
|
2
|
-
set -e # Enable exit on error
|
|
3
|
-
BLUE_COLOR='\033[1;38;2;0;119;247m'
|
|
4
|
-
ORANGE_COLOR='\033[1;38;2;255;127;0m'
|
|
5
|
-
RESET_COLOR='\033[0m'
|
|
6
|
-
TEMP_DIR=$(mktemp -d -t docs-XXXXXXXXXX)
|
|
7
|
-
cleanup() {
|
|
8
|
-
rm -rf "${TEMP_DIR}"
|
|
9
|
-
}
|
|
10
|
-
trap cleanup EXIT
|
|
11
|
-
npx --no-install typedoc --out "${TEMP_DIR}" --plugin typedoc-plugin-markdown --disableSources
|
|
12
|
-
set +e
|
|
13
|
-
diff -u -r "${TEMP_DIR}" ./docs > /dev/null
|
|
14
|
-
diff_exit_code=$?
|
|
15
|
-
set -e
|
|
16
|
-
|
|
17
|
-
if [ "${diff_exit_code}" -ne 0 ]; then
|
|
18
|
-
echo -e "[${0}] ${ORANGE_COLOR}Docs are out of date, updating...${RESET_COLOR}"
|
|
19
|
-
rm -rf ./docs
|
|
20
|
-
mv "${TEMP_DIR}" ./docs
|
|
21
|
-
git add ./docs
|
|
22
|
-
else
|
|
23
|
-
echo -e "[${0}] ${BLUE_COLOR}Docs are up to date${RESET_COLOR}"
|
|
24
|
-
fi
|
|
25
|
-
exit 0
|
package/make_type_doc.js
DELETED
|
@@ -1,59 +0,0 @@
|
|
|
1
|
-
#!/usr/bin/env node
|
|
2
|
-
|
|
3
|
-
import { execSync } from "child_process";
|
|
4
|
-
import fs from "fs";
|
|
5
|
-
import os from "os";
|
|
6
|
-
import path from "path";
|
|
7
|
-
import { fileURLToPath } from "url";
|
|
8
|
-
|
|
9
|
-
const __filename = fileURLToPath(import.meta.url);
|
|
10
|
-
const scriptName = path.basename(__filename);
|
|
11
|
-
|
|
12
|
-
const BLUE_COLOR = "\u001b[1;38;2;0;119;247m";
|
|
13
|
-
const ORANGE_COLOR = "\u001b[1;38;2;255;127;0m";
|
|
14
|
-
const RESET_COLOR = "\u001b[0m";
|
|
15
|
-
|
|
16
|
-
const tempDir = fs.mkdtempSync(path.join(os.tmpdir(), "docs-"));
|
|
17
|
-
const docsDir = path.resolve("./docs");
|
|
18
|
-
|
|
19
|
-
function cleanup() {
|
|
20
|
-
fs.rmSync(tempDir, { recursive: true, force: true });
|
|
21
|
-
}
|
|
22
|
-
|
|
23
|
-
process.on("exit", cleanup);
|
|
24
|
-
process.on("SIGINT", () => {
|
|
25
|
-
cleanup();
|
|
26
|
-
process.exit(1);
|
|
27
|
-
});
|
|
28
|
-
|
|
29
|
-
execSync(`npx --no-install typedoc --out "${tempDir}" --plugin typedoc-plugin-markdown --disableSources`, {
|
|
30
|
-
stdio: "inherit",
|
|
31
|
-
});
|
|
32
|
-
|
|
33
|
-
let docsAreDifferent = false;
|
|
34
|
-
|
|
35
|
-
try {
|
|
36
|
-
execSync(`git diff --no-index --quiet "${tempDir}" "${docsDir}"`, {
|
|
37
|
-
stdio: "inherit",
|
|
38
|
-
});
|
|
39
|
-
} catch (error) {
|
|
40
|
-
if (error.status === 1) {
|
|
41
|
-
// Differences found
|
|
42
|
-
docsAreDifferent = true;
|
|
43
|
-
} else {
|
|
44
|
-
// Unexpected error
|
|
45
|
-
throw error;
|
|
46
|
-
}
|
|
47
|
-
}
|
|
48
|
-
|
|
49
|
-
if (docsAreDifferent) {
|
|
50
|
-
console.log(`[${scriptName}] ${ORANGE_COLOR}Docs are out of date, updating...${RESET_COLOR}`);
|
|
51
|
-
fs.rmSync("./docs", { recursive: true, force: true });
|
|
52
|
-
fs.renameSync(tempDir, "./docs");
|
|
53
|
-
execSync(`git add ./docs`, { stdio: "inherit" });
|
|
54
|
-
} else {
|
|
55
|
-
console.log(`[${scriptName}] ${BLUE_COLOR}Docs are up to date${RESET_COLOR}`);
|
|
56
|
-
}
|
|
57
|
-
|
|
58
|
-
cleanup();
|
|
59
|
-
process.exit(0);
|