flatten declaration typings

Author: eggersCreated May 23, 2019Updated Jun 17, 2026
Labelstypescript

The TypeScript declarations for flatten say:

Note: `flatten(true)` operates on Collection<any, Collection<K, V>> and
returns Collection<K, V>

Would it make sense to add another typing like this:

typescript
flatten(true): V;

or maybe some additional generics on it like this:

typescript
flatten<K2 = any, V2  = any>(shallow?: boolean): Collection<K2, V2>;

Source: immutable-js/immutable-js