@oscarpalmer/atoms 0.212.0 → 0.214.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 (258) 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/instance.mjs +0 -1
  45. package/dist/color/misc/alpha.d.mts +1 -1
  46. package/dist/color/misc/format.d.mts +1 -1
  47. package/dist/color/misc/get.d.mts +1 -1
  48. package/dist/color/misc/is.d.mts +2 -2
  49. package/dist/color/misc/is.mjs +1 -0
  50. package/dist/color/misc/state.d.mts +1 -1
  51. package/dist/color/space/hex.d.mts +1 -1
  52. package/dist/color/space/hsl.d.mts +1 -1
  53. package/dist/color/space/hwb.d.mts +1 -1
  54. package/dist/color/space/rgb.d.mts +1 -1
  55. package/dist/function/limit.d.mts +2 -2
  56. package/dist/function/limit.mjs +2 -1
  57. package/dist/function/once.d.mts +7 -3
  58. package/dist/function/once.mjs +5 -10
  59. package/dist/function/retry.d.mts +4 -14
  60. package/dist/function/retry.mjs +3 -15
  61. package/dist/herald.d.mts +2 -2
  62. package/dist/index.d.mts +466 -351
  63. package/dist/index.mjs +491 -439
  64. package/dist/internal/aborter.d.mts +1 -6
  65. package/dist/internal/aborter.mjs +3 -4
  66. package/dist/internal/array/callbacks.d.mts +3 -7
  67. package/dist/internal/array/chunk.mjs +2 -2
  68. package/dist/internal/array/find.d.mts +5 -23
  69. package/dist/internal/array/find.mjs +5 -9
  70. package/dist/internal/array/get.d.mts +1 -1
  71. package/dist/internal/array/group.d.mts +1 -1
  72. package/dist/internal/array/index-of.d.mts +1 -1
  73. package/dist/internal/array/index-of.mjs +4 -3
  74. package/dist/internal/array/insert.d.mts +2 -5
  75. package/dist/internal/array/insert.mjs +2 -4
  76. package/dist/internal/array/match.d.mts +2 -5
  77. package/dist/internal/array/match.mjs +10 -20
  78. package/dist/internal/array/overlap.d.mts +2 -10
  79. package/dist/internal/array/sets.d.mts +2 -5
  80. package/dist/internal/array/sets.mjs +5 -7
  81. package/dist/internal/function/assert.d.mts +5 -12
  82. package/dist/internal/function/assert.mjs +2 -2
  83. package/dist/internal/function/limit.d.mts +2 -37
  84. package/dist/internal/function/limit.mjs +4 -15
  85. package/dist/internal/function/memoize.d.mts +5 -70
  86. package/dist/internal/function/memoize.mjs +2 -5
  87. package/dist/internal/function/work.d.mts +16 -22
  88. package/dist/internal/function/work.mjs +1 -8
  89. package/dist/internal/herald.d.mts +3 -3
  90. package/dist/internal/herald.mjs +2 -1
  91. package/dist/internal/is.d.mts +1 -1
  92. package/dist/internal/math/aggregate.d.mts +2 -14
  93. package/dist/internal/math/aggregate.mjs +2 -5
  94. package/dist/internal/number.mjs +4 -7
  95. package/dist/internal/result/attempt.d.mts +1 -1
  96. package/dist/internal/result/misc.d.mts +1 -1
  97. package/dist/internal/string/case.mjs +6 -16
  98. package/dist/internal/string/misc.mjs +1 -3
  99. package/dist/internal/subscription.d.mts +1 -100
  100. package/dist/internal/subscription.mjs +3 -9
  101. package/dist/internal/value/compare.d.mts +4 -4
  102. package/dist/internal/value/compare.mjs +1 -1
  103. package/dist/internal/value/equal.d.mts +6 -57
  104. package/dist/internal/value/equal.mjs +5 -10
  105. package/dist/internal/value/get.d.mts +1 -1
  106. package/dist/internal/value/handlers.d.mts +2 -21
  107. package/dist/internal/value/has.d.mts +2 -2
  108. package/dist/internal/value/misc.d.mts +1 -1
  109. package/dist/internal/value/misc.mjs +8 -14
  110. package/dist/internal/value/set.d.mts +1 -1
  111. package/dist/internal/value/set.mjs +2 -2
  112. package/dist/is.mjs +3 -3
  113. package/dist/logger.d.mts +3 -70
  114. package/dist/logger.mjs +2 -5
  115. package/dist/math.d.mts +1 -1
  116. package/dist/math.mjs +2 -1
  117. package/dist/models/aborter.model.d.mts +12 -0
  118. package/dist/models/aborter.model.mjs +5 -0
  119. package/dist/models/array/array.find.model.d.mts +22 -0
  120. package/dist/models/array/array.find.model.mjs +8 -0
  121. package/dist/models/array/array.match.model.d.mts +14 -0
  122. package/dist/models/array/array.match.model.mjs +14 -0
  123. package/dist/models/array/array.misc.model.d.mts +36 -0
  124. package/dist/models/array/array.misc.model.mjs +12 -0
  125. package/dist/models/array/array.sort.model.d.mts +122 -0
  126. package/dist/models/array/array.sort.model.mjs +12 -0
  127. package/dist/models/beacon.model.d.mts +119 -0
  128. package/dist/models/beacon.model.mjs +16 -0
  129. package/dist/{color/models.d.mts → models/color.model.d.mts} +4 -4
  130. package/dist/models/function/assert.model.d.mts +13 -0
  131. package/dist/models/function/assert.model.mjs +4 -0
  132. package/dist/models/function/limiter.model.d.mts +71 -0
  133. package/dist/models/function/limiter.model.mjs +15 -0
  134. package/dist/models/function/memoize.model.d.mts +88 -0
  135. package/dist/models/function/memoize.model.mjs +7 -0
  136. package/dist/models/function/once.model.d.mts +76 -0
  137. package/dist/models/function/once.model.mjs +9 -0
  138. package/dist/models/function/retry.model.d.mts +17 -0
  139. package/dist/models/function/retry.model.mjs +17 -0
  140. package/dist/models/function/work.model.d.mts +20 -0
  141. package/dist/models/function/work.model.mjs +11 -0
  142. package/dist/{internal/models → models}/herald.model.d.mts +3 -3
  143. package/dist/{internal/models → models}/herald.model.mjs +2 -2
  144. package/dist/{models.d.mts → models/index.d.mts} +8 -50
  145. package/dist/models/logger.model.d.mts +83 -0
  146. package/dist/models/logger.model.mjs +7 -0
  147. package/dist/models/math.model.d.mts +16 -0
  148. package/dist/models/math.model.mjs +7 -0
  149. package/dist/models/misc.model.d.mts +10 -0
  150. package/dist/models/misc.model.mjs +11 -0
  151. package/dist/{internal/models → models}/plan.model.d.mts +17 -15
  152. package/dist/{internal/models → models}/plan.model.mjs +1 -1
  153. package/dist/models/promise.model.d.mts +119 -0
  154. package/dist/models/promise.model.mjs +47 -0
  155. package/dist/models/query.model.d.mts +9 -0
  156. package/dist/models/query.model.mjs +14 -0
  157. package/dist/models/queue.model.d.mts +251 -0
  158. package/dist/models/queue.model.mjs +29 -0
  159. package/dist/models/random.model.d.mts +6 -0
  160. package/dist/models/random.model.mjs +7 -0
  161. package/dist/{internal/models → models}/result.model.d.mts +10 -2
  162. package/dist/models/string/string.case.model.d.mts +19 -0
  163. package/dist/models/string/string.case.model.mjs +14 -0
  164. package/dist/models/string/string.fuzzy.model.d.mts +108 -0
  165. package/dist/models/string/string.fuzzy.model.mjs +9 -0
  166. package/dist/models/string/string.misc.model.d.mts +13 -0
  167. package/dist/models/string/string.misc.model.mjs +13 -0
  168. package/dist/models/string/string.normalize.model.d.mts +85 -0
  169. package/dist/models/string/string.normalize.model.mjs +43 -0
  170. package/dist/models/string/string.template.model.d.mts +50 -0
  171. package/dist/models/string/string.template.model.mjs +5 -0
  172. package/dist/models/subscription.model.d.mts +127 -0
  173. package/dist/models/subscription.model.mjs +10 -0
  174. package/dist/models/value/value.clone.model.d.mts +56 -0
  175. package/dist/models/value/value.clone.model.mjs +24 -0
  176. package/dist/models/value/value.diff.model.d.mts +61 -0
  177. package/dist/models/value/value.diff.model.mjs +6 -0
  178. package/dist/models/value/value.equal.model.d.mts +76 -0
  179. package/dist/models/value/value.equal.model.mjs +9 -0
  180. package/dist/models/value/value.handler.model.d.mts +27 -0
  181. package/dist/models/value/value.handler.model.mjs +1 -0
  182. package/dist/models/value/value.merge.model.d.mts +82 -0
  183. package/dist/models/value/value.merge.model.mjs +5 -0
  184. package/dist/models/value/value.misc.model.d.mts +33 -0
  185. package/dist/models/value/value.misc.model.mjs +12 -0
  186. package/dist/models/value/value.transform.model.d.mts +28 -0
  187. package/dist/models/value/value.transform.model.mjs +4 -0
  188. package/dist/plan/generate.d.mts +3 -2
  189. package/dist/plan/generate.mjs +14 -10
  190. package/dist/plan/index.d.mts +1 -1
  191. package/dist/plan/index.mjs +2 -2
  192. package/dist/plan/is.d.mts +31 -2
  193. package/dist/plan/is.mjs +45 -1
  194. package/dist/plan/misc.d.mts +21 -2
  195. package/dist/plan/misc.mjs +32 -2
  196. package/dist/plan/models.d.mts +1 -1
  197. package/dist/plan/result.d.mts +7 -7
  198. package/dist/plan/result.mjs +6 -6
  199. package/dist/plan/run.d.mts +5 -5
  200. package/dist/plan/run.mjs +6 -6
  201. package/dist/promise/delay.d.mts +1 -1
  202. package/dist/promise/delay.mjs +2 -1
  203. package/dist/promise/helpers.d.mts +2 -2
  204. package/dist/promise/helpers.mjs +6 -6
  205. package/dist/promise/index.d.mts +2 -2
  206. package/dist/promise/index.mjs +1 -1
  207. package/dist/promise/misc.d.mts +3 -3
  208. package/dist/promise/misc.mjs +7 -4
  209. package/dist/promise/models.d.mts +2 -106
  210. package/dist/promise/models.mjs +1 -35
  211. package/dist/promise/timed.d.mts +2 -2
  212. package/dist/promise/timed.mjs +3 -3
  213. package/dist/query.d.mts +1 -1
  214. package/dist/query.mjs +5 -15
  215. package/dist/queue.d.mts +6 -200
  216. package/dist/queue.mjs +9 -34
  217. package/dist/random.mjs +2 -5
  218. package/dist/result/match.d.mts +1 -1
  219. package/dist/result/match.mjs +27 -15
  220. package/dist/result/misc.d.mts +1 -1
  221. package/dist/result/work/flow.d.mts +13 -21
  222. package/dist/result/work/flow.mjs +0 -1
  223. package/dist/result/work/pipe.d.mts +2 -2
  224. package/dist/result/work/pipe.mjs +0 -1
  225. package/dist/string/fuzzy.d.mts +5 -87
  226. package/dist/string/fuzzy.mjs +6 -11
  227. package/dist/string/index.mjs +6 -8
  228. package/dist/string/match.mjs +4 -6
  229. package/dist/string/normalize.d.mts +4 -40
  230. package/dist/string/normalize.mjs +9 -48
  231. package/dist/string/template.d.mts +5 -43
  232. package/dist/string/template.mjs +1 -2
  233. package/dist/subscription.d.mts +2 -1
  234. package/dist/value/clone.d.mts +6 -42
  235. package/dist/value/clone.mjs +10 -30
  236. package/dist/value/collection.mjs +2 -0
  237. package/dist/value/diff.d.mts +3 -44
  238. package/dist/value/diff.mjs +1 -3
  239. package/dist/value/freeze.d.mts +1 -5
  240. package/dist/value/index.d.mts +4 -3
  241. package/dist/value/merge.d.mts +6 -64
  242. package/dist/value/merge.mjs +8 -8
  243. package/dist/value/omit.d.mts +1 -1
  244. package/dist/value/pick.d.mts +1 -1
  245. package/dist/value/shake.d.mts +4 -6
  246. package/dist/value/smush.d.mts +4 -6
  247. package/dist/value/smush.mjs +2 -2
  248. package/dist/value/transform.d.mts +6 -22
  249. package/dist/value/transform.mjs +1 -1
  250. package/dist/value/unsmush.d.mts +4 -10
  251. package/package.json +12 -3
  252. package/dist/internal/plan.d.mts +0 -45
  253. package/dist/internal/plan.mjs +0 -70
  254. package/dist/promise/constants.d.mts +0 -17
  255. package/dist/promise/constants.mjs +0 -15
  256. /package/dist/{color/models.mjs → models/color.model.mjs} +0 -0
  257. /package/dist/{internal/models/result.model.mjs → models/index.mjs} +0 -0
  258. /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
  */
