Skip to content

Commit

Permalink
feat: update namespace TypeScript declarations
Browse files Browse the repository at this point in the history
PR-URL: #2394
Co-authored-by: Athan Reines <[email protected]>
Reviewed-by: Athan Reines <[email protected]> 
Signed-off-by: stdlib-bot <[email protected]>
  • Loading branch information
stdlib-bot and kgryte authored Jun 17, 2024
1 parent e190a54 commit d626ffa
Show file tree
Hide file tree
Showing 2 changed files with 149 additions and 0 deletions.
72 changes: 72 additions & 0 deletions lib/node_modules/@stdlib/array/base/assert/docs/types/index.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,8 @@
import contains = require( '@stdlib/array/base/assert/contains' );
import hasSameValues = require( '@stdlib/array/base/assert/has-same-values' );
import isAccessorArray = require( '@stdlib/array/base/assert/is-accessor-array' );
import isBooleanDataType = require( '@stdlib/array/base/assert/is-boolean-data-type' );
import isBooleanArray = require( '@stdlib/array/base/assert/is-booleanarray' );
import isComplexFloatingPointDataType = require( '@stdlib/array/base/assert/is-complex-floating-point-data-type' );
import isComplexTypedArray = require( '@stdlib/array/base/assert/is-complex-typed-array' );
import isComplex64Array = require( '@stdlib/array/base/assert/is-complex64array' );
Expand Down Expand Up @@ -106,6 +108,76 @@ interface Namespace {
*/
isAccessorArray: typeof isAccessorArray;

/**
* Tests whether an input value is a supported array boolean data type.
*
* @param v - value to test
* @returns boolean indicating whether an input value is a supported array boolean data type
*
* @example
* var bool = ns.isBooleanDataType( 'bool' );
* // returns true
*
* bool = ns.isBooleanDataType( 'complex64' );
* // returns false
*
* bool = ns.isBooleanDataType( 'complex128' );
* // returns false
*
* bool = ns.isBooleanDataType( 'float32' );
* // returns false
*
* bool = ns.isBooleanDataType( 'float64' );
* // returns false
*
* bool = ns.isBooleanDataType( 'generic' );
* // returns false
*
* bool = ns.isBooleanDataType( 'int16' );
* // returns false
*
* bool = ns.isBooleanDataType( 'int32' );
* // returns false
*
* bool = ns.isBooleanDataType( 'int8' );
* // returns false
*
* bool = ns.isBooleanDataType( 'uint16' );
* // returns false
*
* bool = ns.isBooleanDataType( 'uint32' );
* // returns false
*
* bool = ns.isBooleanDataType( 'uint8' );
* // returns false
*
* bool = ns.isBooleanDataType( 'uint8c' );
* // returns false
*
* bool = ns.isBooleanDataType( 'foo' );
* // returns false
*/
isBooleanDataType: typeof isBooleanDataType;

/**
* Tests if a value is a `BooleanArray`.
*
* @param value - value to test
* @returns boolean indicating whether a value is a `BooleanArray`
*
* @example
* var BooleanArray = require( '@stdlib/array/bool' );
*
* var arr = new BooleanArray( 10 );
* var bool = ns.isBooleanArray( arr );
* // returns true
*
* @example
* var bool = ns.isBooleanArray( [] );
* // returns false
*/
isBooleanArray: typeof isBooleanArray;

/**
* Tests whether an input value is a supported array complex-valued floating-point data type.
*
Expand Down
77 changes: 77 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 @@ -68,6 +68,8 @@ import countIf = require( '@stdlib/array/base/count-if' );
import countSameValue = require( '@stdlib/array/base/count-same-value' );
import countSameValueZero = require( '@stdlib/array/base/count-same-value-zero' );
import countTruthy = require( '@stdlib/array/base/count-truthy' );
import cuany = require( '@stdlib/array/base/cuany' );
import cuevery = require( '@stdlib/array/base/cuevery' );
import dedupe = require( '@stdlib/array/base/dedupe' );
import every = require( '@stdlib/array/base/every' );
import everyBy = require( '@stdlib/array/base/every-by' );
Expand Down Expand Up @@ -143,6 +145,7 @@ import ones3d = require( '@stdlib/array/base/ones3d' );
import ones4d = require( '@stdlib/array/base/ones4d' );
import ones5d = require( '@stdlib/array/base/ones5d' );
import onesnd = require( '@stdlib/array/base/onesnd' );
import put = require( '@stdlib/array/base/put' );
import quaternary2d = require( '@stdlib/array/base/quaternary2d' );
import quaternary3d = require( '@stdlib/array/base/quaternary3d' );
import quaternary4d = require( '@stdlib/array/base/quaternary4d' );
Expand Down Expand Up @@ -1420,6 +1423,48 @@ interface Namespace {
*/
countTruthy: typeof countTruthy;

/**
* Cumulatively tests whether at least one element in a provided array is truthy.
*
* @param x - input array
* @returns output array
*
* @example
* var x = [ false, false, true, false, false ];
*
* var result = ns.cuany( x );
* // returns [ false, false, true, true, true ]
*
* @example
* var x = [ false, false, true, false, false ];
* var y = [ false, null, false, null, false, null, false, null, false, null ];
*
* var arr = ns.cuany.assign( x, y, 2, 0 );
* // returns [ false, null, false, null, true, null, true, null, true, null ]
*/
cuany: typeof cuany;

/**
* Cumulatively tests whether every element in a provided array is truthy.
*
* @param x - input array
* @returns output array
*
* @example
* var x = [ true, true, true, false, true ];
*
* var result = ns.cuevery( x );
* // returns [ true, true, true, false, false ];
*
* @example
* var x = [ true, true, true, false, true ];
* var y = [ false, null, false, null, false, null, false, null, false, null ];
*
* var arr = ns.cuevery.assign( x, y, 2, 0 );
* // returns [ true, null, true, null, true, null, false, null, false, null ];
*/
cuevery: typeof cuevery;

/**
* Removes consecutive duplicated values.
*
Expand Down Expand Up @@ -3098,6 +3143,38 @@ interface Namespace {
*/
onesnd: typeof onesnd;

/**
* Replaces specified elements of an array with provided values.
*
* @param x - input array
* @param indices - list of element indices
* @param values - values to set
* @param mode - index mode
* @returns input array
*
* @example
* var x = [ 1, 2, 3, 4 ];
*
* var indices = [ 1, 2 ];
* var values = [ 20, 30 ];
*
* var out = ns.put( x, indices, values, 'throw' );
* // returns [ 1, 20, 30, 4 ]
*
* var bool = ( out === x );
* // returns true
*
* @example
* var x = [ 1, 2, 3, 4 ];
*
* var out = ns.put( x, [ 1, 2 ], [ 30 ], 'throw' );
* // returns [ 1, 30, 30, 4 ]
*
* var bool = ( out === x );
* // returns true
*/
put: typeof put;

/**
* Applies a quaternary callback to elements in four two-dimensional nested input arrays and assigns results to elements in a two-dimensional nested output array.
*
Expand Down

1 comment on commit d626ffa

@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/assert $\color{green}222/222$
$\color{green}+100.00\%$
$\color{green}1/1$
$\color{green}+100.00\%$
$\color{green}0/0$
$\color{green}+100.00\%$
$\color{green}222/222$
$\color{green}+100.00\%$
array/base $\color{green}1572/1572$
$\color{green}+100.00\%$
$\color{green}1/1$
$\color{green}+100.00\%$
$\color{green}0/0$
$\color{green}+100.00\%$
$\color{green}1572/1572$
$\color{green}+100.00\%$

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

Please sign in to comment.