20
20
21
21
/// <reference types="@stdlib/types"/>
22
22
23
- import { Collection } from '@stdlib/types/object ' ;
23
+ import { Collection } from '@stdlib/types/array ' ;
24
24
25
25
/**
26
26
* Checks whether an element in a collection passes a test.
@@ -54,7 +54,7 @@ type BinaryPredicate<T> = ( value: T, index: number ) => boolean;
54
54
* @param collection - input collection
55
55
* @returns boolean indicating whether an element in a collection passes a test
56
56
*/
57
- type TernaryPredicate < T > = ( value : T , index : number , collection : Collection < T > ) => boolean ; // tslint-disable-line max-line-length
57
+ type TernaryPredicate < T > = ( value : T , index : number , collection : Collection < T > ) => boolean ;
58
58
59
59
/**
60
60
* Checks whether an element in a collection passes a test.
@@ -64,7 +64,7 @@ type TernaryPredicate<T> = ( value: T, index: number, collection: Collection<T>
64
64
* @param collection - input collection
65
65
* @returns boolean indicating whether an element in a collection passes a test
66
66
*/
67
- type Predicate < T > = NullaryPredicate | UnaryPredicate < T > | BinaryPredicate < T > | TernaryPredicate < T > ; // tslint-disable-line max-line-length
67
+ type Predicate < T > = NullaryPredicate | UnaryPredicate < T > | BinaryPredicate < T > | TernaryPredicate < T > ;
68
68
69
69
/**
70
70
* Function invoked for each collection element passing a test.
@@ -93,7 +93,7 @@ type Binary<T> = ( value: T, index: number ) => void;
93
93
* @param index - collection index
94
94
* @param collection - input collection
95
95
*/
96
- type Ternary < T > = ( value : T , index : number , collection : Collection < T > ) => void ; // tslint-disable-line max-line-length
96
+ type Ternary < T > = ( value : T , index : number , collection : Collection < T > ) => void ;
97
97
98
98
/**
99
99
* Function invoked for each collection element passing a test.
@@ -117,7 +117,6 @@ type Callback<T> = Nullary | Unary<T> | Binary<T> | Ternary<T>;
117
117
*
118
118
* - For dynamic array resizing, the only behavior made intentionally consistent with `whileEach` (iterating from left to right) is when elements are pushed onto the beginning (end) of an array. In other words, for `whileEach()`, `[].push()` behavior is consistent with `whileEachRight()` `[].unshift()` behavior.
119
119
*
120
- *
121
120
* @param collection - input collection
122
121
* @param predicate - function which indicates whether to continue iterating over a collection
123
122
* @param fcn - function to invoke
@@ -137,7 +136,7 @@ type Callback<T> = Nullary | Unary<T> | Binary<T> | Ternary<T>;
137
136
*
138
137
* whileEachRight( arr, predicate, log );
139
138
*/
140
- declare function whileEachRight < T = any > ( collection : Collection < T > , predicate : Predicate < T > , fcn : Callback < T > , thisArg ?: any ) : Collection < T > ; // tslint-disable-line max-line-length
139
+ declare function whileEachRight < T = unknown > ( collection : Collection < T > , predicate : Predicate < T > , fcn : Callback < T > , thisArg ?: ThisParameterType < Callback < T > > ) : Collection < T > ;
141
140
142
141
143
142
// EXPORTS //
0 commit comments