Skip to content

Commit

Permalink
feat: update namespace TypeScript declarations
Browse files Browse the repository at this point in the history
PR-URL: 	#1198
Co-authored-by: Athan Reines <kgryte@gmail.com>
Reviewed-by: Athan Reines <kgryte@gmail.com>
  • Loading branch information
stdlib-bot and kgryte authored Dec 20, 2023
1 parent 848730f commit 7801277
Showing 1 changed file with 63 additions and 0 deletions.
63 changes: 63 additions & 0 deletions lib/node_modules/@stdlib/array/base/docs/types/index.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -79,7 +79,9 @@ import flipud2d = require( '@stdlib/array/base/flipud2d' );
import strided2array = require( '@stdlib/array/base/from-strided' );
import getter = require( '@stdlib/array/base/getter' );
import incrspace = require( '@stdlib/array/base/incrspace' );
import indexOf = require( '@stdlib/array/base/index-of' );
import last = require( '@stdlib/array/base/last' );
import lastIndexOf = require( '@stdlib/array/base/last-index-of' );
import linspace = require( '@stdlib/array/base/linspace' );
import logspace = require( '@stdlib/array/base/logspace' );
import map2d = require( '@stdlib/array/base/map2d' );
Expand Down Expand Up @@ -1612,6 +1614,36 @@ interface Namespace {
*/
incrspace: typeof incrspace;

/**
* Returns the index of the first element which equals a provided search element.
*
* ## Notes
*
* - If unable to find an element which equals a provided search element, the function returns `-1`.
* - If `fromIndex` is less than zero, the starting index is resolved relative to the last array element, with the last array element corresponding to `fromIndex = -1`.
*
* @param x - input array
* @param searchElement - search element
* @param fromIndex - starting index (inclusive)
* @param equalNaNs - boolean indicating whether NaNs should be considered equal
* @returns index
*
* @example
* var x = [ 1, 2, 3, 4 ];
*
* var idx = ns.indexOf( x, 2, 0, false );
* // returns 1
*
* @example
* var Int32Array = require( '@stdlib/array/int32' );
*
* var x = new Int32Array( [ 1, 2, 3, 4 ] );
*
* var idx = ns.indexOf( x, 2, 0, false );
* // returns 1
*/
indexOf: typeof indexOf;

/**
* Returns the last element of an array-like object.
*
Expand All @@ -1626,6 +1658,37 @@ interface Namespace {
*/
last: typeof last;

/**
* Returns the index of the last element which equals a provided search element.
*
* ## Notes
*
* - The function scans an input array from the starting index to the beginning of the array (i.e., backward).
* - If unable to find an element which equals a provided search element, the function returns `-1`.
* - If `fromIndex` is less than zero, the starting index is resolved relative to the last array element, with the last array element corresponding to `fromIndex = -1`.
*
* @param x - input array
* @param searchElement - search element
* @param fromIndex - starting index (inclusive)
* @param equalNaNs - boolean indicating whether NaNs should be considered equal
* @returns index
*
* @example
* var x = [ 1, 2, 3, 4 ];
*
* var idx = ns.lastIndexOf( x, 2, 3, false );
* // returns 1
*
* @example
* var Int32Array = require( '@stdlib/array/int32' );
*
* var x = new Int32Array( [ 1, 2, 3, 4 ] );
*
* var idx = ns.lastIndexOf( x, 2, 3, false );
* // returns 1
*/
lastIndexOf: typeof lastIndexOf;

/**
* Generates a linearly spaced numeric array.
*
Expand Down

1 comment on commit 7801277

@stdlib-bot
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Coverage Report

Package Statements Branches Functions Lines
array/base $\color{green}1068/1068$
$\color{green}+100.00\%$
$\color{green}1/1$
$\color{green}+100.00\%$
$\color{green}0/0$
$\color{green}+100.00\%$
$\color{green}1068/1068$
$\color{green}+100.00\%$

The above coverage report was generated for the changes in this push.

Please sign in to comment.