Closed
Description
lib Update Request
Configuration Check
My compilation target is es5
and my lib is ["dom", "dom.iterable", "esnext"]
.
(Which I believe does not matter in this context as the definition of freeze
is inside lib.es5.d.ts
solely.)
Missing / Incorrect Definition
Object.freeze
It is defined in a way that in IDEs it is always supposed the input is an array.
Sample Code
Object.freeze<{someKey: 'someValue'}>({/* the problem is with autocomplete here (in IDEs) */});
Documentation Link
https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object/freeze
I believe the overload that forces arrays is defined in this PR:
https://github.com/microsoft/TypeScript/pull/12434/files
And I believe just removing it will suffice (and the user of Object.freeze needs to specify its an array in case its an array)
If it is confirmed, I would be happy to create the PR for it.