#How to extract the corrent parameter type for a Map?

7 messages · Page 1 of 1 (latest)

proud bisonBOT
#
autumnlight#0

Preview:ts class TMap<Key, Value> implements Map<Key, Value> { #map: Map<Key, Value> constructor( mapConstructor: ConstructorParameters< typeof Map<Key, Value> > ) { this.#map = new Map<Key, Value>( mapConstructor as ConstructorParameters< typeof Map ...

olive pelican
#

ConstructorParameters gives a tuple of the params, but you're using that for a single argument

#

either add [0] in the type, or make the parameter a rest parameter.

#

you won't need the assertion.

pastel marlin
#

kk thx

#

forgot about that somehow

#

woops