@@ -28,15 +28,15 @@ import { typedndarray } from '@stdlib/types/ndarray';
28
28
*
29
29
* @returns output value
30
30
*/
31
- type Nullary < U , ThisArg > = ( this : ThisArg ) => U ;
31
+ type Nullary < V , ThisArg > = ( this : ThisArg ) => V ;
32
32
33
33
/**
34
34
* Callback invoked for each ndarray element.
35
35
*
36
36
* @param value - current array element
37
37
* @returns output value
38
38
*/
39
- type Unary < T , U , ThisArg > = ( this : ThisArg , value : T ) => U ;
39
+ type Unary < T , V , ThisArg > = ( this : ThisArg , value : T ) => V ;
40
40
41
41
/**
42
42
* Callback invoked for each ndarray element.
@@ -45,7 +45,7 @@ type Unary<T, U, ThisArg> = ( this: ThisArg, value: T ) => U;
45
45
* @param indices - current array element indices
46
46
* @returns output value
47
47
*/
48
- type Binary < T , U , ThisArg > = ( this : ThisArg , value : T , indices : Array < number > ) => U ;
48
+ type Binary < T , V , ThisArg > = ( this : ThisArg , value : T , indices : Array < number > ) => V ;
49
49
50
50
/**
51
51
* Callback invoked for each ndarray element.
@@ -55,7 +55,7 @@ type Binary<T, U, ThisArg> = ( this: ThisArg, value: T, indices: Array<number> )
55
55
* @param arr - input array
56
56
* @returns output value
57
57
*/
58
- type Ternary < T , U , ThisArg > = ( this : ThisArg , value : T , indices : Array < number > , arr : typedndarray < T > ) => U ;
58
+ type Ternary < T , U , V , ThisArg > = ( this : ThisArg , value : T , indices : Array < number > , arr : U ) => V ;
59
59
60
60
/**
61
61
* Callback invoked for each ndarray element.
@@ -65,7 +65,7 @@ type Ternary<T, U, ThisArg> = ( this: ThisArg, value: T, indices: Array<number>,
65
65
* @param arr - input array
66
66
* @returns output value
67
67
*/
68
- type Callback < T , U , ThisArg > = Nullary < U , ThisArg > | Unary < T , U , ThisArg > | Binary < T , U , ThisArg > | Ternary < T , U , ThisArg > ;
68
+ type Callback < T , U , V , ThisArg > = Nullary < V , ThisArg > | Unary < T , V , ThisArg > | Binary < T , V , ThisArg > | Ternary < T , U , V , ThisArg > ;
69
69
70
70
/**
71
71
* Applies a callback function to elements in an input ndarray and assigns results to elements in an output ndarray.
@@ -109,7 +109,7 @@ type Callback<T, U, ThisArg> = Nullary<U, ThisArg> | Unary<T, U, ThisArg> | Bina
109
109
* console.log( y.data );
110
110
* // => <Float64Array>[ 20.0, 30.0, 60.0, 70.0, 100.0, 110.0 ]
111
111
*/
112
- declare function map < T = unknown , U = unknown , ThisArg = unknown > ( arrays : ArrayLike < typedndarray < T > > , fcn : Callback < T , U , ThisArg > , thisArg ?: ThisParameterType < Callback < T , U , ThisArg > > ) : void ;
112
+ declare function map < T = unknown , U extends typedndarray < T > = typedndarray < T > , V = unknown , ThisArg = unknown > ( arrays : ArrayLike < U > , fcn : Callback < T , U , V , ThisArg > , thisArg ?: ThisParameterType < Callback < T , U , V , ThisArg > > ) : void ;
113
113
114
114
115
115
// EXPORTS //
0 commit comments