TypedPropertyDescriptorMap<T> #40137
Labels
Awaiting More Feedback
This means we'd like to hear from more people who would be helped by this feature
Suggestion
An idea for TypeScript
Search Terms
TypedPropertyDescriptor
TypedPropertyDescriptorMap
Typed Property Descriptor Map
Suggestion
Include
TypedPropertyDescriptorMap<T>
, the typed version ofPropertyDescriptorMap
. The following type should do the trick:This would require a change to the Object.defineProperties type definition since it only accepts a PropertyDescriptorMap type, an indexed type. Passing in an object with a type of
TypedPropertyDescriptorMap<T>
results in the error:Index signature is missing in type 'TypedPropertyDescriptorMap<T>'
. There's a related issue on this topic (#15300).Use Cases
It's a headache to have to define a type like the following when I already have defined the final object type:
Examples
Checklist
My suggestion meets these guidelines:
The text was updated successfully, but these errors were encountered: