@oscarpalmer/atoms 0.186.2 → 0.187.1

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 (230) hide show
  1. package/dist/array/filter.d.mts +4 -4
  2. package/dist/array/find.d.mts +4 -4
  3. package/dist/array/first.d.mts +4 -4
  4. package/dist/array/get.d.mts +27 -1
  5. package/dist/array/get.mjs +5 -3
  6. package/dist/array/group-by.d.mts +6 -6
  7. package/dist/array/last.d.mts +4 -4
  8. package/dist/array/match.d.mts +7 -6
  9. package/dist/array/move.d.mts +7 -7
  10. package/dist/array/move.mjs +1 -1
  11. package/dist/array/select.d.mts +1 -0
  12. package/dist/array/slice.d.mts +3 -3
  13. package/dist/array/sort.d.mts +10 -7
  14. package/dist/array/sort.mjs +4 -3
  15. package/dist/array/swap.d.mts +1 -1
  16. package/dist/array/swap.mjs +1 -1
  17. package/dist/array/to-map.d.mts +32 -32
  18. package/dist/array/to-record.d.mts +6 -6
  19. package/dist/array/to-set.d.mts +6 -6
  20. package/dist/beacon.d.mts +6 -0
  21. package/dist/beacon.mjs +3 -0
  22. package/dist/color/index.d.mts +6 -2
  23. package/dist/color/index.mjs +6 -2
  24. package/dist/color/instance.d.mts +78 -14
  25. package/dist/color/instance.mjs +78 -14
  26. package/dist/color/misc/get.d.mts +39 -11
  27. package/dist/color/misc/get.mjs +39 -11
  28. package/dist/color/misc/is.d.mts +26 -11
  29. package/dist/color/misc/is.mjs +26 -11
  30. package/dist/color/misc/state.mjs +1 -1
  31. package/dist/color/models.d.mts +7 -4
  32. package/dist/color/space/hex.d.mts +15 -6
  33. package/dist/color/space/hex.mjs +15 -6
  34. package/dist/color/space/hsl.d.mts +10 -4
  35. package/dist/color/space/hsl.mjs +10 -4
  36. package/dist/color/space/rgb.d.mts +21 -12
  37. package/dist/color/space/rgb.mjs +21 -12
  38. package/dist/function/assert.d.mts +20 -14
  39. package/dist/function/assert.mjs +19 -13
  40. package/dist/function/limit.d.mts +8 -6
  41. package/dist/function/limit.mjs +8 -6
  42. package/dist/function/memoize.d.mts +15 -4
  43. package/dist/function/memoize.mjs +18 -4
  44. package/dist/function/once.d.mts +5 -3
  45. package/dist/function/once.mjs +5 -3
  46. package/dist/function/retry.d.mts +5 -2
  47. package/dist/function/retry.mjs +3 -1
  48. package/dist/function/work.d.mts +146 -98
  49. package/dist/{kalas.d.mts → herald.d.mts} +17 -8
  50. package/dist/{kalas.mjs → herald.mjs} +22 -13
  51. package/dist/index.d.mts +1464 -708
  52. package/dist/index.mjs +703 -342
  53. package/dist/internal/array/index-of.d.mts +4 -4
  54. package/dist/internal/array/insert.mjs +1 -1
  55. package/dist/internal/array/shuffle.d.mts +1 -0
  56. package/dist/internal/array/shuffle.mjs +2 -1
  57. package/dist/internal/is.d.mts +26 -8
  58. package/dist/internal/is.mjs +26 -8
  59. package/dist/internal/math/aggregate.d.mts +9 -9
  60. package/dist/internal/number.d.mts +13 -2
  61. package/dist/internal/number.mjs +13 -2
  62. package/dist/internal/random.d.mts +4 -2
  63. package/dist/internal/random.mjs +7 -5
  64. package/dist/internal/result.d.mts +17 -11
  65. package/dist/internal/result.mjs +10 -14
  66. package/dist/internal/string.d.mts +16 -1
  67. package/dist/internal/string.mjs +24 -1
  68. package/dist/internal/value/compare.d.mts +5 -2
  69. package/dist/internal/value/compare.mjs +5 -2
  70. package/dist/internal/value/equal.d.mts +12 -3
  71. package/dist/internal/value/equal.mjs +7 -4
  72. package/dist/internal/value/get.d.mts +17 -17
  73. package/dist/internal/value/has.d.mts +55 -11
  74. package/dist/internal/value/set.d.mts +24 -0
  75. package/dist/internal/value/set.mjs +1 -1
  76. package/dist/is.d.mts +12 -0
  77. package/dist/is.mjs +16 -1
  78. package/dist/logger.d.mts +7 -6
  79. package/dist/logger.mjs +6 -5
  80. package/dist/math.d.mts +36 -18
  81. package/dist/math.mjs +6 -3
  82. package/dist/models.d.mts +3 -3
  83. package/dist/promise/delay.d.mts +2 -0
  84. package/dist/promise/helpers.d.mts +6 -4
  85. package/dist/promise/helpers.mjs +6 -4
  86. package/dist/promise/index.d.mts +49 -38
  87. package/dist/promise/misc.d.mts +10 -7
  88. package/dist/promise/misc.mjs +4 -3
  89. package/dist/promise/models.d.mts +18 -19
  90. package/dist/promise/models.mjs +4 -3
  91. package/dist/promise/timed.d.mts +8 -6
  92. package/dist/query.d.mts +2 -0
  93. package/dist/query.mjs +27 -17
  94. package/dist/queue.d.mts +15 -4
  95. package/dist/queue.mjs +10 -3
  96. package/dist/random.d.mts +9 -2
  97. package/dist/random.mjs +7 -2
  98. package/dist/result/index.d.mts +14 -8
  99. package/dist/result/match.d.mts +18 -10
  100. package/dist/result/misc.d.mts +14 -7
  101. package/dist/result/misc.mjs +4 -2
  102. package/dist/result/models.d.mts +2 -0
  103. package/dist/result/work/flow.d.mts +86 -62
  104. package/dist/result/work/pipe.d.mts +55 -33
  105. package/dist/sized/map.d.mts +19 -16
  106. package/dist/sized/map.mjs +4 -4
  107. package/dist/sized/set.d.mts +20 -16
  108. package/dist/sized/set.mjs +8 -7
  109. package/dist/string/case.d.mts +8 -0
  110. package/dist/string/case.mjs +8 -0
  111. package/dist/string/fuzzy.d.mts +19 -5
  112. package/dist/string/fuzzy.mjs +7 -0
  113. package/dist/string/index.d.mts +17 -2
  114. package/dist/string/index.mjs +7 -9
  115. package/dist/string/match.d.mts +3 -0
  116. package/dist/string/match.mjs +3 -0
  117. package/dist/string/normalize.d.mts +6 -2
  118. package/dist/string/normalize.mjs +5 -2
  119. package/dist/string/template.d.mts +38 -9
  120. package/dist/string/template.mjs +19 -19
  121. package/dist/value/clone.d.mts +25 -4
  122. package/dist/value/clone.mjs +36 -22
  123. package/dist/value/collection.d.mts +9 -6
  124. package/dist/value/collection.mjs +3 -2
  125. package/dist/value/diff.d.mts +3 -1
  126. package/dist/value/diff.mjs +1 -0
  127. package/dist/value/freeze.d.mts +118 -9
  128. package/dist/value/freeze.mjs +56 -14
  129. package/dist/value/index.d.mts +1 -2
  130. package/dist/value/index.mjs +1 -2
  131. package/dist/value/merge.d.mts +11 -5
  132. package/dist/value/merge.mjs +2 -2
  133. package/dist/value/omit.d.mts +1 -0
  134. package/dist/value/omit.mjs +1 -0
  135. package/dist/value/pick.d.mts +1 -0
  136. package/dist/value/pick.mjs +1 -0
  137. package/dist/value/shake.d.mts +1 -0
  138. package/dist/value/shake.mjs +1 -0
  139. package/dist/value/smush.d.mts +1 -0
  140. package/dist/value/smush.mjs +1 -0
  141. package/dist/value/transform.d.mts +7 -3
  142. package/dist/value/unsmush.d.mts +1 -0
  143. package/dist/value/unsmush.mjs +1 -0
  144. package/package.json +12 -8
  145. package/src/array/filter.ts +4 -4
  146. package/src/array/find.ts +4 -4
  147. package/src/array/first.ts +4 -4
  148. package/src/array/get.ts +40 -5
  149. package/src/array/group-by.ts +6 -6
  150. package/src/array/last.ts +4 -4
  151. package/src/array/match.ts +7 -6
  152. package/src/array/move.ts +7 -7
  153. package/src/array/select.ts +1 -0
  154. package/src/array/slice.ts +3 -3
  155. package/src/array/sort.ts +15 -10
  156. package/src/array/swap.ts +1 -1
  157. package/src/array/to-map.ts +32 -32
  158. package/src/array/to-record.ts +6 -6
  159. package/src/array/to-set.ts +6 -6
  160. package/src/beacon.ts +6 -0
  161. package/src/color/index.ts +6 -2
  162. package/src/color/instance.ts +78 -14
  163. package/src/color/misc/get.ts +39 -11
  164. package/src/color/misc/is.ts +26 -11
  165. package/src/color/misc/state.ts +1 -1
  166. package/src/color/models.ts +7 -4
  167. package/src/color/space/hex.ts +15 -6
  168. package/src/color/space/hsl.ts +10 -4
  169. package/src/color/space/rgb.ts +21 -12
  170. package/src/function/assert.ts +20 -14
  171. package/src/function/limit.ts +8 -6
  172. package/src/function/memoize.ts +24 -5
  173. package/src/function/once.ts +5 -3
  174. package/src/function/retry.ts +7 -3
  175. package/src/function/work.ts +146 -98
  176. package/src/{kalas.ts → herald.ts} +23 -14
  177. package/src/index.ts +3 -2
  178. package/src/internal/array/index-of.ts +4 -4
  179. package/src/internal/array/insert.ts +1 -1
  180. package/src/internal/array/shuffle.ts +2 -1
  181. package/src/internal/is.ts +26 -8
  182. package/src/internal/math/aggregate.ts +9 -9
  183. package/src/internal/number.ts +13 -2
  184. package/src/internal/random.ts +10 -4
  185. package/src/internal/result.ts +30 -29
  186. package/src/internal/string.ts +28 -0
  187. package/src/internal/value/compare.ts +5 -2
  188. package/src/internal/value/equal.ts +13 -4
  189. package/src/internal/value/get.ts +17 -17
  190. package/src/internal/value/has.ts +54 -11
  191. package/src/internal/value/set.ts +25 -1
  192. package/src/is.ts +15 -1
  193. package/src/logger.ts +8 -7
  194. package/src/math.ts +36 -18
  195. package/src/models.ts +3 -3
  196. package/src/promise/delay.ts +2 -0
  197. package/src/promise/helpers.ts +6 -4
  198. package/src/promise/index.ts +49 -38
  199. package/src/promise/misc.ts +10 -7
  200. package/src/promise/models.ts +18 -19
  201. package/src/promise/timed.ts +8 -6
  202. package/src/query.ts +39 -28
  203. package/src/queue.ts +15 -4
  204. package/src/random.ts +8 -1
  205. package/src/result/index.ts +14 -8
  206. package/src/result/match.ts +18 -10
  207. package/src/result/misc.ts +17 -9
  208. package/src/result/models.ts +2 -0
  209. package/src/result/work/flow.ts +86 -62
  210. package/src/result/work/pipe.ts +55 -33
  211. package/src/sized/map.ts +20 -17
  212. package/src/sized/set.ts +21 -17
  213. package/src/string/case.ts +8 -0
  214. package/src/string/fuzzy.ts +19 -5
  215. package/src/string/index.ts +18 -15
  216. package/src/string/match.ts +3 -0
  217. package/src/string/normalize.ts +6 -2
  218. package/src/string/template.ts +69 -18
  219. package/src/value/clone.ts +51 -26
  220. package/src/value/collection.ts +9 -6
  221. package/src/value/diff.ts +3 -1
  222. package/src/value/freeze.ts +239 -25
  223. package/src/value/index.ts +0 -1
  224. package/src/value/merge.ts +11 -5
  225. package/src/value/omit.ts +1 -0
  226. package/src/value/pick.ts +1 -0
  227. package/src/value/shake.ts +1 -0
  228. package/src/value/smush.ts +1 -0
  229. package/src/value/transform.ts +7 -3
  230. package/src/value/unsmush.ts +1 -0
