Skip to content
Merged
Show file tree
Hide file tree
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
467 changes: 467 additions & 0 deletions lib/node_modules/@stdlib/array/base/assert/docs/types/index.d.ts

Large diffs are not rendered by default.

173 changes: 167 additions & 6 deletions lib/node_modules/@stdlib/array/base/docs/types/index.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -63,10 +63,14 @@ import cartesianProduct = require( '@stdlib/array/base/cartesian-product' );
import cartesianSquare = require( '@stdlib/array/base/cartesian-square' );
import copy = require( '@stdlib/array/base/copy' );
import copyIndexed = require( '@stdlib/array/base/copy-indexed' );
import countFalsy = require( '@stdlib/array/base/count-falsy' );
import countTruthy = require( '@stdlib/array/base/count-truthy' );
import dedupe = require( '@stdlib/array/base/dedupe' );
import every = require( '@stdlib/array/base/every' );
import everyBy = require( '@stdlib/array/base/every-by' );
import everyByRight = require( '@stdlib/array/base/every-by-right' );
import fancySlice = require( '@stdlib/array/base/fancy-slice' );
import fancySliceAssign = require( '@stdlib/array/base/fancy-slice-assign' );
import filled = require( '@stdlib/array/base/filled' );
import filledBy = require( '@stdlib/array/base/filled-by' );
import filled2d = require( '@stdlib/array/base/filled2d' );
Expand Down Expand Up @@ -117,8 +121,11 @@ import map2d = require( '@stdlib/array/base/map2d' );
import map3d = require( '@stdlib/array/base/map3d' );
import map4d = require( '@stdlib/array/base/map4d' );
import map5d = require( '@stdlib/array/base/map5d' );
import minSignedIntegerDataType = require( '@stdlib/array/base/min-signed-integer-dtype' );
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 mskreject = require( '@stdlib/array/base/mskreject' );
import mskunary2d = require( '@stdlib/array/base/mskunary2d' );
import mskunary3d = require( '@stdlib/array/base/mskunary3d' );
import nCartesianProduct = require( '@stdlib/array/base/n-cartesian-product' );
Expand All @@ -140,6 +147,7 @@ import quinary2d = require( '@stdlib/array/base/quinary2d' );
import quinary3d = require( '@stdlib/array/base/quinary3d' );
import quinary4d = require( '@stdlib/array/base/quinary4d' );
import quinary5d = require( '@stdlib/array/base/quinary5d' );
import reject = require( '@stdlib/array/base/reject' );
import resolveGetter = require( '@stdlib/array/base/resolve-getter' );
import resolveSetter = require( '@stdlib/array/base/resolve-setter' );
import reverse = require( '@stdlib/array/base/reverse' );
Expand Down Expand Up @@ -1318,6 +1326,34 @@ interface Namespace {
*/
copyIndexed: typeof copyIndexed;

/**
* Counts the number of falsy values in an array.
*
* @param x - input array
* @returns number of falsy values
*
* @example
* var x = [ 0, 1, 0, 1, 1 ];
*
* var out = ns.countFalsy( x );
* // returns 2
*/
countFalsy: typeof countFalsy;

/**
* Counts the number of truthy values in an array.
*
* @param x - input array
* @returns number of truthy values
*
* @example
* var x = [ 0, 1, 0, 1, 1 ];
*
* var out = ns.countTruthy( x );
* // returns 3
*/
countTruthy: typeof countTruthy;

/**
* Removes consecutive duplicated values.
*
Expand Down Expand Up @@ -1419,6 +1455,55 @@ interface Namespace {
*/
everyByRight: typeof everyByRight;

/**
* Returns a shallow copy of a portion of an array.
*
* @param x - input array
* @param s - slice object
* @param strict - boolean indicating whether to enforce strict bounds checking
* @returns output array
*
* @example
* var Slice = require( '@stdlib/ns.fancySlice/ctor' );
*
* var x = [ 1, 2, 3, 4, 5, 6 ];
*
* var out = ns.fancySlice( x, new Slice( null, null, -1 ), false );
* // returns [ 6, 5, 4, 3, 2, 1 ]
*/
fancySlice: typeof fancySlice;

/**
* Assigns element values from a broadcasted input array to corresponding elements in an output array.
*
* ## Notes
*
* - The input array must be broadcast compatible with the output array slice to which elements will be assigned (i.e., contain only one element or the same number of elements as in the slice).
* - The input array must have a data type which can be safely cast to the output array data type. Floating-point data types (both real and complex) are allowed to downcast to a lower precision data type of the same kind (e.g., element values from a `'float64'` input array can be assigned to corresponding elements in a `'float32'` output array).
*
* @param x - input array
* @param y - output array
* @param s - slice object
* @param strict - boolean indicating whether to enforce strict bounds checking
* @returns output array
*
* @example
* var Slice = require( '@stdlib/slice/ctor' );
*
* var x = [ 1, 2, 3, 4 ];
* var y = [ 0, 0, 0, 0, 0, 0, 0, 0 ];
*
* var s = new Slice( null, null, 2 );
* // returns <Slice>
*
* var out = ns.fancySliceAssign( x, y, s, false );
* // returns [ 1, 0, 2, 0, 3, 0, 4, 0 ]
*
* var bool = ( out === y );
* // returns true
*/
fancySliceAssign: typeof fancySliceAssign;

/**
* Returns a filled "generic" array.
*
Expand Down Expand Up @@ -2562,6 +2647,38 @@ interface Namespace {
*/
map5d: typeof map5d;

/**
* Returns the minimum array data type for storing a provided signed integer value.
*
* @param value - scalar value
* @returns array data type
*
* @example
* var dt = ns.minSignedIntegerDataType( 1280 );
* // returns 'int16'
*
* @example
* var dt = ns.minSignedIntegerDataType( 3 );
* // returns 'int8'
*/
minSignedIntegerDataType: typeof minSignedIntegerDataType;

/**
* Returns the minimum array data type for storing a provided unsigned integer value.
*
* @param value - scalar value
* @returns array data type
*
* @example
* var dt = ns.minUnsignedIntegerDataType( 1280 );
* // returns 'uint16'
*
* @example
* var dt = ns.minUnsignedIntegerDataType( 3 );
* // returns 'uint8'
*/
minUnsignedIntegerDataType: typeof minUnsignedIntegerDataType;

/**
* Applies a binary callback to elements in two two-dimensional nested input arrays according to elements in a two-dimensional nested mask array and assigns results to elements in a two-dimensional nested output array.
*
Expand Down Expand Up @@ -2609,6 +2726,21 @@ interface Namespace {
*/
mskfilter: typeof mskfilter;

/**
* Returns a new array by applying a mask to a provided input array.
*
* @param x - input array
* @param mask - mask array
* @returns output array
*
* @example
* var x = [ 1, 2, 3, 4 ];
*
* var y = ns.mskreject( x, [ 0, 1, 0, 1 ] );
* // returns [ 1, 3 ]
*/
mskreject: typeof mskreject;

/**
* Applies a unary callback to elements in a two-dimensional nested input array according to elements in a two-dimensional nested mask array and assigns results to elements in a two-dimensional nested output array.
*
Expand Down Expand Up @@ -3115,6 +3247,22 @@ interface Namespace {
*/
quinary5d: typeof quinary5d;

/**
* Returns a shallow copy of an array containing only those elements which fail a test implemented by a predicate function.
*
* @param x - input array
* @param predicate - predicate function
* @param thisArg - predicate function execution context
* @returns output array
*
* @example
* var x = [ 1, -2, -3, 4 ];
*
* var out = ns.reject( x, isPositiveNumber );
* // returns [ -2, -3 ]
*/
reject: typeof reject;

/**
* Returns an accessor function for retrieving an element from an indexed array-like object.
*
Expand Down Expand Up @@ -3192,6 +3340,12 @@ interface Namespace {
* @returns output array
*
* @example
* var x = [ 1, 2, 3 ];
*
* var out = ns.slice( x, 0, 3 );
* // returns [ 1, 2, 3 ]
*
* @example
* var x = [ 1, 2, 3, 4, 5, 6 ];
*
* var out = ns.slice( x, 0, 3 );
Expand Down Expand Up @@ -3308,21 +3462,28 @@ interface Namespace {
strided2array5d: typeof strided2array5d;

/**
* Takes element from an array.
*
* ## Notes
*
* - The function does **not** perform bounds checking. If an index is less than zero or greater than the maximum index of `x`, the value of the corresponding element in the output array is undefined.
* Takes elements from an array.
*
* @param x - input array
* @param indices - list of element indices
* @param mode - index mode
* @returns output array
*
* @example
* var x = [ 1, 2, 3, 4 ];
*
* var y = ns.take( x, [ 1, 3 ] );
* var y = ns.take( x, [ 1, 3 ], 'throw' );
* // returns [ 2, 4 ]
*
* @example
* var x = [ 1, 2, 3, 4 ];
* var out = [ 0, 0, 0, 0 ];
*
* var arr = ns.take.assign( x, [ 1, 3 ], 'throw', out, 2, 0 );
* // returns [ 2, 0, 4, 0 ]
*
* var bool = ( arr === out );
* // returns true
*/
take: typeof take;

Expand Down
Loading