16
16
* limitations under the License.
17
17
*/
18
18
19
- // TypeScript Version: 2.0
19
+ // TypeScript Version: 4.1
20
20
21
21
/// <reference types="@stdlib/types"/>
22
22
@@ -130,7 +130,7 @@ type GetComplex64 = ( arr: Complex64Array, idx: number ) => Complex64 | void;
130
130
* @param idx - element index
131
131
* @returns element value
132
132
*/
133
- type GetGeneric = ( arr : Array < any > , idx : number ) => any ;
133
+ type GetGeneric < T > = ( arr : Array < T > , idx : number ) => T ;
134
134
135
135
/**
136
136
* Returns an element from an indexed array-like object.
@@ -139,7 +139,7 @@ type GetGeneric = ( arr: Array<any>, idx: number ) => any;
139
139
* @param idx - element index
140
140
* @returns element value
141
141
*/
142
- type GetIndexedArrayLike = ( arr : Collection , idx : number ) => any ;
142
+ type GetIndexedArrayLike < T > = ( arr : Collection < T > , idx : number ) => T ;
143
143
144
144
/**
145
145
* Returns an element from an array-like object supporting the get/set protocol.
@@ -148,7 +148,7 @@ type GetIndexedArrayLike = ( arr: Collection, idx: number ) => any;
148
148
* @param idx - element index
149
149
* @returns element value
150
150
*/
151
- type GetAccessorArrayLike = ( arr : AccessorArrayLike < any > , idx : number ) => any ;
151
+ type GetAccessorArrayLike < T > = ( arr : AccessorArrayLike < T > , idx : number ) => T ;
152
152
153
153
/**
154
154
* Sets an element in a `Float64Array`.
@@ -256,7 +256,7 @@ type SetComplex64 = ( arr: Complex64Array, idx: number, value: ComplexLike ) =>
256
256
* @param idx - element index
257
257
* @param value - value to set
258
258
*/
259
- type SetGeneric = ( arr : Array < any > , idx : number , value : any ) => void ;
259
+ type SetGeneric < T > = ( arr : Array < T > , idx : number , value : T ) => void ;
260
260
261
261
/**
262
262
* Sets an element in an indexed array-like object.
@@ -265,7 +265,7 @@ type SetGeneric = ( arr: Array<any>, idx: number, value: any ) => void;
265
265
* @param idx - element index
266
266
* @param value - value to set
267
267
*/
268
- type SetIndexedArrayLike = ( arr : Collection , idx : number , value : any ) => void ;
268
+ type SetIndexedArrayLike < T > = ( arr : Collection < T > , idx : number , value : T ) => void ; // tslint:disable-line:max-line-length
269
269
270
270
/**
271
271
* Sets an element in an array-like object supporting the get/set protocol.
@@ -274,7 +274,7 @@ type SetIndexedArrayLike = ( arr: Collection, idx: number, value: any ) => void;
274
274
* @param idx - element index
275
275
* @param value - value to set
276
276
*/
277
- type SetAccessorArrayLike = ( arr : AccessorArrayLike < any > , idx : number , value : any ) => void ; // tslint:disable-line:max-line-length
277
+ type SetAccessorArrayLike < T > = ( arr : AccessorArrayLike < T > , idx : number , value : T ) => void ; // tslint:disable-line:max-line-length
278
278
279
279
/**
280
280
* Interface describing the output object for a `Float64Array`.
@@ -444,7 +444,7 @@ interface Complex64AccessorObject {
444
444
/**
445
445
* Interface describing the output object for a "generic" array not supporting the get/set protocol.
446
446
*/
447
- interface GenericAccessorObject {
447
+ interface GenericAccessorObject < T > {
448
448
/**
449
449
* Boolean indicating whether the provided array-like object supports the get/set protocol (i.e., uses accessors for getting and setting elements).
450
450
*/
@@ -453,13 +453,13 @@ interface GenericAccessorObject {
453
453
/**
454
454
* Two-element array whose first element is an accessor for retrieving an array element and whose second element is an accessor for setting an array element.
455
455
*/
456
- accessors : [ GetGeneric , SetGeneric ] ;
456
+ accessors : [ GetGeneric < T > , SetGeneric < T > ] ;
457
457
}
458
458
459
459
/**
460
460
* Interface describing the output object for an indexed array-like object.
461
461
*/
462
- interface IndexedAccessorObject {
462
+ interface IndexedAccessorObject < T > {
463
463
/**
464
464
* Boolean indicating whether the provided array-like object supports the get/set protocol (i.e., uses accessors for getting and setting elements).
465
465
*/
@@ -468,13 +468,13 @@ interface IndexedAccessorObject {
468
468
/**
469
469
* Two-element array whose first element is an accessor for retrieving an array element and whose second element is an accessor for setting an array element.
470
470
*/
471
- accessors : [ GetIndexedArrayLike , SetIndexedArrayLike ] ;
471
+ accessors : [ GetIndexedArrayLike < T > , SetIndexedArrayLike < T > ] ;
472
472
}
473
473
474
474
/**
475
475
* Interface describing the output object for an array-like object supporting the get/set protocol.
476
476
*/
477
- interface GetSetAccessorObject {
477
+ interface GetSetAccessorObject < T > {
478
478
/**
479
479
* Boolean indicating whether the provided array-like object supports the get/set protocol (i.e., uses accessors for getting and setting elements).
480
480
*/
@@ -483,7 +483,7 @@ interface GetSetAccessorObject {
483
483
/**
484
484
* Two-element array whose first element is an accessor for retrieving an array element and whose second element is an accessor for setting an array element.
485
485
*/
486
- accessors : [ GetAccessorArrayLike , SetAccessorArrayLike ] ;
486
+ accessors : [ GetAccessorArrayLike < T > , SetAccessorArrayLike < T > ] ;
487
487
}
488
488
489
489
/**
@@ -830,7 +830,7 @@ declare function accessors( x: Complex64Array ): Complex64AccessorObject;
830
830
* var v = fcns[ 0 ]( x, 2 );
831
831
* // returns 3
832
832
*/
833
- declare function accessors ( x : AccessorArrayLike < any > ) : GetSetAccessorObject ;
833
+ declare function accessors < T = any > ( x : AccessorArrayLike < T > ) : GetSetAccessorObject < T > ; // tslint:disable-line:max-line-length
834
834
835
835
/**
836
836
* Returns element accessors for a provided "generic" array.
@@ -856,7 +856,7 @@ declare function accessors( x: AccessorArrayLike<any> ): GetSetAccessorObject;
856
856
* var v = fcns[ 0 ]( x, 2 );
857
857
* // returns 3
858
858
*/
859
- declare function accessors ( x : Array < any > ) : GenericAccessorObject ;
859
+ declare function accessors < T = any > ( x : Array < T > ) : GenericAccessorObject < T > ;
860
860
861
861
/**
862
862
* Returns element accessors for a provided array-like object.
@@ -888,7 +888,7 @@ declare function accessors( x: Array<any> ): GenericAccessorObject;
888
888
* var v = fcns[ 0 ]( x, 2 );
889
889
* // returns 3
890
890
*/
891
- declare function accessors ( x : Collection ) : IndexedAccessorObject ;
891
+ declare function accessors < T = any > ( x : Collection < T > ) : IndexedAccessorObject < T > ; // tslint:disable-line:max-line-length
892
892
893
893
894
894
// EXPORTS //
0 commit comments