mirror of
https://github.com/gosticks/DefinitelyTyped.git
synced 2026-07-01 15:50:13 +00:00
Update types/seamless-immutable/index.d.ts according to suggestions
This commit is contained in:
2
types/seamless-immutable/index.d.ts
vendored
2
types/seamless-immutable/index.d.ts
vendored
@@ -96,7 +96,7 @@ declare namespace SeamlessImmutable {
|
||||
/** New methods added by seamless-immutable. */
|
||||
interface Additions<T> {
|
||||
asMutable(opts?: AsMutableOptions): T[];
|
||||
asObject(toKeyValue: (item: T) => [string, any]): Immutable<object>;
|
||||
asObject<U extends object = {}, K extends keyof U = keyof U>(toKeyValue: (item: T) => [K, U[K]]): Immutable<U>;
|
||||
flatMap<TTarget>(mapFunction: (item: T) => TTarget): Immutable<TTarget extends any[] ? TTarget : TTarget[]>;
|
||||
}
|
||||
|
||||
|
||||
@@ -155,7 +155,10 @@ interface ExtendedUser extends User {
|
||||
);
|
||||
|
||||
// asObject
|
||||
const arrayToObject1: Immutable.Immutable<object> = array.asObject((value) => [value.toString(), value]);
|
||||
interface ArrayToObjectResult {
|
||||
theFirstName: string;
|
||||
}
|
||||
const arrayToObject1: Immutable.Immutable<ArrayToObjectResult> = array.asObject<ArrayToObjectResult>((value) => ['theFirstName', value.firstName]);
|
||||
}
|
||||
|
||||
//
|
||||
|
||||
Reference in New Issue
Block a user