File tree 2 files changed +8
-2
lines changed
lib/node_modules/@stdlib/array/base/zeros2d/docs/types
2 files changed +8
-2
lines changed Original file line number Diff line number Diff line change 21
21
/// <reference types="@stdlib/types"/>
22
22
23
23
import { Collection } from '@stdlib/types/array' ;
24
+ import { Shape2D } from '@stdlib/types/ndarray' ;
25
+
26
+ /**
27
+ * Two-dimensional nested array.
28
+ */
29
+ type Array2D < T > = Array < Array < T > > ;
24
30
25
31
/**
26
32
* Returns a zero-filled two-dimensional nested array.
@@ -32,7 +38,7 @@ import { Collection } from '@stdlib/types/array';
32
38
* var out = zeros2d( [ 1, 3 ] );
33
39
* // returns [ [ 0.0, 0.0, 0.0 ] ]
34
40
*/
35
- declare function zeros2d ( shape : Collection < number > ) : Array < Array < number > > ;
41
+ declare function zeros2d ( shape : Shape2D ) : Array2D < number > ;
36
42
37
43
38
44
// EXPORTS //
Original file line number Diff line number Diff line change @@ -23,7 +23,7 @@ import zeros2d = require( './index' );
23
23
24
24
// The function returns an array of arrays...
25
25
{
26
- zeros2d ( [ 1 , 3 ] ) ; // $ExpectType number[][]
26
+ zeros2d ( [ 1 , 3 ] ) ; // $ExpectType Array2D< number>
27
27
}
28
28
29
29
// The compiler throws an error if the function is provided a first argument which is not an array of numbers...
You can’t perform that action at this time.
0 commit comments