Skip to content

Commit 33b46cb

Browse files
feat: update namespace TypeScript declarations
PR-URL: #4426 Co-authored-by: Philipp Burckhardt <[email protected]> Reviewed-by: Philipp Burckhardt <[email protected]> Signed-off-by: stdlib-bot <[email protected]>
1 parent edae311 commit 33b46cb

File tree

1 file changed

+28
-0
lines changed
  • lib/node_modules/@stdlib/ndarray/base/docs/types

1 file changed

+28
-0
lines changed

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

Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -57,6 +57,7 @@ import fliplr = require( '@stdlib/ndarray/base/fliplr' );
5757
import flipud = require( '@stdlib/ndarray/base/flipud' );
5858
import forEach = require( '@stdlib/ndarray/base/for-each' );
5959
import scalar2ndarray = require( '@stdlib/ndarray/base/from-scalar' );
60+
import scalar2ndarrayLike = require( '@stdlib/ndarray/base/from-scalar-like' );
6061
import ind = require( '@stdlib/ndarray/base/ind' );
6162
import ind2sub = require( '@stdlib/ndarray/base/ind2sub' );
6263
import iterationOrder = require( '@stdlib/ndarray/base/iteration-order' );
@@ -1143,6 +1144,33 @@ interface Namespace {
11431144
*/
11441145
scalar2ndarray: typeof scalar2ndarray;
11451146

1147+
/**
1148+
* Returns a zero-dimensional ndarray containing a provided scalar value and having the same data type as a provided input ndarray.
1149+
*
1150+
* @param x - input array
1151+
* @param value - scalar value
1152+
* @returns zero-dimensional ndarray
1153+
*
1154+
* @example
1155+
* var zeros = require( '@stdlib/ndarray/base/zeros' );
1156+
*
1157+
* var x = zeros( 'float64', [ 2, 2 ], 'row-major' );
1158+
* // returns <ndarray>
1159+
*
1160+
* var y = ns.scalar2ndarrayLike( x, 1.0 );
1161+
* // returns <ndarray>
1162+
*
1163+
* var sh = y.shape;
1164+
* // returns []
1165+
*
1166+
* var dt = y.dtype;
1167+
* // returns 'generic'
1168+
*
1169+
* var v = y.get();
1170+
* // returns 1.0
1171+
*/
1172+
scalar2ndarrayLike: typeof scalar2ndarrayLike;
1173+
11461174
/**
11471175
* Returns an index given an index mode.
11481176
*

0 commit comments

Comments
 (0)