Skip to content

Commit 7cc8804

Browse files
committed
Auto-generated commit
1 parent 0ec1cf6 commit 7cc8804

File tree

20 files changed

+81
-36
lines changed

20 files changed

+81
-36
lines changed

base/filled5d-by/docs/types/index.d.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,7 @@ type Unary<T, V> = ( this: V, indices: Array<number> ) => T;
4747
type Callback<T, V> = Nullary<T, V> | Unary<T, V>;
4848

4949
/**
50-
* Five-dimensional array.
50+
* Five-dimensional nested array.
5151
*/
5252
type Array5D<T> = Array<Array<Array<Array<Array<T>>>>>;
5353

base/fillednd/docs/types/index.d.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -305,7 +305,7 @@ declare function fillednd<T = unknown>( value: T, shape: Shape10D ): Array10D<T>
305305
* var out = fillednd( 'beep', [ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 3 ] );
306306
* // returns [ [ [ [ [ [ [ [ [ [ [ 'beep', 'beep', 'beep' ] ] ] ] ] ] ] ] ] ]
307307
*/
308-
declare function fillednd( value: any, shape: Shape ): Array<any>;
308+
declare function fillednd<T = unknown, U = unknown>( value: T, shape: Shape ): Array<U>; // tslint:disable-line:no-unnecessary-generics
309309

310310

311311
// EXPORTS //

base/ones2d/docs/types/index.d.ts

+8-2
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,13 @@
2020

2121
/// <reference types="@stdlib/types"/>
2222

23-
import { Collection, Array2D } from '@stdlib/types/array';
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>>;
2430

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

3743

3844
// EXPORTS //

base/ones3d/docs/types/index.d.ts

+8-2
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,13 @@
2020

2121
/// <reference types="@stdlib/types"/>
2222

23-
import { Collection, Array3D } from '@stdlib/types/array';
23+
import { Collection } from '@stdlib/types/array';
24+
import { Shape3D } from '@stdlib/types/ndarray';
25+
26+
/**
27+
* Three-dimensional nested array.
28+
*/
29+
type Array3D<T> = Array<Array<Array<T>>>;
2430

2531
/**
2632
* Returns a three-dimensional nested array filled with ones.
@@ -32,7 +38,7 @@ import { Collection, Array3D } from '@stdlib/types/array';
3238
* var out = ones3d( [ 1, 1, 3 ] );
3339
* // returns [ [ [ 1.0, 1.0, 1.0 ] ] ]
3440
*/
35-
declare function ones3d( shape: Collection<number> ): Array3D<number>;
41+
declare function ones3d( shape: Shape3D ): Array3D<number>;
3642

3743

3844
// EXPORTS //

base/ones4d/docs/types/index.d.ts

+8-2
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,13 @@
2020

2121
/// <reference types="@stdlib/types"/>
2222

23-
import { Collection, Array4D } from '@stdlib/types/array';
23+
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<Array<T>>>>;
2430

2531
/**
2632
* Returns a four-dimensional nested array filled with ones.
@@ -32,7 +38,7 @@ import { Collection, Array4D } from '@stdlib/types/array';
3238
* var out = ones4d( [ 1, 1, 1, 3 ] );
3339
* // returns [ [ [ [ 1.0, 1.0, 1.0 ] ] ] ]
3440
*/
35-
declare function ones4d( shape: Collection<number> ): Array4D<number>;
41+
declare function ones4d( shape: Shape4D ): Array4D<number>;
3642

3743

3844
// EXPORTS //

base/ones5d/docs/types/index.d.ts

+8-2
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,13 @@
2020

2121
/// <reference types="@stdlib/types"/>
2222

23-
import { Collection, Array5D } from '@stdlib/types/array';
23+
import { Collection } from '@stdlib/types/array';
24+
import { Shape5D } from '@stdlib/types/ndarray';
25+
26+
/**
27+
* Five-dimensional nested array.
28+
*/
29+
type Array5D<T> = Array<Array<Array<Array<Array<T>>>>>;
2430

