Skip to content

Commit 323e4e5

Browse files
feat: update namespace TypeScript declarations
PR-URL: #3977 Reviewed-by: Athan Reines <[email protected]> Signed-off-by: stdlib-bot <[email protected]> Co-authored-by: Philipp Burckhardt <[email protected]>
1 parent 54fb9de commit 323e4e5

File tree

1 file changed

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

1 file changed

+22
-0
lines changed

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

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -73,6 +73,7 @@ import stride = require( '@stdlib/ndarray/stride' );
7373
import strides = require( '@stdlib/ndarray/strides' );
7474
import sub2ind = require( '@stdlib/ndarray/sub2ind' );
7575
import ndarray2array = require( '@stdlib/ndarray/to-array' );
76+
import ndarray2json = require( '@stdlib/ndarray/to-json' );
7677
import zeros = require( '@stdlib/ndarray/zeros' );
7778
import zerosLike = require( '@stdlib/ndarray/zeros-like' );
7879

@@ -1599,6 +1600,27 @@ interface Namespace {
15991600
*/
16001601
ndarray2array: typeof ndarray2array;
16011602

1603+
/**
1604+
* Serializes an ndarray as a JSON object.
1605+
*
1606+
* ## Notes
1607+
*
1608+
* - The function does **not** serialize data outside of the buffer region defined by the ndarray view.
1609+
*
1610+
* @param x - input ndarray
1611+
* @returns JSON object
1612+
*
1613+
* @example
1614+
* var array = require( '@stdlib/ndarray/array' );
1615+
*
1616+
* var x = array( [ [ 1.0, 2.0 ], [ 3.0, 4.0 ] ] );
1617+
* // returns <ndarray>
1618+
*
1619+
* var o = ns.ndarray2json( x );
1620+
* // returns {...}
1621+
*/
1622+
ndarray2json: typeof ndarray2json;
1623+
16021624
/**
16031625
* Creates a zero-filled array having a specified shape and data type.
16041626
*

0 commit comments

Comments
 (0)