Skip to content

Commit 05d30f5

Browse files
authored
docs: be more explicit that the callback is a predicate function
Signed-off-by: Athan <[email protected]>
1 parent 694e0d9 commit 05d30f5

File tree

1 file changed

+14
-14
lines changed
  • lib/node_modules/@stdlib/blas/ext/base/ndarray/gfind-index/docs/types

1 file changed

+14
-14
lines changed

lib/node_modules/@stdlib/blas/ext/base/ndarray/gfind-index/docs/types/index.d.ts

Lines changed: 14 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -23,55 +23,55 @@
2323
import { typedndarray } from '@stdlib/types/ndarray';
2424

2525
/**
26-
* Returns the result of callback function.
26+
* Returns a boolean indicating whether an element passes a test.
2727
*
28-
* @returns result
28+
* @returns boolean indicating whether an element passes a test
2929
*/
3030
type Nullary<ThisArg> = ( this: ThisArg ) => boolean;
3131

3232
/**
33-
* Returns the result of callback function.
33+
* Returns a boolean indicating whether an element passes a test.
3434
*
3535
* @param value - current array element
36-
* @returns result
36+
* @returns boolean indicating whether an element passes a test
3737
*/
3838
type Unary<T, ThisArg> = ( this: ThisArg, value: T ) => boolean;
3939

4040
/**
41-
* Returns the result of callback function.
41+
* Returns a boolean indicating whether an element passes a test.
4242
*
4343
* @param value - current array element
4444
* @param index - current array element index
45-
* @returns result
45+
* @returns boolean indicating whether an element passes a test
4646
*/
4747
type Binary<T, ThisArg> = ( this: ThisArg, value: T, index: number ) => boolean;
4848

4949
/**
50-
* Returns the result of callback function.
50+
* Returns a boolean indicating whether an element passes a test.
5151
*
5252
* @param value - current array element
5353
* @param index - current array element index
5454
* @param array - input ndarray
55-
* @returns result
55+
* @returns boolean indicating whether an element passes a test
5656
*/
5757
type Ternary<T, U, ThisArg> = ( this: ThisArg, value: T, index: number, array: U ) => boolean;
5858

5959
/**
60-
* Returns the result of callback function.
60+
* Returns a boolean indicating whether an element passes a test.
6161
*
6262
* @param value - current array element
6363
* @param index - current array element index
6464
* @param array - input ndarray
65-
* @returns result
65+
* @returns boolean indicating whether an element passes a test
6666
*/
67-
type Callback<T, U, ThisArg> = Nullary<ThisArg> | Unary<T, ThisArg> | Binary<T, ThisArg> | Ternary<T, U, ThisArg>;
67+
type Predicate<T, U, ThisArg> = Nullary<ThisArg> | Unary<T, ThisArg> | Binary<T, ThisArg> | Ternary<T, U, ThisArg>;
6868

6969
/**
7070
* Returns the index of the first element in a one-dimensional ndarray which passes a test implemented by a predicate function.
7171
*
7272
* @param arrays - array-like object containing an input ndarray
73-
* @param clbk - callback function
74-
* @param thisArg - callback execution context
73+
* @param clbk - predicate function
74+
* @param thisArg - predicate execution context
7575
* @returns index
7676
*
7777
* @example
@@ -87,7 +87,7 @@ type Callback<T, U, ThisArg> = Nullary<ThisArg> | Unary<T, ThisArg> | Binary<T,
8787
* var v = gfindIndex( [ x ], clbk );
8888
* // returns 2
8989
*/
90-
declare function gfindIndex<T = unknown, U extends typedndarray<T> = typedndarray<T>, ThisArg = unknown>( arrays: [ U ], clbk: Callback<T, U, ThisArg>, thisArg?: ThisParameterType<Callback<T, U, ThisArg>> ): number;
90+
declare function gfindIndex<T = unknown, U extends typedndarray<T> = typedndarray<T>, ThisArg = unknown>( arrays: [ U ], clbk: Predicate<T, U, ThisArg>, thisArg?: ThisParameterType<Predicate<T, U, ThisArg>> ): number;
9191

9292

9393
// EXPORTS //

0 commit comments

Comments
 (0)