@oscarpalmer/atoms 0.213.0 → 0.215.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 (253) hide show
  1. package/dist/array/difference.d.mts +1 -1
  2. package/dist/array/difference.mjs +3 -2
  3. package/dist/array/exists.d.mts +1 -1
  4. package/dist/array/exists.mjs +3 -2
  5. package/dist/array/filter.d.mts +1 -1
  6. package/dist/array/filter.mjs +1 -0
  7. package/dist/array/find.d.mts +1 -1
  8. package/dist/array/find.mjs +4 -3
  9. package/dist/array/first.d.mts +1 -1
  10. package/dist/array/flatten.d.mts +1 -1
  11. package/dist/array/group-by.d.mts +1 -1
  12. package/dist/array/index.d.mts +2 -2
  13. package/dist/array/insert.mjs +3 -2
  14. package/dist/array/intersection.mjs +3 -2
  15. package/dist/array/last.d.mts +1 -1
  16. package/dist/array/move.d.mts +1 -1
  17. package/dist/array/partition.d.mts +1 -1
  18. package/dist/array/partition.mjs +1 -0
  19. package/dist/array/push.mjs +3 -2
  20. package/dist/array/select.d.mts +10 -12
  21. package/dist/array/select.mjs +1 -0
  22. package/dist/array/single.d.mts +1 -1
  23. package/dist/array/single.mjs +1 -0
  24. package/dist/array/slice.d.mts +1 -1
  25. package/dist/array/slice.mjs +4 -5
  26. package/dist/array/sort.d.mts +4 -103
  27. package/dist/array/sort.mjs +6 -14
  28. package/dist/array/splice.mjs +3 -2
  29. package/dist/array/swap.d.mts +1 -1
  30. package/dist/array/to-map.d.mts +1 -1
  31. package/dist/array/to-record.d.mts +1 -1
  32. package/dist/array/to-set.d.mts +1 -1
  33. package/dist/array/toggle.d.mts +1 -1
  34. package/dist/array/union.mjs +3 -2
  35. package/dist/array/unique.d.mts +1 -1
  36. package/dist/array/unique.mjs +3 -2
  37. package/dist/array/update.d.mts +1 -1
  38. package/dist/beacon.d.mts +6 -92
  39. package/dist/beacon.mjs +6 -16
  40. package/dist/color/constants.d.mts +2 -2
  41. package/dist/color/constants.mjs +1 -1
  42. package/dist/color/index.d.mts +1 -1
  43. package/dist/color/instance.d.mts +1 -1
  44. package/dist/color/misc/alpha.d.mts +1 -1
  45. package/dist/color/misc/format.d.mts +1 -1
  46. package/dist/color/misc/get.d.mts +1 -1
  47. package/dist/color/misc/is.d.mts +2 -2
  48. package/dist/color/misc/is.mjs +1 -0
  49. package/dist/color/misc/state.d.mts +1 -1
  50. package/dist/color/space/hex.d.mts +1 -1
  51. package/dist/color/space/hsl.d.mts +1 -1
  52. package/dist/color/space/hwb.d.mts +1 -1
  53. package/dist/color/space/rgb.d.mts +1 -1
  54. package/dist/function/limit.d.mts +2 -2
  55. package/dist/function/limit.mjs +2 -1
  56. package/dist/function/once.d.mts +7 -3
  57. package/dist/function/once.mjs +5 -10
  58. package/dist/function/retry.d.mts +4 -14
  59. package/dist/function/retry.mjs +3 -15
  60. package/dist/herald.d.mts +2 -2
  61. package/dist/index.d.mts +500 -333
  62. package/dist/index.mjs +508 -446
  63. package/dist/internal/aborter.d.mts +1 -6
  64. package/dist/internal/aborter.mjs +3 -4
  65. package/dist/internal/array/callbacks.d.mts +3 -7
  66. package/dist/internal/array/chunk.mjs +2 -2
  67. package/dist/internal/array/find.d.mts +5 -23
  68. package/dist/internal/array/find.mjs +5 -9
  69. package/dist/internal/array/get.d.mts +1 -1
  70. package/dist/internal/array/group.d.mts +1 -1
  71. package/dist/internal/array/index-of.d.mts +1 -1
  72. package/dist/internal/array/index-of.mjs +4 -3
  73. package/dist/internal/array/insert.d.mts +2 -5
  74. package/dist/internal/array/insert.mjs +2 -4
  75. package/dist/internal/array/match.d.mts +2 -5
  76. package/dist/internal/array/match.mjs +10 -20
  77. package/dist/internal/array/overlap.d.mts +2 -10
  78. package/dist/internal/array/sets.d.mts +2 -5
  79. package/dist/internal/array/sets.mjs +5 -7
  80. package/dist/internal/function/assert.d.mts +5 -12
  81. package/dist/internal/function/assert.mjs +2 -2
  82. package/dist/internal/function/limit.d.mts +2 -37
  83. package/dist/internal/function/limit.mjs +4 -15
  84. package/dist/internal/function/memoize.d.mts +5 -70
  85. package/dist/internal/function/memoize.mjs +2 -5
  86. package/dist/internal/function/work.d.mts +16 -22
  87. package/dist/internal/function/work.mjs +1 -8
  88. package/dist/internal/herald.d.mts +3 -3
  89. package/dist/internal/herald.mjs +2 -1
  90. package/dist/internal/is.d.mts +1 -1
  91. package/dist/internal/math/aggregate.d.mts +2 -14
  92. package/dist/internal/math/aggregate.mjs +2 -5
  93. package/dist/internal/number.mjs +4 -7
  94. package/dist/internal/result/attempt.d.mts +1 -1
  95. package/dist/internal/result/misc.d.mts +1 -1
  96. package/dist/internal/string/case.mjs +6 -16
  97. package/dist/internal/string/misc.mjs +1 -2
  98. package/dist/internal/subscription.d.mts +1 -100
  99. package/dist/internal/subscription.mjs +3 -9
  100. package/dist/internal/value/compare.d.mts +4 -4
  101. package/dist/internal/value/compare.mjs +1 -1
  102. package/dist/internal/value/equal.d.mts +6 -57
  103. package/dist/internal/value/equal.mjs +5 -10
  104. package/dist/internal/value/get.d.mts +1 -1
  105. package/dist/internal/value/handlers.d.mts +2 -21
  106. package/dist/internal/value/has.d.mts +2 -2
  107. package/dist/internal/value/misc.d.mts +1 -1
  108. package/dist/internal/value/misc.mjs +8 -14
  109. package/dist/internal/value/set.d.mts +1 -1
  110. package/dist/internal/value/set.mjs +2 -2
  111. package/dist/is.mjs +3 -3
  112. package/dist/logger.d.mts +3 -70
  113. package/dist/logger.mjs +2 -5
  114. package/dist/math.d.mts +1 -1
  115. package/dist/math.mjs +2 -1
  116. package/dist/models/aborter.model.d.mts +12 -0
  117. package/dist/models/aborter.model.mjs +5 -0
  118. package/dist/models/array/array.find.model.d.mts +22 -0
  119. package/dist/models/array/array.find.model.mjs +8 -0
  120. package/dist/models/array/array.match.model.d.mts +14 -0
  121. package/dist/models/array/array.match.model.mjs +14 -0
  122. package/dist/models/array/array.misc.model.d.mts +36 -0
  123. package/dist/models/array/array.misc.model.mjs +12 -0
  124. package/dist/models/array/array.sort.model.d.mts +122 -0
  125. package/dist/models/array/array.sort.model.mjs +12 -0
  126. package/dist/models/beacon.model.d.mts +119 -0
  127. package/dist/models/beacon.model.mjs +16 -0
  128. package/dist/{color/models.d.mts → models/color.model.d.mts} +4 -4
  129. package/dist/models/function/assert.model.d.mts +13 -0
  130. package/dist/models/function/assert.model.mjs +4 -0
  131. package/dist/models/function/limiter.model.d.mts +71 -0
  132. package/dist/models/function/limiter.model.mjs +15 -0
  133. package/dist/models/function/memoize.model.d.mts +88 -0
  134. package/dist/models/function/memoize.model.mjs +7 -0
  135. package/dist/models/function/once.model.d.mts +76 -0
  136. package/dist/models/function/once.model.mjs +9 -0
  137. package/dist/models/function/retry.model.d.mts +17 -0
  138. package/dist/models/function/retry.model.mjs +17 -0
  139. package/dist/models/function/work.model.d.mts +20 -0
  140. package/dist/models/function/work.model.mjs +11 -0
  141. package/dist/{internal/models → models}/herald.model.d.mts +3 -3
  142. package/dist/{internal/models → models}/herald.model.mjs +2 -2
  143. package/dist/{models.d.mts → models/index.d.mts} +5 -47
  144. package/dist/models/logger.model.d.mts +83 -0
  145. package/dist/models/logger.model.mjs +7 -0
  146. package/dist/models/math.model.d.mts +16 -0
  147. package/dist/models/math.model.mjs +7 -0
  148. package/dist/models/misc.model.d.mts +10 -0
  149. package/dist/models/misc.model.mjs +11 -0
  150. package/dist/{internal/models → models}/plan.model.d.mts +40 -8
  151. package/dist/{internal/models → models}/plan.model.mjs +1 -1
  152. package/dist/models/promise.model.d.mts +119 -0
  153. package/dist/models/promise.model.mjs +47 -0
  154. package/dist/models/query.model.d.mts +9 -0
  155. package/dist/models/query.model.mjs +14 -0
  156. package/dist/models/queue.model.d.mts +251 -0
  157. package/dist/models/queue.model.mjs +29 -0
  158. package/dist/models/random.model.d.mts +6 -0
  159. package/dist/models/random.model.mjs +7 -0
  160. package/dist/{internal/models → models}/result.model.d.mts +10 -2
  161. package/dist/models/string/string.case.model.d.mts +19 -0
  162. package/dist/models/string/string.case.model.mjs +14 -0
  163. package/dist/models/string/string.fuzzy.model.d.mts +108 -0
  164. package/dist/models/string/string.fuzzy.model.mjs +9 -0
  165. package/dist/models/string/string.misc.model.d.mts +13 -0
  166. package/dist/models/string/string.misc.model.mjs +13 -0
  167. package/dist/models/string/string.normalize.model.d.mts +85 -0
  168. package/dist/models/string/string.normalize.model.mjs +43 -0
  169. package/dist/models/string/string.template.model.d.mts +50 -0
  170. package/dist/models/string/string.template.model.mjs +5 -0
  171. package/dist/models/subscription.model.d.mts +127 -0
  172. package/dist/models/subscription.model.mjs +10 -0
  173. package/dist/models/value/value.clone.model.d.mts +56 -0
  174. package/dist/models/value/value.clone.model.mjs +24 -0
  175. package/dist/models/value/value.diff.model.d.mts +61 -0
  176. package/dist/models/value/value.diff.model.mjs +6 -0
  177. package/dist/models/value/value.equal.model.d.mts +76 -0
  178. package/dist/models/value/value.equal.model.mjs +9 -0
  179. package/dist/models/value/value.handler.model.d.mts +27 -0
  180. package/dist/models/value/value.handler.model.mjs +1 -0
  181. package/dist/models/value/value.merge.model.d.mts +82 -0
  182. package/dist/models/value/value.merge.model.mjs +5 -0
  183. package/dist/models/value/value.misc.model.d.mts +33 -0
  184. package/dist/models/value/value.misc.model.mjs +12 -0
  185. package/dist/models/value/value.transform.model.d.mts +28 -0
  186. package/dist/models/value/value.transform.model.mjs +4 -0
  187. package/dist/plan/generate.d.mts +3 -2
  188. package/dist/plan/generate.mjs +23 -11
  189. package/dist/plan/index.d.mts +1 -1
  190. package/dist/plan/index.mjs +1 -1
  191. package/dist/plan/is.d.mts +1 -1
  192. package/dist/plan/is.mjs +1 -1
  193. package/dist/plan/misc.d.mts +4 -8
  194. package/dist/plan/misc.mjs +22 -15
  195. package/dist/plan/models.d.mts +2 -2
  196. package/dist/plan/result.d.mts +21 -5
  197. package/dist/plan/result.mjs +15 -11
  198. package/dist/plan/run.d.mts +26 -4
  199. package/dist/plan/run.mjs +7 -7
  200. package/dist/promise/delay.d.mts +1 -1
  201. package/dist/promise/delay.mjs +2 -1
  202. package/dist/promise/helpers.d.mts +2 -2
  203. package/dist/promise/helpers.mjs +6 -6
  204. package/dist/promise/index.d.mts +2 -2
  205. package/dist/promise/index.mjs +1 -1
  206. package/dist/promise/misc.d.mts +3 -3
  207. package/dist/promise/misc.mjs +7 -4
  208. package/dist/promise/models.d.mts +2 -106
  209. package/dist/promise/models.mjs +1 -35
  210. package/dist/promise/timed.d.mts +2 -2
  211. package/dist/promise/timed.mjs +3 -3
  212. package/dist/query.d.mts +1 -1
  213. package/dist/query.mjs +5 -15
  214. package/dist/queue.d.mts +6 -200
  215. package/dist/queue.mjs +9 -34
  216. package/dist/random.mjs +2 -5
  217. package/dist/result/match.d.mts +1 -1
  218. package/dist/result/match.mjs +27 -15
  219. package/dist/result/misc.d.mts +1 -1
  220. package/dist/result/work/flow.d.mts +13 -21
  221. package/dist/result/work/pipe.d.mts +2 -2
  222. package/dist/string/fuzzy.d.mts +5 -87
  223. package/dist/string/fuzzy.mjs +6 -11
  224. package/dist/string/index.mjs +6 -8
  225. package/dist/string/match.mjs +4 -6
  226. package/dist/string/normalize.d.mts +4 -40
  227. package/dist/string/normalize.mjs +9 -48
  228. package/dist/string/template.d.mts +5 -43
  229. package/dist/string/template.mjs +1 -2
  230. package/dist/subscription.d.mts +2 -1
  231. package/dist/value/clone.d.mts +6 -42
  232. package/dist/value/clone.mjs +10 -30
  233. package/dist/value/collection.mjs +2 -0
  234. package/dist/value/diff.d.mts +3 -44
  235. package/dist/value/diff.mjs +1 -3
  236. package/dist/value/freeze.d.mts +1 -5
  237. package/dist/value/index.d.mts +4 -3
  238. package/dist/value/merge.d.mts +6 -64
  239. package/dist/value/merge.mjs +8 -8
  240. package/dist/value/omit.d.mts +1 -1
  241. package/dist/value/pick.d.mts +1 -1
  242. package/dist/value/shake.d.mts +4 -6
  243. package/dist/value/smush.d.mts +4 -6
  244. package/dist/value/smush.mjs +2 -2
  245. package/dist/value/transform.d.mts +6 -22
  246. package/dist/value/transform.mjs +1 -1
  247. package/dist/value/unsmush.d.mts +4 -10
  248. package/package.json +12 -4
  249. package/dist/promise/constants.d.mts +0 -17
  250. package/dist/promise/constants.mjs +0 -15
  251. /package/dist/{color/models.mjs → models/color.model.mjs} +0 -0
  252. /package/dist/{internal/models/result.model.mjs → models/index.mjs} +0 -0
  253. /package/dist/{models.mjs → models/result.model.mjs} +0 -0
package/dist/index.d.mts CHANGED
@@ -1,4 +1,4 @@
1
- //#region src/models.d.ts
1
+ //#region src/models/index.d.ts
2
2
  /**
3
3
  * A generic array or object
4
4
  */
@@ -13,6 +13,10 @@ export type BuiltIns = void | Date | Primitive | RegExp;
13
13
  * A generic class constructor
14
14
  */
15
15
  export type Constructor<Instance = unknown> = new (...args: any[]) => Instance;
16
+ /**
17
+ * A frozen value with readonly properties _(going as deep as possible)_
18
+ */
19
+ export type Frozen<Value> = Value extends unknown[] ? Readonly<Value> : Value extends PlainObject ? { readonly [Key in keyof Value]: Frozen<Value[Key$1]>; } : Value extends Map<infer Key, infer Value> ? ReadonlyMap<Key$1, Frozen<Value>> : Value extends Set<infer Item> ? ReadonlySet<Frozen<Item>> : Readonly<Value>;
16
20
  /**
17
21
  * A generic async callback function
18
22
  */
