typings(Collection): use T in accumulator and initialValue when reducing (#3284)

This brings some consistency with Array#reduce's typings and to reality.
This commit is contained in:
Antonio Román
2019-05-20 20:49:28 +02:00
committed by SpaceEEC
parent abebeac193
commit b3060ea229

2
typings/index.d.ts vendored
View File

@@ -311,7 +311,7 @@ declare module 'discord.js' {
public random(count: number): V[];
public randomKey(): K | undefined;
public randomKey(count: number): K[];
public reduce<T>(fn: (accumulator: any, value: V, key: K, collection: Collection<K, V>) => T, initialValue?: any): T;
public reduce<T>(fn: (accumulator: T, value: V, key: K, collection: Collection<K, V>) => T, initialValue?: T): T;
public some(fn: (value: V, key: K, collection: Collection<K, V>) => boolean, thisArg?: any): boolean;
public sort(compareFunction?: (a: V, b: V, c?: K, d?: K) => number): Collection<K, V>;
public sweep(fn: (value: V, key: K, collection: Collection<K, V>) => boolean, thisArg?: any): number;