2531
/**
2632
* Returns a five-dimensional nested array filled with ones.
@@ -32,7 +38,7 @@ import { Collection, Array5D } from '@stdlib/types/array';
3238
* var out = ones5d( [ 1, 1, 1, 1, 3 ] );
3339
* // returns [ [ [ [ [ 1.0, 1.0, 1.0 ] ] ] ] ]
3440
*/
35-
declare function ones5d( shape: Collection<number> ): Array5D<number>;
41+
declare function ones5d( shape: Shape5D ): Array5D<number>;
3642

3743

3844
// EXPORTS //

base/onesnd/docs/types/index.d.ts

+2-4
Original file line numberDiff line numberDiff line change
@@ -22,12 +22,10 @@
2222

2323
import { Collection } from '@stdlib/types/array';
2424

25-
// FIXME: shapes should be collections of a defined length
26-
2725
/**
2826
* One-dimensional array.
2927
*/
30-
type Array1D<T> = Collection<T>;
28+
type Array1D<T> = Array<T>;
3129

3230
/**
3331
* One-dimensional array shape.
@@ -252,7 +250,7 @@ declare function onesnd( shape: Shape10D ): Array10D<number>;
252250
* var out = onesnd( [ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 3 ] );
253251
* // returns [ [ [ [ [ [ [ [ [ [ [ 1.0, 1.0, 1.0 ] ] ] ] ] ] ] ] ] ]
254252
*/
255-
declare function onesnd( shape: Collection<number> ): Array<any>;
253+
declare function onesnd<T = unknown>( shape: Collection<number> ): Array<T>; // tslint:disable-line:no-unnecessary-generics
256254

257255

258256
// EXPORTS //

base/setter/docs/types/index.d.ts

+2-2
Original file line numberDiff line numberDiff line change
@@ -307,7 +307,7 @@ declare function setter( dtype: 'uint8c' ): SetUint8c;
307307
* var v = arr[ 2 ];
308308
* // returns 3
309309
*/
310-
declare function setter( dtype: 'generic' ): SetGeneric<any>;
310+
declare function setter<T = unknown>( dtype: 'generic' ): SetGeneric<T>; // tslint:disable-line:no-unnecessary-generics
311311

312312
/**
313313
* Returns an accessor function for setting an element in an indexed array-like object.
@@ -326,7 +326,7 @@ declare function setter( dtype: 'generic' ): SetGeneric<any>;
326326
* var v = arr[ 2 ];
327327
* // returns 3
328328
*/
329-
declare function setter( dtype: string ): SetArrayLike<any>;
329+
declare function setter<T = unknown>( dtype: string ): SetArrayLike<T>; // tslint:disable-line:no-unnecessary-generics
330330

331331

332332
// EXPORTS //

base/setter/docs/types/test.ts

+4-4
Original file line numberDiff line numberDiff line change
@@ -32,8 +32,8 @@ import setter = require( './index' );
3232
setter( 'uint16' ); // $ExpectType SetUint16
3333
setter( 'uint8' ); // $ExpectType SetUint8
3434
setter( 'uint8c' ); // $ExpectType SetUint8c
35-
setter( 'generic' ); // $ExpectType SetGeneric<any>
36-
setter( 'foo' ); // $ExpectType SetArrayLike<any>
35+
setter<number>( 'generic' ); // $ExpectType SetGeneric<number>
36+
setter( 'foo' ); // $ExpectType SetArrayLike<unknown>
3737
}
3838

3939
// The compiler throws an error if the function is provided a first argument which is not a string...
@@ -55,7 +55,7 @@ import setter = require( './index' );
5555

5656
// The function returns a function which sets an array element...
5757
{
58-
const set1 = setter( 'generic' );
58+
const set1 = setter<number>( 'generic' );
5959
const x1 = [ 1, 2, 3, 4 ];
6060
set1( x1, 2, 3 ); // $ExpectType void
6161

@@ -95,7 +95,7 @@ import setter = require( './index' );
9595
const x10 = new Uint8ClampedArray( [ 1, 2, 3, 4 ] );
9696
set10( x10, 2, 3 ); // $ExpectType void
9797

98-
const set11 = setter( 'foo' );
98+
const set11 = setter<number>( 'foo' );
9999
const x11 = [ 1, 2, 3, 4 ];
100100
set11( x11, 2, 3 ); // $ExpectType void
101101
}