@@ -3,155 +3,179 @@ import { UnwrapValue } from "../result/models.mjs";
3
3
 
4
4
  //#region src/function/work.d.ts
5
5
  /**
6
- * A synchronous Flow, a function that pipe a value through a series of functions
6
+ * A synchronous _Flow_, a function that pipe a value through a series of functions
7
7
  */
8
8
  type Flow<Callback extends GenericCallback, Value> = (...args: Parameters<Callback>) => UnwrapValue<Value>;
9
9
  /**
10
- * An asynchronous Flow, a function that pipes a value through a series of functions
10
+ * An asynchronous _Flow_, a function that pipes a value through a series of functions
11
11
  */
12
12
  type FlowPromise<Callback extends GenericCallback, Value> = (...args: Parameters<Callback>) => Promise<UnwrapValue<Value>>;
13
13
  /**
14
- * Create an asynchronous Flow, a function that pipes values through a function
14
+ * Create an asynchronous _Flow_, a function that pipes values through a function
15
15
  *
16
- * Available as `asyncFlow` and `flow.async`
17
- * @returns Flow function
16
+ * _Available as `asyncFlow` and `flow.async`_
17
+ *
18
+ * @returns _Flow_ function
18
19
  */
19
20
  declare function asyncFlow<Fn extends GenericCallback>(fn: Fn): FlowPromise<Fn, ReturnType<Fn>>;
