2020
2121/// <reference types="@stdlib/types"/>
2222
23- import { ArrayLike } from '@stdlib/types/array' ;
2423import { typedndarray } from '@stdlib/types/ndarray' ;
2524
2625/**
2726* Callback invoked for each ndarray element.
2827*
2928* @returns output value
3029*/
31- type Nullary < U , ThisArg > = ( this : ThisArg ) => U ;
30+ type Nullary < V , ThisArg > = ( this : ThisArg ) => V ;
3231
3332/**
3433* Callback invoked for each ndarray element.
3534*
3635* @param value - current array element
3736* @returns output value
3837*/
39- type Unary < T , U , ThisArg > = ( this : ThisArg , value : T ) => U ;
38+ type Unary < T , V , ThisArg > = ( this : ThisArg , value : T ) => V ;
4039
4140/**
4241* Callback invoked for each ndarray element.
@@ -45,7 +44,7 @@ type Unary<T, U, ThisArg> = ( this: ThisArg, value: T ) => U;
4544* @param indices - current array element indices
4645* @returns output value
4746*/
48- type Binary < T , U , ThisArg > = ( this : ThisArg , value : T , indices : Array < number > ) => U ;
47+ type Binary < T , V , ThisArg > = ( this : ThisArg , value : T , indices : Array < number > ) => V ;
4948
5049/**
5150* Callback invoked for each ndarray element.
@@ -55,7 +54,7 @@ type Binary<T, U, ThisArg> = ( this: ThisArg, value: T, indices: Array<number> )
5554* @param arr - input array
5655* @returns output value
5756*/
58- type Ternary < T , U , ThisArg > = ( this : ThisArg , value : T , indices : Array < number > , arr : typedndarray < T > ) => U ;
57+ type Ternary < T , U , V , ThisArg > = ( this : ThisArg , value : T , indices : Array < number > , arr : U ) => V ;
5958
6059/**
6160* Callback invoked for each ndarray element.
@@ -65,7 +64,7 @@ type Ternary<T, U, ThisArg> = ( this: ThisArg, value: T, indices: Array<number>,
6564* @param arr - input array
6665* @returns output value
6766*/
68- type Callback < T , U , ThisArg > = Nullary < U , ThisArg > | Unary < T , U , ThisArg > | Binary < T , U , ThisArg > | Ternary < T , U , ThisArg > ;
67+ type Callback < T , U , V , ThisArg > = Nullary < V , ThisArg > | Unary < T , V , ThisArg > | Binary < T , V , ThisArg > | Ternary < T , U , V , ThisArg > ;
6968
7069/**
7170* Applies a callback function to elements in an input ndarray and assigns results to elements in an output ndarray.
@@ -109,7 +108,7 @@ type Callback<T, U, ThisArg> = Nullary<U, ThisArg> | Unary<T, U, ThisArg> | Bina
109108* console.log( y.data );
110109* // => <Float64Array>[ 20.0, 30.0, 60.0, 70.0, 100.0, 110.0 ]
111110*/
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 ;
111+ declare function map < T = unknown , U extends typedndarray < T > = typedndarray < T > , V = unknown , ThisArg = unknown > ( arrays : [ U , typedndarray < V > ] , fcn : Callback < T , U , V , ThisArg > , thisArg ?: ThisParameterType < Callback < T , U , V , ThisArg > > ) : void ;
113112
114113
115114// EXPORTS //
0 commit comments