Skip to content

Commit a6ad617

Browse files
committed
refactor: use predefined types
1 parent f8f5362 commit a6ad617

File tree

2 files changed

+8
-2
lines changed

2 files changed

+8
-2
lines changed

lib/node_modules/@stdlib/array/base/zeros2d/docs/types/index.d.ts

+7-1
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,12 @@
2121
/// <reference types="@stdlib/types"/>
2222

2323
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>>;
2430

2531
/**
2632
* Returns a zero-filled two-dimensional nested array.
@@ -32,7 +38,7 @@ import { Collection } from '@stdlib/types/array';
3238
* var out = zeros2d( [ 1, 3 ] );
3339
* // returns [ [ 0.0, 0.0, 0.0 ] ]
3440
*/
35-
declare function zeros2d( shape: Collection<number> ): Array<Array<number>>;
41+
declare function zeros2d( shape: Shape2D ): Array2D<number>;
3642

3743

3844
// EXPORTS //

lib/node_modules/@stdlib/array/base/zeros2d/docs/types/test.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ import zeros2d = require( './index' );
2323

2424
// The function returns an array of arrays...
2525
{
26-
zeros2d( [ 1, 3 ] ); // $ExpectType number[][]
26+
zeros2d( [ 1, 3 ] ); // $ExpectType Array2D<number>
2727
}
2828

2929
// The compiler throws an error if the function is provided a first argument which is not an array of numbers...

0 commit comments

Comments
 (0)