@@ -28,15 +28,15 @@ import { typedndarray } from '@stdlib/types/ndarray';
28
28
*
29
29
* @returns boolean indicating whether an ndarray element passes a test
30
30
*/
31
- type Nullary < U > = ( this : U ) => boolean ;
31
+ type Nullary < ThisArg > = ( this : ThisArg ) => boolean ;
32
32
33
33
/**
34
34
* Returns a boolean indicating whether an element passes a test.
35
35
*
36
36
* @param value - current array element
37
37
* @returns boolean indicating whether an ndarray element passes a test
38
38
*/
39
- type Unary < T , U > = ( this : U , value : T ) => boolean ;
39
+ type Unary < T , ThisArg > = ( this : ThisArg , value : T ) => boolean ;
40
40
41
41
/**
42
42
* Returns a boolean indicating whether an element passes a test.
@@ -45,7 +45,7 @@ type Unary<T, U> = ( this: U, value: T ) => boolean;
45
45
* @param indices - current array element indices
46
46
* @returns boolean indicating whether an ndarray element passes a test
47
47
*/
48
- type Binary < T , U > = ( this : U , value : T , indices : Array < number > ) => boolean ;
48
+ type Binary < T , ThisArg > = ( this : ThisArg , value : T , indices : Array < number > ) => boolean ;
49
49
50
50
/**
51
51
* Returns a boolean indicating whether an element passes a test.
@@ -55,7 +55,7 @@ type Binary<T, U> = ( this: U, value: T, indices: Array<number> ) => boolean;
55
55
* @param arr - input array
56
56
* @returns boolean indicating whether an ndarray element passes a test
57
57
*/
58
- type Ternary < T , U > = ( this : U , value : T , indices : Array < number > , arr : typedndarray < T > ) => boolean ;
58
+ type Ternary < T , U , ThisArg > = ( this : ThisArg , value : T , indices : Array < number > , arr : U ) => boolean ;
59
59
60
60
/**
61
61
* Returns a boolean indicating whether an element passes a test.
@@ -65,7 +65,7 @@ type Ternary<T, U> = ( this: U, value: T, indices: Array<number>, arr: typedndar
65
65
* @param arr - input array
66
66
* @returns boolean indicating whether an ndarray element passes a test
67
67
*/
68
- type Predicate < T , U > = Nullary < U > | Unary < T , U > | Binary < T , U > | Ternary < T , U > ;
68
+ type Predicate < T , U , ThisArg > = Nullary < ThisArg > | Unary < T , ThisArg > | Binary < T , ThisArg > | Ternary < T , U , ThisArg > ;
69
69
70
70
/**
71
71
* Tests whether at least one element in an ndarray pass a test implemented by a predicate function.
@@ -101,7 +101,7 @@ type Predicate<T, U> = Nullary<U> | Unary<T, U> | Binary<T, U> | Ternary<T, U>;
101
101
* var out = anyBy( [ x ], predicate );
102
102
* // returns true
103
103
*/
104
- declare function anyBy < T = unknown , U = unknown > ( arrays : ArrayLike < typedndarray < T > > , predicate : Predicate < T , U > , thisArg ?: ThisParameterType < Predicate < T , U > > ) : boolean ;
104
+ declare function anyBy < T = unknown , U extends typedndarray < T > = typedndarray < T > , ThisArg = unknown > ( arrays : ArrayLike < U > , predicate : Predicate < T , U , ThisArg > , thisArg ?: ThisParameterType < Predicate < T , U , ThisArg > > ) : boolean ;
105
105
106
106
107
107
// EXPORTS //
0 commit comments