20
21
  /**
21
- * Create an asynchronous Flow, a function that pipes values through a series of functions
22
+ * Create an asynchronous _Flow_, a function that pipes values through a series of functions
23
+ *
24
+ * _Available as `asyncFlow` and `flow.async`_
22
25
  *
23
- * Available as `asyncFlow` and `flow.async`
24
- * @returns Flow function
26
+ * @returns _Flow_ function
25
27
  */
26
28
  declare function asyncFlow<First extends GenericCallback, Second>(first: First, second: (value: Awaited<UnwrapValue<ReturnType<First>>>) => Second): FlowPromise<First, Second>;
27
29
  /**
28
- * Create an asynchronous Flow, a function that pipes values through a series of functions
30
+ * Create an asynchronous _Flow_, a function that pipes values through a series of functions
31
+ *
32
+ * _Available as `asyncFlow` and `flow.async`_
29
33
  *
30
- * Available as `asyncFlow` and `flow.async`
31
- * @returns Flow function
34
+ * @returns _Flow_ function
32
35
  */
33
36
  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>;
34
37
  /**
35
- * Create an asynchronous Flow, a function that pipes values through a series of functions
38
+ * Create an asynchronous _Flow_, a function that pipes values through a series of functions
36
39
  *
37
- * Available as `asyncFlow` and `flow.async`
38
- * @returns Flow function
40
+ * _Available as `asyncFlow` and `flow.async`_
41
+ *
42
+ * @returns _Flow_ function
39
43
  */
40
44
  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>;
41
45
  /**
42
- * Create an asynchronous Flow, a function that pipes values through a series of functions
46
+ * Create an asynchronous _Flow_, a function that pipes values through a series of functions
47
+ *
48
+ * _Available as `asyncFlow` and `flow.async`_
43
49
  *
44
- * Available as `asyncFlow` and `flow.async`
45
- * @returns Flow function
50
+ * @returns _Flow_ function
46
51
  */
47
52
  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>;
48
53
  /**
49
- * Create an asynchronous Flow, a function that pipes values through a series of functions
54
+ * Create an asynchronous _Flow_, a function that pipes values through a series of functions
55
+ *
56
+ * _Available as `asyncFlow` and `flow.async`_
50
57
  *
51
- * Available as `asyncFlow` and `flow.async`
52
- * @returns Flow function
58
+ * @returns _Flow_ function
53
59
  */
54
60
  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>;
55
61
  /**
56
- * Create an asynchronous Flow, a function that pipes values through a series of functions
62
+ * Create an asynchronous _Flow_, a function that pipes values through a series of functions
57
63
  *
58
- * Available as `asyncFlow` and `flow.async`
59
- * @returns Flow function
64
+ * _Available as `asyncFlow` and `flow.async`_
65
+ *
66
+ * @returns _Flow_ function
60
67
  */
61
68
  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>;
62
69
  /**
63
- * Create an asynchronous Flow, a function that pipes values through a series of functions
70
+ * Create an asynchronous _Flow_, a function that pipes values through a series of functions
71
+ *
72
+ * _Available as `asyncFlow` and `flow.async`_
64
73
  *
65
- * Available as `asyncFlow` and `flow.async`
66
- * @returns Flow function
74
+ * @returns _Flow_ function
67
75
  */
68
76
  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>;
69
77
  /**
70
- * Create an asynchronous Flow, a function that pipes values through a series of functions
78
+ * Create an asynchronous _Flow_, a function that pipes values through a series of functions
79
+ *
80
+ * _Available as `asyncFlow` and `flow.async`_
71
81
  *
72
- * Available as `asyncFlow` and `flow.async`
73
- * @returns Flow function
82
+ * @returns _Flow_ function
74
83
  */
75
84
  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>;
76
85
  /**
77
- * Create an asynchronous Flow, a function that pipes values through a series of functions
86
+ * Create an asynchronous _Flow_, a function that pipes values through a series of functions
78
87
  *
79
- * Available as `asyncFlow` and `flow.async`
80
- * @returns Flow function
88
+ * _Available as `asyncFlow` and `flow.async`_
89
+ *
90
+ * @returns _Flow_ function
81
91
  */
82
92
  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>;
83
93
  /**
84
- * Create an asynchronous Flow, a function that pipes values through a series of functions
94
+ * Create an asynchronous _Flow_, a function that pipes values through a series of functions
95
+ *
96
+ * _Available as `asyncFlow` and `flow.async`_
85
97
  *
86
- * Available as `asyncFlow` and `flow.async`
87
- * @returns Flow function
98
+ * @returns _Flow_ function
88
99
  */
89
100
  declare function asyncFlow<Fn extends GenericCallback>(fn: Fn, ...fns: Array<(value: Awaited<UnwrapValue<ReturnType<Fn>>>) => unknown>): FlowPromise<Fn, ReturnType<Fn>>;
90
101
  /**
91
- * Create an asynchronous Flow, a function that pipes values through a series of functions
102
+ * Create an asynchronous _Flow_, a function that pipes values through a series of functions
103
+ *
104
+ * _Available as `asyncFlow` and `flow.async`_
92
105
  *
93
- * Available as `asyncFlow` and `flow.async`
94
- * @returns Flow function
106
+ * @returns _Flow_ function
95
107
  */
