rtfeldman / seamless-immutable

Immutable data structures for JavaScript which are backwards-compatible with normal JS Arrays and Objects.
BSD 3-Clause "New" or "Revised" License
5.37k stars 195 forks source link

Make Typescript typings allow usage of the constructor #200

Open MichaelTontchev opened 7 years ago

MichaelTontchev commented 7 years ago

It seems like the typings at DefinitelyTyped (under @types/seamless-immutable) do not allow usage of the constructor directly, but instead rely on doing Immutable.from(...)

Is there a way to allow us to use the constructor directly? I fiddled around with the type definition file, and I think the issue might be differentiating between the object and array versions of Immutable. That is, the object version shouldn't have the array methods and vice versa.

Has anyone been able to come up with a solution, or do we need to write a wrapper around immutable to differentiate the two classes?