File tree Expand file tree Collapse file tree 1 file changed +22
-0
lines changed
lib/node_modules/@stdlib/ndarray/docs/types Expand file tree Collapse file tree 1 file changed +22
-0
lines changed Original file line number Diff line number Diff line change @@ -73,6 +73,7 @@ import stride = require( '@stdlib/ndarray/stride' );
73
73
import strides = require( '@stdlib/ndarray/strides' ) ;
74
74
import sub2ind = require( '@stdlib/ndarray/sub2ind' ) ;
75
75
import ndarray2array = require( '@stdlib/ndarray/to-array' ) ;
76
+ import ndarray2json = require( '@stdlib/ndarray/to-json' ) ;
76
77
import zeros = require( '@stdlib/ndarray/zeros' ) ;
77
78
import zerosLike = require( '@stdlib/ndarray/zeros-like' ) ;
78
79
@@ -1599,6 +1600,27 @@ interface Namespace {
1599
1600
*/
1600
1601
ndarray2array : typeof ndarray2array ;
1601
1602
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
+
1602
1624
/**
1603
1625
* Creates a zero-filled array having a specified shape and data type.
1604
1626
*
You can’t perform that action at this time.
0 commit comments