Skip to content

Type definitions for 'Symbols as WeakMap keys' #52534

Closed
@acutmore

Description

@acutmore

lib Update Request for 'Symbols as WeakMap keys'

Configuration Check

My compilation target is ESNext and my lib is the default.

Missing / Incorrect Definition

Symbols as WeakMap keys went to stage 4 at TC39 yesterday.
The types for WeakMap, WeakSet, WeakRef and FinalizationRegistry can be updated to reflect that symbol is now also allowed alongside the existing object constraint.

Sample Code

new WeakMap<symbol, any>();
new WeakSet<symbol>();
new WeakRef(Symbol());
new FinalizationRegistry(() => {}).register(Symbol());

Documentation Link

https://github.com/tc39/proposal-symbols-as-weakmap-keys

Metadata

Metadata

Assignees

Labels

Domain: lib.d.tsThe issue relates to the different libraries shipped with TypeScriptEffort: CasualGood issue if you're already used to contributing to the codebase. Harder than "good first issue".Fix AvailableA PR has been opened for this issueHelp WantedYou can do this

Type

No type

Projects

No projects

Relationships

None yet

Development

No branches or pull requests

Issue actions