96
108
  declare function asyncFlow(...fns: GenericCallback[]): (...args: unknown[]) => Promise<unknown>;
97
109
  /**
98
- * Create a Flow, a function that pipes values through a function
99
- * @returns Flow function
110
+ * Create a _Flow_, a function that pipes values through a function
111
+ *
112
+ * @returns _Flow_ function
100
113
  */
101
114
  declare function flow<Fn extends GenericCallback>(fn: Fn): Flow<Fn, ReturnType<Fn>>;
102
115
  /**
103
- * Create a Flow, a function that pipes values through a series of functions
104
- * @returns Flow function
116
+ * Create a _Flow_, a function that pipes values through a series of functions
117
+ *
118
+ * @returns _Flow_ function
105
119
  */
106
120
  declare function flow<First extends GenericCallback, Second>(first: First, second: (value: UnwrapValue<ReturnType<First>>) => Second): Flow<First, Second>;
107
121
  /**
108
- * Create a Flow, a function that pipes values through a series of functions
109
- * @returns Flow function
122
+ * Create a _Flow_, a function that pipes values through a series of functions
123
+ *
124
+ * @returns _Flow_ function
110
125
  */
111
126
  declare function flow<First extends GenericCallback, Second, Third>(first: First, second: (value: UnwrapValue<ReturnType<First>>) => Second, third: (value: UnwrapValue<Second>) => Third): Flow<First, Third>;
112
127
  /**
113
- * Create a Flow, a function that pipes values through a series of functions
114
- * @returns Flow function
128
+ * Create a _Flow_, a function that pipes values through a series of functions
129
+ *
130
+ * @returns _Flow_ function
115
131
  */
116
132
  declare function flow<First extends GenericCallback, Second, Third, Fourth>(first: First, second: (value: UnwrapValue<ReturnType<First>>) => Second, third: (value: UnwrapValue<Second>) => Third, fourth: (value: UnwrapValue<Third>) => Fourth): Flow<First, Fourth>;
117
133
  /**
118
- * Create a Flow, a function that pipes values through a series of functions
119
- * @returns Flow function
134
+ * Create a _Flow_, a function that pipes values through a series of functions
135
+ *
136
+ * @returns _Flow_ function
120
137
  */
121
138
  declare function flow<First extends GenericCallback, Second, Third, Fourth, Fifth>(first: First, second: (value: UnwrapValue<ReturnType<First>>) => Second, third: (value: UnwrapValue<Second>) => Third, fourth: (value: UnwrapValue<Third>) => Fourth, fifth: (value: UnwrapValue<Fourth>) => Fifth): Flow<First, Fifth>;
122
139
  /**
123
- * Create a Flow, a function that pipes values through a series of functions
124
- * @returns Flow function
140
+ * Create a _Flow_, a function that pipes values through a series of functions
141
+ *
142
+ * @returns _Flow_ function
125
143
  */
126
144
  declare function flow<First extends GenericCallback, Second, Third, Fourth, Fifth, Sixth>(first: First, second: (value: UnwrapValue<ReturnType<First>>) => Second, third: (value: UnwrapValue<Second>) => Third, fourth: (value: UnwrapValue<Third>) => Fourth, fifth: (value: UnwrapValue<Fourth>) => Fifth, sixth: (value: UnwrapValue<Fifth>) => Sixth): Flow<First, Sixth>;
127
145
  /**
128
- * Create a Flow, a function that pipes values through a series of functions
129
- * @returns Flow function
146
+ * Create a _Flow_, a function that pipes values through a series of functions
147
+ *
148
+ * @returns _Flow_ function
130
149
  */
131
150
  declare function flow<First extends GenericCallback, Second, Third, Fourth, Fifth, Sixth, Seventh>(first: First, second: (value: UnwrapValue<ReturnType<First>>) => Second, third: (value: UnwrapValue<Second>) => Third, fourth: (value: UnwrapValue<Third>) => Fourth, fifth: (value: UnwrapValue<Fourth>) => Fifth, sixth: (value: UnwrapValue<Fifth>) => Sixth, seventh: (value: UnwrapValue<Sixth>) => Seventh): Flow<First, Seventh>;
132
151
  /**
133
- * Create a Flow, a function that pipes values through a series of functions
134
- * @returns Flow function
152
+ * Create a _Flow_, a function that pipes values through a series of functions
153
+ *
154
+ * @returns _Flow_ function
135
155
  */
136
156
  declare function flow<First extends GenericCallback, Second, Third, Fourth, Fifth, Sixth, Seventh, Eighth>(first: First, second: (value: UnwrapValue<ReturnType<First>>) => Second, third: (value: UnwrapValue<Second>) => Third, fourth: (value: UnwrapValue<Third>) => Fourth, fifth: (value: UnwrapValue<Fourth>) => Fifth, sixth: (value: UnwrapValue<Fifth>) => Sixth, seventh: (value: UnwrapValue<Sixth>) => Seventh, eighth: (value: UnwrapValue<Seventh>) => Eighth): Flow<First, Eighth>;
137
157
  /**
138
- * Create a Flow, a function that pipes values through a series of functions
139
- * @returns Flow function
158
+ * Create a _Flow_, a function that pipes values through a series of functions
159
+ *
160
+ * @returns _Flow_ function
140
161
  */
141
162
  declare function flow<First extends GenericCallback, Second, Third, Fourth, Fifth, Sixth, Seventh, Eighth, Ninth>(first: First, second: (value: UnwrapValue<ReturnType<First>>) => Second, third: (value: UnwrapValue<Second>) => Third, fourth: (value: UnwrapValue<Third>) => Fourth, fifth: (value: UnwrapValue<Fourth>) => Fifth, sixth: (value: UnwrapValue<Fifth>) => Sixth, seventh: (value: UnwrapValue<Sixth>) => Seventh, eighth: (value: UnwrapValue<Seventh>) => Eighth, ninth: (value: UnwrapValue<Eighth>) => Ninth): Flow<First, Ninth>;
142
163
  /**
143
- * Create a Flow, a function that pipes values through a series of functions
144
- * @returns Flow function
164
+ * Create a _Flow_, a function that pipes values through a series of functions
165
+ *
166
+ * @returns _Flow_ function
145
167
  */
