@oscarpalmer/atoms 0.186.2 → 0.187.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.
- package/dist/array/filter.d.mts +4 -4
- package/dist/array/find.d.mts +4 -4
- package/dist/array/first.d.mts +4 -4
- package/dist/array/get.d.mts +27 -1
- package/dist/array/get.mjs +5 -3
- package/dist/array/group-by.d.mts +6 -6
- package/dist/array/last.d.mts +4 -4
- package/dist/array/match.d.mts +7 -6
- package/dist/array/move.d.mts +7 -7
- package/dist/array/move.mjs +1 -1
- package/dist/array/select.d.mts +1 -0
- package/dist/array/slice.d.mts +3 -3
- package/dist/array/sort.d.mts +10 -7
- package/dist/array/sort.mjs +4 -3
- package/dist/array/swap.d.mts +1 -1
- package/dist/array/swap.mjs +1 -1
- package/dist/array/to-map.d.mts +32 -32
- package/dist/array/to-record.d.mts +6 -6
- package/dist/array/to-set.d.mts +6 -6
- package/dist/beacon.d.mts +6 -0
- package/dist/beacon.mjs +3 -0
- package/dist/color/index.d.mts +6 -2
- package/dist/color/index.mjs +6 -2
- package/dist/color/instance.d.mts +78 -14
- package/dist/color/instance.mjs +78 -14
- package/dist/color/misc/get.d.mts +39 -11
- package/dist/color/misc/get.mjs +39 -11
- package/dist/color/misc/is.d.mts +26 -11
- package/dist/color/misc/is.mjs +26 -11
- package/dist/color/misc/state.mjs +1 -1
- package/dist/color/models.d.mts +7 -4
- package/dist/color/space/hex.d.mts +15 -6
- package/dist/color/space/hex.mjs +15 -6
- package/dist/color/space/hsl.d.mts +10 -4
- package/dist/color/space/hsl.mjs +10 -4
- package/dist/color/space/rgb.d.mts +21 -12
- package/dist/color/space/rgb.mjs +21 -12
- package/dist/function/assert.d.mts +20 -14
- package/dist/function/assert.mjs +19 -13
- package/dist/function/limit.d.mts +8 -6
- package/dist/function/limit.mjs +8 -6
- package/dist/function/memoize.d.mts +15 -4
- package/dist/function/memoize.mjs +18 -4
- package/dist/function/once.d.mts +5 -3
- package/dist/function/once.mjs +5 -3
- package/dist/function/retry.d.mts +5 -2
- package/dist/function/retry.mjs +3 -1
- package/dist/function/work.d.mts +146 -98
- package/dist/{kalas.d.mts → herald.d.mts} +17 -8
- package/dist/{kalas.mjs → herald.mjs} +22 -13
- package/dist/index.d.mts +1464 -708
- package/dist/index.mjs +677 -324
- package/dist/internal/array/index-of.d.mts +4 -4
- package/dist/internal/array/insert.mjs +1 -1
- package/dist/internal/array/shuffle.d.mts +1 -0
- package/dist/internal/array/shuffle.mjs +2 -1
- package/dist/internal/is.d.mts +26 -8
- package/dist/internal/is.mjs +26 -8
- package/dist/internal/math/aggregate.d.mts +9 -9
- package/dist/internal/number.d.mts +13 -2
- package/dist/internal/number.mjs +13 -2
- package/dist/internal/random.d.mts +4 -2
- package/dist/internal/random.mjs +7 -5
- package/dist/internal/result.d.mts +17 -11
- package/dist/internal/result.mjs +10 -14
- package/dist/internal/string.d.mts +16 -1
- package/dist/internal/string.mjs +24 -1
- package/dist/internal/value/compare.d.mts +5 -2
- package/dist/internal/value/compare.mjs +5 -2
- package/dist/internal/value/equal.d.mts +12 -3
- package/dist/internal/value/equal.mjs +7 -4
- package/dist/internal/value/get.d.mts +17 -17
- package/dist/internal/value/has.d.mts +55 -11
- package/dist/internal/value/set.d.mts +24 -0
- package/dist/is.d.mts +12 -0
- package/dist/is.mjs +16 -1
- package/dist/logger.d.mts +7 -6
- package/dist/logger.mjs +6 -5
- package/dist/math.d.mts +36 -18
- package/dist/math.mjs +6 -3
- package/dist/models.d.mts +3 -3
- package/dist/promise/delay.d.mts +2 -0
- package/dist/promise/helpers.d.mts +6 -4
- package/dist/promise/helpers.mjs +6 -4
- package/dist/promise/index.d.mts +49 -38
- package/dist/promise/misc.d.mts +10 -7
- package/dist/promise/misc.mjs +4 -3
- package/dist/promise/models.d.mts +18 -19
- package/dist/promise/models.mjs +4 -3
- package/dist/promise/timed.d.mts +8 -6
- package/dist/query.d.mts +2 -0
- package/dist/query.mjs +2 -0
- package/dist/queue.d.mts +15 -4
- package/dist/queue.mjs +10 -3
- package/dist/random.d.mts +9 -2
- package/dist/random.mjs +7 -2
- package/dist/result/index.d.mts +14 -8
- package/dist/result/match.d.mts +18 -10
- package/dist/result/misc.d.mts +14 -7
- package/dist/result/misc.mjs +4 -2
- package/dist/result/models.d.mts +2 -0
- package/dist/result/work/flow.d.mts +86 -62
- package/dist/result/work/pipe.d.mts +55 -33
- package/dist/sized/map.d.mts +19 -16
- package/dist/sized/map.mjs +4 -4
- package/dist/sized/set.d.mts +20 -16
- package/dist/sized/set.mjs +8 -7
- package/dist/string/case.d.mts +8 -0
- package/dist/string/case.mjs +8 -0
- package/dist/string/fuzzy.d.mts +19 -5
- package/dist/string/fuzzy.mjs +7 -0
- package/dist/string/index.d.mts +17 -2
- package/dist/string/index.mjs +7 -9
- package/dist/string/match.d.mts +3 -0
- package/dist/string/match.mjs +3 -0
- package/dist/string/normalize.d.mts +6 -2
- package/dist/string/normalize.mjs +5 -2
- package/dist/string/template.d.mts +38 -9
- package/dist/string/template.mjs +19 -19
- package/dist/value/clone.d.mts +25 -4
- package/dist/value/clone.mjs +36 -22
- package/dist/value/collection.d.mts +9 -6
- package/dist/value/collection.mjs +3 -2
- package/dist/value/diff.d.mts +3 -1
- package/dist/value/diff.mjs +1 -0
- package/dist/value/freeze.d.mts +118 -9
- package/dist/value/freeze.mjs +56 -14
- package/dist/value/index.d.mts +1 -2
- package/dist/value/index.mjs +1 -2
- package/dist/value/merge.d.mts +11 -5
- package/dist/value/merge.mjs +2 -2
- package/dist/value/omit.d.mts +1 -0
- package/dist/value/omit.mjs +1 -0
- package/dist/value/pick.d.mts +1 -0
- package/dist/value/pick.mjs +1 -0
- package/dist/value/shake.d.mts +1 -0
- package/dist/value/shake.mjs +1 -0
- package/dist/value/smush.d.mts +1 -0
- package/dist/value/smush.mjs +1 -0
- package/dist/value/transform.d.mts +7 -3
- package/dist/value/unsmush.d.mts +1 -0
- package/dist/value/unsmush.mjs +1 -0
- package/package.json +11 -7
- package/src/array/filter.ts +4 -4
- package/src/array/find.ts +4 -4
- package/src/array/first.ts +4 -4
- package/src/array/get.ts +40 -5
- package/src/array/group-by.ts +6 -6
- package/src/array/last.ts +4 -4
- package/src/array/match.ts +7 -6
- package/src/array/move.ts +7 -7
- package/src/array/select.ts +1 -0
- package/src/array/slice.ts +3 -3
- package/src/array/sort.ts +15 -10
- package/src/array/swap.ts +1 -1
- package/src/array/to-map.ts +32 -32
- package/src/array/to-record.ts +6 -6
- package/src/array/to-set.ts +6 -6
- package/src/beacon.ts +6 -0
- package/src/color/index.ts +6 -2
- package/src/color/instance.ts +78 -14
- package/src/color/misc/get.ts +39 -11
- package/src/color/misc/is.ts +26 -11
- package/src/color/misc/state.ts +1 -1
- package/src/color/models.ts +7 -4
- package/src/color/space/hex.ts +15 -6
- package/src/color/space/hsl.ts +10 -4
- package/src/color/space/rgb.ts +21 -12
- package/src/function/assert.ts +20 -14
- package/src/function/limit.ts +8 -6
- package/src/function/memoize.ts +24 -5
- package/src/function/once.ts +5 -3
- package/src/function/retry.ts +7 -3
- package/src/function/work.ts +146 -98
- package/src/{kalas.ts → herald.ts} +23 -14
- package/src/index.ts +3 -2
- package/src/internal/array/index-of.ts +4 -4
- package/src/internal/array/insert.ts +1 -1
- package/src/internal/array/shuffle.ts +2 -1
- package/src/internal/is.ts +26 -8
- package/src/internal/math/aggregate.ts +9 -9
- package/src/internal/number.ts +13 -2
- package/src/internal/random.ts +10 -4
- package/src/internal/result.ts +30 -29
- package/src/internal/string.ts +28 -0
- package/src/internal/value/compare.ts +5 -2
- package/src/internal/value/equal.ts +13 -4
- package/src/internal/value/get.ts +17 -17
- package/src/internal/value/has.ts +54 -11
- package/src/internal/value/set.ts +24 -0
- package/src/is.ts +15 -1
- package/src/logger.ts +8 -7
- package/src/math.ts +36 -18
- package/src/models.ts +3 -3
- package/src/promise/delay.ts +2 -0
- package/src/promise/helpers.ts +6 -4
- package/src/promise/index.ts +49 -38
- package/src/promise/misc.ts +10 -7
- package/src/promise/models.ts +18 -19
- package/src/promise/timed.ts +8 -6
- package/src/query.ts +2 -0
- package/src/queue.ts +15 -4
- package/src/random.ts +8 -1
- package/src/result/index.ts +14 -8
- package/src/result/match.ts +18 -10
- package/src/result/misc.ts +17 -9
- package/src/result/models.ts +2 -0
- package/src/result/work/flow.ts +86 -62
- package/src/result/work/pipe.ts +55 -33
- package/src/sized/map.ts +20 -17
- package/src/sized/set.ts +21 -17
- package/src/string/case.ts +8 -0
- package/src/string/fuzzy.ts +19 -5
- package/src/string/index.ts +18 -15
- package/src/string/match.ts +3 -0
- package/src/string/normalize.ts +6 -2
- package/src/string/template.ts +69 -18
- package/src/value/clone.ts +51 -26
- package/src/value/collection.ts +9 -6
- package/src/value/diff.ts +3 -1
- package/src/value/freeze.ts +239 -25
- package/src/value/index.ts +0 -1
- package/src/value/merge.ts +11 -5
- package/src/value/omit.ts +1 -0
- package/src/value/pick.ts +1 -0
- package/src/value/shake.ts +1 -0
- package/src/value/smush.ts +1 -0
- package/src/value/transform.ts +7 -3
- package/src/value/unsmush.ts +1 -0
package/dist/function/work.d.mts
CHANGED
|
@@ -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
|
|
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
|
|
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
|
|
14
|
+
* Create an asynchronous _Flow_, a function that pipes values through a function
|
|
15
15
|
*
|
|
16
|
-
*
|
|
17
|
-
*
|
|
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
|
|
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
|
-
*
|
|
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
|
|
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
|
-
*
|
|
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
|
|
38
|
+
* Create an asynchronous _Flow_, a function that pipes values through a series of functions
|
|
36
39
|
*
|
|
37
|
-
*
|
|
38
|
-
*
|
|
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
|
|
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
|
-
*
|
|
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
|
|
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
|
-
*
|
|
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
|
|
62
|
+
* Create an asynchronous _Flow_, a function that pipes values through a series of functions
|
|
57
63
|
*
|
|
58
|
-
*
|
|
59
|
-
*
|
|
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
|
|
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
|
-
*
|
|
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
|
|
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
|
-
*
|
|
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
|
|
86
|
+
* Create an asynchronous _Flow_, a function that pipes values through a series of functions
|
|
78
87
|
*
|
|
79
|
-
*
|
|
80
|
-
*
|
|
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
|
|
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
|
-
*
|
|
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
|
|
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
|
-
*
|
|
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
|
|
99
|
-
*
|
|
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
|
|
104
|
-
*
|
|
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
|
|
109
|
-
*
|
|
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
|
|
114
|
-
*
|
|
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
|
|
119
|
-
*
|
|
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
|
|
124
|
-
*
|
|
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
|
|
129
|
-
*
|
|
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
|
|
134
|
-
*
|
|
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
|
|
139
|
-
*
|
|
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
|
|
144
|
-
*
|
|
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
|
|
149
|
-
*
|
|
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
|
|
154
|
-
*
|
|
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
|
-
*
|
|
187
|
+
* _Available as `asyncPipe` and `pipe.async`_
|
|
188
|
+
*
|
|
164
189
|
* @param value Initial value
|
|
165
|
-
* @returns
|
|
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
|
-
*
|
|
196
|
+
* _Available as `asyncPipe` and `pipe.async`_
|
|
197
|
+
*
|
|
172
198
|
* @param value Initial value
|
|
173
|
-
* @returns
|
|
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
|
-
*
|
|
205
|
+
* _Available as `asyncPipe` and `pipe.async`_
|
|
206
|
+
*
|
|
180
207
|
* @param value Initial value
|
|
181
|
-
* @returns
|
|
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
|
-
*
|
|
214
|
+
* _Available as `asyncPipe` and `pipe.async`_
|
|
215
|
+
*
|
|
188
216
|
* @param value Initial value
|
|
189
|
-
* @returns
|
|
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
|
-
*
|
|
223
|
+
* _Available as `asyncPipe` and `pipe.async`_
|
|
224
|
+
*
|
|
196
225
|
* @param value Initial value
|
|
197
|
-
* @returns
|
|
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
|
-
*
|
|
232
|
+
* _Available as `asyncPipe` and `pipe.async`_
|
|
233
|
+
*
|
|
204
234
|
* @param value Initial value
|
|
205
|
-
* @returns
|
|
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
|
-
*
|
|
241
|
+
* _Available as `asyncPipe` and `pipe.async`_
|
|
242
|
+
*
|
|
212
243
|
* @param value Initial value
|
|
213
|
-
* @returns
|
|
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
|
-
*
|
|
250
|
+
* _Available as `asyncPipe` and `pipe.async`_
|
|
251
|
+
*
|
|
220
252
|
* @param value Initial value
|
|
221
|
-
* @returns
|
|
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
|
-
*
|
|
259
|
+
* _Available as `asyncPipe` and `pipe.async`_
|
|
260
|
+
*
|
|
228
261
|
* @param value Initial value
|
|
229
|
-
* @returns
|
|
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
|
-
*
|
|
268
|
+
* _Available as `asyncPipe` and `pipe.async`_
|
|
269
|
+
*
|
|
236
270
|
* @param value Initial value
|
|
237
|
-
* @returns
|
|
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
|
-
*
|
|
277
|
+
* _Available as `asyncPipe` and `pipe.async`_
|
|
278
|
+
*
|
|
244
279
|
* @param value Initial value
|
|
245
|
-
* @returns
|
|
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
|
-
*
|
|
286
|
+
* _Available as `asyncPipe` and `pipe.async`_
|
|
287
|
+
*
|
|
252
288
|
* @param value Initial value
|
|
253
|
-
* @returns
|
|
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
|
|
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
|
|
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
|
|
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
|
|
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
|
|
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
|
|
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
|
|
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
|
|
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
|
|
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
|
|
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
|
|
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
|
|
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/
|
|
3
|
+
//#region src/herald.d.ts
|
|
4
4
|
declare class Events<Map extends Record<string, GenericCallback>> {
|
|
5
5
|
#private;
|
|
6
|
-
constructor(
|
|
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
|
-
|
|
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
|
|
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
|
|
63
|
+
* Create a _Herald_ for announcing named events
|
|
64
|
+
*
|
|
56
65
|
* @param names Event names
|
|
57
|
-
* @returns
|
|
66
|
+
* @returns _Herald_ instance
|
|
58
67
|
*/
|
|
59
|
-
declare function
|
|
68
|
+
declare function herald<Events extends Record<string, GenericCallback>>(names: (keyof Events)[]): Herald<Events>;
|
|
60
69
|
//#endregion
|
|
61
|
-
export { type Events, type
|
|
70
|
+
export { type Events, type Herald, Unsubscriber, herald };
|
|
@@ -1,30 +1,35 @@
|
|
|
1
1
|
import { noop } from "./internal/function/misc.mjs";
|
|
2
|
-
//#region src/
|
|
2
|
+
//#region src/herald.ts
|
|
3
3
|
var Events = class {
|
|
4
|
-
#
|
|
5
|
-
constructor(
|
|
6
|
-
this.#
|
|
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.#
|
|
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.#
|
|
26
|
+
return this.#herald.unsubscribe(event, callback);
|
|
25
27
|
}
|
|
26
28
|
};
|
|
27
|
-
|
|
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
|
|
91
|
+
* Create a _Herald_ for announcing named events
|
|
92
|
+
*
|
|
84
93
|
* @param names Event names
|
|
85
|
-
* @returns
|
|
94
|
+
* @returns _Herald_ instance
|
|
86
95
|
*/
|
|
87
|
-
function
|
|
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
|
|
98
|
+
return new Herald(names);
|
|
90
99
|
}
|
|
91
|
-
const MESSAGE = "
|
|
100
|
+
const MESSAGE = "Herald requires an array of event names.";
|
|
92
101
|
//#endregion
|
|
93
|
-
export {
|
|
102
|
+
export { herald };
|