Skip to content

Commit 08d72b4

Browse files
committed
fix: improve type declarations
1 parent 12102f1 commit 08d72b4

File tree

2 files changed

+4
-4
lines changed

2 files changed

+4
-4
lines changed

lib/node_modules/@stdlib/ndarray/ind2sub/docs/types/index.d.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -102,7 +102,7 @@ interface Ind2Sub {
102102
* var bool = ( s === out );
103103
* // returns true
104104
*/
105-
assign( shape: ArrayLike<number>, idx: number, options: Options, out: any ): Array<number>;
105+
assign<T = unknown>( shape: ArrayLike<number>, idx: number, options: Options, out: ArrayLike<T> ): ArrayLike<T | number>;
106106

107107
/**
108108
* Converts a linear index to an array of subscripts and assigns results to a provided output array.
@@ -134,7 +134,7 @@ interface Ind2Sub {
134134
* var bool = ( s === out );
135135
* // returns true
136136
*/
137-
assign( shape: ArrayLike<number>, idx: number, out: any ): Array<number>;
137+
assign<T = unknown>( shape: ArrayLike<number>, idx: number, out: ArrayLike<T> ): ArrayLike<T | number>;
138138
}
139139

140140
/**

lib/node_modules/@stdlib/ndarray/ind2sub/docs/types/test.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -109,8 +109,8 @@ import ind2sub = require( './index' );
109109
{
110110
const shape = [ 3, 3, 3 ];
111111
const out = [ 0, 0, 0 ];
112-
ind2sub.assign( shape, 0, out ); // $ExpectType number[]
113-
ind2sub.assign( shape, 0, { 'mode': 'throw' }, out ); // $ExpectType number[]
112+
ind2sub.assign( shape, 0, out ); // $ExpectType ArrayLike<number>
113+
ind2sub.assign( shape, 0, { 'mode': 'throw' }, out ); // $ExpectType ArrayLike<number>
114114
}
115115

116116
// The `assign` method does not compile if provided a first argument which is not an array-like object containing numbers...

0 commit comments

Comments
 (0)