@@ -72,52 +76,6 @@ export type NumericalKeys<Value> = { [ItemKey in keyof Value]: ItemKey extends n
72
76
  * The numerical values of an object
73
77
  */
74
78
  export type NumericalValues<Item extends PlainObject> = Simplify<{ [ItemKey in keyof Item as Item[ItemKey] extends number ? ItemKey : never]: Item[ItemKey]; }>;
75
- /**
76
- * An asynchronous function that can only be called once, returning the same value on subsequent calls
77
- */
78
- export type OnceAsync<Callback extends GenericAsyncCallback> = {
79
- /**
80
- * Did the callback's promise reject?
81
- */
82
- readonly error: boolean;
83
- /**
84
- * Has the callback finished?
85
- */
86
- readonly finished: boolean;
87
- /**
88
- * Run the callback
89
- *
90
- * @param parameters Callback parameters
91
- * @returns Call result
92
- */
93
- run(...parameters: Parameters<Callback>): ReturnType<Callback>;
94
- } & OnceProperties;
95
- /**
96
- * A callback function that can only be called once, returning the same value on subsequent calls
97
- */
98
- export type Once<Callback extends GenericCallback> = {
99
- /**
100
- * Run the callback
101
- *
102
- * @param parameters Callback parameters
103
- * @returns Call result
104
- */
105
- run(...parameters: Parameters<Callback>): ReturnType<Callback>;
106
- } & OnceProperties;
107
- type OnceProperties = {
108
- /**
109
- * Has the callback been called?
110
- */
111
- readonly called: boolean;
112
- /**
113
- * Has the callback's value been cleared?
114
- */
115
- readonly cleared: boolean;
116
- /**
117
- * Clear the callback's cached value
118
- */
119
- clear(): void;
120
- };
121
79
  /**
122
80
  * A generic object
123
81
  */
@@ -824,11 +782,16 @@ export declare function getArray<Item>(value: Item[]): Item[];
824
782
  */
825
783
  export declare function getArray<Value>(value: Value): Value[];
826
784
  //#endregion
827
- //#region src/internal/array/match.d.ts
785
+ //#region src/models/array/array.misc.model.d.ts
828
786
  /**
829
787
  * Comparison of an array within another array
830
788
  */
831
- export type ArrayComparison = "end" | "inside" | "invalid" | "outside" | "same" | "start";
789
+ type ArrayComparison = "end" | "inside" | "invalid" | "outside" | "same" | "start";
790
+ type ArrayMapKeyOrCallback<Item> = ((item: Item, index: number, array: Item[]) => unknown) | (Item extends PlainObject ? keyof Item : never);
791
+ type ArrayMapped<Item, Map extends ArrayMapKeyOrCallback<Item>> = Map extends ((item: Item, index: number, array: Item[]) => unknown) ? ReturnType<Map> : Map extends keyof Item ? Item[Map] : never;
792
+ type ArrayObjectKeysOf<Item> = { [Key in keyof Item]: Item[Key] extends PlainObject ? Key : never; }[keyof Item];
793
+ //#endregion
794
+ //#region src/internal/array/match.d.ts
832
795
  /**
833
796
  * Is the needle array at the end of the haystack array?
834
797
  *
@@ -2372,9 +2335,6 @@ export declare namespace move {
2372
2335
  }
2373
2336
  //#endregion
2374
2337
  //#region src/array/select.d.ts
2375
- type MapKeyOrCallback<Item> = ((item: Item, index: number, array: Item[]) => unknown) | (Item extends PlainObject ? keyof Item : never);
2376
- type Mapped<Item, Map extends MapKeyOrCallback<Item>> = Map extends ((item: Item, index: number, array: Item[]) => unknown) ? ReturnType<Map> : Map extends keyof Item ? Item[Map] : never;
2377
- type ObjectKeysOf<Item> = { [Key in keyof Item]: Item[Key] extends PlainObject ? Key : never; }[keyof Item];
2378
2338
  /**
2379
2339
  * Get a filtered and mapped array of items
2380
2340
  *
@@ -2394,7 +2354,7 @@ type ObjectKeysOf<Item> = { [Key in keyof Item]: Item[Key] extends PlainObject ?
2394
2354
  * ); // => ['Bob']
2395
2355
  * ```
2396
2356
  */
2397
- export declare function filterAndMap<Item, FilterCallback extends (item: Item, index: number, array: Item[]) => unknown, Map extends MapKeyOrCallback<Item>>(array: Item[], filterCallback: FilterCallback, filterValue: ReturnType<FilterCallback>, map: Map): Array<Mapped<Item, Map>>;
2357
+ export declare function filterAndMap<Item, FilterCallback extends (item: Item, index: number, array: Item[]) => unknown, Map extends ArrayMapKeyOrCallback<Item>>(array: Item[], filterCallback: FilterCallback, filterValue: ReturnType<FilterCallback>, map: Map): Array<ArrayMapped<Item, Map>>;
2398
2358
  /**
2399
2359
  * Get a filtered and mapped array of items
2400
2360
  *
@@ -2414,7 +2374,7 @@ export declare function filterAndMap<Item, FilterCallback extends (item: Item, i
2414
2374
  * ); // => ['Bob']
2415
2375
  * ```
2416
2376
  */
2417
- export declare function filterAndMap<Item extends PlainObject, ItemKey extends keyof Item, Map extends MapKeyOrCallback<Item>>(array: Item[], filterKey: ItemKey, filterValue: Item[ItemKey], map: Map): Array<Mapped<Item, Map>>;
2377
+ export declare function filterAndMap<Item extends PlainObject, ItemKey extends keyof Item, Map extends ArrayMapKeyOrCallback<Item>>(array: Item[], filterKey: ItemKey, filterValue: Item[ItemKey], map: Map): Array<ArrayMapped<Item, Map>>;
2418
2378
  /**
2419
2379
  * Get a filtered and mapped array of items
2420
2380
  *
@@ -2432,7 +2392,7 @@ export declare function filterAndMap<Item extends PlainObject, ItemKey extends k
2432
2392
  * ); // => ['Bob']
2433
2393
  * ```
2434
2394
  */
2435
- export declare function filterAndMap<Item, Map extends MapKeyOrCallback<Item>>(array: Item[], filter: (item: Item, index: number, array: Item[]) => boolean, map: Map): Array<Mapped<Item, Map>>;
2395
+ export declare function filterAndMap<Item, Map extends ArrayMapKeyOrCallback<Item>>(array: Item[], filter: (item: Item, index: number, array: Item[]) => boolean, map: Map): Array<ArrayMapped<Item, Map>>;
2436
2396
  /**
2437
2397
  * Get a filtered and mapped array of items
2438
2398
  *
@@ -2450,7 +2410,7 @@ export declare function filterAndMap<Item, Map extends MapKeyOrCallback<Item>>(a
2450
2410
  * ); // => [9]
2451
2411
  * ```
2452
2412
  */
2453
- export declare function filterAndMap<Item, Map extends MapKeyOrCallback<Item>>(array: Item[], item: Item, map: Map): Array<Mapped<Item, Map>>;
2413
+ export declare function filterAndMap<Item, Map extends ArrayMapKeyOrCallback<Item>>(array: Item[], item: Item, map: Map): Array<ArrayMapped<Item, Map>>;
2454
2414
  /**
2455
2415
  * Get a mapped and filtered array of items
2456
2416
  *
@@ -2472,7 +2432,7 @@ export declare function filterAndMap<Item, Map extends MapKeyOrCallback<Item>>(a
2472
2432
  * ); // => ['Bob']
2473
2433
  * ```
2474
2434
  */
2475
- export declare function mapAndFilter<Item, Map extends MapKeyOrCallback<Item>, FilterCallback extends (item: Mapped<Item, Map>, index: number, array: Item[]) => unknown>(array: Item[], map: Map, filterCallback: FilterCallback, filterValue: ReturnType<FilterCallback>): Array<Mapped<Item, Map>>;
2435
+ export declare function mapAndFilter<Item, Map extends ArrayMapKeyOrCallback<Item>, FilterCallback extends (item: ArrayMapped<Item, Map>, index: number, array: Item[]) => unknown>(array: Item[], map: Map, filterCallback: FilterCallback, filterValue: ReturnType<FilterCallback>): Array<ArrayMapped<Item, Map>>;
2476
2436
  /**
2477
2437
  * Get a mapped and filtered array of items
2478
2438
  *
@@ -2516,7 +2476,7 @@ export declare function mapAndFilter<Item, MapCallback extends (item: Item, inde
2516
2476
  * ); // => [{tag: 'b'}]
2517
2477
  * ```
2518
2478
  */
2519
- export declare function mapAndFilter<Item, MapKey extends ObjectKeysOf<Item>, ItemKey extends keyof Item[MapKey]>(array: Item[], map: MapKey, filterKey: ItemKey, filterValue: Item[MapKey][ItemKey]): Array<Item[MapKey]>;
2479
+ export declare function mapAndFilter<Item, MapKey extends ArrayObjectKeysOf<Item>, ItemKey extends keyof Item[MapKey]>(array: Item[], map: MapKey, filterKey: ItemKey, filterValue: Item[MapKey][ItemKey]): Array<Item[MapKey]>;
2520
2480
  /**
2521
2481
  * Get a mapped and filtered array of items
2522
2482
  *
@@ -2536,7 +2496,7 @@ export declare function mapAndFilter<Item, MapKey extends ObjectKeysOf<Item>, It
2536
2496
  * ); // => ['Bob']
2537
2497
  * ```
2538
2498
  */
2539
- export declare function mapAndFilter<Item, Map extends MapKeyOrCallback<Item>>(array: Item[], map: Map, filter: (item: Mapped<Item, Map>, index: number, array: Item[]) => boolean): Array<Mapped<Item, Map>>;
2499
+ export declare function mapAndFilter<Item, Map extends ArrayMapKeyOrCallback<Item>>(array: Item[], map: Map, filter: (item: ArrayMapped<Item, Map>, index: number, array: Item[]) => boolean): Array<ArrayMapped<Item, Map>>;
2540
2500
  /**
2541
2501
  * Get a mapped and filtered array of items
2542
2502
  *
@@ -2556,16 +2516,16 @@ export declare function mapAndFilter<Item, Map extends MapKeyOrCallback<Item>>(a
2556
2516
  * ); // => [4, 4]
2557
2517
  * ```
2558
2518
  */
2559
- export declare function mapAndFilter<Item, Map extends MapKeyOrCallback<Item>>(array: Item[], map: Map, value: Mapped<Item, Map>): Array<Mapped<Item, Map>>;
2519
+ export declare function mapAndFilter<Item, Map extends ArrayMapKeyOrCallback<Item>>(array: Item[], map: Map, value: ArrayMapped<Item, Map>): Array<ArrayMapped<Item, Map>>;
2560
2520
  export declare namespace filterAndMap {
2561
2521
  export var reverse: typeof mapAndFilter;
2562
2522
  }
2563
2523
  //#endregion
2564
- //#region src/array/sort.d.ts
2524
+ //#region src/models/array/array.sort.model.d.ts
2565
2525
  /**
2566
2526
  * Sorting information for arrays _(using a comparison callback)_
2567
2527
  */
2568
- export type ArrayComparisonSorter<Item> = {
2528
+ type ArrayComparisonSorter<Item> = {
2569
2529
  /**
2570
2530
  * Callback to use when comparing items and values
2571
2531
  */
@@ -2578,7 +2538,7 @@ export type ArrayComparisonSorter<Item> = {
2578
2538
  /**
2579
2539
  * Sorting information for arrays _(using a key)_
2580
2540
  */
2581
- export type ArrayKeySorter<Item extends PlainObject, ItemKey extends keyof Item> = {
2541
+ type ArrayKeySorter<Item extends PlainObject, ItemKey extends keyof Item> = {
2582
2542
  /**
2583
2543
  * Comparator to use when comparing items and values
2584
2544
  */
@@ -2599,15 +2559,15 @@ type ArrayKeySorters<Item extends PlainObject> = { [ItemKey in keyof Item]: Arra
2599
2559
  /**
2600
2560
  * Sorter to use for sorting
2601
2561
  */
2602
- export type ArraySorter<Item> = Item extends PlainObject ? keyof Item | ArrayComparisonSorter<Item> | ArrayKeySorters<Item> | ArrayValueSorter<Item> | ComparisonSorter<Item> : ArrayComparisonSorter<Item> | ArrayValueSorter<Item> | ComparisonSorter<Item>;
2562
+ type ArraySorter<Item> = Item extends PlainObject ? keyof Item | ArrayComparisonSorter<Item> | ArrayKeySorters<Item> | ArrayValueSorter<Item> | ComparisonSorter<Item> : ArrayComparisonSorter<Item> | ArrayValueSorter<Item> | ComparisonSorter<Item>;
2603
2563
  /**
2604
2564
  * Sorters to use for sorting
2605
2565
  */
2606
- export type ArraySorters<Item> = Array<ArraySorter<Item>>;
2566
+ type ArraySorters<Item> = Array<ArraySorter<Item>>;
2607
2567
  /**
2608
2568
  * Sorting information for arrays _(using a value callback and built-in comparison)_
2609
2569
  */
2610
- export type ArrayValueSorter<Item> = {
2570
+ type ArrayValueSorter<Item> = {
2611
2571
  /**
2612
2572
  * Direction to sort by
2613
2573
  */
@@ -2629,13 +2589,24 @@ type ComparisonSorter<Item> = (first: Item, second: Item) => number;
2629
2589
  /**
2630
2590
  * Direction to sort by
2631
2591
  */
2632
- export type SortDirection = "ascending" | "descending";
2592
+ type SortDirection = "ascending" | "descending";
2593
+ type SortHandler = {
2594
+ comparison?: SortHandlerComparison;
2595
+ get: boolean;
2596
+ identifier: string;
2597
+ modifier: number;
2598
+ value?: Function;
2599
+ };
2600
+ type SortHandlerComparison = {
2601
+ complex?: Function;
2602
+ simple?: Function;
2603
+ };
2633
2604
  /**
2634
2605
  * Sorter for an array with predefined sorters
2635
2606
  *
2636
2607
  * Can be used to sort an array, get the predicted index for an item, and check if an array is sorted
2637
2608
  */
2638
- export type Sorter<Item> = {
2609
+ type Sorter<Item> = {
2639
2610
  /**
2640
2611
  * Get the index for an item _(to be inserted into an array of items)_
2641
2612
  *
@@ -2661,6 +2632,11 @@ export type Sorter<Item> = {
2661
2632
  */
2662
2633
  sort(array: Item[]): Item[];
2663
2634
  };
2635
+ export declare const SORT_DIRECTION_ASCENDING: SortDirection;
2636
+ export declare const SORT_DIRECTION_DESCENDING: SortDirection;
2637
+ //#endregion
2638
+ //#region src/array/sort.d.ts
2639
+ declare function Sorter(this: any, sorters: SortHandler[]): void;
2664
2640
  /**
2665
2641
  * Get the index for an item _(to be inserted into an array of items)_ based on sorters _(and an optional default direction)_
2666
2642
  *
@@ -2806,8 +2782,6 @@ export declare function sort<Item>(array: Item[], sorter: ArraySorter<Item>, des
2806
2782
  * @returns Sorted array
2807
2783
  */
2808
2784
  export declare function sort<Item>(array: Item[], descending?: boolean): Item[];
2809
- export declare const SORT_DIRECTION_ASCENDING: SortDirection;
2810
- export declare const SORT_DIRECTION_DESCENDING: SortDirection;
2811
2785
  export declare namespace sort {
2812
2786
  export var getIndex: typeof getSortedIndex;
2813
2787
  export var initialize: typeof initializeSorter;
@@ -3194,7 +3168,7 @@ export declare namespace toRecord {
3194
3168
  */
3195
3169
  export declare function noop(): void;
3196
3170
  //#endregion
3197
- //#region src/internal/function/limit.d.ts
3171
+ //#region src/models/function/limiter.model.d.ts
3198
3172
  /**
3199
3173
  * An asynchronous function that can be cancelled
3200
3174
  */
@@ -3280,7 +3254,57 @@ export declare namespace throttle {
3280
3254
  export var async: typeof asyncThrottle;
3281
3255
  }
3282
3256
  //#endregion
3257
+ //#region src/models/function/once.model.d.ts
3258
+ /**
3259
+ * An asynchronous function that can only be called once, returning the same value on subsequent calls
3260
+ */
3261
+ type AsyncOnce<Callback extends GenericAsyncCallback> = {
3262
+ /**
3263
+ * Did the callback's promise reject?
3264
+ */
3265
+ readonly error: boolean;
3266
+ /**
3267
+ * Has the callback finished?
3268
+ */
3269
+ readonly finished: boolean;
3270
+ /**
3271
+ * Run the callback
3272
+ *
3273
+ * @param parameters Callback parameters
3274
+ * @returns Call result
3275
+ */
3276
+ run(...parameters: Parameters<Callback>): ReturnType<Callback>;
3277
+ } & OnceProperties;
3278
+ /**
3279
+ * A callback function that can only be called once, returning the same value on subsequent calls
3280
+ */
3281
+ type Once<Callback extends GenericCallback> = {
3282
+ /**
3283
+ * Run the callback
3284
+ *
3285
+ * @param parameters Callback parameters
3286
+ * @returns Call result
3287
+ */
3288
+ run(...parameters: Parameters<Callback>): ReturnType<Callback>;
3289
+ } & OnceProperties;
3290
+ type OnceProperties = {
3291
+ /**
3292
+ * Has the callback been called?
3293
+ */
3294
+ readonly called: boolean;
3295
+ /**
3296
+ * Has the callback's value been cleared?
3297
+ */
3298
+ readonly cleared: boolean;
3299
+ /**
3300
+ * Clear the callback's cached value
3301
+ */
3302
+ clear(): void;
3303
+ };
3304
+ //#endregion
3283
3305
  //#region src/function/once.d.ts
3306
+ declare function AsyncOnce(this: any, callback: GenericAsyncCallback): void;
3307
+ declare function Once(this: any, callback: GenericCallback): void;
3284
3308
  /**
3285
3309
  * Create an asynchronous function that can only be called once, rejecting or resolving the same result on subsequent calls
3286
3310
  *
@@ -3289,7 +3313,7 @@ export declare namespace throttle {
3289
3313
  * @param callback Callback to use once
3290
3314
  * @returns _Once_ callback
3291
3315
  */
3292
- export declare function asyncOnce<Callback extends GenericAsyncCallback>(callback: Callback): OnceAsync<Callback>;
3316
+ export declare function asyncOnce<Callback extends GenericAsyncCallback>(callback: Callback): AsyncOnce<Callback>;
3293
3317
  /**
3294
3318
  * Is the value an asynchronous once callback?
3295
3319
  *
@@ -3320,7 +3344,7 @@ export declare namespace once {
3320
3344
  export var isAsync: typeof isAsyncOnce;
3321
3345
  }
3322
3346
  //#endregion
3323
- //#region src/function/retry.d.ts
3347
+ //#region src/models/function/retry.model.d.ts
3324
3348
  /**
3325
3349
  * An error thrown when a retry fails
3326
3350
  */
@@ -3328,11 +3352,13 @@ export declare class RetryError extends Error {
3328
3352
  readonly original: unknown;
3329
3353
  constructor(message: string, original: unknown);
3330
3354
  }
3331
- export type RetryOptions = {
3355
+ type RetryOptions = {
3332
3356
  delay?: number;
3333
3357
  times?: number;
3334
3358
  when?: (error: unknown) => boolean;
3335
3359
  };
3360
+ //#endregion
3361
+ //#region src/function/retry.d.ts
3336
3362
  /**
3337
3363
  * Retry a callback a specified number of times, with a delay between attempts
3338
3364
  *
@@ -3508,16 +3534,14 @@ export declare namespace indexOf {
3508
3534
  export var last: typeof lastIndexOf;
3509
3535
  }
3510
3536
  //#endregion
3511
- //#region src/internal/function/assert.d.ts
3512
- /**
3513
- * Asserter for a property of a value
3514
- */
3515
- export type AssertProperty<Value extends PlainObject, Path extends NestedKeys<Value>, Asserted extends NestedPick<Value, Path> = NestedPick<Value, Path>> = Asserter<Asserted>;
3537
+ //#region src/models/function/assert.model.d.ts
3538
+ type AssertNestedPick<Value, Path extends string> = Value extends PlainObject ? Path extends `${infer Head}.${infer Rest}` ? Head extends keyof Value ? { [Key in Head]: AssertNestedPick<Value[Key], Rest>; } : never : Path extends keyof Value ? { [Key in Path]: Value[Key]; } : never : never;
3516
3539
  /**
3517
3540
  * A function that asserts a value is of a specific type, throwing an error if it is not
3518
3541
  */
3519
- export type Asserter<Value> = (value: unknown) => asserts value is Value;
3520
- type NestedPick<Value, Path extends string> = Value extends PlainObject ? Path extends `${infer Head}.${infer Rest}` ? Head extends keyof Value ? { [Key in Head]: NestedPick<Value[Key], Rest>; } : never : Path extends keyof Value ? { [Key in Path]: Value[Key]; } : never : never;
3542
+ type Asserter<Value> = (value: unknown) => asserts value is Value;
3543
+ //#endregion
3544
+ //#region src/internal/function/assert.d.ts
3521
3545
  /**
3522
3546
  * Asserts that a condition is true, throwing an error if it is not
3523
3547
  *
@@ -3580,7 +3604,7 @@ export declare function assertIs<Value>(condition: (value: unknown) => value is
3580
3604
  * @param error Error constructor _(defaults to `Error`)_
3581
3605
  * @returns _Asserter_
3582
3606
  */
3583
- export declare function assertProperty<Value extends PlainObject, Path extends NestedKeys<Value>>(path: Path, condition: (value: NestedValue<Value, Path>) => boolean, message: string, error?: ErrorConstructor): Asserter<NestedPick<Value, Path>>;
3607
+ export declare function assertProperty<Value extends PlainObject, Path extends NestedKeys<Value>>(path: Path, condition: (value: NestedValue<Value, Path>) => boolean, message: string, error?: ErrorConstructor): Asserter<AssertNestedPick<Value, Path>>;
3584
3608
  export declare namespace assert {
3585
3609
  export var condition: typeof assertCondition;
3586
3610
  export var defined: typeof assertDefined;
@@ -3589,11 +3613,59 @@ export declare namespace assert {
3589
3613
  export var property: typeof assertProperty;
3590
3614
  }
3591
3615
  //#endregion
3592
- //#region src/internal/function/memoize.d.ts
3616
+ //#region src/internal/sized/map.d.ts
3617
+ /**
3618
+ * A _Map_ with a maximum size
3619
+ *
3620
+ * Behavior is similar to a _LRU_ cache, where the least recently used entries are removed
3621
+ */
3622
+ export declare class SizedMap<SizedKey = unknown, SizedValue = unknown> extends Map<SizedKey, SizedValue> {
3623
+ #private;
3624
+ /**
3625
+ * Is the _Map_ full?
3626
+ */
3627
+ get full(): boolean;
3628
+ get maximum(): number;
3629
+ /**
3630
+ * Create a new _SizedMap_ with entries and a maximum size _(2^20)_
3631
+ *
3632
+ * @param entries Array of key-value pairs to initialize the _SizedMap_ with
3633
+ * @template SizedKey Type of the keys in the _SizedMap_
3634
+ * @template SizedValue Type of the values in the _SizedMap_
3635
+ */
3636
+ constructor(entries: [SizedKey, SizedValue][]);
3637
+ /**
3638
+ * Create a new _SizedMap_ with a maximum size _(but clamped at 2^24)_
3639
+ *
3640
+ * @param maximum Maximum size of the _SizedMap_
3641
+ * @template SizedKey Type of the keys in the _SizedMap_
3642
+ * @template SizedValue Type of the values in the _SizedMap_
3643
+ */
3644
+ constructor(maximum: number);
3645
+ /**
3646
+ * Create a new _SizedMap_ with _(optional)_ entries and a maximum size
3647
+ *
3648
+ * @param entries Array of key-value pairs to initialize the _SizedMap_ with
3649
+ * @param maximum Maximum size of the _SizedMap_ _(defaults to 2^20; clamped at 2^24)_
3650
+ * @template SizedKey Type of the keys in the _SizedMap_
3651
+ * @template SizedValue Type of the values in the _SizedMap_
3652
+ */
3653
+ constructor(entries?: [SizedKey, SizedValue][], maximum?: number);
3654
+ /**
3655
+ * @inheritdoc
3656
+ */
3657
+ override get(key: SizedKey): SizedValue | undefined;
3658
+ /**
3659
+ * @inheritdoc
3660
+ */
3661
+ override set(key: SizedKey, value: SizedValue): this;
3662
+ }
3663
+ //#endregion
3664
+ //#region src/models/function/memoize.model.d.ts
3593
3665
  /**
3594
3666
  * A _Memoized_ function instance, caching and retrieving results based on the its parameters _(or a custom cache key)_
3595
3667
  */
3596
- export type Memoized<Callback extends GenericCallback> = {
3668
+ type Memoized<Callback extends GenericCallback> = {
3597
3669
  /**
3598
3670
  * Maximum cache size
3599
3671
  *
@@ -3648,7 +3720,7 @@ export type Memoized<Callback extends GenericCallback> = {
3648
3720
  /**
3649
3721
  * Options for a _Memoized_ function
3650
3722
  */
3651
- export type MemoizedOptions<Callback extends GenericCallback> = {
3723
+ type MemoizedOptions<Callback extends GenericCallback> = {
3652
3724
  /**
3653
3725
  * Callback for getting a cache key for the provided parameters
3654
3726
  */
@@ -3658,6 +3730,13 @@ export type MemoizedOptions<Callback extends GenericCallback> = {
3658
3730
  */
3659
3731
  cacheSize?: number;
3660
3732
  };
3733
+ type MemoizedStateOptions = {
3734
+ cacheKey?: GenericCallback;
3735
+ cacheSize: number;
3736
+ };
3737
+ //#endregion
3738
+ //#region src/internal/function/memoize.d.ts
3739
+ declare function Memoized(this: any, callback: GenericCallback, options: MemoizedStateOptions): void;
3661
3740
  /**
3662
3741
  * Memoize a function, caching and retrieving results based on the first parameter
3663
3742
  *
@@ -3667,11 +3746,19 @@ export type MemoizedOptions<Callback extends GenericCallback> = {
3667
3746
  */
3668
3747
  export declare function memoize<Callback extends GenericCallback>(callback: Callback, options?: MemoizedOptions<Callback>): Memoized<Callback>;
3669
3748
  //#endregion
3670
- //#region src/internal/models/result.model.d.ts
3749
+ //#region src/models/result.model.d.ts
3671
3750
  /**
3672
3751
  * An unknown result
3673
3752
  */
3674
3753
  export type AnyResult<Value, E> = Err<E> | ExtendedErr<E> | Ok<Value>;
3754
+ /**
3755
+ * A synchronous _Flow_, a function that attempts to pipe values through a series of functions
3756
+ */
3757
+ export type AttemptFlow<Callback extends GenericCallback, Value> = (...args: Parameters<Callback>) => Result<UnwrapValue<Value>>;
3758
+ /**
3759
+ * An asynchronous _Flow_, a function that attempts to pipe values through a series of functions
3760
+ */
3761
+ export type AttemptAsyncFlow<Callback extends GenericCallback, Value> = (...args: Parameters<Callback>) => Promise<Result<UnwrapValue<Value>>>;
3675
3762
  /**
3676
3763
  * An error result
3677
3764
  */
@@ -3729,15 +3816,17 @@ type UnwrapResult<Original extends Result<unknown, unknown>> = Original extends
3729
3816
  */
3730
3817
  export type UnwrapValue<Original> = Original extends GenericCallback ? ReturnType<Original> extends Result<unknown, unknown> ? UnwrapResult<ReturnType<Original>> : ReturnType<Original> : Original extends Result<unknown, unknown> ? UnwrapResult<Original> : Original extends Promise<infer Value> ? Awaited<Value> : Original;
3731
3818
  //#endregion
3732
- //#region src/internal/function/work.d.ts
3819
+ //#region src/models/function/work.model.d.ts
3733
3820
  /**
3734
- * A synchronous _Flow_, a function that pipe a value through a series of functions
3821
+ * An asynchronous _Flow_, a function that pipes a value through a series of functions
3735
3822
  */
3736
- export type Flow<Callback extends GenericCallback, Value> = (...args: Parameters<Callback>) => UnwrapValue<Value>;
3823
+ type AsyncFlow<Callback extends GenericCallback, Value> = (...args: Parameters<Callback>) => Promise<UnwrapValue<Value>>;
3737
3824
  /**
3738
- * An asynchronous _Flow_, a function that pipes a value through a series of functions
3825
+ * A synchronous _Flow_, a function that pipe a value through a series of functions
3739
3826
  */
3740
- export type FlowPromise<Callback extends GenericCallback, Value> = (...args: Parameters<Callback>) => Promise<UnwrapValue<Value>>;
3827
+ type Flow<Callback extends GenericCallback, Value> = (...args: Parameters<Callback>) => UnwrapValue<Value>;
3828
+ //#endregion
3829
+ //#region src/internal/function/work.d.ts
3741
3830
  /**
3742
3831
  * Create an asynchronous _Flow_, a function that pipes values through a function
3743
3832
  *
@@ -3745,7 +3834,7 @@ export type FlowPromise<Callback extends GenericCallback, Value> = (...args: Par
3745
3834
  *
3746
3835
  * @returns _Flow_ function
3747
3836
  */
3748
- export declare function asyncFlow<Fn extends GenericCallback>(fn: Fn): FlowPromise<Fn, ReturnType<Fn>>;
3837
+ export declare function asyncFlow<Fn extends GenericCallback>(fn: Fn): AsyncFlow<Fn, ReturnType<Fn>>;
3749
3838
  /**
3750
3839
  * Create an asynchronous _Flow_, a function that pipes values through a series of functions
3751
3840
  *
@@ -3753,7 +3842,7 @@ export declare function asyncFlow<Fn extends GenericCallback>(fn: Fn): FlowPromi
3753
3842
  *
3754
3843
  * @returns _Flow_ function
3755
3844
  */
3756
- export declare function asyncFlow<First extends GenericCallback, Second>(first: First, second: (value: Awaited<UnwrapValue<ReturnType<First>>>) => Second): FlowPromise<First, Second>;
3845
+ export declare function asyncFlow<First extends GenericCallback, Second>(first: First, second: (value: Awaited<UnwrapValue<ReturnType<First>>>) => Second): AsyncFlow<First, Second>;
3757
3846
  /**
3758
3847
  * Create an asynchronous _Flow_, a function that pipes values through a series of functions
3759
3848
  *
@@ -3761,7 +3850,7 @@ export declare function asyncFlow<First extends GenericCallback, Second>(first:
3761
3850
  *
3762
3851
  * @returns _Flow_ function
3763
3852
  */
3764
- export declare function asyncFlow<First extends GenericCallback, Second, Third>(first: First, second: (value: Awaited<UnwrapValue<ReturnType<First>>>) => Second, third: (value: Awaited<UnwrapValue<Second>>) => Third): FlowPromise<First, Third>;
3853
+ export declare function asyncFlow<First extends GenericCallback, Second, Third>(first: First, second: (value: Awaited<UnwrapValue<ReturnType<First>>>) => Second, third: (value: Awaited<UnwrapValue<Second>>) => Third): AsyncFlow<First, Third>;
3765
3854
  /**
3766
3855
  * Create an asynchronous _Flow_, a function that pipes values through a series of functions
3767
3856
  *
@@ -3769,7 +3858,7 @@ export declare function asyncFlow<First extends GenericCallback, Second, Third>(
3769
3858
  *
3770
3859
  * @returns _Flow_ function
3771
3860
  */
3772
- export declare function asyncFlow<First extends GenericCallback, Second, Third, Fourth>(first: First, second: (value: Awaited<UnwrapValue<ReturnType<First>>>) => Second, third: (value: Awaited<UnwrapValue<Second>>) => Third, fourth: (value: Awaited<UnwrapValue<Third>>) => Fourth): FlowPromise<First, Fourth>;
3861
+ export declare function asyncFlow<First extends GenericCallback, Second, Third, Fourth>(first: First, second: (value: Awaited<UnwrapValue<ReturnType<First>>>) => Second, third: (value: Awaited<UnwrapValue<Second>>) => Third, fourth: (value: Awaited<UnwrapValue<Third>>) => Fourth): AsyncFlow<First, Fourth>;
3773
3862
  /**
3774
3863
  * Create an asynchronous _Flow_, a function that pipes values through a series of functions
3775
3864
  *
@@ -3777,7 +3866,7 @@ export declare function asyncFlow<First extends GenericCallback, Second, Third,
3777
3866
  *
3778
3867
  * @returns _Flow_ function
3779
3868
  */
3780
- export declare function asyncFlow<First extends GenericCallback, Second, Third, Fourth, Fifth>(first: First, second: (value: Awaited<UnwrapValue<ReturnType<First>>>) => Second, third: (value: Awaited<UnwrapValue<Second>>) => Third, fourth: (value: Awaited<UnwrapValue<Third>>) => Fourth, fifth: (value: Awaited<UnwrapValue<Fourth>>) => Fifth): FlowPromise<First, Fifth>;
3869
+ export declare function asyncFlow<First extends GenericCallback, Second, Third, Fourth, Fifth>(first: First, second: (value: Awaited<UnwrapValue<ReturnType<First>>>) => Second, third: (value: Awaited<UnwrapValue<Second>>) => Third, fourth: (value: Awaited<UnwrapValue<Third>>) => Fourth, fifth: (value: Awaited<UnwrapValue<Fourth>>) => Fifth): AsyncFlow<First, Fifth>;
3781
3870
  /**
3782
3871
  * Create an asynchronous _Flow_, a function that pipes values through a series of functions
3783
3872
  *
@@ -3785,7 +3874,7 @@ export declare function asyncFlow<First extends GenericCallback, Second, Third,
3785
3874
  *
3786
3875
  * @returns _Flow_ function
3787
3876
  */
3788
- export declare function asyncFlow<First extends GenericCallback, Second, Third, Fourth, Fifth, Sixth>(first: First, second: (value: Awaited<UnwrapValue<ReturnType<First>>>) => Second, third: (value: Awaited<UnwrapValue<Second>>) => Third, fourth: (value: Awaited<UnwrapValue<Third>>) => Fourth, fifth: (value: Awaited<UnwrapValue<Fourth>>) => Fifth, sixth: (value: Awaited<UnwrapValue<Fifth>>) => Sixth): FlowPromise<First, Sixth>;
3877
+ export declare function asyncFlow<First extends GenericCallback, Second, Third, Fourth, Fifth, Sixth>(first: First, second: (value: Awaited<UnwrapValue<ReturnType<First>>>) => Second, third: (value: Awaited<UnwrapValue<Second>>) => Third, fourth: (value: Awaited<UnwrapValue<Third>>) => Fourth, fifth: (value: Awaited<UnwrapValue<Fourth>>) => Fifth, sixth: (value: Awaited<UnwrapValue<Fifth>>) => Sixth): AsyncFlow<First, Sixth>;
3789
3878
  /**
3790
3879
  * Create an asynchronous _Flow_, a function that pipes values through a series of functions
3791
3880
  *
@@ -3793,7 +3882,7 @@ export declare function asyncFlow<First extends GenericCallback, Second, Third,
3793
3882
  *
3794
3883
  * @returns _Flow_ function
3795
3884
  */
3796
- export declare function asyncFlow<First extends GenericCallback, Second, Third, Fourth, Fifth, Sixth, Seventh>(first: First, second: (value: Awaited<UnwrapValue<ReturnType<First>>>) => Second, third: (value: Awaited<UnwrapValue<Second>>) => Third, fourth: (value: Awaited<UnwrapValue<Third>>) => Fourth, fifth: (value: Awaited<UnwrapValue<Fourth>>) => Fifth, sixth: (value: Awaited<UnwrapValue<Fifth>>) => Sixth, seventh: (value: Awaited<UnwrapValue<Sixth>>) => Seventh): FlowPromise<First, Seventh>;
3885
+ export declare function asyncFlow<First extends GenericCallback, Second, Third, Fourth, Fifth, Sixth, Seventh>(first: First, second: (value: Awaited<UnwrapValue<ReturnType<First>>>) => Second, third: (value: Awaited<UnwrapValue<Second>>) => Third, fourth: (value: Awaited<UnwrapValue<Third>>) => Fourth, fifth: (value: Awaited<UnwrapValue<Fourth>>) => Fifth, sixth: (value: Awaited<UnwrapValue<Fifth>>) => Sixth, seventh: (value: Awaited<UnwrapValue<Sixth>>) => Seventh): AsyncFlow<First, Seventh>;
3797
3886
  /**
3798
3887
  * Create an asynchronous _Flow_, a function that pipes values through a series of functions
3799
3888
  *
@@ -3801,7 +3890,7 @@ export declare function asyncFlow<First extends GenericCallback, Second, Third,
3801
3890
  *
3802
3891
  * @returns _Flow_ function
3803
3892
  */
3804
- export declare function asyncFlow<First extends GenericCallback, Second, Third, Fourth, Fifth, Sixth, Seventh, Eighth>(first: First, second: (value: Awaited<UnwrapValue<ReturnType<First>>>) => Second, third: (value: Awaited<UnwrapValue<Second>>) => Third, fourth: (value: Awaited<UnwrapValue<Third>>) => Fourth, fifth: (value: Awaited<UnwrapValue<Fourth>>) => Fifth, sixth: (value: Awaited<UnwrapValue<Fifth>>) => Sixth, seventh: (value: Awaited<UnwrapValue<Sixth>>) => Seventh, eighth: (value: Awaited<UnwrapValue<Seventh>>) => Eighth): FlowPromise<First, Eighth>;
3893
+ export declare function asyncFlow<First extends GenericCallback, Second, Third, Fourth, Fifth, Sixth, Seventh, Eighth>(first: First, second: (value: Awaited<UnwrapValue<ReturnType<First>>>) => Second, third: (value: Awaited<UnwrapValue<Second>>) => Third, fourth: (value: Awaited<UnwrapValue<Third>>) => Fourth, fifth: (value: Awaited<UnwrapValue<Fourth>>) => Fifth, sixth: (value: Awaited<UnwrapValue<Fifth>>) => Sixth, seventh: (value: Awaited<UnwrapValue<Sixth>>) => Seventh, eighth: (value: Awaited<UnwrapValue<Seventh>>) => Eighth): AsyncFlow<First, Eighth>;
3805
3894
  /**
3806
3895
  * Create an asynchronous _Flow_, a function that pipes values through a series of functions
3807
3896
  *
@@ -3809,7 +3898,7 @@ export declare function asyncFlow<First extends GenericCallback, Second, Third,
3809
3898
  *
3810
3899
  * @returns _Flow_ function
3811
3900
  */
3812
- export declare function asyncFlow<First extends GenericCallback, Second, Third, Fourth, Fifth, Sixth, Seventh, Eighth, Ninth>(first: First, second: (value: Awaited<UnwrapValue<ReturnType<First>>>) => Second, third: (value: Awaited<UnwrapValue<Second>>) => Third, fourth: (value: Awaited<UnwrapValue<Third>>) => Fourth, fifth: (value: Awaited<UnwrapValue<Fourth>>) => Fifth, sixth: (value: Awaited<UnwrapValue<Fifth>>) => Sixth, seventh: (value: Awaited<UnwrapValue<Sixth>>) => Seventh, eighth: (value: Awaited<UnwrapValue<Seventh>>) => Eighth, ninth: (value: Awaited<UnwrapValue<Eighth>>) => Ninth): FlowPromise<First, Ninth>;
3901
+ export declare function asyncFlow<First extends GenericCallback, Second, Third, Fourth, Fifth, Sixth, Seventh, Eighth, Ninth>(first: First, second: (value: Awaited<UnwrapValue<ReturnType<First>>>) => Second, third: (value: Awaited<UnwrapValue<Second>>) => Third, fourth: (value: Awaited<UnwrapValue<Third>>) => Fourth, fifth: (value: Awaited<UnwrapValue<Fourth>>) => Fifth, sixth: (value: Awaited<UnwrapValue<Fifth>>) => Sixth, seventh: (value: Awaited<UnwrapValue<Sixth>>) => Seventh, eighth: (value: Awaited<UnwrapValue<Seventh>>) => Eighth, ninth: (value: Awaited<UnwrapValue<Eighth>>) => Ninth): AsyncFlow<First, Ninth>;
3813
3902
  /**
3814
3903
  * Create an asynchronous _Flow_, a function that pipes values through a series of functions
3815
3904
  *
@@ -3817,7 +3906,7 @@ export declare function asyncFlow<First extends GenericCallback, Second, Third,
3817
3906
  *
3818
3907
  * @returns _Flow_ function
3819
3908
  */
3820
- export declare function asyncFlow<First extends GenericCallback, Second, Third, Fourth, Fifth, Sixth, Seventh, Eighth, Ninth, Tenth>(first: First, second: (value: Awaited<UnwrapValue<ReturnType<First>>>) => Second, third: (value: Awaited<UnwrapValue<Second>>) => Third, fourth: (value: Awaited<UnwrapValue<Third>>) => Fourth, fifth: (value: Awaited<UnwrapValue<Fourth>>) => Fifth, sixth: (value: Awaited<UnwrapValue<Fifth>>) => Sixth, seventh: (value: Awaited<UnwrapValue<Sixth>>) => Seventh, eighth: (value: Awaited<UnwrapValue<Seventh>>) => Eighth, ninth: (value: Awaited<UnwrapValue<Eighth>>) => Ninth, tenth: (value: Awaited<UnwrapValue<Ninth>>) => Tenth): FlowPromise<First, Tenth>;
3909
+ export declare function asyncFlow<First extends GenericCallback, Second, Third, Fourth, Fifth, Sixth, Seventh, Eighth, Ninth, Tenth>(first: First, second: (value: Awaited<UnwrapValue<ReturnType<First>>>) => Second, third: (value: Awaited<UnwrapValue<Second>>) => Third, fourth: (value: Awaited<UnwrapValue<Third>>) => Fourth, fifth: (value: Awaited<UnwrapValue<Fourth>>) => Fifth, sixth: (value: Awaited<UnwrapValue<Fifth>>) => Sixth, seventh: (value: Awaited<UnwrapValue<Sixth>>) => Seventh, eighth: (value: Awaited<UnwrapValue<Seventh>>) => Eighth, ninth: (value: Awaited<UnwrapValue<Eighth>>) => Ninth, tenth: (value: Awaited<UnwrapValue<Ninth>>) => Tenth): AsyncFlow<First, Tenth>;
3821
3910
  /**
3822
3911
  * Create an asynchronous _Flow_, a function that pipes values through a series of functions
3823
3912
  *
@@ -3825,7 +3914,7 @@ export declare function asyncFlow<First extends GenericCallback, Second, Third,
3825
3914
  *
3826
3915
  * @returns _Flow_ function
3827
3916
  */
3828
- export declare function asyncFlow<Fn extends GenericCallback>(fn: Fn, ...fns: Array<(value: Awaited<UnwrapValue<ReturnType<Fn>>>) => unknown>): FlowPromise<Fn, ReturnType<Fn>>;
3917
+ export declare function asyncFlow<Fn extends GenericCallback>(fn: Fn, ...fns: Array<(value: Awaited<UnwrapValue<ReturnType<Fn>>>) => unknown>): AsyncFlow<Fn, ReturnType<Fn>>;
3829
3918
  /**
3830
3919
  * Create an asynchronous _Flow_, a function that pipes values through a series of functions
3831
3920
  *
@@ -4105,54 +4194,6 @@ export declare namespace pipe {
4105
4194
  export var async: typeof asyncPipe;
4106
4195
  }
4107
4196
  //#endregion
4108
- //#region src/internal/sized/map.d.ts
4109
- /**
4110
- * A _Map_ with a maximum size
4111
- *
4112
- * Behavior is similar to a _LRU_ cache, where the least recently used entries are removed
4113
- */
4114
- export declare class SizedMap<SizedKey = unknown, SizedValue = unknown> extends Map<SizedKey, SizedValue> {
4115
- #private;
4116
- /**
4117
- * Is the _Map_ full?
4118
- */
4119
- get full(): boolean;
4120
- get maximum(): number;
4121
- /**
4122
- * Create a new _SizedMap_ with entries and a maximum size _(2^20)_
4123
- *
4124
- * @param entries Array of key-value pairs to initialize the _SizedMap_ with
4125
- * @template SizedKey Type of the keys in the _SizedMap_
4126
- * @template SizedValue Type of the values in the _SizedMap_
4127
- */
4128
- constructor(entries: [SizedKey, SizedValue][]);
4129
- /**
4130
- * Create a new _SizedMap_ with a maximum size _(but clamped at 2^24)_
4131
- *
4132
- * @param maximum Maximum size of the _SizedMap_
4133
- * @template SizedKey Type of the keys in the _SizedMap_
4134
- * @template SizedValue Type of the values in the _SizedMap_
4135
- */
4136
- constructor(maximum: number);
4137
- /**
4138
- * Create a new _SizedMap_ with _(optional)_ entries and a maximum size
4139
- *
4140
- * @param entries Array of key-value pairs to initialize the _SizedMap_ with
4141
- * @param maximum Maximum size of the _SizedMap_ _(defaults to 2^20; clamped at 2^24)_
4142
- * @template SizedKey Type of the keys in the _SizedMap_
4143
- * @template SizedValue Type of the values in the _SizedMap_
4144
- */
4145
- constructor(entries?: [SizedKey, SizedValue][], maximum?: number);
4146
- /**
4147
- * @inheritdoc
4148
- */
4149
- override get(key: SizedKey): SizedValue | undefined;
4150
- /**
4151
- * @inheritdoc
4152
- */
4153
- override set(key: SizedKey, value: SizedValue): this;
4154
- }
4155
- //#endregion
4156
4197
  //#region src/internal/string/case.d.ts
4157
4198
  /**
4158
4199
  * Convert a string to camel case _(thisIsCamelCase)_
@@ -4252,7 +4293,7 @@ export declare function tryEncode(value: boolean | number | string): unknown;
4252
4293
  */
4253
4294
  export declare function words(value: string): string[];
4254
4295
  //#endregion
4255
- //#region src/internal/value/handlers.d.ts
4296
+ //#region src/models/value/value.handler.model.d.ts
4256
4297
  type BaseHandler = {
4257
4298
  handlers: WeakMap<WeakKey, string | GenericCallback>;
4258
4299
  options: BaseHandlerOptions;
@@ -4274,8 +4315,26 @@ type ValueHandler = {
4274
4315
  handle(value: unknown, ...parameters: unknown[]): unknown;
4275
4316
  };
4276
4317
  //#endregion
4318
+ //#region src/models/value/value.misc.model.d.ts
4319
+ type ComparisonHandler<Value = any> = (first: Value, second: Value) => number;
4320
+ /**
4321
+ * Thanks, type-fest!
4322
+ */
4323
+ type KeysOfUnion<ObjectType> = keyof UnionToIntersection<ObjectType extends unknown ? Record<keyof ObjectType, never> : never>;
4324
+ /**
4325
+ * A shaken object, without any `undefined` values
4326
+ */
4327
+ type Shaken<Value extends PlainObject> = Simplify<{ [Key in keyof Value as undefined extends Value[Key] ? never : Key]: Value[Key]; } & { [Key in keyof Value as undefined extends Value[Key] ? [Value[Key]] extends [undefined] ? never : Key : never]?: Exclude<Value[Key], undefined>; }>;
4328
+ /**
4329
+ * A smushed object, with all nested objects flattened into a single level, using dot notation keys
4330
+ */
4331
+ type Smushed<Value extends PlainObject> = Simplify<{ [NestedKey in NestedKeys<Value>]: NestedValue<Value, ToString<NestedKey>>; }>;
4332
+ /**
4333
+ * An unsmushed object, with all dot notation keys turned into nested keys
4334
+ */
4335
+ type Unsmushed<Value extends PlainObject> = Simplify<Omit<{ [UnionKey in KeysOfUnion<Value>]: Value[UnionKey]; }, `${string}.${string}`>>;
4336
+ //#endregion
4277
4337
  //#region src/internal/value/compare.d.ts
4278
- type Comparator<Value = any> = (first: Value, second: Value) => number;
4279
4338
  /**
4280
4339
  * Compare two values _(for sorting purposes)_
4281
4340
  *
@@ -4300,18 +4359,18 @@ export declare function deregisterComparator<Instance>(constructor: Constructor<
4300
4359
  * @param constructor Class constructor
4301
4360
  * @param handler Method name or comparison function _(defaults to `compare`)_
4302
4361
  */
4303
- export declare function registerComparator<Instance>(constructor: Constructor<Instance>, handler?: string | Comparator<Instance>): void;
4362
+ export declare function registerComparator<Instance>(constructor: Constructor<Instance>, handler?: string | ComparisonHandler<Instance>): void;
4304
4363
  export declare namespace compare {
4305
4364
  export var deregister: typeof deregisterComparator;
4306
4365
  export var handler: CompareHandler<number>;
4307
4366
  export var register: typeof registerComparator;
4308
4367
  }
4309
4368
  //#endregion
4310
- //#region src/internal/value/equal.d.ts
4369
+ //#region src/models/value/value.equal.model.d.ts
4311
4370
  /**
4312
4371
  * Options for value equality comparison
4313
4372
  */
4314
- export type EqualOptions = {
4373
+ type EqualOptions = {
4315
4374
  /**
4316
4375
  * When `true`, strings are compared case-insensitively
4317
4376
  */
@@ -4362,6 +4421,19 @@ type Equalizer = {
4362
4421
  */
4363
4422
  register: <Instance>(constructor: Constructor<Instance>, handler: (first: Instance, second: Instance) => boolean) => void;
4364
4423
  };
4424
+ type EqualizerOptions = {
4425
+ ignoreCase: boolean;
4426
+ ignoreExpressions: EqualizerOptionsKeys<RegExp[]>;
4427
+ ignoreKeys: EqualizerOptionsKeys<Set<string>>;
4428
+ relaxedNullish: boolean;
4429
+ };
4430
+ type EqualizerOptionsKeys<Values> = {
4431
+ enabled: boolean;
4432
+ values: Values;
4433
+ };
4434
+ //#endregion
4435
+ //#region src/internal/value/equal.d.ts
4436
+ declare function Equalizer(this: any, options: EqualizerOptions): void;
4365
4437
  /**
4366
4438
  * Deregister a equality comparison handler for a specific class
4367
4439
  *
@@ -4587,7 +4659,7 @@ export declare function setValue<Data extends PlainObject, Path extends NestedKe
4587
4659
  */
4588
4660
  export declare function setValue<Data extends PlainObject>(data: Data, path: string, value: unknown, ignoreCase?: boolean): Data;
4589
4661
  //#endregion
4590
- //#region src/internal/models/plan.model.d.ts
4662
+ //#region src/models/plan.model.d.ts
4591
4663
  /**
4592
4664
  * An asynchronous plan of execution that can yield intermediate results and eventually return a result
4593
4665
  */
@@ -4605,15 +4677,27 @@ type AsyncPlan<Yielded, Returned, Parameters extends unknown[]> = {
4605
4677
  *
4606
4678
  * @returns Attempted result
4607
4679
  */
4608
- attempt(...parameters: Parameters): Promise<Result<PlanOk<Returned>, PlanError<Yielded, Returned>>>;
4680
+ attempt: Parameters extends [infer _, ...(infer _)[]] ? (parameters: Parameters, signal?: AbortSignal) => Promise<Result<PlanOk<Returned>, PlanError<Yielded, Returned>>> : (signal?: AbortSignal) => Promise<Result<PlanOk<Returned>, PlanError<Yielded, Returned>>>;
4609
4681
  /**
4610
4682
  * Run the plan to completion
4611
4683
  *
4612
4684
  * @throws {PlanError<Yielded, Returned>}
4613
4685
  * @returns Result
4614
4686
  */
4615
- run(...parameters: Parameters): Promise<PlanReturned<Returned>>;
4687
+ run: Parameters extends [infer _, ...(infer _)[]] ? (parameters: Parameters, signal?: AbortSignal) => Promise<PlanReturned<Returned>> : (signal?: AbortSignal) => Promise<PlanReturned<Returned>>;
4688
+ };
4689
+ type AsyncPlanState = {
4690
+ generator(...parameters: unknown[]): AsyncGenerator;
4691
+ } & BaseState<typeof PLAN_TYPE_PLAN_ASYNC>;
4692
+ type BaseState<Type extends PlanType> = {
4693
+ type: Type;
4616
4694
  };
4695
+ type InternalAsyncPlan = {
4696
+ [PLAN_SYMBOL]: AsyncPlanState;
4697
+ } & AsyncPlan<never, never, unknown[]>;
4698
+ type InternalPlan = {
4699
+ [PLAN_SYMBOL]: PlanState;
4700
+ } & Plan<never, never, unknown[]>;
4617
4701
  /**
4618
4702
  * A plan of execution that can yield intermediate results and eventually return a result
4619
4703
  */
@@ -4640,11 +4724,44 @@ type Plan<Yielded, Returned, Parameters extends unknown[]> = {
4640
4724
  */
4641
4725
  run(...parameters: Parameters): PlanReturned<Returned>;
4642
4726
  };
4727
+ /**
4728
+ * An immediately failing plan
4729
+ */
4730
+ type PlanFailure<E> = {
4731
+ /**
4732
+ * Get the generator for the failed plan
4733
+ *
4734
+ * @returns Generator
4735
+ */
4736
+ [Symbol.iterator]: () => Generator<Err<E>, never>;
4737
+ };
4643
4738
  type PlanOk<Returned> = Returned extends Error ? never : Returned extends Err<infer _> ? never : Returned extends Ok<infer Value> ? Value : Returned;
4644
4739
  type PlanErrors<Yielded, Returned> = PlanErrorValues<Yielded> | PlanErrorValues<Returned>;
4645
- type PlanError<Yielded, Returned> = [PlanErrors<Yielded, Returned>] extends [never] ? Error : PlanErrors<Yielded, Returned>;
4646
- type PlanErrorValues<Original> = Original extends Error ? Original : Original extends Err<infer Error> ? Error : never;
4740
+ type PlanError<Yielded, Returned> = [PlanErrors<Yielded, Returned>] extends [never] ? Error : PlanErrorValues<Yielded> | PlanErrorValues<Returned>;
4741
+ type PlanErrorValues<Original> = Original extends Error ? Original : Original extends Err<infer E> ? E : Original extends PlanFailure<infer E> ? E : never;
4647
4742
  type PlanReturned<Returned> = Returned extends Error ? never : Returned extends Err<infer _> ? never : Returned;
4743
+ /**
4744
+ * An immediately successful or failing plan
4745
+ */
4746
+ type PlanResult<Success, Failure> = PlanSuccess<Success> | PlanFailure<Failure>;
4747
+ type PlanState = {
4748
+ generator(...parameters: unknown[]): Generator;
4749
+ } & BaseState<typeof PLAN_TYPE_PLAN_SYNC>;
4750
+ /**
4751
+ * An immediately successful plan
4752
+ */
4753
+ type PlanSuccess<Value> = {
4754
+ /**
4755
+ * Get the generator for the successful plan
4756
+ *
4757
+ * @returns Generator
4758
+ */
4759
+ [Symbol.iterator]: () => Generator<never, Value>;
4760
+ };
4761
+ type PlanType = "asyncPlan" | "plan";
4762
+ declare const PLAN_SYMBOL: unique symbol;
4763
+ declare const PLAN_TYPE_PLAN_ASYNC: PlanType;
4764
+ declare const PLAN_TYPE_PLAN_SYNC: PlanType;
4648
4765
  //#endregion
4649
4766
  //#region src/plan/result.d.ts
4650
4767
  /**
@@ -4654,7 +4771,23 @@ type PlanReturned<Returned> = Returned extends Error ? never : Returned extends
4654
4771
  *
4655
4772
  * @returns Promised result
4656
4773
  */
4657
- export declare function asyncAttemptRun<Yielded, Returned, Parameters extends unknown[]>(generator: (...parameters: Parameters) => AsyncGenerator<Yielded, Returned>, ...parameters: Parameters): Promise<Result<PlanOk<Returned>, PlanError<Yielded, Returned>>>;
4774
+ export declare function asyncAttemptRun<Yielded, Returned, Parameters extends unknown[]>(generator: (...parameters: Parameters) => AsyncGenerator<Yielded, Returned>, parameters: Parameters, signal?: AbortSignal): Promise<Result<PlanOk<Returned>, PlanError<Yielded, Returned>>>;
4775
+ /**
4776
+ * Attempt to run the generator to completion
4777
+ *
4778
+ * _Returns a promised {@link Result} instead of a raw value or throwing an error_
4779
+ *
4780
+ * @returns Promised result
4781
+ */
4782
+ export declare function asyncAttemptRun<Yielded, Returned>(generator: () => AsyncGenerator<Yielded, Returned>, signal?: AbortSignal): Promise<Result<PlanOk<Returned>, PlanError<Yielded, Returned>>>;
4783
+ /**
4784
+ * Attempt to run the plan to completion
4785
+ *
4786
+ * _Returns a promised {@link Result} instead of a raw value or throwing an error_
4787
+ *
4788
+ * @returns Promised result
4789
+ */
4790
+ export declare function asyncAttemptRun<Yielded, Returned, Parameters extends unknown[]>(plan: AsyncPlan<Yielded, Returned, Parameters>, parameters: Parameters, signal?: AbortSignal): Promise<Result<PlanOk<Returned>, PlanError<Yielded, Returned>>>;
4658
4791
  /**
4659
4792
  * Attempt to run the plan to completion
4660
4793
  *
@@ -4662,7 +4795,7 @@ export declare function asyncAttemptRun<Yielded, Returned, Parameters extends un
4662
4795
  *
4663
4796
  * @returns Promised result
4664
4797
  */
4665
- export declare function asyncAttemptRun<Yielded, Returned, Parameters extends unknown[]>(plan: AsyncPlan<Yielded, Returned, Parameters>, ...parameters: Parameters): Promise<Result<PlanOk<Returned>, PlanError<Yielded, Returned>>>;
4798
+ export declare function asyncAttemptRun<Yielded, Returned>(plan: AsyncPlan<Yielded, Returned, []>, signal?: AbortSignal): Promise<Result<PlanOk<Returned>, PlanError<Yielded, Returned>>>;
4666
4799
  /**
4667
4800
  * Attempt to run the generator to completion
4668
4801
  *
@@ -4679,6 +4812,8 @@ export declare function attemptRun<Yielded, Returned, Parameters extends unknown
4679
4812
  * @returns Result
4680
4813
  */
4681
4814
  export declare function attemptRun<Yielded, Returned, Parameters extends unknown[]>(plan: Plan<Yielded, Returned, Parameters>, ...parameters: Parameters): Result<PlanOk<Returned>, PlanError<Yielded, Returned>>;
4815
+ export declare function attemptRunAsyncPlan(this: never, first: never, second: never): Promise<unknown>;
4816
+ export declare function attemptRunPlan(this: InternalPlan, ...parameters: unknown[]): unknown;
4682
4817
  export declare namespace attemptRun {
4683
4818
  export var async: typeof asyncAttemptRun;
4684
4819
  }
@@ -4688,20 +4823,41 @@ export declare namespace attemptRun {
4688
4823
  * Run an asynchronous generator to completion
4689
4824
  *
4690
4825
  * @param generator Generator to run
4826
+ * @param parameters Parameters for starting the run
4827
+ * @param signal Optional abort signal
4828
+ * @returns Result
4829
+ */
4830
+ export declare function asyncRun<Yielded, Returned, Parameters extends unknown[]>(generator: (...parameters: Parameters) => AsyncGenerator<Yielded, Returned>, parameters: Parameters, signal?: AbortSignal): Promise<PlanReturned<Returned>>;
4831
+ /**
4832
+ * Run an asynchronous generator to completion
4833
+ *
4834
+ * @param generator Generator to run
4835
+ * @param signal Optional abort signal
4836
+ * @returns Result
4837
+ */
4838
+ export declare function asyncRun<Yielded, Returned>(generator: () => AsyncGenerator<Yielded, Returned>, signal?: AbortSignal): Promise<PlanReturned<Returned>>;
4839
+ /**
4840
+ * Run an asynchronous plan to completion
4841
+ *
4842
+ * @param plan Plan to run
4843
+ * @param parameters Parameters for starting the run
4844
+ * @param signal Optional abort signal
4691
4845
  * @returns Result
4692
4846
  */
4693
- export declare function asyncRun<Yielded, Returned, Parameters extends unknown[]>(generator: (...parameters: Parameters) => AsyncGenerator<Yielded, Returned>, ...parameters: Parameters): Promise<PlanReturned<Returned>>;
4847
+ export declare function asyncRun<Yielded, Returned, Parameters extends unknown[]>(plan: AsyncPlan<Yielded, Returned, Parameters>, parameters: Parameters, signal?: AbortSignal): Promise<PlanReturned<Returned>>;
4694
4848
  /**
4695
4849
  * Run an asynchronous plan to completion
4696
4850
  *
4697
4851
  * @param plan Plan to run
4852
+ * @param signal Optional abort signal
4698
4853
  * @returns Result
4699
4854
  */
4700
- export declare function asyncRun<Yielded, Returned, Parameters extends unknown[]>(plan: AsyncPlan<Yielded, Returned, Parameters>, ...parameters: Parameters): Promise<PlanReturned<Returned>>;
4855
+ export declare function asyncRun<Yielded, Returned>(plan: AsyncPlan<Yielded, Returned, []>, signal?: AbortSignal): Promise<PlanReturned<Returned>>;
4701
4856
  /**
4702
4857
  * Run a generator to completion
4703
4858
  *
4704
4859
  * @param generator Generator to run
4860
+ * @param parameters Parameters for starting the run
4705
4861
  * @returns Result
4706
4862
  */
4707
4863
  export declare function run<Yielded, Returned, Parameters extends unknown[]>(generator: (...parameters: Parameters) => Generator<Yielded, Returned>, ...parameters: Parameters): PlanReturned<Returned>;
@@ -4709,9 +4865,12 @@ export declare function run<Yielded, Returned, Parameters extends unknown[]>(gen
4709
4865
  * Run a plan to completion
4710
4866
  *
4711
4867
  * @param plan Plan to run
4868
+ * @param parameters Parameters for starting the run
4712
4869
  * @returns Result
4713
4870
  */
4714
4871
  export declare function run<Yielded, Returned, Parameters extends unknown[]>(plan: Plan<Yielded, Returned, Parameters>, ...parameters: Parameters): PlanReturned<Returned>;
4872
+ export declare function runAsyncPlan(this: InternalAsyncPlan, first: never, second: never): Promise<unknown>;
4873
+ export declare function runPlan(this: InternalPlan, ...parameters: unknown[]): unknown;
4715
4874
  export declare namespace asyncRun {
4716
4875
  export var attempt: typeof asyncAttemptRun;
4717
4876
  }
@@ -4770,34 +4929,26 @@ export declare function isPlan<Yielded = unknown, Returned = unknown, Parameters
4770
4929
  /**
4771
4930
  * Create an immediately failing plan
4772
4931
  *
4773
- * @param reason Failure reason
4932
+ * @param value Failure value
4774
4933
  * @returns Plan failure
4775
4934
  */
4776
- export declare function fail<Reason>(reason: Reason): Generator<Reason, void>;
4935
+ export declare function fail<Value>(value: Value): PlanFailure<Value>;
4777
4936
  /**
4778
4937
  * Create an immediately succeeding plan
4779
4938
  *
4780
4939
  * @param value Success value
4781
4940
  * @returns Plan success
4782
4941
  */
4783
- export declare function succeed<Value>(value: Value): Generator<never, Value>;
4784
- export declare function succeedResult<Returned>(value: Returned): Generator<never, Ok<Returned>>;
4785
- export declare namespace succeed {
4786
- export var result: typeof succeedResult;
4787
- }
4942
+ export declare function succeed<Value>(value: Value): PlanSuccess<Value>;
4788
4943
  //#endregion
4789
- //#region src/internal/aborter.d.ts
4944
+ //#region src/models/aborter.model.d.ts
4790
4945
  type Aborter = {
4791
4946
  callback: GenericCallback;
4792
4947
  cancel(): void;
4793
4948
  signal: AbortSignal;
4794
4949
  };
4795
4950
  //#endregion
4796
- //#region src/promise/constants.d.ts
4797
- declare const PROMISE_TYPE_FULFILLED = "fulfilled";
4798
- declare const PROMISE_TYPE_REJECTED = "rejected";
4799
- //#endregion
4800
- //#region src/promise/models.d.ts
4951
+ //#region src/models/promise.model.d.ts
4801
4952
  /**
4802
4953
  * A _Promise_ that can be canceled
4803
4954
  */
@@ -4814,7 +4965,7 @@ export declare class CancelablePromise<Value = void> extends Promise<Value> {
4814
4965
  /**
4815
4966
  * A _Promise_ that was fulfilled
4816
4967
  */
4817
- export type FulfilledPromise<Value> = {
4968
+ type FulfilledPromise<Value> = {
4818
4969
  /**
4819
4970
  * Status of the _Promise_
4820
4971
  */
@@ -4824,18 +4975,18 @@ export type FulfilledPromise<Value> = {
4824
4975
  */
4825
4976
  value: Awaited<Value>;
4826
4977
  };
4827
- export type PromiseData = {
4978
+ type PromiseData = {
4828
4979
  last: number;
4829
4980
  result: ArrayOrPlainObject;
4830
4981
  };
4831
- export type PromiseHandlers = {
4982
+ type PromiseHandlers = {
4832
4983
  resolve(value: unknown[]): void;
4833
4984
  reject(reason: unknown): void;
4834
4985
  };
4835
4986
  /**
4836
4987
  * Options for a _Promise_-handling function
4837
4988
  */
4838
- export type PromiseOptions = {
4989
+ type PromiseOptions = {
4839
4990
  /**
4840
4991
  * AbortSignal for aborting the _Promise_; when aborted, the _Promise_ will reject with the reason of the signal
4841
4992
  */
@@ -4845,7 +4996,7 @@ export type PromiseOptions = {
4845
4996
  */
4846
4997
  time?: number;
4847
4998
  };
4848
- export type PromiseParameters = {
4999
+ type PromiseParameters = {
4849
5000
  aborter?: Aborter;
4850
5001
  complete: boolean;
4851
5002
  data: PromiseData;
@@ -4860,18 +5011,18 @@ export type PromiseParameters = {
4860
5011
  * - `complete`: wait for all _Promises_ to settle, then return the results, as an array of fulfilled and/or rejected results
4861
5012
  * - `first`: rejects on the first rejected _Promise_, and returns an array of values
4862
5013
  */
4863
- export type PromiseStrategy = "complete" | "first";
5014
+ type PromiseStrategy = "complete" | "first";
4864
5015
  /**
4865
5016
  * An error thrown when a promise times out
4866
5017
  */
4867
5018
  export declare class PromiseTimeoutError extends Error {
4868
5019
  constructor();
4869
5020
  }
4870
- export type PromisesItems<Items extends ArrayOrPlainObject> = { [ItemsKey in keyof Items]: Items[ItemsKey] extends GenericCallback ? ReturnType<Items[ItemsKey]> extends Promise<infer Value> ? Promise<Value> : never : Items[ItemsKey] extends Promise<infer Value> ? Promise<Value> : Promise<Items[ItemsKey]>; } extends (infer Result) ? Result : never;
5021
+ type PromisesItems<Items extends ArrayOrPlainObject> = { [ItemsKey in keyof Items]: Items[ItemsKey] extends GenericCallback ? ReturnType<Items[ItemsKey]> extends Promise<infer Value> ? Promise<Value> : never : Items[ItemsKey] extends Promise<infer Value> ? Promise<Value> : Promise<Items[ItemsKey]>; };
4871
5022
  /**
4872
5023
  * Options for handling multiple _Promises_
4873
5024
  */
4874
- export type PromisesOptions = {
5025
+ type PromisesOptions = {
4875
5026
  /**
4876
5027
  * AbortSignal for aborting the _Promises_; when aborted, the _Promises_ will reject with the reason of the signal
4877
5028
  */
@@ -4881,14 +5032,14 @@ export type PromisesOptions = {
4881
5032
  */
4882
5033
  strategy?: PromiseStrategy;
4883
5034
  };
4884
- export type PromisesResult<Items extends ArrayOrPlainObject> = { [ItemsKey in keyof Items]: Items[ItemsKey] extends Promise<infer Value> ? Result<Awaited<Value>> : never; };
4885
- export type PromisesUnwrapped<Items extends ArrayOrPlainObject> = { [ItemsKey in keyof Items]: Items[ItemsKey] extends GenericCallback ? ReturnType<Items[ItemsKey]> extends Promise<infer Value> ? Awaited<Value> : never : Items[ItemsKey] extends Promise<infer Value> ? Awaited<Value> : never; } extends (infer Result) ? Result : never;
4886
- export type PromisesValue<Value> = (FulfilledPromise<Value> | RejectedPromise);
4887
- export type PromisesValues<Items extends ArrayOrPlainObject> = { [ItemsKey in keyof Items]: Items[ItemsKey] extends Promise<infer Value> ? PromisesValue<Awaited<Value>> : never; } extends (infer Result) ? Result : never;
5035
+ type PromisesResult<Items extends ArrayOrPlainObject> = { [ItemsKey in keyof Items]: Items[ItemsKey] extends Promise<infer Value> ? Result<Awaited<Value>> : never; };
5036
+ type PromisesUnwrapped<Items extends ArrayOrPlainObject> = { [ItemsKey in keyof Items]: Items[ItemsKey] extends GenericCallback ? ReturnType<Items[ItemsKey]> extends Promise<infer Value> ? Awaited<Value> : never : Items[ItemsKey] extends Promise<infer Value> ? Awaited<Value> : never; } extends (infer Result) ? Result : never;
5037
+ type PromisesValue<Value> = FulfilledPromise<Value> | RejectedPromise;
5038
+ type PromisesValues<Items extends ArrayOrPlainObject> = { [ItemsKey in keyof Items]: Items[ItemsKey] extends Promise<infer Value> ? PromisesValue<Awaited<Value>> : never; } extends (infer Result) ? Result : never;
4888
5039
  /**
4889
5040
  * A _Promise_ that was rejected
4890
5041
  */
4891
- export type RejectedPromise = {
5042
+ type RejectedPromise = {
4892
5043
  /**
4893
5044
  * Status of the _Promise_
4894
5045
  */
@@ -4898,6 +5049,8 @@ export type RejectedPromise = {
4898
5049
  */
4899
5050
  reason: unknown;
4900
5051
  };
5052
+ declare const PROMISE_TYPE_FULFILLED = "fulfilled";
5053
+ declare const PROMISE_TYPE_REJECTED = "rejected";
4901
5054
  //#endregion
4902
5055
  //#region src/promise/delay.d.ts
4903
5056
  /**
@@ -5302,14 +5455,6 @@ export declare namespace matchResult {
5302
5455
  }
5303
5456
  //#endregion
5304
5457
  //#region src/result/work/flow.d.ts
5305
- /**
5306
- * A synchronous _Flow_, a function that attempts to pipe values through a series of functions
5307
- */
5308
- export type AttemptFlow<Callback extends GenericCallback, Value> = (...args: Parameters<Callback>) => Result<UnwrapValue<Value>>;
5309
- /**
5310
- * An asynchronous _Flow_, a function that attempts to pipe values through a series of functions
5311
- */
5312
- export type AttemptFlowPromise<Callback extends GenericCallback, Value> = (...args: Parameters<Callback>) => Promise<Result<UnwrapValue<Value>>>;
5313
5458
  /**
5314
5459
  * Create an asynchronous _Flow_, a function that attempts to pipe a value through a series of functions
5315
5460
  *
@@ -5317,7 +5462,7 @@ export type AttemptFlowPromise<Callback extends GenericCallback, Value> = (...ar
5317
5462
  *
5318
5463
  * @returns _Flow_ function
5319
5464
  */
5320
- export declare function attemptAsyncFlow<Fn extends GenericCallback>(fn: Fn): AttemptFlowPromise<Fn, ReturnType<Fn>>;
5465
+ export declare function attemptAsyncFlow<Fn extends GenericCallback>(fn: Fn): AttemptAsyncFlow<Fn, ReturnType<Fn>>;
5321
5466
  /**
5322
5467
  * Create an asynchronous _Flow_, a function that pipes values through a series of functions
5323
5468
  *
@@ -5325,7 +5470,7 @@ export declare function attemptAsyncFlow<Fn extends GenericCallback>(fn: Fn): At
5325
5470
  *
5326
5471
  * @returns _Flow_ function
5327
5472
  */
5328
- export declare function attemptAsyncFlow<First extends GenericCallback, Second>(first: First, second: (value: Awaited<UnwrapValue<ReturnType<First>>>) => Second): AttemptFlowPromise<First, Second>;
5473
+ export declare function attemptAsyncFlow<First extends GenericCallback, Second>(first: First, second: (value: Awaited<UnwrapValue<ReturnType<First>>>) => Second): AttemptAsyncFlow<First, Second>;
5329
5474
  /**
5330
5475
  * Create an asynchronous _Flow_, a function that pipes values through a series of functions
5331
5476
  *
@@ -5333,7 +5478,7 @@ export declare function attemptAsyncFlow<First extends GenericCallback, Second>(
5333
5478
  *
5334
5479
  * @returns _Flow_ function
5335
5480
  */
5336
- export declare function attemptAsyncFlow<First extends GenericCallback, Second, Third>(first: First, second: (value: Awaited<UnwrapValue<ReturnType<First>>>) => Second, third: (value: Awaited<UnwrapValue<Second>>) => Third): AttemptFlowPromise<First, Third>;
5481
+ export declare function attemptAsyncFlow<First extends GenericCallback, Second, Third>(first: First, second: (value: Awaited<UnwrapValue<ReturnType<First>>>) => Second, third: (value: Awaited<UnwrapValue<Second>>) => Third): AttemptAsyncFlow<First, Third>;
5337
5482
  /**
5338
5483
  * Create an asynchronous _Flow_, a function that pipes values through a series of functions
5339
5484
  *
@@ -5341,7 +5486,7 @@ export declare function attemptAsyncFlow<First extends GenericCallback, Second,
5341
5486
  *
5342
5487
  * @returns _Flow_ function
5343
5488
  */
5344
- export declare function attemptAsyncFlow<First extends GenericCallback, Second, Third, Fourth>(first: First, second: (value: Awaited<UnwrapValue<ReturnType<First>>>) => Second, third: (value: Awaited<UnwrapValue<Second>>) => Third, fourth: (value: Awaited<UnwrapValue<Third>>) => Fourth): AttemptFlowPromise<First, Fourth>;
5489
+ export declare function attemptAsyncFlow<First extends GenericCallback, Second, Third, Fourth>(first: First, second: (value: Awaited<UnwrapValue<ReturnType<First>>>) => Second, third: (value: Awaited<UnwrapValue<Second>>) => Third, fourth: (value: Awaited<UnwrapValue<Third>>) => Fourth): AttemptAsyncFlow<First, Fourth>;
5345
5490
  /**
5346
5491
  * Create an asynchronous _Flow_, a function that pipes values through a series of functions
5347
5492
  *
@@ -5349,7 +5494,7 @@ export declare function attemptAsyncFlow<First extends GenericCallback, Second,
5349
5494
  *
5350
5495
  * @returns _Flow_ function
5351
5496
  */
5352
- export declare function attemptAsyncFlow<First extends GenericCallback, Second, Third, Fourth, Fifth>(first: First, second: (value: Awaited<UnwrapValue<ReturnType<First>>>) => Second, third: (value: Awaited<UnwrapValue<Second>>) => Third, fourth: (value: Awaited<UnwrapValue<Third>>) => Fourth, fifth: (value: Awaited<UnwrapValue<Fourth>>) => Fifth): AttemptFlowPromise<First, Fifth>;
5497
+ export declare function attemptAsyncFlow<First extends GenericCallback, Second, Third, Fourth, Fifth>(first: First, second: (value: Awaited<UnwrapValue<ReturnType<First>>>) => Second, third: (value: Awaited<UnwrapValue<Second>>) => Third, fourth: (value: Awaited<UnwrapValue<Third>>) => Fourth, fifth: (value: Awaited<UnwrapValue<Fourth>>) => Fifth): AttemptAsyncFlow<First, Fifth>;
5353
5498
  /**
5354
5499
  * Create an asynchronous _Flow_, a function that pipes values through a series of functions
5355
5500
  *
@@ -5357,7 +5502,7 @@ export declare function attemptAsyncFlow<First extends GenericCallback, Second,
5357
5502
  *
5358
5503
  * @returns _Flow_ function
5359
5504
  */
5360
- export declare function attemptAsyncFlow<First extends GenericCallback, Second, Third, Fourth, Fifth, Sixth>(first: First, second: (value: Awaited<UnwrapValue<ReturnType<First>>>) => Second, third: (value: Awaited<UnwrapValue<Second>>) => Third, fourth: (value: Awaited<UnwrapValue<Third>>) => Fourth, fifth: (value: Awaited<UnwrapValue<Fourth>>) => Fifth, sixth: (value: Awaited<UnwrapValue<Fifth>>) => Sixth): AttemptFlowPromise<First, Sixth>;
5505
+ export declare function attemptAsyncFlow<First extends GenericCallback, Second, Third, Fourth, Fifth, Sixth>(first: First, second: (value: Awaited<UnwrapValue<ReturnType<First>>>) => Second, third: (value: Awaited<UnwrapValue<Second>>) => Third, fourth: (value: Awaited<UnwrapValue<Third>>) => Fourth, fifth: (value: Awaited<UnwrapValue<Fourth>>) => Fifth, sixth: (value: Awaited<UnwrapValue<Fifth>>) => Sixth): AttemptAsyncFlow<First, Sixth>;
5361
5506
  /**
5362
5507
  * Create an asynchronous _Flow_, a function that pipes values through a series of functions
5363
5508
  *
@@ -5365,7 +5510,7 @@ export declare function attemptAsyncFlow<First extends GenericCallback, Second,
5365
5510
  *
5366
5511
  * @returns _Flow_ function
5367
5512
  */
5368
- export declare function attemptAsyncFlow<First extends GenericCallback, Second, Third, Fourth, Fifth, Sixth, Seventh>(first: First, second: (value: Awaited<UnwrapValue<ReturnType<First>>>) => Second, third: (value: Awaited<UnwrapValue<Second>>) => Third, fourth: (value: Awaited<UnwrapValue<Third>>) => Fourth, fifth: (value: Awaited<UnwrapValue<Fourth>>) => Fifth, sixth: (value: Awaited<UnwrapValue<Fifth>>) => Sixth, seventh: (value: Awaited<UnwrapValue<Sixth>>) => Seventh): AttemptFlowPromise<First, Seventh>;
5513
+ export declare function attemptAsyncFlow<First extends GenericCallback, Second, Third, Fourth, Fifth, Sixth, Seventh>(first: First, second: (value: Awaited<UnwrapValue<ReturnType<First>>>) => Second, third: (value: Awaited<UnwrapValue<Second>>) => Third, fourth: (value: Awaited<UnwrapValue<Third>>) => Fourth, fifth: (value: Awaited<UnwrapValue<Fourth>>) => Fifth, sixth: (value: Awaited<UnwrapValue<Fifth>>) => Sixth, seventh: (value: Awaited<UnwrapValue<Sixth>>) => Seventh): AttemptAsyncFlow<First, Seventh>;
5369
5514
  /**
5370
5515
  * Create an asynchronous _Flow_, a function that pipes values through a series of functions
5371
5516
  *
@@ -5373,7 +5518,7 @@ export declare function attemptAsyncFlow<First extends GenericCallback, Second,
5373
5518
  *
5374
5519
  * @returns _Flow_ function
5375
5520
  */
5376
- export declare function attemptAsyncFlow<First extends GenericCallback, Second, Third, Fourth, Fifth, Sixth, Seventh, Eighth>(first: First, second: (value: Awaited<UnwrapValue<ReturnType<First>>>) => Second, third: (value: Awaited<UnwrapValue<Second>>) => Third, fourth: (value: Awaited<UnwrapValue<Third>>) => Fourth, fifth: (value: Awaited<UnwrapValue<Fourth>>) => Fifth, sixth: (value: Awaited<UnwrapValue<Fifth>>) => Sixth, seventh: (value: Awaited<UnwrapValue<Sixth>>) => Seventh, eighth: (value: Awaited<UnwrapValue<Seventh>>) => Eighth): AttemptFlowPromise<First, Eighth>;
5521
+ export declare function attemptAsyncFlow<First extends GenericCallback, Second, Third, Fourth, Fifth, Sixth, Seventh, Eighth>(first: First, second: (value: Awaited<UnwrapValue<ReturnType<First>>>) => Second, third: (value: Awaited<UnwrapValue<Second>>) => Third, fourth: (value: Awaited<UnwrapValue<Third>>) => Fourth, fifth: (value: Awaited<UnwrapValue<Fourth>>) => Fifth, sixth: (value: Awaited<UnwrapValue<Fifth>>) => Sixth, seventh: (value: Awaited<UnwrapValue<Sixth>>) => Seventh, eighth: (value: Awaited<UnwrapValue<Seventh>>) => Eighth): AttemptAsyncFlow<First, Eighth>;
5377
5522
  /**
5378
5523
  * Create an asynchronous _Flow_, a function that pipes values through a series of functions
5379
5524
  *
@@ -5381,7 +5526,7 @@ export declare function attemptAsyncFlow<First extends GenericCallback, Second,
5381
5526
  *
5382
5527
  * @returns _Flow_ function
5383
5528
  */
5384
- export declare function attemptAsyncFlow<First extends GenericCallback, Second, Third, Fourth, Fifth, Sixth, Seventh, Eighth, Ninth>(first: First, second: (value: Awaited<UnwrapValue<ReturnType<First>>>) => Second, third: (value: Awaited<UnwrapValue<Second>>) => Third, fourth: (value: Awaited<UnwrapValue<Third>>) => Fourth, fifth: (value: Awaited<UnwrapValue<Fourth>>) => Fifth, sixth: (value: Awaited<UnwrapValue<Fifth>>) => Sixth, seventh: (value: Awaited<UnwrapValue<Sixth>>) => Seventh, eighth: (value: Awaited<UnwrapValue<Seventh>>) => Eighth, ninth: (value: Awaited<UnwrapValue<Eighth>>) => Ninth): AttemptFlowPromise<First, Ninth>;
5529
+ export declare function attemptAsyncFlow<First extends GenericCallback, Second, Third, Fourth, Fifth, Sixth, Seventh, Eighth, Ninth>(first: First, second: (value: Awaited<UnwrapValue<ReturnType<First>>>) => Second, third: (value: Awaited<UnwrapValue<Second>>) => Third, fourth: (value: Awaited<UnwrapValue<Third>>) => Fourth, fifth: (value: Awaited<UnwrapValue<Fourth>>) => Fifth, sixth: (value: Awaited<UnwrapValue<Fifth>>) => Sixth, seventh: (value: Awaited<UnwrapValue<Sixth>>) => Seventh, eighth: (value: Awaited<UnwrapValue<Seventh>>) => Eighth, ninth: (value: Awaited<UnwrapValue<Eighth>>) => Ninth): AttemptAsyncFlow<First, Ninth>;
5385
5530
  /**
5386
5531
  * Create an asynchronous _Flow_, a function that pipes values through a series of functions
5387
5532
  *
@@ -5389,7 +5534,7 @@ export declare function attemptAsyncFlow<First extends GenericCallback, Second,
5389
5534
  *
5390
5535
  * @returns _Flow_ function
5391
5536
  */
5392
- export declare function attemptAsyncFlow<First extends GenericCallback, Second, Third, Fourth, Fifth, Sixth, Seventh, Eighth, Ninth, Tenth>(first: First, second: (value: Awaited<UnwrapValue<ReturnType<First>>>) => Second, third: (value: Awaited<UnwrapValue<Second>>) => Third, fourth: (value: Awaited<UnwrapValue<Third>>) => Fourth, fifth: (value: Awaited<UnwrapValue<Fourth>>) => Fifth, sixth: (value: Awaited<UnwrapValue<Fifth>>) => Sixth, seventh: (value: Awaited<UnwrapValue<Sixth>>) => Seventh, eighth: (value: Awaited<UnwrapValue<Seventh>>) => Eighth, ninth: (value: Awaited<UnwrapValue<Eighth>>) => Ninth, tenth: (value: Awaited<UnwrapValue<Ninth>>) => Tenth): AttemptFlowPromise<First, Tenth>;
5537
+ export declare function attemptAsyncFlow<First extends GenericCallback, Second, Third, Fourth, Fifth, Sixth, Seventh, Eighth, Ninth, Tenth>(first: First, second: (value: Awaited<UnwrapValue<ReturnType<First>>>) => Second, third: (value: Awaited<UnwrapValue<Second>>) => Third, fourth: (value: Awaited<UnwrapValue<Third>>) => Fourth, fifth: (value: Awaited<UnwrapValue<Fourth>>) => Fifth, sixth: (value: Awaited<UnwrapValue<Fifth>>) => Sixth, seventh: (value: Awaited<UnwrapValue<Sixth>>) => Seventh, eighth: (value: Awaited<UnwrapValue<Seventh>>) => Eighth, ninth: (value: Awaited<UnwrapValue<Eighth>>) => Ninth, tenth: (value: Awaited<UnwrapValue<Ninth>>) => Tenth): AttemptAsyncFlow<First, Tenth>;
5393
5538
  /**
5394
5539
  * Create an asynchronous _Flow_, a function that pipes values through a series of functions
5395
5540
  *
@@ -5397,7 +5542,7 @@ export declare function attemptAsyncFlow<First extends GenericCallback, Second,
5397
5542
  *
5398
5543
  * @returns _Flow_ function
5399
5544
  */
5400
- export declare function attemptAsyncFlow<Fn extends GenericCallback>(fn: Fn, ...fns: Array<(value: Awaited<UnwrapValue<ReturnType<Fn>>>) => unknown>): AttemptFlowPromise<Fn, ReturnType<Fn>>;
5545
+ export declare function attemptAsyncFlow<Fn extends GenericCallback>(fn: Fn, ...fns: Array<(value: Awaited<UnwrapValue<ReturnType<Fn>>>) => unknown>): AttemptAsyncFlow<Fn, ReturnType<Fn>>;
5401
5546
  /**
5402
5547
  * Create an asynchronous _Flow_, a function that pipes values through a series of functions
5403
5548
  *
@@ -5664,11 +5809,11 @@ export declare namespace attemptPipe {
5664
5809
  export var async: typeof attemptAsyncPipe;
5665
5810
  }
5666
5811
  //#endregion
5667
- //#region src/string/fuzzy.d.ts
5812
+ //#region src/models/string/string.fuzzy.model.d.ts
5668
5813
  /**
5669
5814
  * Fuzzy searcher for an array of items
5670
5815
  */
5671
- export type Fuzzy<Item> = {
5816
+ type Fuzzy<Item> = {
5672
5817
  /**
5673
5818
  * Get items currently being searched through
5674
5819
  *
@@ -5704,7 +5849,7 @@ export type Fuzzy<Item> = {
5704
5849
  */
5705
5850
  search(value: string, limit: number): FuzzyResult<Item>;
5706
5851
  };
5707
- export type FuzzyConfiguration<Item> = {
5852
+ type FuzzyConfiguration<Item> = {
5708
5853
  /**
5709
5854
  * Handler to stringify items
5710
5855
  *
@@ -5720,7 +5865,11 @@ export type FuzzyConfiguration<Item> = {
5720
5865
  */
5721
5866
  key?: keyof Item;
5722
5867
  } : {}) & FuzzyOptions;
5723
- export type FuzzyOptions = {
5868
+ type FuzzyItem<Item> = {
5869
+ item: Item;
5870
+ haystack: string;
5871
+ };
5872
+ type FuzzyOptions = {
5724
5873
  /**
5725
5874
  * Maximum number of combined items to return in `exact` and `similar` _(defaults to all matches)_
5726
5875
  */
@@ -5736,7 +5885,7 @@ export type FuzzyOptions = {
5736
5885
  /**
5737
5886
  * Search results from a fuzzy search, with exact and similar matches
5738
5887
  */
5739
- export type FuzzyResult<Item> = {
5888
+ type FuzzyResult<Item> = {
5740
5889
  /**
5741
5890
  * Ordered items that exactly match the search value
5742
5891
  */
@@ -5746,10 +5895,16 @@ export type FuzzyResult<Item> = {
5746
5895
  */
5747
5896
  similar: Item[];
5748
5897
  };
5749
- /**
5750
- * Options for fuzzy searching
5751
- */
5752
- export type FuzzySearchOptions = FuzzyOptions;
5898
+ type FuzzyState<Item> = {
5899
+ handler(item: Item): string;
5900
+ items: Item[];
5901
+ limit?: number;
5902
+ strings: string[];
5903
+ tolerance: number;
5904
+ };
5905
+ //#endregion
5906
+ //#region src/string/fuzzy.d.ts
5907
+ declare function Fuzzy(this: any, state: FuzzyState<unknown>): void;
5753
5908
  /**
5754
5909
  * Create a fuzzy searcher for an array of items
5755
5910
  *
@@ -5879,11 +6034,11 @@ export declare function includes(haystack: string, needle: string, ignoreCase?:
5879
6034
  */
5880
6035
  export declare function startsWith(haystack: string, needle: string, ignoreCase?: boolean): boolean;
5881
6036
  //#endregion
5882
- //#region src/string/normalize.d.ts
6037
+ //#region src/models/string/string.normalize.model.d.ts
5883
6038
  /**
5884
6039
  * Options for normalizing a string
5885
6040
  */
5886
- export type NormalizeOptions = {
6041
+ type NormalizeOptions = {
5887
6042
  /**
5888
6043
  * Remove diacritical marks from the string? _(defaults to `true`)_
5889
6044
  */
@@ -5910,7 +6065,7 @@ export type NormalizeOptions = {
5910
6065
  /**
5911
6066
  * String normalizer function
5912
6067
  */
5913
- export type Normalizer = {
6068
+ type Normalizer = {
5914
6069
  /**
5915
6070
  * Normalize a string
5916
6071
  *
@@ -5919,6 +6074,10 @@ export type Normalizer = {
5919
6074
  */
5920
6075
  normalize(value: string): string;
5921
6076
  };
6077
+ type NormalizerOptions = Required<NormalizeOptions>;
6078
+ //#endregion
6079
+ //#region src/string/normalize.d.ts
6080
+ declare function Normalizer(this: any, options: NormalizerOptions): void;
5922
6081
  /**
5923
6082
  * Deburr a string, removing diacritical marks
5924
6083
  *
@@ -5949,7 +6108,7 @@ export declare namespace normalize {
5949
6108
  export var initialize: typeof initializeNormalizer;
5950
6109
  }
5951
6110
  //#endregion
5952
- //#region src/string/template.d.ts
6111
+ //#region src/models/string/string.template.model.d.ts
5953
6112
  /**
5954
6113
  * Renderer for a string template with variables
5955
6114
  *
@@ -5961,7 +6120,7 @@ type Renderer = (variables?: PlainObject, options?: Partial<TemplateOptions>) =>
5961
6120
  /**
5962
6121
  * Options for templating strings
5963
6122
  */
5964
- export type TemplateOptions = {
6123
+ type TemplateOptions = {
5965
6124
  /**
5966
6125
  * Ignore case when searching for variables?
5967
6126
  */
@@ -5987,10 +6146,14 @@ type Templater = {
5987
6146
  */
5988
6147
  render(value: string, variables?: PlainObject): string;
5989
6148
  };
6149
+ type TemplaterOptions = Required<TemplateOptions>;
5990
6150
  /**
5991
6151
  * Render a template string with variables
5992
6152
  */
5993
6153
  type TemplaterRenderer = (variables?: PlainObject) => string;
6154
+ //#endregion
6155
+ //#region src/string/template.d.ts
6156
+ declare function Templater(this: any, options: TemplaterOptions): void;
5994
6157
  /**
5995
6158
  * Create a _Templater_ with predefined options
5996
6159
  *
@@ -6019,8 +6182,8 @@ export declare namespace template {
6019
6182
  export var initialize: typeof initializeTemplater;
6020
6183
  }
6021
6184
  //#endregion
6022
- //#region src/value/clone.d.ts
6023
- export type CloneOptions = {
6185
+ //#region src/models/value/value.clone.model.d.ts
6186
+ type CloneOptions = {
6024
6187
  /**
6025
6188
  * Copy functions instead of returning `undefined`? _(defaults to `false`)_
6026
6189
  */
@@ -6033,7 +6196,7 @@ export type CloneOptions = {
6033
6196
  /**
6034
6197
  * A cloning function with predefined options
6035
6198
  */
6036
- export type Cloner = {
6199
+ type Cloner = {
6037
6200
  /**
6038
6201
  * Clone any kind of value
6039
6202
  *
@@ -6048,7 +6211,7 @@ export type Cloner = {
6048
6211
  *
6049
6212
  * @param constructor Class constructor
6050
6213
  */
6051
- deregister: typeof deregisterCloner;
6214
+ deregister<Instance>(constructor: Constructor<Instance>): void;
6052
6215
  /**
6053
6216
  * Register a clone handler for a specific class
6054
6217
  *
@@ -6057,8 +6220,11 @@ export type Cloner = {
6057
6220
  * @param constructor Class constructor
6058
6221
  * @param handler Method name or clone function _(defaults to method name `clone`)_
6059
6222
  */
6060
- register: typeof registerCloner;
6223
+ register<Instance>(constructor: Constructor<Instance>, handler?: string | ((value: Instance) => Instance)): void;
6061
6224
  };
6225
+ //#endregion
6226
+ //#region src/value/clone.d.ts
6227
+ declare function Cloner(this: any, options: Required<CloneOptions>): void;
6062
6228
  /**
6063
6229
  * Clone any kind of value _(deeply, if needed)_
6064
6230
  *
@@ -6137,11 +6303,11 @@ export declare function inMap<Key, Value>(map: Map<Key, Value>, value: Value, ke
6137
6303
  */
6138
6304
  export declare function inSet<Value>(set: Set<Value>, value: Value): boolean;
6139
6305
  //#endregion
6140
- //#region src/value/diff.d.ts
6306
+ //#region src/models/value/value.diff.model.d.ts
6141
6307
  /**
6142
6308
  * Options for value comparison
6143
6309
  */
6144
- export type DiffOptions = {
6310
+ type DiffOptions = {
6145
6311
  /**
6146
6312
  * Should `null` and `undefined` be considered equal and ignored in results?
6147
6313
  */
@@ -6150,7 +6316,7 @@ export type DiffOptions = {
6150
6316
  /**
6151
6317
  * The result of a comparison beteen two values
6152
6318
  */
6153
- export type DiffResult<First, Second = First> = {
6319
+ type DiffResult<First, Second = First> = {
6154
6320
  /**
6155
6321
  * The original values that were compared
6156
6322
  */
@@ -6171,7 +6337,7 @@ type DiffType = "full" | "none" | "partial";
6171
6337
  /**
6172
6338
  * The difference between two values
6173
6339
  */
6174
- export type DiffValue<First = unknown, Second = First> = {
6340
+ type DiffValue<First = unknown, Second = First> = {
6175
6341
  /**
6176
6342
  * The value from the first value
6177
6343
  */
@@ -6181,6 +6347,8 @@ export type DiffValue<First = unknown, Second = First> = {
6181
6347
  */
6182
6348
  to: Second;
6183
6349
  };
6350
+ //#endregion
6351
+ //#region src/value/diff.d.ts
6184
6352
  /**
6185
6353
  * Find the differences between two values
6186
6354
  *
@@ -6192,10 +6360,6 @@ export type DiffValue<First = unknown, Second = First> = {
6192
6360
  export declare function diff<First, Second = First>(first: First, second: Second, options?: DiffOptions): DiffResult<First, Second>;
6193
6361
  //#endregion
6194
6362
  //#region src/value/freeze.d.ts
6195
- /**
6196
- * A frozen value with readonly properties _(going as deep as possible)_
6197
- */
6198
- export type Frozen<Value> = Value extends unknown[] ? Readonly<Value> : Value extends PlainObject ? { readonly [Key in keyof Value]: Frozen<Value[Key]>; } : Value extends Map<infer Key, infer Value> ? ReadonlyMap<Key, Frozen<Value>> : Value extends Set<infer Item> ? ReadonlySet<Frozen<Item>> : Readonly<Value>;
6199
6363
  /**
6200
6364
  * Freeze an array and its indiced values, but not any nested values
6201
6365
  *
@@ -6355,10 +6519,6 @@ export declare function omit<Value extends PlainObject, ValueKey extends keyof V
6355
6519
  export declare function pick<Value extends PlainObject, ValueKey extends keyof Value>(value: Value, keys: ValueKey[]): Pick<Value, ValueKey>;
6356
6520
  //#endregion
6357
6521
  //#region src/value/shake.d.ts
6358
- /**
6359
- * A shaken object, without any `undefined` values
6360
- */
6361
- type Shaken<Value extends PlainObject> = Simplify<{ [Key in keyof Value as undefined extends Value[Key] ? never : Key]: Value[Key]; } & { [Key in keyof Value as undefined extends Value[Key] ? [Value[Key]] extends [undefined] ? never : Key : never]?: Exclude<Value[Key], undefined>; }>;
6362
6522
  /**
6363
6523
  * Shake an object, removing all keys with `undefined` values
6364
6524
  *
@@ -6368,10 +6528,6 @@ type Shaken<Value extends PlainObject> = Simplify<{ [Key in keyof Value as undef
6368
6528
  export declare function shake<Value extends PlainObject>(value: Value): Shaken<Value>;
6369
6529
  //#endregion
6370
6530
  //#region src/value/smush.d.ts
6371
- /**
6372
- * A smushed object, with all nested objects flattened into a single level, using dot notation keys
6373
- */
6374
- type Smushed<Value extends PlainObject> = Simplify<{ [NestedKey in NestedKeys<Value>]: NestedValue<Value, ToString<NestedKey>>; }>;
6375
6531
  /**
6376
6532
  * Smush an object into a flat object that uses dot notation keys
6377
6533
  *
@@ -6381,14 +6537,6 @@ type Smushed<Value extends PlainObject> = Simplify<{ [NestedKey in NestedKeys<Va
6381
6537
  export declare function smush<Value extends PlainObject>(value: Value): Smushed<Value>;
6382
6538
  //#endregion
6383
6539
  //#region src/value/unsmush.d.ts
6384
- /**
6385
- * Thanks, type-fest!
6386
- */
6387
- type KeysOfUnion<ObjectType> = keyof UnionToIntersection<ObjectType extends unknown ? Record<keyof ObjectType, never> : never>;
6388
- /**
6389
- * An unsmushed object, with all dot notation keys turned into nested keys
6390
- */
6391
- type Unsmushed<Value extends PlainObject> = Simplify<Omit<{ [UnionKey in KeysOfUnion<Value>]: Value[UnionKey]; }, `${string}.${string}`>>;
6392
6540
  /**
6393
6541
  * Unsmush a smushed object _(turning dot notation keys into nested keys)_
6394
6542
  *
@@ -6397,32 +6545,12 @@ type Unsmushed<Value extends PlainObject> = Simplify<Omit<{ [UnionKey in KeysOfU
6397
6545
  */
6398
6546
  export declare function unsmush<Value extends PlainObject>(value: Value): Unsmushed<Value>;
6399
6547
  //#endregion
6400
- //#region src/value/merge.d.ts
6548
+ //#region src/models/value/value.merge.model.d.ts
6401
6549
  /**
6402
6550
  * Options for assigning values
6403
6551
  */
6404
- export type AssignOptions = Omit<MergeOptions, "assignValues">;
6405
- /**
6406
- * An assigner function for assigning values from one or more objects to the first one
6407
- */
6408
- export type Assigner = {
6409
- /**
6410
- * Assign values from one or more objects to the first one
6411
- *
6412
- * @param to Value to assign to
6413
- * @param from Values to assign
6414
- * @returns Assigned value
6415
- */
6416
- assign<To extends PlainObject, From extends PlainObject[]>(to: To, from: [...From]): To & UnionToIntersection<From[number]>;
6417
- };
6418
- /**
6419
- * Options for merging values
6420
- */
6421
- export type MergeOptions = {
6422
- /**
6423
- * Assign values to the first array or object instead of creating a new one?
6424
- */
6425
- assignValues?: boolean;
6552
+ type AssignOptions = BaseOptions;
6553
+ type BaseOptions = {
6426
6554
  /**
6427
6555
  * Key _(or key epxressions)_ for values that should be replaced
6428
6556
  *
@@ -6448,10 +6576,32 @@ export type MergeOptions = {
6448
6576
  */
6449
6577
  skipNullableInArrays?: boolean;
6450
6578
  };
6579
+ /**
6580
+ * An assigner function for assigning values from one or more objects to the first one
6581
+ */
6582
+ type Assigner = {
6583
+ /**
6584
+ * Assign values from one or more objects to the first one
6585
+ *
6586
+ * @param to Value to assign to
6587
+ * @param from Values to assign
6588
+ * @returns Assigned value
6589
+ */
6590
+ assign<To extends PlainObject, From extends PlainObject[]>(to: To, from: [...From]): To & UnionToIntersection<From[number]>;
6591
+ };
6592
+ /**
6593
+ * Options for merging values
6594
+ */
6595
+ type MergeOptions = {
6596
+ /**
6597
+ * Assign values to the first array or object instead of creating a new one?
6598
+ */
6599
+ assignValues?: boolean;
6600
+ };
6451
6601
  /**
6452
6602
  * A merger function for merging multiple arrays or objects into a single one
6453
6603
  */
6454
- export type Merger = {
6604
+ type Merger = {
6455
6605
  /**
6456
6606
  * Merge multiple arrays or objects into a single one
6457
6607
  *
@@ -6460,6 +6610,17 @@ export type Merger = {
6460
6610
  */
6461
6611
  merge<Values extends ArrayOrPlainObject[]>(values: Array<NestedPartial<Values[number]>>): UnionToIntersection<Values[number]>;
6462
6612
  };
6613
+ type MergeReplaceableObjectsCallback = (name: string) => boolean;
6614
+ type MergingOptions = {
6615
+ assignValues: boolean;
6616
+ replaceableObjects: MergeReplaceableObjectsCallback | undefined;
6617
+ skipNullableAny: boolean;
6618
+ skipNullableInArrays: boolean;
6619
+ };
6620
+ //#endregion
6621
+ //#region src/value/merge.d.ts
6622
+ declare function Assigner(this: any, options: MergingOptions): void;
6623
+ declare function Merger(this: any, options: MergingOptions): void;
6463
6624
  /**
6464
6625
  * Assign values from one or more objects to the first one
6465
6626
  *
@@ -6502,7 +6663,7 @@ export declare namespace merge {
6502
6663
  export var initialize: typeof initializeMerger;
6503
6664
  }
6504
6665
  //#endregion
6505
- //#region src/value/transform.d.ts
6666
+ //#region src/models/value/value.transform.model.d.ts
6506
6667
  /**
6507
6668
  * A callback transform an object's properties
6508
6669
  */
@@ -6511,18 +6672,11 @@ type TransformCallback<Value extends PlainObject, Key extends keyof Value> = (ke
6511
6672
  * A collection of keyed callbacks to transform an object's properties
6512
6673
  */
6513
6674
  type TransformCallbacks<Value extends PlainObject> = Partial<{ [Key in keyof Value]: (value: Value[Key]) => Value[Key]; }>;
6514
- /**
6515
- * A transformer for an object, with predefined callbacks for transforming its properties
6516
- */
6517
- export type Transformer<Value extends PlainObject> = {
6518
- /**
6519
- * Transform an object's properties
6520
- *
6521
- * @param value Object to transform
6522
- * @returns Transformed object
6523
- */
6524
- transform(value: Value): Value;
6525
- };
6675
+ type TransformHandler<Value extends PlainObject> = TransformCallback<Value, keyof Value> | TransformCallbacks<Value>;
6676
+ //#endregion
6677
+ //#region src/value/transform.d.ts
6678
+ declare function Transformer(this: any, transformer: ReturnType<typeof getTransformHandler>): void;
6679
+ declare function getTransformHandler<Value extends PlainObject, Key extends keyof Value>(input: unknown): TransformHandler<Value> | undefined;
6526
6680
  /**
6527
6681
  * Initialize a transformer for an object with a transformer function
6528
6682
  *
@@ -6561,7 +6715,7 @@ export declare namespace transform {
6561
6715
  export var initialize: typeof initializeTransformer;
6562
6716
  }
6563
6717
  //#endregion
6564
- //#region src/internal/subscription.d.ts
6718
+ //#region src/models/subscription.model.d.ts
6565
6719
  type Subscription = {
6566
6720
  /**
6567
6721
  * Is the subscription active?
@@ -6660,33 +6814,12 @@ type SubscriptionsValuesItem<MapKey, MapValue> = {
6660
6814
  any: Map<MapKey, MapValue>;
6661
6815
  keyed?: Map<Key$1, Map<MapKey, MapValue>>;
6662
6816
  };
6663
- /**
6664
- * Is the value a subscription?
6665
- *
6666
- * @param value Value to check
6667
- * @returns `true` if the value is a subscription, otherwise `false`
6668
- */
6669
- export declare function isSubscription(value: unknown): value is Subscription;
6670
- /**
6671
- * Is the value a subscriptions store?
6672
- *
6673
- * @param value Value to check
6674
- * @returns `true` if the value is a subscriptions store, otherwise `false`
6675
- */
6676
- export declare function isSubscriptions(value: unknown): value is Subscriptions;
6677
- /**
6678
- * Create a subscription store
6679
- *
6680
- * @param parameters Store parameters
6681
- * @returns Subscription store
6682
- */
6683
- export declare function subscriptions<Value = unknown>(parameters?: SubscriptionsParameters): Subscriptions<Value>;
6684
6817
  //#endregion
6685
- //#region src/beacon.d.ts
6818
+ //#region src/models/beacon.model.d.ts
6686
6819
  /**
6687
6820
  * A beacon is a lighthouse, holding an observable value that can be subscribed to and emitted from
6688
6821
  */
6689
- export type Beacon<Value> = {
6822
+ type Beacon<Value> = {
6690
6823
  /**
6691
6824
  * Is the beacon active?
6692
6825
  */
@@ -6722,7 +6855,7 @@ export type Beacon<Value> = {
6722
6855
  */
6723
6856
  finish(): void;
6724
6857
  };
6725
- export type BeaconOptions<Value> = {
6858
+ type BeaconOptions<Value> = {
6726
6859
  /**
6727
6860
  * Method for comparing values for equality
6728
6861
  *
@@ -6733,7 +6866,14 @@ export type BeaconOptions<Value> = {
6733
6866
  */
6734
6867
  equal?: (first: Value, second: Value) => boolean;
6735
6868
  };
6736
- export type Observable<Value> = {
6869
+ type BeaconState<Value> = {
6870
+ active: boolean;
6871
+ observable?: Observable<Value>;
6872
+ options: Required<BeaconOptions<Value>>;
6873
+ subscriptions?: Subscriptions<Observer<unknown>>;
6874
+ value: Value;
6875
+ };
6876
+ type Observable<Value> = {
6737
6877
  /**
6738
6878
  * Is the observable active?
6739
6879
  */
@@ -6773,6 +6913,33 @@ type Observer<Value> = {
6773
6913
  */
6774
6914
  next?: (value: Value) => void;
6775
6915
  };
6916
+ //#endregion
6917
+ //#region src/internal/subscription.d.ts
6918
+ /**
6919
+ * Is the value a subscription?
6920
+ *
6921
+ * @param value Value to check
6922
+ * @returns `true` if the value is a subscription, otherwise `false`
6923
+ */
6924
+ export declare function isSubscription(value: unknown): value is Subscription;
6925
+ /**
6926
+ * Is the value a subscriptions store?
6927
+ *
6928
+ * @param value Value to check
6929
+ * @returns `true` if the value is a subscriptions store, otherwise `false`
6930
+ */
6931
+ export declare function isSubscriptions(value: unknown): value is Subscriptions;
6932
+ /**
6933
+ * Create a subscription store
6934
+ *
6935
+ * @param parameters Store parameters
6936
+ * @returns Subscription store
6937
+ */
6938
+ export declare function subscriptions<Value = unknown>(parameters?: SubscriptionsParameters): Subscriptions<Value>;
6939
+ //#endregion
6940
+ //#region src/beacon.d.ts
6941
+ declare function Beacon(this: any, value: unknown, options?: BeaconOptions<unknown>): void;
6942
+ declare function Observable(this: any, beacon: BeaconState<unknown>): void;
6776
6943
  /**
6777
6944
  * Create a new beacon
6778
6945
  *
@@ -6803,7 +6970,7 @@ export declare function isBeaconSubscription(value: unknown): value is Subscript
6803
6970
  */
6804
6971
  export declare function isObservable<Value = unknown>(value: unknown): value is Observable<Value>;
6805
6972
  //#endregion
6806
- //#region src/internal/models/herald.model.d.ts
6973
+ //#region src/models/herald.model.d.ts
6807
6974
  type Herald<Events extends Record<string, GenericCallback>> = {
6808
6975
  readonly events: HeraldEvents<Events>;
6809
6976
  /**
@@ -6842,7 +7009,7 @@ type HeraldOptions<Events extends Record<string, GenericCallback>> = {
6842
7009
  onCreate?: HeraldOnCreate<Events>;
6843
7010
  };
6844
7011
  //#endregion
6845
- //#region src/color/models.d.ts
7012
+ //#region src/models/color.model.d.ts
6846
7013
  /**
6847
7014
  * A color that is represented in multiple color formats
6848
7015
  */
@@ -7765,8 +7932,8 @@ export declare function isNumerical(value: unknown): value is number | `${number
7765
7932
  */
7766
7933
  export declare function isObject(value: unknown): value is object;
7767
7934
  //#endregion
7768
- //#region src/logger.d.ts
7769
- type Logger = {
7935
+ //#region src/models/logger.model.d.ts
7936
+ type Lumberjack = {
7770
7937
  /**
7771
7938
  * Log any number of values at the "debug" log level
7772
7939
  */
@@ -7834,15 +8001,17 @@ type TimeLogger = {
7834
8001
  */
7835
8002
  get stop(): () => void;
7836
8003
  };
8004
+ //#endregion
8005
+ //#region src/logger.d.ts
7837
8006
  declare function TimeLogger(this: any, label: string): void;
7838
- declare function isLogger(value: unknown): value is Logger;
8007
+ declare function isLogger(value: unknown): value is Lumberjack;
7839
8008
  declare function isTimeLogger(value: unknown): value is TimeLogger;
7840
8009
  /**
7841
8010
  * A logger that can be used to log messages to the console
7842
8011
  *
7843
8012
  * _(Logging can be enabled or disabled by setting the `enabled` property)_
7844
8013
  */
7845
- declare const Logger: Logger;
8014
+ declare const Logger: Lumberjack;
7846
8015
  //#endregion
7847
8016
  //#region src/internal/math/aggregate.d.ts
7848
8017
  /**
@@ -8148,11 +8317,11 @@ export declare function fromQuery(query: string): PlainObject;
8148
8317
  */
8149
8318
  export declare function toQuery(parameters: PlainObject): string;
8150
8319
  //#endregion
8151
- //#region src/queue.d.ts
8320
+ //#region src/models/queue.model.d.ts
8152
8321
  /**
8153
8322
  * A queue that can be used to manage (a)synchronous tasks with a specific key
8154
8323
  */
8155
- export type KeyedQueue<Callback extends GenericCallback | GenericAsyncCallback, CallbackParameters extends unknown[] = Parameters<Callback>> = {
8324
+ type KeyedQueue<Callback extends GenericCallback | GenericAsyncCallback, CallbackParameters extends unknown[] = Parameters<Callback>> = {
8156
8325
  /**
8157
8326
  * Get keys of all active queues
8158
8327
  */
@@ -8250,7 +8419,7 @@ export type KeyedQueue<Callback extends GenericCallback | GenericAsyncCallback,
8250
8419
  /**
8251
8420
  * A queue that can be used to manage (a)synchronous tasks
8252
8421
  */
8253
- export type Queue<Callback extends GenericCallback | GenericAsyncCallback, CallbackParameters extends unknown[] = Parameters<Callback>> = {
8422
+ type Queue<Callback extends GenericCallback | GenericAsyncCallback, CallbackParameters extends unknown[] = Parameters<Callback>> = {
8254
8423
  /**
8255
8424
  * Is the queue active?
8256
8425
  */
@@ -8313,13 +8482,7 @@ export type Queue<Callback extends GenericCallback | GenericAsyncCallback, Callb
8313
8482
  */
8314
8483
  resume(): void;
8315
8484
  };
8316
- /**
8317
- * An error thrown by the Queue when an operation fails
8318
- */
8319
- export declare class QueueError extends Error {
8320
- constructor(message: string);
8321
- }
8322
- export type QueueOptions = {
8485
+ type QueueOptions = {
8323
8486
  /**
8324
8487
  * Automatically start processing the queue when the first item is added _(defaults to `true`)_
8325
8488
  */
@@ -8336,7 +8499,7 @@ export type QueueOptions = {
8336
8499
  /**
8337
8500
  * A queued item
8338
8501
  */
8339
- export type Queued<Value> = {
8502
+ type Queued<Value> = {
8340
8503
  /**
8341
8504
  * ID of the queued item _(can be used to remove it from the queue)_
8342
8505
  */
@@ -8347,6 +8510,10 @@ export type Queued<Value> = {
8347
8510
  readonly promise: Promise<Value extends Promise<infer Result> ? Result : Value>;
8348
8511
  };
8349
8512
  type Tail<Values extends any[]> = Values extends [infer _, ...infer Rest] ? Rest : never;
8513
+ //#endregion
8514
+ //#region src/queue.d.ts
8515
+ declare function KeyedQueue(this: any, callback: GenericAsyncCallback, options: Required<QueueOptions>): void;
8516
+ declare function Queue(this: any, callback: GenericAsyncCallback, options: Required<QueueOptions>, key?: string): void;
8350
8517
  /**
8351
8518
  * Is the value keyed queue?
8352
8519
  *
@@ -8518,4 +8685,4 @@ export declare class SizedSet<Value = unknown> extends Set<Value> {
8518
8685
  get(value: Value, update?: boolean): Value | undefined;
8519
8686
  }
8520
8687
  //#endregion
8521
- export { type AsyncLimiter, type AsyncPlan, type Color, type ColorType, type ColorTypeExtended, type ColorValue, type ColorValueExtended, type HSLAColor, type HSLColor, type HWBAColor, type HWBColor, type Herald, type HeraldEvents, Key$1 as Key, type Limiter, Logger, type Plan, type RGBAColor, type RGBColor, type Shaken, type Smushed, type Subscription, type SubscriptionParameters, type SubscriptionProperty, type Subscriptions, type SubscriptionsParameters, type TimeLogger, type Unsmushed, push as append, filterAndMap as select, toPromise as fromResult, getRandomFloatingNumber as getRandomFloat, isLogger, isTimeLogger, mapAndFilter as reverseSelect };
8688
+ export { type ArrayComparisonSorter, type ArrayKeySorter, type ArrayKeySorters, type ArraySorter, type ArraySorters, type ArrayValueSorter, type Asserter, type AssignOptions, type Assigner, type AsyncFlow, type AsyncLimiter, type AsyncOnce, type AsyncPlan, type Beacon, type BeaconOptions, type CloneOptions, type Cloner, type Color, type ColorType, type ColorTypeExtended, type ColorValue, type ColorValueExtended, type CompareCallback, type ComparisonSorter, type DiffOptions, type DiffResult, type EqualOptions, type Equalizer, type Flow, type FulfilledPromise, type Fuzzy, type FuzzyItem, type FuzzyOptions, type FuzzyResult, type HSLAColor, type HSLColor, type HWBAColor, type HWBColor, type Herald, type HeraldEvents, type HeraldOptions, Key$1 as Key, type KeyedQueue, type Limiter, Logger, type Memoized, type MemoizedOptions, type MergeOptions, type Merger, type NormalizeOptions, type Normalizer, type Observable, type Observer, type Once, type Plan, type PlanFailure, type PlanResult, type PlanSuccess, type PromiseOptions, type PromiseStrategy, type PromisesOptions, type Queue, type QueueOptions, type Queued, type RGBAColor, type RGBColor, type RejectedPromise, type Renderer, type Shaken, type Smushed, type SortDirection, type Sorter, type Subscription, type SubscriptionParameters, type SubscriptionProperty, type Subscriptions, type SubscriptionsParameters, type TemplateOptions, type Templater, type TemplaterOptions, type TemplaterRenderer, type TimeLogger, type TransformCallback, type TransformCallbacks, type Transformer, type Unsmushed, push as append, filterAndMap as select, toPromise as fromResult, getRandomFloatingNumber as getRandomFloat, isLogger, isTimeLogger, mapAndFilter as reverseSelect };