@@ -46,7 +46,7 @@ export class ObservableArray<T> extends Observable {
46
46
*/
47
47
public static changeEvent = CHANGE ;
48
48
49
- private _array : Array < any > ;
49
+ private _array : Array < T > ;
50
50
private _addArgs : ChangedData < T > ;
51
51
private _deleteArgs : ChangedData < T > ;
52
52
@@ -184,7 +184,7 @@ export class ObservableArray<T> extends Observable {
184
184
* Appends new elements to an array, and returns the new length of the array.
185
185
* @param item New element of the Array.
186
186
*/
187
- push ( ...args : any ) : number {
187
+ push ( ...args : T [ ] ) : number {
188
188
const length = this . _array . length ;
189
189
const result = this . _array . push ( ...args ) ;
190
190
@@ -253,7 +253,7 @@ export class ObservableArray<T> extends Observable {
253
253
* @param deleteCount The number of elements to remove.
254
254
* @param items Elements to insert into the array in place of the deleted elements.
255
255
*/
256
- splice ( start : number , deleteCount ?: number , ...items : any ) : ObservableArray < T > {
256
+ splice ( start : number , deleteCount ?: number , ...items : T [ ] ) : ObservableArray < T > {
257
257
const length = this . _array . length ;
258
258
const result = arguments . length === 1 ? this . _array . splice ( start ) : this . _array . splice ( start , deleteCount , ...items ) ;
259
259
@@ -284,7 +284,7 @@ export class ObservableArray<T> extends Observable {
284
284
* Inserts new elements at the start of an array.
285
285
* @param items Elements to insert at the start of the Array.
286
286
*/
287
- unshift ( ...args : any ) : number {
287
+ unshift ( ...args : T [ ] ) : number {
288
288
const length = this . _array . length ;
289
289
const result = this . _array . unshift ( ...args ) ;
290
290
@@ -302,7 +302,7 @@ export class ObservableArray<T> extends Observable {
302
302
* @param callbackfn
303
303
* @param thisArg If provided, it will be used as the this value for each invocation of predicate. If it is not provided, undefined is used instead.
304
304
*/
305
- find ( callbackfn : ( value : T , index : number , array : ObservableArray < T > ) => any , thisArg ?: any ) : number {
305
+ find ( callbackfn : ( value : T , index : number , array : ObservableArray < T > ) => any , thisArg ?: any ) : T {
306
306
return this . _array . find ( ( value : T , index : number , array : T [ ] ) => callbackfn ( value , index , this ) , thisArg ) ;
307
307
}
308
308
0 commit comments