From e563ea8104d4d3c768466924d97aa2c4d98a8bb2 Mon Sep 17 00:00:00 2001 From: stdlib-bot <82920195+stdlib-bot@users.noreply.github.com> Date: Mon, 29 Dec 2025 02:53:58 +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 | 133 ++++++++++++++++++ 1 file changed, 133 insertions(+) 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 9335fda77c23..b2f7c44b4a44 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 @@ -66,6 +66,7 @@ import dtypeStrings = require( '@stdlib/ndarray/base/dtype-strings' ); import dtype2c = require( '@stdlib/ndarray/base/dtype2c' ); import dtypes2enums = require( '@stdlib/ndarray/base/dtypes2enums' ); import dtypes2signatures = require( '@stdlib/ndarray/base/dtypes2signatures' ); +import dtypes2strings = require( '@stdlib/ndarray/base/dtypes2strings' ); import empty = require( '@stdlib/ndarray/base/empty' ); import emptyLike = require( '@stdlib/ndarray/base/empty-like' ); import every = require( '@stdlib/ndarray/base/every' ); @@ -147,8 +148,11 @@ import strides2offset = require( '@stdlib/ndarray/base/strides2offset' ); import strides2order = require( '@stdlib/ndarray/base/strides2order' ); import sub2ind = require( '@stdlib/ndarray/base/sub2ind' ); import ndarray2array = require( '@stdlib/ndarray/base/to-array' ); +import toFlippedlr = require( '@stdlib/ndarray/base/to-flippedlr' ); +import toFlippedud = require( '@stdlib/ndarray/base/to-flippedud' ); import toNormalizedIndices = require( '@stdlib/ndarray/base/to-normalized-indices' ); import toReversed = require( '@stdlib/ndarray/base/to-reversed' ); +import toReversedDimension = require( '@stdlib/ndarray/base/to-reversed-dimension' ); import toUniqueNormalizedIndices = require( '@stdlib/ndarray/base/to-unique-normalized-indices' ); import transpose = require( '@stdlib/ndarray/base/transpose' ); import unary = require( '@stdlib/ndarray/base/unary' ); @@ -1434,6 +1438,26 @@ interface Namespace { */ dtypes2signatures: typeof dtypes2signatures; + /** + * Resolves a list of data type strings. + * + * ## Notes + * + * - If the function is unable to resolve a data type string for a provided data type, the corresponding element in the returned array will be `null`. + * + * @param dtypes - list of data types + * @returns results + * + * @example + * var out = ns.dtypes2strings( [ 'float32', 'float64' ] ); + * // returns [...] + * + * @example + * var out = ns.dtypes2strings( [ 'foo', 'bar' ] ); + * // returns [ null, null ] + */ + dtypes2strings: typeof dtypes2strings; + /** * Creates an uninitialized array having a specified shape and data type. * @@ -4105,6 +4129,78 @@ interface Namespace { */ ndarray2array: typeof ndarray2array; + /** + * Returns a new ndarray where the order of elements along the last dimension of an input ndarray is reversed. + * + * @param x - input array + * @returns output array + * + * @example + * var typedarray = require( '@stdlib/array/typed' ); + * var ndarray = require( '@stdlib/ndarray/ctor' ); + * var ndarray2array = require( '@stdlib/ndarray/to-array' ); + * + * var buffer = typedarray( [ 1.0, 2.0, 3.0, 4.0, 5.0, 6.0 ], 'float64' ); + * var shape = [ 3, 2 ]; + * var strides = [ 2, 1 ]; + * var offset = 0; + * + * var x = ndarray( 'float64', buffer, shape, strides, offset, 'row-major' ); + * // returns + * + * var sh = x.shape; + * // returns [ 3, 2 ] + * + * var arr = ndarray2array( x ); + * // returns [ [ 1.0, 2.0 ], [ 3.0, 4.0 ], [ 5.0, 6.0 ] ] + * + * var y = ns.toFlippedlr( x ); + * // returns + * + * sh = y.shape; + * // returns [ 3, 2 ] + * + * arr = ndarray2array( y ); + * // returns [ [ 2.0, 1.0 ], [ 4.0, 3.0 ], [ 6.0, 5.0 ] ] + */ + toFlippedlr: typeof toFlippedlr; + + /** + * Returns a new ndarray where the order of elements along the second-to-last dimension of an input ndarray is reversed. + * + * @param x - input array + * @returns output array + * + * @example + * var typedarray = require( '@stdlib/array/typed' ); + * var ndarray = require( '@stdlib/ndarray/ctor' ); + * var ndarray2array = require( '@stdlib/ndarray/to-array' ); + * + * var buffer = typedarray( [ 1.0, 2.0, 3.0, 4.0, 5.0, 6.0 ], 'float64' ); + * var shape = [ 3, 2 ]; + * var strides = [ 2, 1 ]; + * var offset = 0; + * + * var x = ndarray( 'float64', buffer, shape, strides, offset, 'row-major' ); + * // returns + * + * var sh = x.shape; + * // returns [ 3, 2 ] + * + * var arr = ndarray2array( x ); + * // returns [ [ 1.0, 2.0 ], [ 3.0, 4.0 ], [ 5.0, 6.0 ] ] + * + * var y = ns.toFlippedud( x ); + * // returns + * + * sh = y.shape; + * // returns [ 3, 2 ] + * + * arr = ndarray2array( y ); + * // returns [ [ 5.0, 6.0 ], [ 3.0, 4.0 ], [ 1.0, 2.0 ] ] + */ + toFlippedud: typeof toFlippedud; + /** * Normalizes a list of indices to the interval `[0,max]`. * @@ -4161,6 +4257,43 @@ interface Namespace { */ toReversed: typeof toReversed; + /** + * Returns a new ndarray where the order of elements of an input ndarray along a specified dimension is reversed. + * + * @param x - input array + * @param dim - index of dimension to reverse + * @returns output array + * + * @example + * var typedarray = require( '@stdlib/array/typed' ); + * var ndarray = require( '@stdlib/ndarray/ctor' ); + * var ndarray2array = require( '@stdlib/ndarray/to-array' ); + * + * var buffer = typedarray( [ 1.0, 2.0, 3.0, 4.0, 5.0, 6.0 ], 'float64' ); + * var shape = [ 3, 2 ]; + * var strides = [ 2, 1 ]; + * var offset = 0; + * + * var x = ndarray( 'float64', buffer, shape, strides, offset, 'row-major' ); + * // returns + * + * var sh = x.shape; + * // returns [ 3, 2 ] + * + * var arr = ndarray2array( x ); + * // returns [ [ 1.0, 2.0 ], [ 3.0, 4.0 ], [ 5.0, 6.0 ] ] + * + * var y = ns.toReversedDimension( x, 0 ); + * // returns + * + * sh = y.shape; + * // returns [ 3, 2 ] + * + * arr = ndarray2array( y ); + * // returns [ [ 5.0, 6.0 ], [ 3.0, 4.0 ], [ 1.0, 2.0 ] ] + */ + toReversedDimension: typeof toReversedDimension; + /** * Returns a list of unique indices after normalizing to the interval `[0,max]`. *