Skip to content

Commit 00fd68d

Browse files
stdlib-botkgryte
andauthored
feat: update namespace TypeScript declarations
PR-URL: #2415 Co-authored-by: Athan Reines <kgryte@gmail.com> Reviewed-by: Athan Reines <kgryte@gmail.com> Signed-off-by: stdlib-bot <82920195+stdlib-bot@users.noreply.github.com>
1 parent 0b3db04 commit 00fd68d

File tree

1 file changed

+99
-0
lines changed
  • lib/node_modules/@stdlib/array/base/docs/types

1 file changed

+99
-0
lines changed

lib/node_modules/@stdlib/array/base/docs/types/index.d.ts

Lines changed: 99 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -131,6 +131,7 @@ import minSignedIntegerDataType = require( '@stdlib/array/base/min-signed-intege
131131
import minUnsignedIntegerDataType = require( '@stdlib/array/base/min-unsigned-integer-dtype' );
132132
import mskbinary2d = require( '@stdlib/array/base/mskbinary2d' );
133133
import mskfilter = require( '@stdlib/array/base/mskfilter' );
134+
import mskput = require( '@stdlib/array/base/mskput' );
134135
import mskreject = require( '@stdlib/array/base/mskreject' );
135136
import mskunary2d = require( '@stdlib/array/base/mskunary2d' );
136137
import mskunary3d = require( '@stdlib/array/base/mskunary3d' );
@@ -145,6 +146,7 @@ import ones3d = require( '@stdlib/array/base/ones3d' );
145146
import ones4d = require( '@stdlib/array/base/ones4d' );
146147
import ones5d = require( '@stdlib/array/base/ones5d' );
147148
import onesnd = require( '@stdlib/array/base/onesnd' );
149+
import place = require( '@stdlib/array/base/place' );
148150
import put = require( '@stdlib/array/base/put' );
149151
import quaternary2d = require( '@stdlib/array/base/quaternary2d' );
150152
import quaternary3d = require( '@stdlib/array/base/quaternary3d' );
@@ -182,6 +184,7 @@ import unary4d = require( '@stdlib/array/base/unary4d' );
182184
import unary5d = require( '@stdlib/array/base/unary5d' );
183185
import unarynd = require( '@stdlib/array/base/unarynd' );
184186
import unitspace = require( '@stdlib/array/base/unitspace' );
187+
import where = require( '@stdlib/array/base/where' );
185188
import arrayWith = require( '@stdlib/array/base/with' );
186189
import zeroTo = require( '@stdlib/array/base/zero-to' );
187190
import zeros = require( '@stdlib/array/base/zeros' );
@@ -2874,6 +2877,38 @@ interface Namespace {
28742877
*/
28752878
mskfilter: typeof mskfilter;
28762879

2880+
/**
2881+
* Replaces elements of an array with provided values according to a provided mask array.
2882+
*
2883+
* @param x - input array
2884+
* @param mask - mask array
2885+
* @param values - values to set
2886+
* @param mode - string specifying behavior when the number of values does not equal the number of falsy values in the mask array
2887+
* @returns input array
2888+
*
2889+
* @example
2890+
* var x = [ 1, 2, 3, 4 ];
2891+
*
2892+
* var mask = [ 1, 0, 0, 1 ];
2893+
* var values = [ 20, 30 ];
2894+
*
2895+
* var out = ns.mskput( x, mask, values, 'strict' );
2896+
* // returns [ 1, 20, 30, 4 ]
2897+
*
2898+
* var bool = ( out === x );
2899+
* // returns true
2900+
*
2901+
* @example
2902+
* var x = [ 1, 2, 3, 4 ];
2903+
*
2904+
* var out = ns.mskput( x, [ 1, 0, 0, 1 ], [ 30 ], 'strict_broadcast' );
2905+
* // returns [ 1, 30, 30, 4 ]
2906+
*
2907+
* var bool = ( out === x );
2908+
* // returns true
2909+
*/
2910+
mskput: typeof mskput;
2911+
28772912
/**
28782913
* Returns a new array by applying a mask to a provided input array.
28792914
*
@@ -3143,6 +3178,38 @@ interface Namespace {
31433178
*/
31443179
onesnd: typeof onesnd;
31453180

3181+
/**
3182+
* Replaces elements of an array with provided values according to a provided mask array.
3183+
*
3184+
* @param x - input array
3185+
* @param mask - mask array
3186+
* @param values - values to set
3187+
* @param mode - string specifying behavior when the number of values does not equal the number of truthy values in the mask array
3188+
* @returns input array
3189+
*
3190+
* @example
3191+
* var x = [ 1, 2, 3, 4 ];
3192+
*
3193+
* var mask = [ 0, 1, 1, 0 ];
3194+
* var values = [ 20, 30 ];
3195+
*
3196+
* var out = ns.place( x, mask, values, 'strict' );
3197+
* // returns [ 1, 20, 30, 4 ]
3198+
*
3199+
* var bool = ( out === x );
3200+
* // returns true
3201+
*
3202+
* @example
3203+
* var x = [ 1, 2, 3, 4 ];
3204+
*
3205+
* var out = ns.place( x, [ 0, 1, 1, 0 ], [ 30 ], 'strict_broadcast' );
3206+
* // returns [ 1, 30, 30, 4 ]
3207+
*
3208+
* var bool = ( out === x );
3209+
* // returns true
3210+
*/
3211+
place: typeof place;
3212+
31463213
/**
31473214
* Replaces specified elements of an array with provided values.
31483215
*
@@ -4133,6 +4200,38 @@ interface Namespace {
41334200
*/
41344201
unitspace: typeof unitspace;
41354202

4203+
/**
4204+
* Takes elements from either one of two arrays depending on a condition.
4205+
*
4206+
* @param condition - array containing indicator values
4207+
* @param x - first input array
4208+
* @param y - second input array
4209+
* @returns output array
4210+
*
4211+
* @example
4212+
* var x = [ 1, 2, 3, 4 ];
4213+
* var y = [ 5, 6, 7, 8 ];
4214+
*
4215+
* var condition = [ true, false, true, false ];
4216+
*
4217+
* var z = ns.where( condition, x, y );
4218+
* // returns [ 1, 6, 3, 8 ]
4219+
*
4220+
* @example
4221+
* var x = [ 1, 2, 3, 4 ];
4222+
* var y = [ 5, 6, 7, 8 ];
4223+
*
4224+
* var out = [ 0, 0, 0, 0 ];
4225+
* var condition = [ true, false, true, false ];
4226+
*
4227+
* var arr = assign( condition, x, y, out, 1, 0 );
4228+
* // returns [ 1, 6, 3, 8 ]
4229+
*
4230+
* var bool = ( arr === out );
4231+
* // returns true
4232+
*/
4233+
where: typeof where;
4234+
41364235
/**
41374236
* Returns a new array with the element at the specified index replaced with a provided value.
41384237
*

0 commit comments

Comments
 (0)