@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.
Files changed (216) hide show
  1. package/package.json +20 -6
  2. package/types/config/listCrud.d.ts +153 -0
  3. package/types/config/listCrud.d.ts.map +1 -0
  4. package/types/config/objectCrud.d.ts +171 -0
  5. package/types/config/objectCrud.d.ts.map +1 -0
  6. package/types/index.d.ts +37 -0
  7. package/types/index.d.ts.map +1 -0
  8. package/types/tests/unit/config/listCrud.spec.d.ts +2 -0
  9. package/types/tests/unit/config/listCrud.spec.d.ts.map +1 -0
  10. package/types/tests/unit/config/objectCrud.spec.d.ts +2 -0
  11. package/types/tests/unit/config/objectCrud.spec.d.ts.map +1 -0
  12. package/types/tests/unit/crudPromise.d.ts +25 -0
  13. package/types/tests/unit/crudPromise.d.ts.map +1 -0
  14. package/types/tests/unit/expectHelpers.d.ts +2 -0
  15. package/types/tests/unit/expectHelpers.d.ts.map +1 -0
  16. package/types/tests/unit/mockOnUnmounted.d.ts +2 -0
  17. package/types/tests/unit/mockOnUnmounted.d.ts.map +1 -0
  18. package/types/tests/unit/poll.d.ts +2 -0
  19. package/types/tests/unit/poll.d.ts.map +1 -0
  20. package/types/tests/unit/use/cancellableIntent.spec.d.ts +2 -0
  21. package/types/tests/unit/use/cancellableIntent.spec.d.ts.map +1 -0
  22. package/types/tests/unit/use/listCalculated.spec.d.ts +2 -0
  23. package/types/tests/unit/use/listCalculated.spec.d.ts.map +1 -0
  24. package/types/tests/unit/use/listFilter.spec.d.ts +2 -0
  25. package/types/tests/unit/use/listFilter.spec.d.ts.map +1 -0
  26. package/types/tests/unit/use/listInstance.spec.d.ts +2 -0
  27. package/types/tests/unit/use/listInstance.spec.d.ts.map +1 -0
  28. package/types/tests/unit/use/listRelated.spec.d.ts +2 -0
  29. package/types/tests/unit/use/listRelated.spec.d.ts.map +1 -0
  30. package/types/tests/unit/use/listSearch.spec.d.ts +2 -0
  31. package/types/tests/unit/use/listSearch.spec.d.ts.map +1 -0
  32. package/types/tests/unit/use/listSort.spec.d.ts +2 -0
  33. package/types/tests/unit/use/listSort.spec.d.ts.map +1 -0
  34. package/types/tests/unit/use/listSubscription.spec.d.ts +2 -0
  35. package/types/tests/unit/use/listSubscription.spec.d.ts.map +1 -0
  36. package/types/tests/unit/use/loadingError.spec.d.ts +2 -0
  37. package/types/tests/unit/use/loadingError.spec.d.ts.map +1 -0
  38. package/types/tests/unit/use/objectInstance.spec.d.ts +2 -0
  39. package/types/tests/unit/use/objectInstance.spec.d.ts.map +1 -0
  40. package/types/tests/unit/use/objectSubscription.spec.d.ts +2 -0
  41. package/types/tests/unit/use/objectSubscription.spec.d.ts.map +1 -0
  42. package/types/tests/unit/use/proxyLoadingError.spec.d.ts +2 -0
  43. package/types/tests/unit/use/proxyLoadingError.spec.d.ts.map +1 -0
  44. package/types/tests/unit/use/search.spec.d.ts +2 -0
  45. package/types/tests/unit/use/search.spec.d.ts.map +1 -0
  46. package/types/tests/unit/utils/assignReactiveObject.spec.d.ts +2 -0
  47. package/types/tests/unit/utils/assignReactiveObject.spec.d.ts.map +1 -0
  48. package/types/tests/unit/utils/classes.spec.d.ts +2 -0
  49. package/types/tests/unit/utils/classes.spec.d.ts.map +1 -0
  50. package/types/tests/unit/utils/deleteKey.spec.d.ts +2 -0
  51. package/types/tests/unit/utils/deleteKey.spec.d.ts.map +1 -0
  52. package/types/tests/unit/utils/flattenPaths.spec.d.ts +2 -0
  53. package/types/tests/unit/utils/flattenPaths.spec.d.ts.map +1 -0
  54. package/types/tests/unit/utils/keyDiff.spec.d.ts +2 -0
  55. package/types/tests/unit/utils/keyDiff.spec.d.ts.map +1 -0
  56. package/types/tests/unit/utils/set.spec.d.ts +2 -0
  57. package/types/tests/unit/utils/set.spec.d.ts.map +1 -0
  58. package/types/tests/unit/utils/watches.spec.d.ts +2 -0
  59. package/types/tests/unit/utils/watches.spec.d.ts.map +1 -0
  60. package/types/use/cancellableIntent.d.ts +129 -0
  61. package/types/use/cancellableIntent.d.ts.map +1 -0
  62. package/types/use/combineClasses.d.ts +43 -0
  63. package/types/use/combineClasses.d.ts.map +1 -0
  64. package/types/use/list.d.ts +176 -0
  65. package/types/use/list.d.ts.map +1 -0
  66. package/types/use/listCalculated.d.ts +192 -0
  67. package/types/use/listCalculated.d.ts.map +1 -0
  68. package/types/use/listFilter.d.ts +203 -0
  69. package/types/use/listFilter.d.ts.map +1 -0
  70. package/types/use/listInstance.d.ts +357 -0
  71. package/types/use/listInstance.d.ts.map +1 -0
  72. package/types/use/listKeys.d.ts +15 -0
  73. package/types/use/listKeys.d.ts.map +1 -0
  74. package/types/use/listRelated.d.ts +239 -0
  75. package/types/use/listRelated.d.ts.map +1 -0
  76. package/types/use/listSearch.d.ts +298 -0
  77. package/types/use/listSearch.d.ts.map +1 -0
  78. package/types/use/listSort.d.ts +235 -0
  79. package/types/use/listSort.d.ts.map +1 -0
  80. package/types/use/listSubscription.d.ts +218 -0
  81. package/types/use/listSubscription.d.ts.map +1 -0
  82. package/types/use/loadingError.d.ts +81 -0
  83. package/types/use/loadingError.d.ts.map +1 -0
  84. package/types/use/object.d.ts +67 -0
  85. package/types/use/object.d.ts.map +1 -0
  86. package/types/use/objectCalculated.d.ts +215 -0
  87. package/types/use/objectCalculated.d.ts.map +1 -0
  88. package/types/use/objectInstance.d.ts +289 -0
  89. package/types/use/objectInstance.d.ts.map +1 -0
  90. package/types/use/objectRelated.d.ts +264 -0
  91. package/types/use/objectRelated.d.ts.map +1 -0
  92. package/types/use/objectSubscription.d.ts +249 -0
  93. package/types/use/objectSubscription.d.ts.map +1 -0
  94. package/types/use/paginatedListInstance.d.ts +51 -0
  95. package/types/use/paginatedListInstance.d.ts.map +1 -0
  96. package/types/use/proxyLoadingError.d.ts +36 -0
  97. package/types/use/proxyLoadingError.d.ts.map +1 -0
  98. package/types/use/search.d.ts +144 -0
  99. package/types/use/search.d.ts.map +1 -0
  100. package/types/use/watchesRunning.d.ts +63 -0
  101. package/types/use/watchesRunning.d.ts.map +1 -0
  102. package/types/utils/assignReactiveObject.d.ts +115 -0
  103. package/types/utils/assignReactiveObject.d.ts.map +1 -0
  104. package/types/utils/classes.d.ts +22 -0
  105. package/types/utils/classes.d.ts.map +1 -0
  106. package/types/utils/compact.d.ts +4 -0
  107. package/types/utils/compact.d.ts.map +1 -0
  108. package/types/utils/deleteKey.d.ts +16 -0
  109. package/types/utils/deleteKey.d.ts.map +1 -0
  110. package/types/utils/flattenPaths.d.ts +23 -0
  111. package/types/utils/flattenPaths.d.ts.map +1 -0
  112. package/types/utils/getFakePk.d.ts +13 -0
  113. package/types/utils/getFakePk.d.ts.map +1 -0
  114. package/types/utils/keepAliveTry.d.ts +15 -0
  115. package/types/utils/keepAliveTry.d.ts.map +1 -0
  116. package/types/utils/keyDiff.d.ts +63 -0
  117. package/types/utils/keyDiff.d.ts.map +1 -0
  118. package/types/utils/loadingCombine.d.ts +9 -0
  119. package/types/utils/loadingCombine.d.ts.map +1 -0
  120. package/types/utils/proxyRunning.d.ts +9 -0
  121. package/types/utils/proxyRunning.d.ts.map +1 -0
  122. package/types/utils/relatedCalculatedHelpers.d.ts +5 -0
  123. package/types/utils/relatedCalculatedHelpers.d.ts.map +1 -0
  124. package/types/utils/set.d.ts +7 -0
  125. package/types/utils/set.d.ts.map +1 -0
  126. package/types/utils/transformWalk.d.ts +2 -0
  127. package/types/utils/transformWalk.d.ts.map +1 -0
  128. package/types/utils/watches.d.ts +155 -0
  129. package/types/utils/watches.d.ts.map +1 -0
  130. package/use/loadingError.js +1 -1
  131. package/.circleci/config.yml +0 -88
  132. package/.commitlintrc.json +0 -25
  133. package/.editorconfig +0 -5
  134. package/.husky/commit-msg +0 -3
  135. package/.husky/pre-commit +0 -3
  136. package/.idea/codeStyles/codeStyleConfig.xml +0 -5
  137. package/.idea/encodings.xml +0 -6
  138. package/.idea/inspectionProfiles/Project_Default.xml +0 -7
  139. package/.idea/modules.xml +0 -8
  140. package/.idea/prettier.xml +0 -8
  141. package/.idea/reactive-helpers.iml +0 -15
  142. package/.prettierignore +0 -5
  143. package/.prettierrc.cjs +0 -5
  144. package/.vscode/extensions.json +0 -3
  145. package/docs/README.md +0 -45
  146. package/docs/config/listCrud.md +0 -422
  147. package/docs/config/objectCrud.md +0 -427
  148. package/docs/use/cancellableIntent.md +0 -165
  149. package/docs/use/combineClasses.md +0 -62
  150. package/docs/use/list.md +0 -361
  151. package/docs/use/listCalculated.md +0 -794
  152. package/docs/use/listFilter.md +0 -897
  153. package/docs/use/listInstance.md +0 -559
  154. package/docs/use/listKeys.md +0 -91
  155. package/docs/use/listRelated.md +0 -706
  156. package/docs/use/listSearch.md +0 -903
  157. package/docs/use/listSort.md +0 -1171
  158. package/docs/use/listSubscription.md +0 -393
  159. package/docs/use/loadingError.md +0 -115
  160. package/docs/use/object.md +0 -668
  161. package/docs/use/objectCalculated.md +0 -741
  162. package/docs/use/objectInstance.md +0 -685
  163. package/docs/use/objectRelated.md +0 -723
  164. package/docs/use/objectSubscription.md +0 -538
  165. package/docs/use/paginatedListInstance.md +0 -155
  166. package/docs/use/proxyLoadingError.md +0 -51
  167. package/docs/use/search.md +0 -321
  168. package/docs/use/watchesRunning.md +0 -84
  169. package/docs/utils/assignReactiveObject.md +0 -413
  170. package/docs/utils/classes.md +0 -139
  171. package/docs/utils/compact.md +0 -67
  172. package/docs/utils/deleteKey.md +0 -61
  173. package/docs/utils/flattenPaths.md +0 -53
  174. package/docs/utils/getFakePk.md +0 -39
  175. package/docs/utils/keepAliveTry.md +0 -59
  176. package/docs/utils/keyDiff.md +0 -117
  177. package/docs/utils/loadingCombine.md +0 -30
  178. package/docs/utils/proxyRunning.md +0 -39
  179. package/docs/utils/relatedCalculatedHelpers.md +0 -93
  180. package/docs/utils/set.md +0 -223
  181. package/docs/utils/transformWalk.md +0 -68
  182. package/docs/utils/watches.md +0 -489
  183. package/eslint.config.js +0 -125
  184. package/lint-staged.config.js +0 -10
  185. package/makeTypeDoc.sh +0 -25
  186. package/make_type_doc.js +0 -59
  187. package/tests/unit/config/listCrud.spec.js +0 -114
  188. package/tests/unit/config/objectCrud.spec.js +0 -160
  189. package/tests/unit/crudPromise.js +0 -40
  190. package/tests/unit/expectHelpers.js +0 -6
  191. package/tests/unit/mockOnUnmounted.js +0 -9
  192. package/tests/unit/poll.js +0 -50
  193. package/tests/unit/use/cancellableIntent.spec.js +0 -152
  194. package/tests/unit/use/listCalculated.spec.js +0 -135
  195. package/tests/unit/use/listFilter.spec.js +0 -484
  196. package/tests/unit/use/listInstance.spec.js +0 -1166
  197. package/tests/unit/use/listRelated.spec.js +0 -260
  198. package/tests/unit/use/listSearch.spec.js +0 -586
  199. package/tests/unit/use/listSort.spec.js +0 -418
  200. package/tests/unit/use/listSubscription.spec.js +0 -845
  201. package/tests/unit/use/loadingError.spec.js +0 -43
  202. package/tests/unit/use/objectInstance.spec.js +0 -1525
  203. package/tests/unit/use/objectSubscription.spec.js +0 -849
  204. package/tests/unit/use/proxyLoadingError.spec.js +0 -64
  205. package/tests/unit/use/search.spec.js +0 -248
  206. package/tests/unit/utils/assignReactiveObject.spec.js +0 -593
  207. package/tests/unit/utils/classes.spec.js +0 -427
  208. package/tests/unit/utils/deleteKey.spec.js +0 -265
  209. package/tests/unit/utils/flattenPaths.spec.js +0 -126
  210. package/tests/unit/utils/keyDiff.spec.js +0 -110
  211. package/tests/unit/utils/set.spec.js +0 -81
  212. package/tests/unit/utils/watches.spec.js +0 -276
  213. package/tsconfig.json +0 -19
  214. package/typedoc-local-plugins/customize-output.js +0 -13
  215. package/typedoc.json +0 -11
  216. package/vitest.config.js +0 -11
@@ -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
- ];
@@ -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);