diff --git a/types/seamless-immutable/index.d.ts b/types/seamless-immutable/index.d.ts index f5d3a2c3a3..1990dff0ab 100644 --- a/types/seamless-immutable/index.d.ts +++ b/types/seamless-immutable/index.d.ts @@ -96,7 +96,7 @@ declare namespace SeamlessImmutable { /** New methods added by seamless-immutable. */ interface Additions { asMutable(opts?: AsMutableOptions): T[]; - asObject(toKeyValue: (item: T) => [string, any]): Immutable; + asObject(toKeyValue: (item: T) => [K, U[K]]): Immutable; flatMap(mapFunction: (item: T) => TTarget): Immutable; } diff --git a/types/seamless-immutable/seamless-immutable-tests.ts b/types/seamless-immutable/seamless-immutable-tests.ts index 5b1a33d0bb..1e54f9eff6 100644 --- a/types/seamless-immutable/seamless-immutable-tests.ts +++ b/types/seamless-immutable/seamless-immutable-tests.ts @@ -155,7 +155,10 @@ interface ExtendedUser extends User { ); // asObject - const arrayToObject1: Immutable.Immutable = array.asObject((value) => [value.toString(), value]); + interface ArrayToObjectResult { + theFirstName: string; + } + const arrayToObject1: Immutable.Immutable = array.asObject((value) => ['theFirstName', value.firstName]); } //