From ef61296e03ac4c333eac0c1e700a65149634045b Mon Sep 17 00:00:00 2001 From: stdlib-bot <82920195+stdlib-bot@users.noreply.github.com> Date: Thu, 26 Mar 2026 03:14:50 +0000 Subject: [PATCH] feat: update `ndarray/base` TypeScript declarations Signed-off-by: stdlib-bot <82920195+stdlib-bot@users.noreply.github.com> --- .../ndarray/base/docs/types/index.d.ts | 42 ++++++++++++++++--- 1 file changed, 37 insertions(+), 5 deletions(-) diff --git a/lib/node_modules/@stdlib/ndarray/base/docs/types/index.d.ts b/lib/node_modules/@stdlib/ndarray/base/docs/types/index.d.ts index 0e386b6846de..e981549eb47e 100644 --- a/lib/node_modules/@stdlib/ndarray/base/docs/types/index.d.ts +++ b/lib/node_modules/@stdlib/ndarray/base/docs/types/index.d.ts @@ -121,6 +121,7 @@ import numel = require( '@stdlib/ndarray/base/numel' ); import numelDimension = require( '@stdlib/ndarray/base/numel-dimension' ); import offset = require( '@stdlib/ndarray/base/offset' ); import ones = require( '@stdlib/ndarray/base/ones' ); +import onesLike = require( '@stdlib/ndarray/base/ones-like' ); import order = require( '@stdlib/ndarray/base/order' ); import outputDataType = require( '@stdlib/ndarray/base/output-dtype' ); import outputPolicyEnum2Str = require( '@stdlib/ndarray/base/output-policy-enum2str' ); @@ -3183,6 +3184,37 @@ interface Namespace { */ ones: typeof ones; + /** + * Creates a ones-filled array having the same shape and data type as a provided input ndarray. + * + * @param x - input array + * @returns ones-filled array + * + * @example + * var getShape = require( '@stdlib/ndarray/shape' ); + * var getDType = require( '@stdlib/ndarray/dtype' ); + * var ones = require( '@stdlib/ndarray/base/ones' ); + * + * var x = ones( 'float64', [ 2, 2 ], 'row-major' ); + * // returns [ [ 1.0, 1.0 ], [ 1.0, 1.0 ] ] + * + * var sh = getShape( x ); + * // returns [ 2, 2 ] + * + * var dt = String( getDType( x ) ); + * // returns 'float64' + * + * var y = ns.onesLike( x ); + * // returns [ [ 1.0, 1.0 ], [ 1.0, 1.0 ] ] + * + * sh = getShape( y ); + * // returns [ 2, 2 ] + * + * dt = String( getDType( y ) ); + * // returns 'float64' + */ + onesLike: typeof onesLike; + /** * Returns the layout order of a provided ndarray. * @@ -5435,23 +5467,23 @@ interface Namespace { * var getDType = require( '@stdlib/ndarray/dtype' ); * var zeros = require( '@stdlib/ndarray/base/zeros' ); * - * var x = zeros( 'generic', [ 2, 2 ], 'row-major' ); - * // returns [ [ 0, 0 ], [ 0, 0 ] ] + * var x = zeros( 'float64', [ 2, 2 ], 'row-major' ); + * // returns [ [ 0.0, 0.0 ], [ 0.0, 0.0 ] ] * * var sh = getShape( x ); * // returns [ 2, 2 ] * * var dt = String( getDType( x ) ); - * // returns 'generic' + * // returns 'float64' * * var y = ns.zerosLike( x ); - * // returns [ [ 0, 0 ], [ 0, 0 ] ] + * // returns [ [ 0.0, 0.0 ], [ 0.0, 0.0 ] ] * * sh = getShape( y ); * // returns [ 2, 2 ] * * dt = String( getDType( y ) ); - * // returns 'generic' + * // returns 'float64' */ zerosLike: typeof zerosLike;