Skip to content

Commit 45fbaeb

Browse files
committed
refactor: use Shape4D type
1 parent 0771a1b commit 45fbaeb

File tree

2 files changed

+8
-2
lines changed

2 files changed

+8
-2
lines changed

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

Lines changed: 7 additions & 1 deletion
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 { Shape4D } from '@stdlib/types/ndarray';
25+
26+
/**
27+
* Four-dimensional nested array.
28+
*/
29+
type Array4D<T> = Array<Array<Array<T>>>;
2430

2531
/**
2632
* Returns a filled four-dimensional nested array.
@@ -37,7 +43,7 @@ import { Collection } from '@stdlib/types/array';
3743
* var out = filled4d( 'beep', [ 1, 1, 1, 3 ] );
3844
* // returns [ [ [ [ 'beep', 'beep', 'beep' ] ] ] ]
3945
*/
40-
declare function filled4d<T = unknown>( value: T, shape: Collection<number> ): Array<Array<Array<Array<T>>>>;
46+
declare function filled4d<T = unknown>( value: T, shape: Shape4D ): Array4D<T>;
4147

4248

4349
// EXPORTS //

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ import filled4d = require( './index' );
2323

2424
// The function returns a nested array...
2525
{
26-
filled4d( 0.0, [ 1, 1, 1, 3 ] ); // $ExpectType number[][][][]
26+
filled4d( 0.0, [ 1, 1, 1, 3 ] ); // $ExpectType Array4D<number>
2727
}
2828

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

0 commit comments

Comments
 (0)