146
168
  declare function flow<First extends GenericCallback, Second, Third, Fourth, Fifth, Sixth, Seventh, Eighth, Ninth, Tenth>(first: First, second: (value: UnwrapValue<ReturnType<First>>) => Second, third: (value: UnwrapValue<Second>) => Third, fourth: (value: UnwrapValue<Third>) => Fourth, fifth: (value: UnwrapValue<Fourth>) => Fifth, sixth: (value: UnwrapValue<Fifth>) => Sixth, seventh: (value: UnwrapValue<Sixth>) => Seventh, eighth: (value: UnwrapValue<Seventh>) => Eighth, ninth: (value: UnwrapValue<Eighth>) => Ninth, tenth: (value: UnwrapValue<Ninth>) => Tenth): Flow<First, Tenth>;
147
169
  /**
148
- * Create a Flow, a function that pipes values through a series of functions
149
- * @returns Flow function
170
+ * Create a _Flow_, a function that pipes values through a series of functions
171
+ *
172
+ * @returns _Flow_ function
150
173
  */
151
174
  declare function flow<First extends GenericCallback>(first: First, ...fns: Array<(value: UnwrapValue<ReturnType<First>>) => unknown>): Flow<First, ReturnType<First>>;
152
175
  /**
153
- * Create a Flow, a function that pipes values through a series of functions
154
- * @returns Flow function
176
+ * Create a _Flow_, a function that pipes values through a series of functions
177
+ *
178
+ * @returns _Flow_ function
155
179
  */
156
180
  declare function flow(...fns: GenericCallback[]): (...args: unknown[]) => unknown;
