Skip to content

Commit 4649560

Browse files
authored
feat: improve type specificity
Signed-off-by: Athan <[email protected]>
1 parent a49cb40 commit 4649560

File tree

1 file changed

+6
-6
lines changed
  • lib/node_modules/@stdlib/ndarray/base/any-by/docs/types

1 file changed

+6
-6
lines changed

lib/node_modules/@stdlib/ndarray/base/any-by/docs/types/index.d.ts

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -28,15 +28,15 @@ import { typedndarray } from '@stdlib/types/ndarray';
2828
*
2929
* @returns boolean indicating whether an ndarray element passes a test
3030
*/
31-
type Nullary<U> = ( this: U ) => boolean;
31+
type Nullary<ThisArg> = ( this: ThisArg ) => boolean;
3232

3333
/**
3434
* Returns a boolean indicating whether an element passes a test.
3535
*
3636
* @param value - current array element
3737
* @returns boolean indicating whether an ndarray element passes a test
3838
*/
39-
type Unary<T, U> = ( this: U, value: T ) => boolean;
39+
type Unary<T, ThisArg> = ( this: ThisArg, value: T ) => boolean;
4040

4141
/**
4242
* Returns a boolean indicating whether an element passes a test.
@@ -45,7 +45,7 @@ type Unary<T, U> = ( this: U, value: T ) => boolean;
4545
* @param indices - current array element indices
4646
* @returns boolean indicating whether an ndarray element passes a test
4747
*/
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;
4949

5050
/**
5151
* 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;
5555
* @param arr - input array
5656
* @returns boolean indicating whether an ndarray element passes a test
5757
*/
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;
5959

6060
/**
6161
* 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
6565
* @param arr - input array
6666
* @returns boolean indicating whether an ndarray element passes a test
6767
*/
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>;
6969

7070
/**
7171
* 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>;
101101
* var out = anyBy( [ x ], predicate );
102102
* // returns true
103103
*/
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;
105105

106106

107107
// EXPORTS //

0 commit comments

Comments
 (0)