Skip to content

Commit ef61296

Browse files
committed
feat: update ndarray/base TypeScript declarations
Signed-off-by: stdlib-bot <82920195+stdlib-bot@users.noreply.github.com>
1 parent 475f496 commit ef61296

1 file changed

Lines changed: 37 additions & 5 deletions

File tree

  • lib/node_modules/@stdlib/ndarray/base/docs/types

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

Lines changed: 37 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -121,6 +121,7 @@ import numel = require( '@stdlib/ndarray/base/numel' );
121121
import numelDimension = require( '@stdlib/ndarray/base/numel-dimension' );
122122
import offset = require( '@stdlib/ndarray/base/offset' );
123123
import ones = require( '@stdlib/ndarray/base/ones' );
124+
import onesLike = require( '@stdlib/ndarray/base/ones-like' );
124125
import order = require( '@stdlib/ndarray/base/order' );
125126
import outputDataType = require( '@stdlib/ndarray/base/output-dtype' );
126127
import outputPolicyEnum2Str = require( '@stdlib/ndarray/base/output-policy-enum2str' );
@@ -3183,6 +3184,37 @@ interface Namespace {
31833184
*/
31843185
ones: typeof ones;
31853186

3187+
/**
3188+
* Creates a ones-filled array having the same shape and data type as a provided input ndarray.
3189+
*
3190+
* @param x - input array
3191+
* @returns ones-filled array
3192+
*
3193+
* @example
3194+
* var getShape = require( '@stdlib/ndarray/shape' );
3195+
* var getDType = require( '@stdlib/ndarray/dtype' );
3196+
* var ones = require( '@stdlib/ndarray/base/ones' );
3197+
*
3198+
* var x = ones( 'float64', [ 2, 2 ], 'row-major' );
3199+
* // returns <ndarray>[ [ 1.0, 1.0 ], [ 1.0, 1.0 ] ]
3200+
*
3201+
* var sh = getShape( x );
3202+
* // returns [ 2, 2 ]
3203+
*
3204+
* var dt = String( getDType( x ) );
3205+
* // returns 'float64'
3206+
*
3207+
* var y = ns.onesLike( x );
3208+
* // returns <ndarray>[ [ 1.0, 1.0 ], [ 1.0, 1.0 ] ]
3209+
*
3210+
* sh = getShape( y );
3211+
* // returns [ 2, 2 ]
3212+
*
3213+
* dt = String( getDType( y ) );
3214+
* // returns 'float64'
3215+
*/
3216+
onesLike: typeof onesLike;
3217+
31863218
/**
31873219
* Returns the layout order of a provided ndarray.
31883220
*
@@ -5435,23 +5467,23 @@ interface Namespace {
54355467
* var getDType = require( '@stdlib/ndarray/dtype' );
54365468
* var zeros = require( '@stdlib/ndarray/base/zeros' );
54375469
*
5438-
* var x = zeros( 'generic', [ 2, 2 ], 'row-major' );
5439-
* // returns <ndarray>[ [ 0, 0 ], [ 0, 0 ] ]
5470+
* var x = zeros( 'float64', [ 2, 2 ], 'row-major' );
5471+
* // returns <ndarray>[ [ 0.0, 0.0 ], [ 0.0, 0.0 ] ]
54405472
*
54415473
* var sh = getShape( x );
54425474
* // returns [ 2, 2 ]
54435475
*
54445476
* var dt = String( getDType( x ) );
5445-
* // returns 'generic'
5477+
* // returns 'float64'
54465478
*
54475479
* var y = ns.zerosLike( x );
5448-
* // returns <ndarray>[ [ 0, 0 ], [ 0, 0 ] ]
5480+
* // returns <ndarray>[ [ 0.0, 0.0 ], [ 0.0, 0.0 ] ]
54495481
*
54505482
* sh = getShape( y );
54515483
* // returns [ 2, 2 ]
54525484
*
54535485
* dt = String( getDType( y ) );
5454-
* // returns 'generic'
5486+
* // returns 'float64'
54555487
*/
54565488
zerosLike: typeof zerosLike;
54575489

0 commit comments

Comments
 (0)