|
20 | 20 |
|
21 | 21 | /// <reference types="@stdlib/types"/>
|
22 | 22 |
|
23 |
| -import { Collection } from '@stdlib/types/array'; |
24 |
| - |
25 |
| -/** |
26 |
| -* Two-dimensional nested array. |
27 |
| -*/ |
28 |
| -type Array2D<T> = Array<Collection<T>>; |
| 23 | +import { Collection, Array2D } from '@stdlib/types/array'; |
| 24 | +import { Shape2D } from '@stdlib/types/ndarray'; |
29 | 25 |
|
30 | 26 | /**
|
31 | 27 | * Interface describing `flatten2d`.
|
@@ -55,7 +51,7 @@ interface Flatten2d {
|
55 | 51 | * var out = flatten2d( x, [ 2, 2 ], true );
|
56 | 52 | * // returns [ 1, 3, 2, 4 ]
|
57 | 53 | */
|
58 |
| - <T = unknown>( x: Array2D<T>, shape: Collection<number>, colexicographic: boolean ): Array<T>; |
| 54 | + <T = unknown>( x: Array2D<T>, shape: Shape2D, colexicographic: boolean ): Array<T>; |
59 | 55 |
|
60 | 56 | /**
|
61 | 57 | * Flattens a two-dimensional nested array and assigns elements to a provided output array.
|
@@ -88,7 +84,7 @@ interface Flatten2d {
|
88 | 84 | * var out = flatten2d.assign( x, [ 2, 2 ], true, new Float64Array( 4 ), 1, 0 );
|
89 | 85 | * // returns <Float64Array>[ 1, 3, 2, 4 ]
|
90 | 86 | */
|
91 |
| - assign<T = unknown, U = unknown>( x: Array2D<T>, shape: Collection<number>, colexicographic: boolean, out: Collection<U>, stride: number, offset: number ): Collection<T | U>; |
| 87 | + assign<T = unknown, U = unknown>( x: Array2D<T>, shape: Shape2D, colexicographic: boolean, out: Collection<U>, stride: number, offset: number ): Collection<T | U>; |
92 | 88 | }
|
93 | 89 |
|
94 | 90 | /**
|
|
0 commit comments