@@ -63,7 +67,7 @@ type _NestedValue<Value, Path extends string> = Path extends `${infer ItemKey}.$
63
67
  /**
64
68
  * The nested _(keyed)_ values of an object _(up to 5 levels deep)_
65
69
  */
66
- export type NestedValues<Value extends PlainObject> = { [Path in NestedKeys<Value>]: NestedValue<Value, Path>; };
70
+ export type NestedValues<Value extends PlainObject> = Simplify<{ [Path in NestedKeys<Value>]: NestedValue<Value, Path>; }>;
67
71
  /**
68
72
  * The numerical keys of an object
69
73
  */
@@ -71,53 +75,7 @@ export type NumericalKeys<Value> = { [ItemKey in keyof Value]: ItemKey extends n
71
75
  /**
72
76
  * The numerical values of an object
73
77
  */
74
- export type NumericalValues<Item extends PlainObject> = { [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
- };
78
+ export type NumericalValues<Item extends PlainObject> = Simplify<{ [ItemKey in keyof Item as Item[ItemKey] extends number ? ItemKey : never]: Item[ItemKey]; }>;
121
79
  /**
122
80
  * A generic object
123
81
  */
@@ -131,7 +89,7 @@ export type Primitive = null | undefined | string | number | boolean | symbol |
131
89
  /**
132
90
  * Set required keys for a type
133
91
  */
134
- export type RequiredKeys<Model extends object, Keys extends keyof Model> = Required<Pick<Model, Keys>> & Omit<Model, Keys>;
92
+ export type RequiredKeys<Model extends object, Keys extends keyof Model> = Simplify<Required<Pick<Model, Keys>> & Omit<Model, Keys>>;
135
93
  /**
136
94
  * Flattens the type to improve type hints in IDEs
137
95
  *
@@ -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
  */
@@ -4597,23 +4669,35 @@ type AsyncPlan<Yielded, Returned, Parameters extends unknown[]> = {
4597
4669
  *
4598
4670
  * @returns Asynchronous generator
4599
4671
  */
4600
- [Symbol.asyncIterator]: () => AsyncGenerator<Yielded, Returned, unknown>;
4672
+ [Symbol.asyncIterator]: (...parameters: Parameters) => AsyncGenerator<Yielded, Returned>;
4601
4673
  /**
4602
4674
  * Attempt to run the plan to completion
4603
4675
  *
4604
4676
  * _Returns a promised {@link Result} instead of a raw value or throwing an error_
4605
4677
  *
4606
- * @returns Promised result
4678
+ * @returns Attempted result
4607
4679
  */
4608
- attempt(...parameters: Parameters): Promise<Result<PlanResult<Returned>, PlanError<Yielded, Returned>>>;
4680
+ attempt(...parameters: Parameters): 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<PlanResult<Returned>>;
4687
+ run(...parameters: Parameters): Promise<PlanReturned<Returned>>;
4616
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;
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
  */
@@ -4623,26 +4707,35 @@ type Plan<Yielded, Returned, Parameters extends unknown[]> = {
4623
4707
  *
4624
4708
  * @returns Generator
4625
4709
  */
4626
- [Symbol.iterator]: () => Generator<Yielded, Returned, unknown>;
4710
+ [Symbol.iterator]: (...parameters: Parameters) => Generator<Yielded, Returned>;
4627
4711
  /**
4628
4712
  * Attempt to run the plan to completion
4629
4713
  *
4630
4714
  * _Returns a {@link Result} instead of a raw value or throwing an error_
4631
4715
  *
4632
- * @returns Result
4716
+ * @returns Attempted result
4633
4717
  */
4634
- attempt(...parameters: Parameters): Result<PlanResult<Returned>, PlanError<Yielded, Returned>>;
4718
+ attempt(...parameters: Parameters): Result<PlanOk<Returned>, PlanError<Yielded, Returned>>;
4635
4719
  /**
4636
4720
  * Run the plan to completion
4637
4721
  *
4638
4722
  * @throws {PlanError<Yielded, Returned>}
4639
4723
  * @returns Result
4640
4724
  */
4641
- run(...parameters: Parameters): PlanResult<Returned>;
4725
+ run(...parameters: Parameters): PlanReturned<Returned>;
4642
4726
  };
4643
- type PlanErrorValues<Original> = Original extends Error ? Original : Original extends Err<infer Error> ? Error : Original extends Result<infer _, infer Error> ? Error : never;
4644
- type PlanError<Yielded, Returned> = PlanErrorValues<Yielded> | PlanErrorValues<Returned> | Error;
4645
- type PlanResult<Returned> = Returned extends Error ? never : Returned extends Err<infer _> ? never : Returned extends Ok<infer Value> ? Value : Returned extends Result<infer Value, infer _> ? Value : Returned;
4727
+ type PlanOk<Returned> = Returned extends Error ? never : Returned extends Err<infer _> ? never : Returned extends Ok<infer Value> ? Value : Returned;
4728
+ type PlanErrors<Yielded, Returned> = PlanErrorValues<Yielded> | PlanErrorValues<Returned>;
4729
+ type PlanError<Yielded, Returned> = [PlanErrors<Yielded, Returned>] extends [never] ? Error : PlanErrors<Yielded, Returned>;
4730
+ type PlanErrorValues<Original> = Original extends Error ? Original : Original extends Err<infer Error> ? Error : never;
4731
+ type PlanReturned<Returned> = Returned extends Error ? never : Returned extends Err<infer _> ? never : Returned;
4732
+ type PlanState = {
4733
+ generator(...parameters: unknown[]): Generator;
4734
+ } & BaseState<typeof PLAN_TYPE_PLAN_SYNC>;
4735
+ type PlanType = "asyncPlan" | "plan";
4736
+ declare const PLAN_SYMBOL: symbol;
4737
+ declare const PLAN_TYPE_PLAN_ASYNC: PlanType;
4738
+ declare const PLAN_TYPE_PLAN_SYNC: PlanType;
4646
4739
  //#endregion
4647
4740
  //#region src/plan/result.d.ts
4648
4741
  /**
@@ -4652,7 +4745,7 @@ type PlanResult<Returned> = Returned extends Error ? never : Returned extends Er
4652
4745
  *
4653
4746
  * @returns Promised result
4654
4747
  */
4655
- export declare function asyncAttemptRun<Yielded, Returned, Parameters extends unknown[]>(generator: (...parameters: Parameters) => AsyncGenerator<Yielded, Returned, unknown>, ...parameters: Parameters): Promise<Result<PlanResult<Returned>, PlanError<Yielded, Returned>>>;
4748
+ export declare function asyncAttemptRun<Yielded, Returned, Parameters extends unknown[]>(generator: (...parameters: Parameters) => AsyncGenerator<Yielded, Returned>, ...parameters: Parameters): Promise<Result<PlanOk<Returned>, PlanError<Yielded, Returned>>>;
4656
4749
  /**
4657
4750
  * Attempt to run the plan to completion
4658
4751
  *
@@ -4660,7 +4753,7 @@ export declare function asyncAttemptRun<Yielded, Returned, Parameters extends un
4660
4753
  *
4661
4754
  * @returns Promised result
4662
4755
  */
4663
- export declare function asyncAttemptRun<Yielded, Returned, Parameters extends unknown[]>(plan: AsyncPlan<Yielded, Returned, Parameters>, ...parameters: Parameters): Promise<Result<PlanResult<Returned>, PlanError<Yielded, Returned>>>;
4756
+ export declare function asyncAttemptRun<Yielded, Returned, Parameters extends unknown[]>(plan: AsyncPlan<Yielded, Returned, Parameters>, ...parameters: Parameters): Promise<Result<PlanOk<Returned>, PlanError<Yielded, Returned>>>;
4664
4757
  /**
4665
4758
  * Attempt to run the generator to completion
4666
4759
  *
@@ -4668,7 +4761,7 @@ export declare function asyncAttemptRun<Yielded, Returned, Parameters extends un
4668
4761
  *
4669
4762
  * @returns Result
4670
4763
  */
4671
- export declare function attemptRun<Yielded, Returned>(generator: () => Generator<Yielded, Returned, unknown>, ...parameters: Parameters<typeof generator>): Result<PlanResult<Returned>, PlanError<Yielded, Returned>>;
4764
+ export declare function attemptRun<Yielded, Returned, Parameters extends unknown[]>(generator: (...parameters: Parameters) => Generator<Yielded, Returned>, ...parameters: Parameters): Result<PlanOk<Returned>, PlanError<Yielded, Returned>>;
4672
4765
  /**
4673
4766
  * Attempt to run the plan to completion
4674
4767
  *
@@ -4676,7 +4769,9 @@ export declare function attemptRun<Yielded, Returned>(generator: () => Generator
4676
4769
  *
4677
4770
  * @returns Result
4678
4771
  */
4679
- export declare function attemptRun<Yielded, Returned, Parameters extends unknown[]>(plan: Plan<Yielded, Returned, Parameters>, ...parameters: Parameters): Result<PlanResult<Returned>, PlanError<Yielded, Returned>>;
4772
+ export declare function attemptRun<Yielded, Returned, Parameters extends unknown[]>(plan: Plan<Yielded, Returned, Parameters>, ...parameters: Parameters): Result<PlanOk<Returned>, PlanError<Yielded, Returned>>;
4773
+ export declare function attemptRunAsyncPlan(this: InternalAsyncPlan, ...parameters: unknown[]): Promise<unknown>;
4774
+ export declare function attemptRunPlan(this: InternalPlan, ...parameters: unknown[]): unknown;
4680
4775
  export declare namespace attemptRun {
4681
4776
  export var async: typeof asyncAttemptRun;
4682
4777
  }
@@ -4688,28 +4783,30 @@ export declare namespace attemptRun {
4688
4783
  * @param generator Generator to run
4689
4784
  * @returns Result
4690
4785
  */
4691
- export declare function asyncRun<Yielded, Returned, Parameters extends unknown[]>(generator: (...parameters: Parameters) => AsyncGenerator<Yielded, Returned, unknown>, ...parameters: Parameters): Promise<PlanResult<Returned>>;
4786
+ export declare function asyncRun<Yielded, Returned, Parameters extends unknown[]>(generator: (...parameters: Parameters) => AsyncGenerator<Yielded, Returned>, ...parameters: Parameters): Promise<PlanReturned<Returned>>;
4692
4787
  /**
4693
4788
  * Run an asynchronous plan to completion
4694
4789
  *
4695
4790
  * @param plan Plan to run
4696
4791
  * @returns Result
4697
4792
  */
4698
- export declare function asyncRun<Yielded, Returned, Parameters extends unknown[]>(plan: AsyncPlan<Yielded, Returned, Parameters>, ...parameters: Parameters): Promise<PlanResult<Returned>>;
4793
+ export declare function asyncRun<Yielded, Returned, Parameters extends unknown[]>(plan: AsyncPlan<Yielded, Returned, Parameters>, ...parameters: Parameters): Promise<PlanReturned<Returned>>;
4699
4794
  /**
4700
4795
  * Run a generator to completion
4701
4796
  *
4702
4797
  * @param generator Generator to run
4703
4798
  * @returns Result
4704
4799
  */
4705
- export declare function run<Yielded, Returned, Parameters extends unknown[]>(generator: (...parameters: Parameters) => Generator<Yielded, Returned, unknown>, ...parameters: Parameters): PlanResult<Returned> | PlanError<Yielded, Returned>;
4800
+ export declare function run<Yielded, Returned, Parameters extends unknown[]>(generator: (...parameters: Parameters) => Generator<Yielded, Returned>, ...parameters: Parameters): PlanReturned<Returned>;
4706
4801
  /**
4707
4802
  * Run a plan to completion
4708
4803
  *
4709
4804
  * @param plan Plan to run
4710
4805
  * @returns Result
4711
4806
  */
4712
- export declare function run<Yielded, Returned, Parameters extends unknown[]>(plan: Plan<Yielded, Returned, Parameters>, ...parameters: Parameters): PlanResult<Returned> | PlanError<Yielded, Returned>;
4807
+ export declare function run<Yielded, Returned, Parameters extends unknown[]>(plan: Plan<Yielded, Returned, Parameters>, ...parameters: Parameters): PlanReturned<Returned>;
4808
+ export declare function runAsyncPlan(this: InternalAsyncPlan, ...parameters: unknown[]): Promise<unknown>;
4809
+ export declare function runPlan(this: InternalPlan, ...parameters: unknown[]): unknown;
4713
4810
  export declare namespace asyncRun {
4714
4811
  export var attempt: typeof asyncAttemptRun;
4715
4812
  }
@@ -4734,14 +4831,7 @@ export declare function plan<Yielded, Returned, Parameters extends unknown[]>(ge
4734
4831
  */
4735
4832
  export declare function plan<Yielded, Returned, Parameters extends unknown[]>(generator: (...parameters: Parameters) => Generator<Yielded, Returned>): Plan<Yielded, Returned, Parameters>;
4736
4833
  //#endregion
4737
- //#region src/internal/plan.d.ts
4738
- /**
4739
- * Create an immediately failing generator
4740
- *
4741
- * @param reason Failure reason
4742
- * @returns Failing generator
4743
- */
4744
- export declare function fail<Reason>(reason: Reason): Generator<unknown, never>;
4834
+ //#region src/plan/is.d.ts
4745
4835
  /**
4746
4836
  * Is the value an asynchronous generator function?
4747
4837
  *
@@ -4770,26 +4860,35 @@ export declare function isGenerator(value: unknown): value is () => Generator;
4770
4860
  * @returns `true` if the value is a plan, otherwise `false`
4771
4861
  */
4772
4862
  export declare function isPlan<Yielded = unknown, Returned = unknown, Parameters extends unknown[] = unknown[]>(value: unknown): value is Plan<Yielded, Returned, Parameters>;
4863
+ //#endregion
4864
+ //#region src/plan/misc.d.ts
4773
4865
  /**
4774
- * Create an immediately succeeding generator
4866
+ * Create an immediately failing plan
4867
+ *
4868
+ * @param reason Failure reason
4869
+ * @returns Plan failure
4870
+ */
4871
+ export declare function fail<Reason>(reason: Reason): Generator<Reason, void>;
4872
+ /**
4873
+ * Create an immediately succeeding plan
4775
4874
  *
4776
4875
  * @param value Success value
4777
- * @returns Succeeding generator
4876
+ * @returns Plan success
4778
4877
  */
4779
- export declare function succeed<Value>(value: Value): Generator<unknown, Value>;
4878
+ export declare function succeed<Value>(value: Value): Generator<never, Value>;
4879
+ export declare function succeedResult<Returned>(value: Returned): Generator<never, Ok<Returned>>;
4880
+ export declare namespace succeed {
4881
+ export var result: typeof succeedResult;
4882
+ }
4780
4883
  //#endregion
4781
- //#region src/internal/aborter.d.ts
4884
+ //#region src/models/aborter.model.d.ts
4782
4885
  type Aborter = {
4783
4886
  callback: GenericCallback;
4784
4887
  cancel(): void;
4785
4888
  signal: AbortSignal;
4786
4889
  };
4787
4890
  //#endregion
4788
- //#region src/promise/constants.d.ts
4789
- declare const PROMISE_TYPE_FULFILLED = "fulfilled";
4790
- declare const PROMISE_TYPE_REJECTED = "rejected";
4791
- //#endregion
4792
- //#region src/promise/models.d.ts
4891
+ //#region src/models/promise.model.d.ts
4793
4892
  /**
4794
4893
  * A _Promise_ that can be canceled
4795
4894
  */
@@ -4806,7 +4905,7 @@ export declare class CancelablePromise<Value = void> extends Promise<Value> {
4806
4905
  /**
4807
4906
  * A _Promise_ that was fulfilled
4808
4907
  */
4809
- export type FulfilledPromise<Value> = {
4908
+ type FulfilledPromise<Value> = {
4810
4909
  /**
4811
4910
  * Status of the _Promise_
4812
4911
  */
@@ -4816,18 +4915,18 @@ export type FulfilledPromise<Value> = {
4816
4915
  */
4817
4916
  value: Awaited<Value>;
4818
4917
  };
4819
- export type PromiseData = {
4918
+ type PromiseData = {
4820
4919
  last: number;
4821
4920
  result: ArrayOrPlainObject;
4822
4921
  };
4823
- export type PromiseHandlers = {
4922
+ type PromiseHandlers = {
4824
4923
  resolve(value: unknown[]): void;
4825
4924
  reject(reason: unknown): void;
4826
4925
  };
4827
4926
  /**
4828
4927
  * Options for a _Promise_-handling function
4829
4928
  */
4830
- export type PromiseOptions = {
4929
+ type PromiseOptions = {
4831
4930
  /**
4832
4931
  * AbortSignal for aborting the _Promise_; when aborted, the _Promise_ will reject with the reason of the signal
4833
4932
  */
@@ -4837,7 +4936,7 @@ export type PromiseOptions = {
4837
4936
  */
4838
4937
  time?: number;
4839
4938
  };
4840
- export type PromiseParameters = {
4939
+ type PromiseParameters = {
4841
4940
  aborter?: Aborter;
4842
4941
  complete: boolean;
4843
4942
  data: PromiseData;
@@ -4852,18 +4951,18 @@ export type PromiseParameters = {
4852
4951
  * - `complete`: wait for all _Promises_ to settle, then return the results, as an array of fulfilled and/or rejected results
4853
4952
  * - `first`: rejects on the first rejected _Promise_, and returns an array of values
4854
4953
  */
4855
- export type PromiseStrategy = "complete" | "first";
4954
+ type PromiseStrategy = "complete" | "first";
4856
4955
  /**
4857
4956
  * An error thrown when a promise times out
4858
4957
  */
4859
4958
  export declare class PromiseTimeoutError extends Error {
4860
4959
  constructor();
4861
4960
  }
4862
- 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]>; };
4961
+ 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]>; };
4863
4962
  /**
4864
4963
  * Options for handling multiple _Promises_
4865
4964
  */
4866
- export type PromisesOptions = {
4965
+ type PromisesOptions = {
4867
4966
  /**
4868
4967
  * AbortSignal for aborting the _Promises_; when aborted, the _Promises_ will reject with the reason of the signal
4869
4968
  */
@@ -4873,14 +4972,14 @@ export type PromisesOptions = {
4873
4972
  */
4874
4973
  strategy?: PromiseStrategy;
4875
4974
  };
4876
- export type PromisesResult<Items extends ArrayOrPlainObject> = { [ItemsKey in keyof Items]: Items[ItemsKey] extends Promise<infer Value> ? Result<Awaited<Value>> : never; };
4877
- 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; };
4878
- export type PromisesValue<Value> = FulfilledPromise<Value> | RejectedPromise;
4879
- export type PromisesValues<Items extends ArrayOrPlainObject> = { [ItemsKey in keyof Items]: Items[ItemsKey] extends Promise<infer Value> ? PromisesValue<Awaited<Value>> : never; };
4975
+ type PromisesResult<Items extends ArrayOrPlainObject> = { [ItemsKey in keyof Items]: Items[ItemsKey] extends Promise<infer Value> ? Result<Awaited<Value>> : never; };
4976
+ 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;
4977
+ type PromisesValue<Value> = FulfilledPromise<Value> | RejectedPromise;
4978
+ type PromisesValues<Items extends ArrayOrPlainObject> = { [ItemsKey in keyof Items]: Items[ItemsKey] extends Promise<infer Value> ? PromisesValue<Awaited<Value>> : never; } extends (infer Result) ? Result : never;
4880
4979
  /**
4881
4980
  * A _Promise_ that was rejected
4882
4981
  */
4883
- export type RejectedPromise = {
4982
+ type RejectedPromise = {
4884
4983
  /**
4885
4984
  * Status of the _Promise_
4886
4985
  */
@@ -4890,6 +4989,8 @@ export type RejectedPromise = {
4890
4989
  */
4891
4990
  reason: unknown;
4892
4991
  };
4992
+ declare const PROMISE_TYPE_FULFILLED = "fulfilled";
4993
+ declare const PROMISE_TYPE_REJECTED = "rejected";
4893
4994
  //#endregion
4894
4995
  //#region src/promise/delay.d.ts
4895
4996
  /**
@@ -5294,14 +5395,6 @@ export declare namespace matchResult {
5294
5395
  }
5295
5396
  //#endregion
5296
5397
  //#region src/result/work/flow.d.ts
5297
- /**
5298
- * A synchronous _Flow_, a function that attempts to pipe values through a series of functions
5299
- */
5300
- export type AttemptFlow<Callback extends GenericCallback, Value> = (...args: Parameters<Callback>) => Result<UnwrapValue<Value>>;
5301
- /**
5302
- * An asynchronous _Flow_, a function that attempts to pipe values through a series of functions
5303
- */
5304
- export type AttemptFlowPromise<Callback extends GenericCallback, Value> = (...args: Parameters<Callback>) => Promise<Result<UnwrapValue<Value>>>;
5305
5398
  /**
5306
5399
  * Create an asynchronous _Flow_, a function that attempts to pipe a value through a series of functions
5307
5400
  *
@@ -5309,7 +5402,7 @@ export type AttemptFlowPromise<Callback extends GenericCallback, Value> = (...ar
5309
5402
  *
5310
5403
  * @returns _Flow_ function
5311
5404
  */
5312
- export declare function attemptAsyncFlow<Fn extends GenericCallback>(fn: Fn): AttemptFlowPromise<Fn, ReturnType<Fn>>;
5405
+ export declare function attemptAsyncFlow<Fn extends GenericCallback>(fn: Fn): AttemptAsyncFlow<Fn, ReturnType<Fn>>;
5313
5406
  /**
5314
5407
  * Create an asynchronous _Flow_, a function that pipes values through a series of functions
5315
5408
  *
@@ -5317,7 +5410,7 @@ export declare function attemptAsyncFlow<Fn extends GenericCallback>(fn: Fn): At
5317
5410
  *
5318
5411
  * @returns _Flow_ function
5319
5412
  */
5320
- export declare function attemptAsyncFlow<First extends GenericCallback, Second>(first: First, second: (value: Awaited<UnwrapValue<ReturnType<First>>>) => Second): AttemptFlowPromise<First, Second>;
5413
+ export declare function attemptAsyncFlow<First extends GenericCallback, Second>(first: First, second: (value: Awaited<UnwrapValue<ReturnType<First>>>) => Second): AttemptAsyncFlow<First, Second>;
5321
5414
  /**
5322
5415
  * Create an asynchronous _Flow_, a function that pipes values through a series of functions
5323
5416
  *
@@ -5325,7 +5418,7 @@ export declare function attemptAsyncFlow<First extends GenericCallback, Second>(
5325
5418
  *
5326
5419
  * @returns _Flow_ function
5327
5420
  */
5328
- 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>;
5421
+ 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>;
5329
5422
  /**
5330
5423
  * Create an asynchronous _Flow_, a function that pipes values through a series of functions
5331
5424
  *
@@ -5333,7 +5426,7 @@ export declare function attemptAsyncFlow<First extends GenericCallback, Second,
5333
5426
  *
5334
5427
  * @returns _Flow_ function
5335
5428
  */
5336
- 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>;
5429
+ 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>;
5337
5430
  /**
5338
5431
  * Create an asynchronous _Flow_, a function that pipes values through a series of functions
5339
5432
  *
@@ -5341,7 +5434,7 @@ export declare function attemptAsyncFlow<First extends GenericCallback, Second,
5341
5434
  *
5342
5435
  * @returns _Flow_ function
5343
5436
  */
5344
- 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>;
5437
+ 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>;
5345
5438
  /**
5346
5439
  * Create an asynchronous _Flow_, a function that pipes values through a series of functions
5347
5440
  *
@@ -5349,7 +5442,7 @@ export declare function attemptAsyncFlow<First extends GenericCallback, Second,
5349
5442
  *
5350
5443
  * @returns _Flow_ function
5351
5444
  */
5352
- 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>;
5445
+ 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>;
5353
5446
  /**
5354
5447
  * Create an asynchronous _Flow_, a function that pipes values through a series of functions
5355
5448
  *
@@ -5357,7 +5450,7 @@ export declare function attemptAsyncFlow<First extends GenericCallback, Second,
5357
5450
  *
5358
5451
  * @returns _Flow_ function
5359
5452
  */
5360
- 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>;
5453
+ 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>;
5361
5454
  /**
5362
5455
  * Create an asynchronous _Flow_, a function that pipes values through a series of functions
5363
5456
  *
@@ -5365,7 +5458,7 @@ export declare function attemptAsyncFlow<First extends GenericCallback, Second,
5365
5458
  *
5366
5459
  * @returns _Flow_ function
5367
5460
  */
5368
- 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>;
5461
+ 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>;
5369
5462
  /**
5370
5463
  * Create an asynchronous _Flow_, a function that pipes values through a series of functions
5371
5464
  *
@@ -5373,7 +5466,7 @@ export declare function attemptAsyncFlow<First extends GenericCallback, Second,
5373
5466
  *
5374
5467
  * @returns _Flow_ function
5375
5468
  */
5376
- 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>;
5469
+ 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>;
5377
5470
  /**
5378
5471
  * Create an asynchronous _Flow_, a function that pipes values through a series of functions
5379
5472
  *
@@ -5381,7 +5474,7 @@ export declare function attemptAsyncFlow<First extends GenericCallback, Second,
5381
5474
  *
5382
5475
  * @returns _Flow_ function
5383
5476
  */
5384
- 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>;
5477
+ 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>;
5385
5478
  /**
5386
5479
  * Create an asynchronous _Flow_, a function that pipes values through a series of functions
5387
5480
  *
@@ -5389,7 +5482,7 @@ export declare function attemptAsyncFlow<First extends GenericCallback, Second,
5389
5482
  *
5390
5483
  * @returns _Flow_ function
5391
5484
  */
5392
- export declare function attemptAsyncFlow<Fn extends GenericCallback>(fn: Fn, ...fns: Array<(value: Awaited<UnwrapValue<ReturnType<Fn>>>) => unknown>): AttemptFlowPromise<Fn, ReturnType<Fn>>;
5485
+ export declare function attemptAsyncFlow<Fn extends GenericCallback>(fn: Fn, ...fns: Array<(value: Awaited<UnwrapValue<ReturnType<Fn>>>) => unknown>): AttemptAsyncFlow<Fn, ReturnType<Fn>>;
5393
5486
  /**
5394
5487
  * Create an asynchronous _Flow_, a function that pipes values through a series of functions
5395
5488
  *
@@ -5656,11 +5749,11 @@ export declare namespace attemptPipe {
5656
5749
  export var async: typeof attemptAsyncPipe;
5657
5750
  }
5658
5751
  //#endregion
5659
- //#region src/string/fuzzy.d.ts
5752
+ //#region src/models/string/string.fuzzy.model.d.ts
5660
5753
  /**
5661
5754
  * Fuzzy searcher for an array of items
5662
5755
  */
5663
- export type Fuzzy<Item> = {
5756
+ type Fuzzy<Item> = {
5664
5757
  /**
5665
5758
  * Get items currently being searched through
5666
5759
  *
@@ -5696,7 +5789,7 @@ export type Fuzzy<Item> = {
5696
5789
  */
5697
5790
  search(value: string, limit: number): FuzzyResult<Item>;
5698
5791
  };
5699
- export type FuzzyConfiguration<Item> = {
5792
+ type FuzzyConfiguration<Item> = {
5700
5793
  /**
5701
5794
  * Handler to stringify items
5702
5795
  *
@@ -5712,7 +5805,11 @@ export type FuzzyConfiguration<Item> = {
5712
5805
  */
5713
5806
  key?: keyof Item;
5714
5807
  } : {}) & FuzzyOptions;
5715
- export type FuzzyOptions = {
5808
+ type FuzzyItem<Item> = {
5809
+ item: Item;
5810
+ haystack: string;
5811
+ };
5812
+ type FuzzyOptions = {
5716
5813
  /**
5717
5814
  * Maximum number of combined items to return in `exact` and `similar` _(defaults to all matches)_
5718
5815
  */
@@ -5728,7 +5825,7 @@ export type FuzzyOptions = {
5728
5825
  /**
5729
5826
  * Search results from a fuzzy search, with exact and similar matches
5730
5827
  */
5731
- export type FuzzyResult<Item> = {
5828
+ type FuzzyResult<Item> = {
5732
5829
  /**
5733
5830
  * Ordered items that exactly match the search value
5734
5831
  */
@@ -5738,10 +5835,16 @@ export type FuzzyResult<Item> = {
5738
5835
  */
5739
5836
  similar: Item[];
5740
5837
  };
5741
- /**
5742
- * Options for fuzzy searching
5743
- */
5744
- export type FuzzySearchOptions = FuzzyOptions;
5838
+ type FuzzyState<Item> = {
5839
+ handler(item: Item): string;
5840
+ items: Item[];
5841
+ limit?: number;
5842
+ strings: string[];
5843
+ tolerance: number;
5844
+ };
5845
+ //#endregion
5846
+ //#region src/string/fuzzy.d.ts
5847
+ declare function Fuzzy(this: any, state: FuzzyState<unknown>): void;
5745
5848
  /**
5746
5849
  * Create a fuzzy searcher for an array of items
5747
5850
  *
@@ -5871,11 +5974,11 @@ export declare function includes(haystack: string, needle: string, ignoreCase?:
5871
5974
  */
5872
5975
  export declare function startsWith(haystack: string, needle: string, ignoreCase?: boolean): boolean;
5873
5976
  //#endregion
5874
- //#region src/string/normalize.d.ts
5977
+ //#region src/models/string/string.normalize.model.d.ts
5875
5978
  /**
5876
5979
  * Options for normalizing a string
5877
5980
  */
5878
- export type NormalizeOptions = {
5981
+ type NormalizeOptions = {
5879
5982
  /**
5880
5983
  * Remove diacritical marks from the string? _(defaults to `true`)_
5881
5984
  */
@@ -5902,7 +6005,7 @@ export type NormalizeOptions = {
5902
6005
  /**
5903
6006
  * String normalizer function
5904
6007
  */
5905
- export type Normalizer = {
6008
+ type Normalizer = {
5906
6009
  /**
5907
6010
  * Normalize a string
5908
6011
  *
@@ -5911,6 +6014,10 @@ export type Normalizer = {
5911
6014
  */
5912
6015
  normalize(value: string): string;
5913
6016
  };
6017
+ type NormalizerOptions = Required<NormalizeOptions>;
6018
+ //#endregion
6019
+ //#region src/string/normalize.d.ts
6020
+ declare function Normalizer(this: any, options: NormalizerOptions): void;
5914
6021
  /**
5915
6022
  * Deburr a string, removing diacritical marks
5916
6023
  *
@@ -5941,7 +6048,7 @@ export declare namespace normalize {
5941
6048
  export var initialize: typeof initializeNormalizer;
5942
6049
  }
5943
6050
  //#endregion
5944
- //#region src/string/template.d.ts
6051
+ //#region src/models/string/string.template.model.d.ts
5945
6052
  /**
5946
6053
  * Renderer for a string template with variables
5947
6054
  *
@@ -5953,7 +6060,7 @@ type Renderer = (variables?: PlainObject, options?: Partial<TemplateOptions>) =>
5953
6060
  /**
5954
6061
  * Options for templating strings
5955
6062
  */
5956
- export type TemplateOptions = {
6063
+ type TemplateOptions = {
5957
6064
  /**
5958
6065
  * Ignore case when searching for variables?
5959
6066
  */
@@ -5979,10 +6086,14 @@ type Templater = {
5979
6086
  */
5980
6087
  render(value: string, variables?: PlainObject): string;
5981
6088
  };
6089
+ type TemplaterOptions = Required<TemplateOptions>;
5982
6090
  /**
5983
6091
  * Render a template string with variables
5984
6092
  */
5985
6093
  type TemplaterRenderer = (variables?: PlainObject) => string;
6094
+ //#endregion
6095
+ //#region src/string/template.d.ts
6096
+ declare function Templater(this: any, options: TemplaterOptions): void;
5986
6097
  /**
5987
6098
  * Create a _Templater_ with predefined options
5988
6099
  *
@@ -6011,8 +6122,8 @@ export declare namespace template {
6011
6122
  export var initialize: typeof initializeTemplater;
6012
6123
  }
6013
6124
  //#endregion
6014
- //#region src/value/clone.d.ts
6015
- export type CloneOptions = {
6125
+ //#region src/models/value/value.clone.model.d.ts
6126
+ type CloneOptions = {
6016
6127
  /**
6017
6128
  * Copy functions instead of returning `undefined`? _(defaults to `false`)_
6018
6129
  */
@@ -6025,7 +6136,7 @@ export type CloneOptions = {
6025
6136
  /**
6026
6137
  * A cloning function with predefined options
6027
6138
  */
6028
- export type Cloner = {
6139
+ type Cloner = {
6029
6140
  /**
6030
6141
  * Clone any kind of value
6031
6142
  *
@@ -6040,7 +6151,7 @@ export type Cloner = {
6040
6151
  *
6041
6152
  * @param constructor Class constructor
6042
6153
  */
6043
- deregister: typeof deregisterCloner;
6154
+ deregister<Instance>(constructor: Constructor<Instance>): void;
6044
6155
  /**
6045
6156
  * Register a clone handler for a specific class
6046
6157
  *
@@ -6049,8 +6160,11 @@ export type Cloner = {
6049
6160
  * @param constructor Class constructor
6050
6161
  * @param handler Method name or clone function _(defaults to method name `clone`)_
6051
6162
  */
6052
- register: typeof registerCloner;
6163
+ register<Instance>(constructor: Constructor<Instance>, handler?: string | ((value: Instance) => Instance)): void;
6053
6164
  };
6165
+ //#endregion
6166
+ //#region src/value/clone.d.ts
6167
+ declare function Cloner(this: any, options: Required<CloneOptions>): void;
6054
6168
  /**
6055
6169
  * Clone any kind of value _(deeply, if needed)_
6056
6170
  *
@@ -6129,11 +6243,11 @@ export declare function inMap<Key, Value>(map: Map<Key, Value>, value: Value, ke
6129
6243
  */
6130
6244
  export declare function inSet<Value>(set: Set<Value>, value: Value): boolean;
6131
6245
  //#endregion
6132
- //#region src/value/diff.d.ts
6246
+ //#region src/models/value/value.diff.model.d.ts
6133
6247
  /**
6134
6248
  * Options for value comparison
6135
6249
  */
6136
- export type DiffOptions = {
6250
+ type DiffOptions = {
6137
6251
  /**
6138
6252
  * Should `null` and `undefined` be considered equal and ignored in results?
6139
6253
  */
@@ -6142,7 +6256,7 @@ export type DiffOptions = {
6142
6256
  /**
6143
6257
  * The result of a comparison beteen two values
6144
6258
  */
6145
- export type DiffResult<First, Second = First> = {
6259
+ type DiffResult<First, Second = First> = {
6146
6260
  /**
6147
6261
  * The original values that were compared
6148
6262
  */
@@ -6163,7 +6277,7 @@ type DiffType = "full" | "none" | "partial";
6163
6277
  /**
6164
6278
  * The difference between two values
6165
6279
  */
6166
- export type DiffValue<First = unknown, Second = First> = {
6280
+ type DiffValue<First = unknown, Second = First> = {
6167
6281
  /**
6168
6282
  * The value from the first value
6169
6283
  */
@@ -6173,6 +6287,8 @@ export type DiffValue<First = unknown, Second = First> = {
6173
6287
  */
6174
6288
  to: Second;
6175
6289
  };
6290
+ //#endregion
6291
+ //#region src/value/diff.d.ts
6176
6292
  /**
6177
6293
  * Find the differences between two values
6178
6294
  *
@@ -6184,10 +6300,6 @@ export type DiffValue<First = unknown, Second = First> = {
6184
6300
  export declare function diff<First, Second = First>(first: First, second: Second, options?: DiffOptions): DiffResult<First, Second>;
6185
6301
  //#endregion
6186
6302
  //#region src/value/freeze.d.ts
6187
- /**
6188
- * A frozen value with readonly properties _(going as deep as possible)_
6189
- */
6190
- 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>;
6191
6303
  /**
6192
6304
  * Freeze an array and its indiced values, but not any nested values
6193
6305
  *
@@ -6347,10 +6459,6 @@ export declare function omit<Value extends PlainObject, ValueKey extends keyof V
6347
6459
  export declare function pick<Value extends PlainObject, ValueKey extends keyof Value>(value: Value, keys: ValueKey[]): Pick<Value, ValueKey>;
6348
6460
  //#endregion
6349
6461
  //#region src/value/shake.d.ts
6350
- /**
6351
- * A shaken object, without any `undefined` values
6352
- */
6353
- type Shaken<Value extends PlainObject> = { [Key in keyof Value]: Value[Key] extends undefined ? never : Value[Key]; };
6354
6462
  /**
6355
6463
  * Shake an object, removing all keys with `undefined` values
6356
6464
  *
@@ -6360,10 +6468,6 @@ type Shaken<Value extends PlainObject> = { [Key in keyof Value]: Value[Key] exte
6360
6468
  export declare function shake<Value extends PlainObject>(value: Value): Shaken<Value>;
6361
6469
  //#endregion
6362
6470
  //#region src/value/smush.d.ts
6363
- /**
6364
- * A smushed object, with all nested objects flattened into a single level, using dot notation keys
6365
- */
6366
- type Smushed<Value extends PlainObject> = Simplify<{ [NestedKey in NestedKeys<Value>]: NestedValue<Value, ToString<NestedKey>>; }>;
6367
6471
  /**
6368
6472
  * Smush an object into a flat object that uses dot notation keys
6369
6473
  *
@@ -6373,14 +6477,6 @@ type Smushed<Value extends PlainObject> = Simplify<{ [NestedKey in NestedKeys<Va
6373
6477
  export declare function smush<Value extends PlainObject>(value: Value): Smushed<Value>;
6374
6478
  //#endregion
6375
6479
  //#region src/value/unsmush.d.ts
6376
- /**
6377
- * Thanks, type-fest!
6378
- */
6379
- type KeysOfUnion<ObjectType> = keyof UnionToIntersection<ObjectType extends unknown ? Record<keyof ObjectType, never> : never>;
6380
- /**
6381
- * An unsmushed object, with all dot notation keys turned into nested keys
6382
- */
6383
- type Unsmushed<Value extends PlainObject> = Simplify<Omit<{ [UnionKey in KeysOfUnion<Value>]: Value[UnionKey]; }, `${string}.${string}`>>;
6384
6480
  /**
6385
6481
  * Unsmush a smushed object _(turning dot notation keys into nested keys)_
6386
6482
  *
@@ -6389,32 +6485,12 @@ type Unsmushed<Value extends PlainObject> = Simplify<Omit<{ [UnionKey in KeysOfU
6389
6485
  */
6390
6486
  export declare function unsmush<Value extends PlainObject>(value: Value): Unsmushed<Value>;
6391
6487
  //#endregion
6392
- //#region src/value/merge.d.ts
6488
+ //#region src/models/value/value.merge.model.d.ts
6393
6489
  /**
6394
6490
  * Options for assigning values
6395
6491
  */
6396
- export type AssignOptions = Omit<MergeOptions, "assignValues">;
6397
- /**
6398
- * An assigner function for assigning values from one or more objects to the first one
6399
- */
6400
- export type Assigner = {
6401
- /**
6402
- * Assign values from one or more objects to the first one
6403
- *
6404
- * @param to Value to assign to
6405
- * @param from Values to assign
6406
- * @returns Assigned value
6407
- */
6408
- assign<To extends PlainObject, From extends PlainObject[]>(to: To, from: [...From]): To & UnionToIntersection<From[number]>;
6409
- };
6410
- /**
6411
- * Options for merging values
6412
- */
6413
- export type MergeOptions = {
6414
- /**
6415
- * Assign values to the first array or object instead of creating a new one?
6416
- */
6417
- assignValues?: boolean;
6492
+ type AssignOptions = BaseOptions;
6493
+ type BaseOptions = {
6418
6494
  /**
6419
6495
  * Key _(or key epxressions)_ for values that should be replaced
6420
6496
  *
@@ -6440,10 +6516,32 @@ export type MergeOptions = {
6440
6516
  */
6441
6517
  skipNullableInArrays?: boolean;
6442
6518
  };
6519
+ /**
6520
+ * An assigner function for assigning values from one or more objects to the first one
6521
+ */
6522
+ type Assigner = {
6523
+ /**
6524
+ * Assign values from one or more objects to the first one
6525
+ *
6526
+ * @param to Value to assign to
6527
+ * @param from Values to assign
6528
+ * @returns Assigned value
6529
+ */
6530
+ assign<To extends PlainObject, From extends PlainObject[]>(to: To, from: [...From]): To & UnionToIntersection<From[number]>;
6531
+ };
6532
+ /**
6533
+ * Options for merging values
6534
+ */
6535
+ type MergeOptions = {
6536
+ /**
6537
+ * Assign values to the first array or object instead of creating a new one?
6538
+ */
6539
+ assignValues?: boolean;
6540
+ };
6443
6541
  /**
6444
6542
  * A merger function for merging multiple arrays or objects into a single one
6445
6543
  */
6446
- export type Merger = {
6544
+ type Merger = {
6447
6545
  /**
6448
6546
  * Merge multiple arrays or objects into a single one
6449
6547
  *
@@ -6452,6 +6550,17 @@ export type Merger = {
6452
6550
  */
6453
6551
  merge<Values extends ArrayOrPlainObject[]>(values: Array<NestedPartial<Values[number]>>): UnionToIntersection<Values[number]>;
6454
6552
  };
6553
+ type MergeReplaceableObjectsCallback = (name: string) => boolean;
6554
+ type MergingOptions = {
6555
+ assignValues: boolean;
6556
+ replaceableObjects: MergeReplaceableObjectsCallback | undefined;
6557
+ skipNullableAny: boolean;
6558
+ skipNullableInArrays: boolean;
6559
+ };
6560
+ //#endregion
6561
+ //#region src/value/merge.d.ts
6562
+ declare function Assigner(this: any, options: MergingOptions): void;
6563
+ declare function Merger(this: any, options: MergingOptions): void;
6455
6564
  /**
6456
6565
  * Assign values from one or more objects to the first one
6457
6566
  *
@@ -6494,7 +6603,7 @@ export declare namespace merge {
6494
6603
  export var initialize: typeof initializeMerger;
6495
6604
  }
6496
6605
  //#endregion
6497
- //#region src/value/transform.d.ts
6606
+ //#region src/models/value/value.transform.model.d.ts
6498
6607
  /**
6499
6608
  * A callback transform an object's properties
6500
6609
  */
@@ -6503,18 +6612,11 @@ type TransformCallback<Value extends PlainObject, Key extends keyof Value> = (ke
6503
6612
  * A collection of keyed callbacks to transform an object's properties
6504
6613
  */
6505
6614
  type TransformCallbacks<Value extends PlainObject> = Partial<{ [Key in keyof Value]: (value: Value[Key]) => Value[Key]; }>;
6506
- /**
6507
- * A transformer for an object, with predefined callbacks for transforming its properties
6508
- */
6509
- export type Transformer<Value extends PlainObject> = {
6510
- /**
6511
- * Transform an object's properties
6512
- *
6513
- * @param value Object to transform
6514
- * @returns Transformed object
6515
- */
6516
- transform(value: Value): Value;
6517
- };
6615
+ type TransformHandler<Value extends PlainObject> = TransformCallback<Value, keyof Value> | TransformCallbacks<Value>;
6616
+ //#endregion
6617
+ //#region src/value/transform.d.ts
6618
+ declare function Transformer(this: any, transformer: ReturnType<typeof getTransformHandler>): void;
6619
+ declare function getTransformHandler<Value extends PlainObject, Key extends keyof Value>(input: unknown): TransformHandler<Value> | undefined;
6518
6620
  /**
6519
6621
  * Initialize a transformer for an object with a transformer function
6520
6622
  *
@@ -6553,7 +6655,7 @@ export declare namespace transform {
6553
6655
  export var initialize: typeof initializeTransformer;
6554
6656
  }
6555
6657
  //#endregion
6556
- //#region src/internal/subscription.d.ts
6658
+ //#region src/models/subscription.model.d.ts
6557
6659
  type Subscription = {
6558
6660
  /**
6559
6661
  * Is the subscription active?
@@ -6652,33 +6754,12 @@ type SubscriptionsValuesItem<MapKey, MapValue> = {
6652
6754
  any: Map<MapKey, MapValue>;
6653
6755
  keyed?: Map<Key$1, Map<MapKey, MapValue>>;
6654
6756
  };
6655
- /**
6656
- * Is the value a subscription?
6657
- *
6658
- * @param value Value to check
6659
- * @returns `true` if the value is a subscription, otherwise `false`
6660
- */
6661
- export declare function isSubscription(value: unknown): value is Subscription;
6662
- /**
6663
- * Is the value a subscriptions store?
6664
- *
6665
- * @param value Value to check
6666
- * @returns `true` if the value is a subscriptions store, otherwise `false`
6667
- */
6668
- export declare function isSubscriptions(value: unknown): value is Subscriptions;
6669
- /**
6670
- * Create a subscription store
6671
- *
6672
- * @param parameters Store parameters
6673
- * @returns Subscription store
6674
- */
6675
- export declare function subscriptions<Value = unknown>(parameters?: SubscriptionsParameters): Subscriptions<Value>;
6676
6757
  //#endregion
6677
- //#region src/beacon.d.ts
6758
+ //#region src/models/beacon.model.d.ts
6678
6759
  /**
6679
6760
  * A beacon is a lighthouse, holding an observable value that can be subscribed to and emitted from
6680
6761
  */
6681
- export type Beacon<Value> = {
6762
+ type Beacon<Value> = {
6682
6763
  /**
6683
6764
  * Is the beacon active?
6684
6765
  */
@@ -6714,7 +6795,7 @@ export type Beacon<Value> = {
6714
6795
  */
6715
6796
  finish(): void;
6716
6797
  };
6717
- export type BeaconOptions<Value> = {
6798
+ type BeaconOptions<Value> = {
6718
6799
  /**
6719
6800
  * Method for comparing values for equality
6720
6801
  *
@@ -6725,7 +6806,14 @@ export type BeaconOptions<Value> = {
6725
6806
  */
6726
6807
  equal?: (first: Value, second: Value) => boolean;
6727
6808
  };
6728
- export type Observable<Value> = {
6809
+ type BeaconState<Value> = {
6810
+ active: boolean;
6811
+ observable?: Observable<Value>;
6812
+ options: Required<BeaconOptions<Value>>;
6813
+ subscriptions?: Subscriptions<Observer<unknown>>;
6814
+ value: Value;
6815
+ };
6816
+ type Observable<Value> = {
6729
6817
  /**
6730
6818
  * Is the observable active?
6731
6819
  */
@@ -6765,6 +6853,33 @@ type Observer<Value> = {
6765
6853
  */
6766
6854
  next?: (value: Value) => void;
6767
6855
  };
6856
+ //#endregion
6857
+ //#region src/internal/subscription.d.ts
6858
+ /**
6859
+ * Is the value a subscription?
6860
+ *
6861
+ * @param value Value to check
6862
+ * @returns `true` if the value is a subscription, otherwise `false`
6863
+ */
6864
+ export declare function isSubscription(value: unknown): value is Subscription;
6865
+ /**
6866
+ * Is the value a subscriptions store?
6867
+ *
6868
+ * @param value Value to check
6869
+ * @returns `true` if the value is a subscriptions store, otherwise `false`
6870
+ */
6871
+ export declare function isSubscriptions(value: unknown): value is Subscriptions;
6872
+ /**
6873
+ * Create a subscription store
6874
+ *
6875
+ * @param parameters Store parameters
6876
+ * @returns Subscription store
6877
+ */
6878
+ export declare function subscriptions<Value = unknown>(parameters?: SubscriptionsParameters): Subscriptions<Value>;
6879
+ //#endregion
6880
+ //#region src/beacon.d.ts
6881
+ declare function Beacon(this: any, value: unknown, options?: BeaconOptions<unknown>): void;
6882
+ declare function Observable(this: any, beacon: BeaconState<unknown>): void;
6768
6883
  /**
6769
6884
  * Create a new beacon
6770
6885
  *
@@ -6795,7 +6910,7 @@ export declare function isBeaconSubscription(value: unknown): value is Subscript
6795
6910
  */
6796
6911
  export declare function isObservable<Value = unknown>(value: unknown): value is Observable<Value>;
6797
6912
  //#endregion
6798
- //#region src/internal/models/herald.model.d.ts
6913
+ //#region src/models/herald.model.d.ts
6799
6914
  type Herald<Events extends Record<string, GenericCallback>> = {
6800
6915
  readonly events: HeraldEvents<Events>;
6801
6916
  /**
@@ -6834,7 +6949,7 @@ type HeraldOptions<Events extends Record<string, GenericCallback>> = {
6834
6949
  onCreate?: HeraldOnCreate<Events>;
6835
6950
  };
6836
6951
  //#endregion
6837
- //#region src/color/models.d.ts
6952
+ //#region src/models/color.model.d.ts
6838
6953
  /**
6839
6954
  * A color that is represented in multiple color formats
6840
6955
  */
@@ -7757,8 +7872,8 @@ export declare function isNumerical(value: unknown): value is number | `${number
7757
7872
  */
7758
7873
  export declare function isObject(value: unknown): value is object;
7759
7874
  //#endregion
7760
- //#region src/logger.d.ts
7761
- type Logger = {
7875
+ //#region src/models/logger.model.d.ts
7876
+ type Lumberjack = {
7762
7877
  /**
7763
7878
  * Log any number of values at the "debug" log level
7764
7879
  */
@@ -7826,15 +7941,17 @@ type TimeLogger = {
7826
7941
  */
7827
7942
  get stop(): () => void;
7828
7943
  };
7944
+ //#endregion
7945
+ //#region src/logger.d.ts
7829
7946
  declare function TimeLogger(this: any, label: string): void;
7830
- declare function isLogger(value: unknown): value is Logger;
7947
+ declare function isLogger(value: unknown): value is Lumberjack;
7831
7948
  declare function isTimeLogger(value: unknown): value is TimeLogger;
7832
7949
  /**
7833
7950
  * A logger that can be used to log messages to the console
7834
7951
  *
7835
7952
  * _(Logging can be enabled or disabled by setting the `enabled` property)_
7836
7953
  */
7837
- declare const Logger: Logger;
7954
+ declare const Logger: Lumberjack;
7838
7955
  //#endregion
7839
7956
  //#region src/internal/math/aggregate.d.ts
7840
7957
  /**
@@ -8140,11 +8257,11 @@ export declare function fromQuery(query: string): PlainObject;
8140
8257
  */
8141
8258
  export declare function toQuery(parameters: PlainObject): string;
8142
8259
  //#endregion
8143
- //#region src/queue.d.ts
8260
+ //#region src/models/queue.model.d.ts
8144
8261
  /**
8145
8262
  * A queue that can be used to manage (a)synchronous tasks with a specific key
8146
8263
  */
8147
- export type KeyedQueue<Callback extends GenericCallback | GenericAsyncCallback, CallbackParameters extends unknown[] = Parameters<Callback>> = {
8264
+ type KeyedQueue<Callback extends GenericCallback | GenericAsyncCallback, CallbackParameters extends unknown[] = Parameters<Callback>> = {
8148
8265
  /**
8149
8266
  * Get keys of all active queues
8150
8267
  */
@@ -8242,7 +8359,7 @@ export type KeyedQueue<Callback extends GenericCallback | GenericAsyncCallback,
8242
8359
  /**
8243
8360
  * A queue that can be used to manage (a)synchronous tasks
8244
8361
  */
8245
- export type Queue<Callback extends GenericCallback | GenericAsyncCallback, CallbackParameters extends unknown[] = Parameters<Callback>> = {
8362
+ type Queue<Callback extends GenericCallback | GenericAsyncCallback, CallbackParameters extends unknown[] = Parameters<Callback>> = {
8246
8363
  /**
8247
8364
  * Is the queue active?
8248
8365
  */
@@ -8305,13 +8422,7 @@ export type Queue<Callback extends GenericCallback | GenericAsyncCallback, Callb
8305
8422
  */
8306
8423
  resume(): void;
8307
8424
  };
8308
- /**
8309
- * An error thrown by the Queue when an operation fails
8310
- */
8311
- export declare class QueueError extends Error {
8312
- constructor(message: string);
8313
- }
8314
- export type QueueOptions = {
8425
+ type QueueOptions = {
8315
8426
  /**
8316
8427
  * Automatically start processing the queue when the first item is added _(defaults to `true`)_
8317
8428
  */
@@ -8328,7 +8439,7 @@ export type QueueOptions = {
8328
8439
  /**
8329
8440
  * A queued item
8330
8441
  */
8331
- export type Queued<Value> = {
8442
+ type Queued<Value> = {
8332
8443
  /**
8333
8444
  * ID of the queued item _(can be used to remove it from the queue)_
8334
8445
  */
@@ -8339,6 +8450,10 @@ export type Queued<Value> = {
8339
8450
  readonly promise: Promise<Value extends Promise<infer Result> ? Result : Value>;
8340
8451
  };
8341
8452
  type Tail<Values extends any[]> = Values extends [infer _, ...infer Rest] ? Rest : never;
8453
+ //#endregion
8454
+ //#region src/queue.d.ts
8455
+ declare function KeyedQueue(this: any, callback: GenericAsyncCallback, options: Required<QueueOptions>): void;
8456
+ declare function Queue(this: any, callback: GenericAsyncCallback, options: Required<QueueOptions>, key?: string): void;
8342
8457
  /**
8343
8458
  * Is the value keyed queue?
8344
8459
  *
@@ -8510,4 +8625,4 @@ export declare class SizedSet<Value = unknown> extends Set<Value> {
8510
8625
  get(value: Value, update?: boolean): Value | undefined;
8511
8626
  }
8512
8627
  //#endregion
8513
- 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 };
8628
+ 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 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 };