diff --git a/types/seamless-immutable/index.d.ts b/types/seamless-immutable/index.d.ts index 1206034846..ebf546d409 100644 --- a/types/seamless-immutable/index.d.ts +++ b/types/seamless-immutable/index.d.ts @@ -105,7 +105,7 @@ declare namespace SeamlessImmutable { map(mapFuction: (item: T) => TTarget): Immutable; filter(filterFunction: (item: T) => boolean): Immutable; slice(start?: number, end?: number): Immutable; - concat(...arr: T[]): Immutable; + concat(...arr: Array): Immutable; reduce(callbackfn: (previousValue: T, currentValue: T, currentIndex: number, array: T[]) => T): Immutable; reduce(callbackfn: (previousValue: TTarget, currentValue: T, currentIndex: number, array: T[]) => TTarget, initialValue?: TTarget): Immutable; reduceRight(callbackfn: (previousValue: T, currentValue: T, currentIndex: number, array: T[]) => T): Immutable; diff --git a/types/seamless-immutable/seamless-immutable-tests.ts b/types/seamless-immutable/seamless-immutable-tests.ts index 1e54f9eff6..b44dc58543 100644 --- a/types/seamless-immutable/seamless-immutable-tests.ts +++ b/types/seamless-immutable/seamless-immutable-tests.ts @@ -120,7 +120,14 @@ interface ExtendedUser extends User { // concat. Call the mutable array's 'concat' with the same args to ensure compatability. Make sure the output array is immutable. array.asMutable().concat({ firstName: 'Happy', lastName: 'Cat' }); - const concat: Immutable.Immutable = array.concat({ firstName: 'Happy', lastName: 'Cat' }); + const concat: Immutable.Immutable = array + .concat({ firstName: 'Happy', lastName: 'Cat' }, { firstName: 'Silly', lastName: 'Cat' }) + .concat([{firstName: 'saucy', lastName: 'Cat'}], {firstName: 'Fussy', lastName: 'Cat'}) + .concat([ + {firstName: 'Fancy', lastName: 'Cat'}, + {firstName: 'Sassy', lastName: 'Cat'}], + [{firstName: 'Bossy', lastName: 'Cat'} + ]); concat.asMutable(); // reduce. Call the mutable array's 'reduce' with the same function to ensure compatability. Make sure the output array is immutable.