Skip to content

feat: update namespace TypeScript declarations #2415

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Jun 20, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
99 changes: 99 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 @@ -131,6 +131,7 @@ import minSignedIntegerDataType = require( '@stdlib/array/base/min-signed-intege
import minUnsignedIntegerDataType = require( '@stdlib/array/base/min-unsigned-integer-dtype' );
import mskbinary2d = require( '@stdlib/array/base/mskbinary2d' );
import mskfilter = require( '@stdlib/array/base/mskfilter' );
import mskput = require( '@stdlib/array/base/mskput' );
import mskreject = require( '@stdlib/array/base/mskreject' );
import mskunary2d = require( '@stdlib/array/base/mskunary2d' );
import mskunary3d = require( '@stdlib/array/base/mskunary3d' );
Expand All @@ -145,6 +146,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 place = require( '@stdlib/array/base/place' );
import put = require( '@stdlib/array/base/put' );
import quaternary2d = require( '@stdlib/array/base/quaternary2d' );
import quaternary3d = require( '@stdlib/array/base/quaternary3d' );
Expand Down Expand Up @@ -182,6 +184,7 @@ import unary4d = require( '@stdlib/array/base/unary4d' );
import unary5d = require( '@stdlib/array/base/unary5d' );
import unarynd = require( '@stdlib/array/base/unarynd' );
import unitspace = require( '@stdlib/array/base/unitspace' );
import where = require( '@stdlib/array/base/where' );
import arrayWith = require( '@stdlib/array/base/with' );
import zeroTo = require( '@stdlib/array/base/zero-to' );
import zeros = require( '@stdlib/array/base/zeros' );
Expand Down Expand Up @@ -2874,6 +2877,38 @@ interface Namespace {
*/
mskfilter: typeof mskfilter;

/**
* Replaces elements of an array with provided values according to a provided mask array.
*
* @param x - input array
* @param mask - mask array
* @param values - values to set
* @param mode - string specifying behavior when the number of values does not equal the number of falsy values in the mask array
* @returns input array
*
* @example
* var x = [ 1, 2, 3, 4 ];
*
* var mask = [ 1, 0, 0, 1 ];
* var values = [ 20, 30 ];
*
* var out = ns.mskput( x, mask, values, 'strict' );
* // returns [ 1, 20, 30, 4 ]
*
* var bool = ( out === x );
* // returns true
*
* @example
* var x = [ 1, 2, 3, 4 ];
*
* var out = ns.mskput( x, [ 1, 0, 0, 1 ], [ 30 ], 'strict_broadcast' );
* // returns [ 1, 30, 30, 4 ]
*
* var bool = ( out === x );
* // returns true
*/
mskput: typeof mskput;

/**
* Returns a new array by applying a mask to a provided input array.
*
Expand Down Expand Up @@ -3143,6 +3178,38 @@ interface Namespace {
*/
onesnd: typeof onesnd;

/**
* Replaces elements of an array with provided values according to a provided mask array.
*
* @param x - input array
* @param mask - mask array
* @param values - values to set
* @param mode - string specifying behavior when the number of values does not equal the number of truthy values in the mask array
* @returns input array
*
* @example
* var x = [ 1, 2, 3, 4 ];
*
* var mask = [ 0, 1, 1, 0 ];
* var values = [ 20, 30 ];
*
* var out = ns.place( x, mask, values, 'strict' );
* // returns [ 1, 20, 30, 4 ]
*
* var bool = ( out === x );
* // returns true
*
* @example
* var x = [ 1, 2, 3, 4 ];
*
* var out = ns.place( x, [ 0, 1, 1, 0 ], [ 30 ], 'strict_broadcast' );
* // returns [ 1, 30, 30, 4 ]
*
* var bool = ( out === x );
* // returns true
*/
place: typeof place;

/**
* Replaces specified elements of an array with provided values.
*
Expand Down Expand Up @@ -4133,6 +4200,38 @@ interface Namespace {
*/
unitspace: typeof unitspace;

/**
* Takes elements from either one of two arrays depending on a condition.
*
* @param condition - array containing indicator values
* @param x - first input array
* @param y - second input array
* @returns output array
*
* @example
* var x = [ 1, 2, 3, 4 ];
* var y = [ 5, 6, 7, 8 ];
*
* var condition = [ true, false, true, false ];
*
* var z = ns.where( condition, x, y );
* // returns [ 1, 6, 3, 8 ]
*
* @example
* var x = [ 1, 2, 3, 4 ];
* var y = [ 5, 6, 7, 8 ];
*
* var out = [ 0, 0, 0, 0 ];
* var condition = [ true, false, true, false ];
*
* var arr = assign( condition, x, y, out, 1, 0 );
* // returns [ 1, 6, 3, 8 ]
*
* var bool = ( arr === out );
* // returns true
*/
where: typeof where;

/**
* Returns a new array with the element at the specified index replaced with a provided value.
*
Expand Down
Loading