base/take/docs/types/index.d.ts

+2-2
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@
2020

2121
/// <reference types="@stdlib/types"/>
2222

23-
import { ArrayLike } from '@stdlib/types/array';
23+
import { Collection } from '@stdlib/types/array';
2424

2525
/**
2626
* Takes element from an array.
@@ -39,7 +39,7 @@ import { ArrayLike } from '@stdlib/types/array';
3939
* var y = take( x, [ 1, 3 ] );
4040
* // returns [ 2, 4 ]
4141
*/
42-
declare function take<T>( x: ArrayLike<T>, indices: ArrayLike<number> ): Array<T>; // tslint:disable-line:max-line-length
42+
declare function take<T>( x: Collection<T>, indices: Collection<number> ): Array<T>;
4343

4444

4545
// EXPORTS //

base/to-accessor-array/docs/types/index.d.ts

+2-2
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@
2020

2121
/// <reference types="@stdlib/types"/>
2222

23-
import { ArrayLike, AccessorArrayLike } from '@stdlib/types/array';
23+
import { Collection, AccessorArrayLike } from '@stdlib/types/array';
2424

2525
/**
2626
* Converts an array-like object to a minimal array-like object supporting the accessor protocol.
@@ -45,7 +45,7 @@ import { ArrayLike, AccessorArrayLike } from '@stdlib/types/array';
4545
* var arr = toAccessorArray( new Complex128Array( 10 ) );
4646
* // returns <Complex128Array>
4747
*/
48-
declare function toAccessorArray<T>( arr: ArrayLike<T> ): AccessorArrayLike<T>;
48+
declare function toAccessorArray<T>( arr: Collection<T> ): AccessorArrayLike<T>;
4949

5050

5151
// EXPORTS //

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 //

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...

base/zeros3d/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 { Shape3D } from '@stdlib/types/ndarray';
25+
26+
/**
27+
* Three-dimensional nested array.
28+
*/
29+
type Array3D<T> = Array<Array<Array<T>>>;
2430

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

3743

3844
// EXPORTS //

base/zeros3d/docs/types/test.ts

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

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

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

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

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

3743

3844
// EXPORTS //

base/zeros4d/docs/types/test.ts

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

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

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

base/zeros5d/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 { Shape5D } from '@stdlib/types/ndarray';
25+
26+
/**
27+
* Five-dimensional nested array.
28+
*/
29+
type Array5D<T> = Array<Array<Array<Array<Array<T>>>>>;
2430

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

3743

3844
// EXPORTS //

base/zeros5d/docs/types/test.ts

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

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

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

base/zerosnd/docs/types/index.d.ts

+3-4
Original file line numberDiff line numberDiff line change
@@ -21,13 +21,12 @@
2121
/// <reference types="@stdlib/types"/>
2222

2323
import { Collection } from '@stdlib/types/array';
24-
25-
// FIXME: shapes should be collections of a defined length
24+
import { Shape } from '@stdlib/types/ndarray';
2625

2726
/**
2827
* One-dimensional array.
2928
*/
30-
type Array1D<T> = Collection<T>;
29+
type Array1D<T> = Array<T>;
3130

3231
/**
3332
* One-dimensional array shape.
@@ -252,7 +251,7 @@ declare function zerosnd( shape: Shape10D ): Array10D<number>;
252251
* var out = zerosnd( [ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 3 ] );
253252
* // returns [ [ [ [ [ [ [ [ [ [ [ 0.0, 0.0, 0.0 ] ] ] ] ] ] ] ] ] ]
254253
*/
255-
declare function zerosnd( shape: Collection<number> ): Array<any>;
254+
declare function zerosnd<T = unknown>( shape: Shape ): Array<T>; // tslint:disable-line:no-unnecessary-generics
256255

257256

258257
// EXPORTS //

0 commit comments

Comments
 (0)