18
18
19
19
/// <reference types="@stdlib/types"/>
20
20
21
- import { Collection } from '@stdlib/types/object ' ;
21
+ import { Collection } from '@stdlib/types/array ' ;
22
22
import dispatch = require( './index' ) ;
23
23
24
24
@@ -32,7 +32,7 @@ import dispatch = require( './index' );
32
32
* @param x - output array
33
33
* @param strideX - `x` stride length
34
34
*/
35
- function addon ( N : number , dtypeX : number , x : Collection , strideX : number ) : void { // tslint:disable-line:max-line-length
35
+ function addon ( N : number , dtypeX : number , x : Collection < number > , strideX : number ) : void {
36
36
let i ;
37
37
if ( dtypeX !== dtypeX ) {
38
38
throw new Error ( 'beep' ) ;
@@ -50,7 +50,7 @@ function addon( N: number, dtypeX: number, x: Collection, strideX: number ): voi
50
50
* @param x - output array
51
51
* @param strideX - `x` stride length
52
52
*/
53
- function fallback ( N : number , dtypeX : any , x : Collection , strideX : number ) : void { // tslint:disable-line:max-line-length
53
+ function fallback ( N : number , dtypeX : any , x : Collection < number > , strideX : number ) : void {
54
54
let i ;
55
55
if ( dtypeX !== dtypeX ) {
56
56
throw new Error ( 'beep' ) ;
@@ -69,7 +69,7 @@ function fallback( N: number, dtypeX: any, x: Collection, strideX: number ): voi
69
69
* @param strideX - `x` stride length
70
70
* @param offsetX - starting `x` index
71
71
*/
72
- function fallbackWithOffsets ( N : number , dtypeX : any , x : Collection , strideX : number , offsetX : number ) : void { // tslint:disable-line:max-line-length
72
+ function fallbackWithOffsets ( N : number , dtypeX : any , x : Collection < number > , strideX : number , offsetX : number ) : void {
73
73
let i ;
74
74
if ( dtypeX !== dtypeX ) {
75
75
throw new Error ( 'beep' ) ;
@@ -84,7 +84,7 @@ function fallbackWithOffsets( N: number, dtypeX: any, x: Collection, strideX: nu
84
84
85
85
// The function returns a dispatch function...
86
86
{
87
- dispatch ( addon , fallback ) ; // $ExpectType Dispatcher
87
+ dispatch ( addon , fallback ) ; // $ExpectType Dispatcher<number>
88
88
}
89
89
90
90
// The compiler throws an error if not provided a first argument which is an add-on function...
@@ -119,7 +119,7 @@ function fallbackWithOffsets( N: number, dtypeX: any, x: Collection, strideX: nu
119
119
120
120
const f = dispatch ( addon , fallback ) ;
121
121
122
- f ( x . length , 'float64' , x , 1 ) ; // $ExpectType Collection
122
+ f ( x . length , 'float64' , x , 1 ) ; // $ExpectType Collection<number>
123
123
}
124
124
125
125
// The compiler throws an error if the returned function is not provided a first argument which is a number...
@@ -169,7 +169,7 @@ function fallbackWithOffsets( N: number, dtypeX: any, x: Collection, strideX: nu
169
169
170
170
// Attached to the main export is an `ndarray` method which returns a dispatch function...
171
171
{
172
- dispatch . ndarray ( addon , fallbackWithOffsets ) ; // $ExpectType DispatcherWithOffsets
172
+ dispatch . ndarray ( addon , fallbackWithOffsets ) ; // $ExpectType DispatcherWithOffsets<number>
173
173
}
174
174
175
175
// The compiler throws an error if the `ndarray` method is not provided a first argument which is an add-on function...
@@ -204,7 +204,7 @@ function fallbackWithOffsets( N: number, dtypeX: any, x: Collection, strideX: nu
204
204
205
205
const f = dispatch . ndarray ( addon , fallbackWithOffsets ) ;
206
206
207
- f ( x . length , 'float64' , x , 1 , 0 ) ; // $ExpectType Collection
207
+ f ( x . length , 'float64' , x , 1 , 0 ) ; // $ExpectType Collection<number>
208
208
}
209
209
210
210
// The compiler throws an error if the returned function is not provided a first argument which is a number...
0 commit comments