Skip to content

Commit da8a676

Browse files
authored
feat: update namespace TypeScript declarations
PR-URL: #6315 Reviewed-by: Athan Reines <[email protected]>
1 parent 32c7044 commit da8a676

File tree

3 files changed

+70
-3
lines changed

3 files changed

+70
-3
lines changed

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

Lines changed: 44 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -51,6 +51,7 @@ import empty = require( '@stdlib/ndarray/base/empty' );
5151
import emptyLike = require( '@stdlib/ndarray/base/empty-like' );
5252
import expandDimensions = require( '@stdlib/ndarray/base/expand-dimensions' );
5353
import fill = require( '@stdlib/ndarray/base/fill' );
54+
import fillBy = require( '@stdlib/ndarray/base/fill-by' );
5455
import flag = require( '@stdlib/ndarray/base/flag' );
5556
import flags = require( '@stdlib/ndarray/base/flags' );
5657
import fliplr = require( '@stdlib/ndarray/base/fliplr' );
@@ -986,6 +987,49 @@ interface Namespace {
986987
*/
987988
fill: typeof fill;
988989

990+
/**
991+
* Fills an input ndarray according to a callback function.
992+
*
993+
* @param x - input ndarray
994+
* @param fcn - callback function
995+
* @param thisArg - callback function execution context
996+
*
997+
* @example
998+
* var Float64Array = require( '@stdlib/array/float64' );
999+
*
1000+
* function fcn() {
1001+
* return 10.0;
1002+
* }
1003+
*
1004+
* // Create a data buffer:
1005+
* var xbuf = new Float64Array( [ 1.0, 2.0, 3.0, 4.0, 5.0, 6.0 ] );
1006+
*
1007+
* // Define the shape of the input array:
1008+
* var shape = [ 3, 1, 2 ];
1009+
*
1010+
* // Define the array strides:
1011+
* var sx = [ 2, 2, 1 ];
1012+
*
1013+
* // Define the index offset:
1014+
* var ox = 0;
1015+
*
1016+
* // Create the input ndarray-like object:
1017+
* var x = {
1018+
* 'dtype': 'float64',
1019+
* 'data': xbuf,
1020+
* 'shape': shape,
1021+
* 'strides': sx,
1022+
* 'offset': ox,
1023+
* 'order': 'row-major'
1024+
* };
1025+
*
1026+
* ns.fillBy( x, fcn );
1027+
*
1028+
* console.log( x.data );
1029+
* // => <Float64Array>[ 10.0, 10.0, 10.0, 10.0, 10.0, 10.0 ]
1030+
*/
1031+
fillBy: typeof fillBy;
1032+
9891033
/**
9901034
* Returns a specified flag for a provided ndarray.
9911035
*

lib/node_modules/@stdlib/ndarray/docs/types/index.d.ts

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -35,6 +35,7 @@ import dtypes = require( '@stdlib/ndarray/dtypes' );
3535
import empty = require( '@stdlib/ndarray/empty' );
3636
import emptyLike = require( '@stdlib/ndarray/empty-like' );
3737
import FancyArray = require( '@stdlib/ndarray/fancy' );
38+
import fill = require( '@stdlib/ndarray/fill' );
3839
import filter = require( '@stdlib/ndarray/filter' );
3940
import filterMap = require( '@stdlib/ndarray/filter-map' );
4041
import flag = require( '@stdlib/ndarray/flag' );
@@ -570,6 +571,28 @@ interface Namespace {
570571
*/
571572
FancyArray: typeof FancyArray;
572573

574+
/**
575+
* Fills an input ndarray with a specified value.
576+
*
577+
* @param x - input ndarray
578+
* @param value - scalar value
579+
* @returns input ndarray
580+
*
581+
* @example
582+
* var zeros = require( '@stdlib/ndarray/zeros' );
583+
* var getData = require( '@stdlib/ndarray/data-buffer' );
584+
*
585+
* var x = zeros( [ 3, 1, 2 ], {
586+
* 'dtype': 'float64'
587+
* });
588+
*
589+
* ns.fill( x, 10.0 );
590+
*
591+
* console.log( getData( x ) );
592+
* // => <Float64Array>[ 10.0, 10.0, 10.0, 10.0, 10.0, 10.0 ]
593+
*/
594+
fill: typeof fill;
595+
573596
/**
574597
* Returns a shallow copy of an ndarray containing only those elements which pass a test implemented by a predicate function.
575598
*

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

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2350,7 +2350,7 @@ interface Namespace {
23502350
*
23512351
* @param N - number of indexed elements
23522352
* @param x - input array
2353-
* @param stride - stride length
2353+
* @param strideX - stride length
23542354
* @returns arithmetic mean
23552355
*
23562356
* @example
@@ -2903,9 +2903,9 @@ interface Namespace {
29032903
*
29042904
* @param N - number of indexed elements
29052905
* @param x - input array
2906-
* @param strideX - `x` stride length
2906+
* @param strideX - stride length for `x`
29072907
* @param mask - mask array
2908-
* @param strideMask - `mask` stride length
2908+
* @param strideMask - stride length for `x`
29092909
* @returns range
29102910
*
29112911
* @example

0 commit comments

Comments
 (0)