157
181
  declare namespace flow {
@@ -160,169 +184,193 @@ declare namespace flow {
160
184
  /**
161
185
  * Pipe a value through a function
162
186
  *
163
- * Available as `asyncPipe` and `pipe.async`
187
+ * _Available as `asyncPipe` and `pipe.async`_
188
+ *
164
189
  * @param value Initial value
165
- * @returns Piped result
190
+ * @returns _Piped_ result
166
191
  */
167
192
  declare function asyncPipe<Initial, Piped>(value: Initial, pipe: (value: UnwrapValue<Initial>) => Piped): Promise<UnwrapValue<Piped>>;
168
193
  /**
169
194
  * Pipe a value through a series of functions
170
195
  *
171
- * Available as `asyncPipe` and `pipe.async`
196
+ * _Available as `asyncPipe` and `pipe.async`_
197
+ *
172
198
  * @param value Initial value
173
- * @returns Piped result
199
+ * @returns _Piped_ result
174
200
  */
175
201
  declare function asyncPipe<Initial, First, Second>(value: Initial, first: (value: UnwrapValue<Initial>) => First, second: (value: UnwrapValue<First>) => Second): Promise<UnwrapValue<Second>>;
176
202
  /**
177
203
  * Pipe a value through a series of functions
178
204
  *
179
- * Available as `asyncPipe` and `pipe.async`
205
+ * _Available as `asyncPipe` and `pipe.async`_
206
+ *
180
207
  * @param value Initial value
181
- * @returns Piped result
208
+ * @returns _Piped_ result
182
209
  */
183
210
  declare function asyncPipe<Initial, First, Second, Third>(value: Initial, first: (value: UnwrapValue<Initial>) => First, second: (value: UnwrapValue<First>) => Second, third: (value: UnwrapValue<Second>) => Third): Promise<UnwrapValue<Third>>;
184
211
  /**
185
212
  * Pipe a value through a series of functions
186
213
  *
187
- * Available as `asyncPipe` and `pipe.async`
214
+ * _Available as `asyncPipe` and `pipe.async`_
215
+ *
188
216
  * @param value Initial value
189
- * @returns Piped result
217
+ * @returns _Piped_ result
190
218
  */
191
219
  declare function asyncPipe<Initial, First, Second, Third, Fourth>(value: Initial, first: (value: UnwrapValue<Initial>) => First, second: (value: UnwrapValue<First>) => Second, third: (value: UnwrapValue<Second>) => Third, fourth: (value: UnwrapValue<Third>) => Fourth): Promise<UnwrapValue<Fourth>>;
192
220
  /**
193
221
  * Pipe a value through a series of functions
194
222
  *
195
- * Available as `asyncPipe` and `pipe.async`
223
+ * _Available as `asyncPipe` and `pipe.async`_
224
+ *
196
225
  * @param value Initial value
197
- * @returns Piped result
226
+ * @returns _Piped_ result
198
227
  */
199
228
  declare function asyncPipe<Initial, First, Second, Third, Fourth, Fifth>(value: Initial, first: (value: UnwrapValue<Initial>) => First, second: (value: UnwrapValue<First>) => Second, third: (value: UnwrapValue<Second>) => Third, fourth: (value: UnwrapValue<Third>) => Fourth, fifth: (value: UnwrapValue<Fourth>) => Fifth): Promise<UnwrapValue<Fifth>>;
200
229
  /**
201
230
  * Pipe a value through a series of functions
202
231
  *
203
- * Available as `asyncPipe` and `pipe.async`
232
+ * _Available as `asyncPipe` and `pipe.async`_
233
+ *
204
234
  * @param value Initial value
205
- * @returns Piped result
235
+ * @returns _Piped_ result
206
236
  */
207
237
  declare function asyncPipe<Initial, First, Second, Third, Fourth, Fifth, Sixth>(value: Initial, first: (value: UnwrapValue<Initial>) => First, second: (value: UnwrapValue<First>) => Second, third: (value: UnwrapValue<Second>) => Third, fourth: (value: UnwrapValue<Third>) => Fourth, fifth: (value: UnwrapValue<Fourth>) => Fifth, sixth: (value: UnwrapValue<Fifth>) => Sixth): Promise<UnwrapValue<Sixth>>;
208
238
  /**
209
239
  * Pipe a value through a series of functions
210
240
  *
211
- * Available as `asyncPipe` and `pipe.async`
241
+ * _Available as `asyncPipe` and `pipe.async`_
242
+ *
212
243
  * @param value Initial value
213
- * @returns Piped result
244
+ * @returns _Piped_ result
214
245
  */
215
246
  declare function asyncPipe<Initial, First, Second, Third, Fourth, Fifth, Sixth, Seventh>(value: Initial, first: (value: UnwrapValue<Initial>) => First, second: (value: UnwrapValue<First>) => Second, third: (value: UnwrapValue<Second>) => Third, fourth: (value: UnwrapValue<Third>) => Fourth, fifth: (value: UnwrapValue<Fourth>) => Fifth, sixth: (value: UnwrapValue<Fifth>) => Sixth, seventh: (value: UnwrapValue<Sixth>) => Seventh): Promise<UnwrapValue<Seventh>>;
216
247
  /**
217
248
  * Pipe a value through a series of functions
218
249
  *
219
- * Available as `asyncPipe` and `pipe.async`
250
+ * _Available as `asyncPipe` and `pipe.async`_
251
+ *
220
252
  * @param value Initial value
221
- * @returns Piped result
253
+ * @returns _Piped_ result
222
254
  */
223
255
  declare function asyncPipe<Initial, First, Second, Third, Fourth, Fifth, Sixth, Seventh, Eighth>(value: Initial, first: (value: UnwrapValue<Initial>) => First, second: (value: UnwrapValue<First>) => Second, third: (value: UnwrapValue<Second>) => Third, fourth: (value: UnwrapValue<Third>) => Fourth, fifth: (value: UnwrapValue<Fourth>) => Fifth, sixth: (value: UnwrapValue<Fifth>) => Sixth, seventh: (value: UnwrapValue<Sixth>) => Seventh, eighth: (value: UnwrapValue<Seventh>) => Eighth): Promise<UnwrapValue<Eighth>>;
224
256
  /**
225
257
  * Pipe a value through a series of functions
226
258
  *
227
- * Available as `asyncPipe` and `pipe.async`
259
+ * _Available as `asyncPipe` and `pipe.async`_
260
+ *
228
261
  * @param value Initial value
229
- * @returns Piped result
262
+ * @returns _Piped_ result
230
263
  */
231
264
  declare function asyncPipe<Initial, First, Second, Third, Fourth, Fifth, Sixth, Seventh, Eighth, Ninth>(value: Initial, first: (value: UnwrapValue<Initial>) => First, second: (value: UnwrapValue<First>) => Second, third: (value: UnwrapValue<Second>) => Third, fourth: (value: UnwrapValue<Third>) => Fourth, fifth: (value: UnwrapValue<Fourth>) => Fifth, sixth: (value: UnwrapValue<Fifth>) => Sixth, seventh: (value: UnwrapValue<Sixth>) => Seventh, eighth: (value: UnwrapValue<Seventh>) => Eighth, ninth: (value: UnwrapValue<Eighth>) => Ninth): Promise<UnwrapValue<Ninth>>;
232
265
  /**
233
266
  * Pipe a value through a series of functions
234
267
  *
235
- * Available as `asyncPipe` and `pipe.async`
268
+ * _Available as `asyncPipe` and `pipe.async`_
269
+ *
236
270
  * @param value Initial value
237
- * @returns Piped result
271
+ * @returns _Piped_ result
238
272
  */
239
273
  declare function asyncPipe<Initial, First, Second, Third, Fourth, Fifth, Sixth, Seventh, Eighth, Ninth, Tenth>(value: Initial, first: (value: UnwrapValue<Initial>) => First, second: (value: UnwrapValue<First>) => Second, third: (value: UnwrapValue<Second>) => Third, fourth: (value: UnwrapValue<Third>) => Fourth, fifth: (value: UnwrapValue<Fourth>) => Fifth, sixth: (value: UnwrapValue<Fifth>) => Sixth, seventh: (value: UnwrapValue<Sixth>) => Seventh, eighth: (value: UnwrapValue<Seventh>) => Eighth, ninth: (value: UnwrapValue<Eighth>) => Ninth, tenth: (value: UnwrapValue<Ninth>) => Tenth): Promise<UnwrapValue<Tenth>>;
240
274
  /**
241
275
  * Pipe a value through a series of functions
242
276
  *
243
- * Available as `asyncPipe` and `pipe.async`
277
+ * _Available as `asyncPipe` and `pipe.async`_
278
+ *
244
279
  * @param value Initial value
245
- * @returns Piped result
280
+ * @returns _Piped_ result
246
281
  */
247
282
  declare function asyncPipe<Value>(value: Value, ...pipes: Array<(value: Value) => Value>): Promise<UnwrapValue<Value>>;
248
283
  /**
249
284
  * Pipe a value through a series of functions
250
285
  *
251
- * Available as `asyncPipe` and `pipe.async`
286
+ * _Available as `asyncPipe` and `pipe.async`_
287
+ *
252
288
  * @param value Initial value
253
- * @returns Piped result
289
+ * @returns _Piped_ result
254
290
  */
255
291
  declare function asyncPipe(value: unknown, ...pipes: Array<(value: unknown) => unknown>): Promise<unknown>;
256
292
  /**
257
293
  * Pipe a value through a function
294
+ *
258
295
  * @param value Initial value
259
- * @returns Piped result
296
+ * @returns _Piped_ result
260
297
  */
261
298
  declare function pipe<Initial, Piped>(value: Initial, pipe: (value: UnwrapValue<Initial>) => Piped): UnwrapValue<Piped>;
262
299
  /**
263
300
  * Pipe a value through a series of functions
301
+ *
264
302
  * @param value Initial value
265
- * @returns Piped result
303
+ * @returns _Piped_ result
266
304
  */
267
305
  declare function pipe<Initial, First, Second>(value: Initial, first: (value: UnwrapValue<Initial>) => First, second: (value: UnwrapValue<First>) => Second): UnwrapValue<Second>;
268
306
  /**
269
307
  * Pipe a value through a series of functions
308
+ *
270
309
  * @param value Initial value
271
- * @returns Piped result
310
+ * @returns _Piped_ result
272
311
  */
273
312
  declare function pipe<Initial, First, Second, Third>(value: Initial, first: (value: UnwrapValue<Initial>) => First, second: (value: UnwrapValue<First>) => Second, third: (value: UnwrapValue<Second>) => Third): UnwrapValue<Third>;
274
313
  /**
275
314
  * Pipe a value through a series of functions
315
+ *
276
316
  * @param value Initial value
277
- * @returns Piped result
317
+ * @returns _Piped_ result
278
318
  */
279
319
  declare function pipe<Initial, First, Second, Third, Fourth>(value: Initial, first: (value: UnwrapValue<Initial>) => First, second: (value: UnwrapValue<First>) => Second, third: (value: UnwrapValue<Second>) => Third, fourth: (value: UnwrapValue<Third>) => Fourth): UnwrapValue<Fourth>;
280
320
  /**
281
321
  * Pipe a value through a series of functions
322
+ *
282
323
  * @param value Initial value
283
- * @returns Piped result
324
+ * @returns _Piped_ result
284
325
  */
285
326
  declare function pipe<Initial, First, Second, Third, Fourth, Fifth>(value: Initial, first: (value: UnwrapValue<Initial>) => First, second: (value: UnwrapValue<First>) => Second, third: (value: UnwrapValue<Second>) => Third, fourth: (value: UnwrapValue<Third>) => Fourth, fifth: (value: UnwrapValue<Fourth>) => Fifth): UnwrapValue<Fifth>;
286
327
  /**
287
328
  * Pipe a value through a series of functions
329
+ *
288
330
  * @param value Initial value
289
- * @returns Piped result
331
+ * @returns _Piped_ result
290
332
  */
291
333
  declare function pipe<Initial, First, Second, Third, Fourth, Fifth, Sixth>(value: Initial, first: (value: UnwrapValue<Initial>) => First, second: (value: UnwrapValue<First>) => Second, third: (value: UnwrapValue<Second>) => Third, fourth: (value: UnwrapValue<Third>) => Fourth, fifth: (value: UnwrapValue<Fourth>) => Fifth, sixth: (value: UnwrapValue<Fifth>) => Sixth): UnwrapValue<Sixth>;
292
334
  /**
293
335
  * Pipe a value through a series of functions
336
+ *
294
337
  * @param value Initial value
295
- * @returns Piped result
338
+ * @returns _Piped_ result
296
339
  */
297
340
  declare function pipe<Initial, First, Second, Third, Fourth, Fifth, Sixth, Seventh>(value: Initial, first: (value: UnwrapValue<Initial>) => First, second: (value: UnwrapValue<First>) => Second, third: (value: UnwrapValue<Second>) => Third, fourth: (value: UnwrapValue<Third>) => Fourth, fifth: (value: UnwrapValue<Fourth>) => Fifth, sixth: (value: UnwrapValue<Fifth>) => Sixth, seventh: (value: UnwrapValue<Sixth>) => Seventh): UnwrapValue<Seventh>;
298
341
  /**
299
342
  * Pipe a value through a series of functions
343
+ *
300
344
  * @param value Initial value
301
- * @returns Piped result
345
+ * @returns _Piped_ result
302
346
  */
303
347
  declare function pipe<Initial, First, Second, Third, Fourth, Fifth, Sixth, Seventh, Eighth>(value: Initial, first: (value: UnwrapValue<Initial>) => First, second: (value: UnwrapValue<First>) => Second, third: (value: UnwrapValue<Second>) => Third, fourth: (value: UnwrapValue<Third>) => Fourth, fifth: (value: UnwrapValue<Fourth>) => Fifth, sixth: (value: UnwrapValue<Fifth>) => Sixth, seventh: (value: UnwrapValue<Sixth>) => Seventh, eighth: (value: UnwrapValue<Seventh>) => Eighth): UnwrapValue<Eighth>;
304
348
  /**
305
349
  * Pipe a value through a series of functions
350
+ *
306
351
  * @param value Initial value
307
- * @returns Piped result
352
+ * @returns _Piped_ result
308
353
  */
309
354
  declare function pipe<Initial, First, Second, Third, Fourth, Fifth, Sixth, Seventh, Eighth, Ninth>(value: Initial, first: (value: UnwrapValue<Initial>) => First, second: (value: UnwrapValue<First>) => Second, third: (value: UnwrapValue<Second>) => Third, fourth: (value: UnwrapValue<Third>) => Fourth, fifth: (value: UnwrapValue<Fourth>) => Fifth, sixth: (value: UnwrapValue<Fifth>) => Sixth, seventh: (value: UnwrapValue<Sixth>) => Seventh, eighth: (value: UnwrapValue<Seventh>) => Eighth, ninth: (value: UnwrapValue<Eighth>) => Ninth): UnwrapValue<Ninth>;
310
355
  /**
311
356
  * Pipe a value through a series of functions
357
+ *
312
358
  * @param value Initial value
313
- * @returns Piped result
359
+ * @returns _Piped_ result
314
360
  */
315
361
  declare function pipe<Initial, First, Second, Third, Fourth, Fifth, Sixth, Seventh, Eighth, Ninth, Tenth>(value: Initial, first: (value: UnwrapValue<Initial>) => First, second: (value: UnwrapValue<First>) => Second, third: (value: UnwrapValue<Second>) => Third, fourth: (value: UnwrapValue<Third>) => Fourth, fifth: (value: UnwrapValue<Fourth>) => Fifth, sixth: (value: UnwrapValue<Fifth>) => Sixth, seventh: (value: UnwrapValue<Sixth>) => Seventh, eighth: (value: UnwrapValue<Seventh>) => Eighth, ninth: (value: UnwrapValue<Eighth>) => Ninth, tenth: (value: UnwrapValue<Ninth>) => Tenth): UnwrapValue<Tenth>;
316
362
  /**
317
363
  * Pipe a value through a series of functions
364
+ *
318
365
  * @param value Initial value
319
- * @returns Piped result
366
+ * @returns _Piped_ result
320
367
  */
321
368
  declare function pipe<Value>(value: Value, ...pipes: Array<(value: Value) => Value>): UnwrapValue<Value>;
322
369
  /**
323
370
  * Pipe a value through a series of functions
371
+ *
324
372
  * @param value Initial value
325
- * @returns Piped result
373
+ * @returns _Piped_ result
326
374
  */
327
375
  declare function pipe(value: unknown, ...pipes: Array<(value: unknown) => unknown>): unknown;
328
376
  declare namespace pipe {
@@ -1,11 +1,12 @@
1
1
  import { GenericCallback } from "./models.mjs";
2
2
 
3
- //#region src/kalas.d.ts
3
+ //#region src/herald.d.ts
4
4
  declare class Events<Map extends Record<string, GenericCallback>> {
5
5
  #private;
6
- constructor(kalas: Kalas<Map>);
6
+ constructor(herald: Herald<Map>);
7
7
  /**
8
8
  * Subscribe to an event with a callback
9
+ *
9
10
  * @param event Event name
10
11
  * @param callback Callback function
11
12
  * @returns Unsubscriber function
@@ -13,16 +14,20 @@ declare class Events<Map extends Record<string, GenericCallback>> {
13
14
  subscribe<Event extends keyof Map>(event: Event, callback: Map[Event]): Unsubscriber;
14
15
  /**
15
16
  * Unsubscribe from an event with a callback _(or all callbacks, if no callback is provided)_
17
+ *
16
18
  * @param event Event name
17
19
  * @param callback Callback function
18
20
  * @returns Unsubscriber function
19
21
  */
20
22
  unsubscribe<Event extends keyof Map>(event: Event, callback?: Map[Event]): void;
21
23
  }
22
- declare class Kalas<Map extends Record<string, GenericCallback>> {
24
+ /**
25
+ * A _Herald_ is an announcer for named events, allowing emission, subscription, and unsubscription of events
26
+ */
27
+ declare class Herald<Map extends Record<string, GenericCallback>> {
23
28
  #private;
24
29
  /**
25
- * Events interface for subscribing and unsubscribing to events
30
+ * Events interface for subscribing to and unsubscribing from events
26
31
  */
27
32
  readonly events: Events<Map>;
28
33
  constructor(names: (keyof Map)[]);
@@ -32,12 +37,14 @@ declare class Kalas<Map extends Record<string, GenericCallback>> {
32
37
  clear(): void;
33
38
  /**
34
39
  * Emit an event with parameters
40
+ *
35
41
  * @param event Event name
36
42
  * @param parameters Event parameters
37
43
  */
38
44
  emit<Event extends keyof Map>(event: Event, ...parameters: Parameters<Map[Event]>): void;
39
45
  /**
40
46
  * Subscribe to an event with a callback
47
+ *
41
48
  * @param event Event name
42
49
  * @param callback Callback function
43
50
  * @returns Unsubscriber function
@@ -45,6 +52,7 @@ declare class Kalas<Map extends Record<string, GenericCallback>> {
45
52
  subscribe<Event extends keyof Map>(event: Event, callback: Map[Event]): Unsubscriber;
46
53
  /**
47
54
  * Unsubscribe from an event with a callback _(or all callbacks, if no callback is provided)_
55
+ *
48
56
  * @param event Event name
49
57
  * @param callback Callback function
50
58
  */
@@ -52,10 +60,11 @@ declare class Kalas<Map extends Record<string, GenericCallback>> {
52
60
  }
53
61
  type Unsubscriber = () => void;
54
62
  /**
55
- * Create a Kalas _(party)_ for named events
63
+ * Create a _Herald_ for announcing named events
64
+ *
56
65
  * @param names Event names
57
- * @returns Kalas instance
66
+ * @returns _Herald_ instance
58
67
  */
59
- declare function kalas<Events extends Record<string, GenericCallback>>(names: (keyof Events)[]): Kalas<Events>;
68
+ declare function herald<Events extends Record<string, GenericCallback>>(names: (keyof Events)[]): Herald<Events>;
60
69
  //#endregion
61
- export { type Events, type Kalas, Unsubscriber, kalas };
70
+ export { type Events, type Herald, Unsubscriber, herald };
@@ -1,30 +1,35 @@
1
1
  import { noop } from "./internal/function/misc.mjs";
2
- //#region src/kalas.ts
2
+ //#region src/herald.ts
3
3
  var Events = class {
4
- #kalas;
5
- constructor(kalas) {
6
- this.#kalas = kalas;
4
+ #herald;
5
+ constructor(herald) {
6
+ this.#herald = herald;
7
7
  }
8
8
  /**
9
9
  * Subscribe to an event with a callback
10
+ *
10
11
  * @param event Event name
11
12
  * @param callback Callback function
12
13
  * @returns Unsubscriber function
13
14
  */
14
15
  subscribe(event, callback) {
15
- return this.#kalas.subscribe(event, callback);
16
+ return this.#herald.subscribe(event, callback);
16
17
  }
17
18
  /**
18
19
  * Unsubscribe from an event with a callback _(or all callbacks, if no callback is provided)_
20
+ *
19
21
  * @param event Event name
20
22
  * @param callback Callback function
21
23
  * @returns Unsubscriber function
22
24
  */
23
25
  unsubscribe(event, callback) {
24
- return this.#kalas.unsubscribe(event, callback);
26
+ return this.#herald.unsubscribe(event, callback);
25
27
  }
26
28
  };
27
- var Kalas = class {
29
+ /**
30
+ * A _Herald_ is an announcer for named events, allowing emission, subscription, and unsubscription of events
31
+ */
32
+ var Herald = class {
28
33
  #names;
29
34
  #subscribers = /* @__PURE__ */ new Map();
30
35
  constructor(names) {
@@ -39,6 +44,7 @@ var Kalas = class {
39
44
  }
40
45
  /**
41
46
  * Emit an event with parameters
47
+ *
42
48
  * @param event Event name
43
49
  * @param parameters Event parameters
44
50
  */
@@ -49,6 +55,7 @@ var Kalas = class {
49
55
  }
50
56
  /**
51
57
  * Subscribe to an event with a callback
58
+ *
52
59
  * @param event Event name
53
60
  * @param callback Callback function
54
61
  * @returns Unsubscriber function
@@ -67,6 +74,7 @@ var Kalas = class {
67
74
  }
68
75
  /**
69
76
  * Unsubscribe from an event with a callback _(or all callbacks, if no callback is provided)_
77
+ *
70
78
  * @param event Event name
71
79
  * @param callback Callback function
72
80
  */
@@ -80,14 +88,15 @@ var Kalas = class {
80
88
  }
81
89
  };
82
90
  /**
83
- * Create a Kalas _(party)_ for named events
91
+ * Create a _Herald_ for announcing named events
92
+ *
84
93
  * @param names Event names
85
- * @returns Kalas instance
94
+ * @returns _Herald_ instance
86
95
  */
87
- function kalas(names) {
96
+ function herald(names) {
88
97
  if (!Array.isArray(names) || names.length === 0 || !names.every((name) => typeof name === "string")) throw new Error(MESSAGE);
89
- return new Kalas(names);
98
+ return new Herald(names);
90
99
  }
91
- const MESSAGE = "Kalas requires an array of event names.";
100
+ const MESSAGE = "Herald requires an array of event names.";
92
101
  //#endregion
93
- export { kalas };
102
+ export { herald };