Infer type of object values in array
Can someone help me get this straight I want to infer all possible types of Value from T and get an array of object type with all possible options
https://www.typescriptlang.org/play?#code/JYWwDg9gTgLgBAJQKYEMDG8BmUIjgIilQ3wChSYBPMJOAQSihUoHlMAFHG2SgHgBUAfHDgBeOAG9SI4ABMAXHADOMKMAB2Ac2lwqNRQHIANhDQoYwCOoNwAPnAMrzAVyU37B10ihu7DzMBGSPzUSAY60LLeiurOIABG3joAbihGzkiK-KQAvuQaMN6Y6LScEGBKAsJSIiAo6iiaSLJl3BZISooMTKwcXN5UVQDaALq55BShcADKMC5KYpI6RiiJRooqalo6YGrQwFQxcYlQOsBKdEbAyZlw8RAQQfXjpGhWKspzMK5wirPz4hqcBWa0U+AAFsB8AAaHZ7NSHOAARlhMguVxuilUGRer3e8DqDSaLX6sGAHVEQx0IiBIjpcDkhic3zcqPpdL0t0cX1cNhQCze6hUbPZcEi0WRIvZqXSt3wmw0mhhAHplXBeABaXTgjq0N7OIyyO60FBwNBEczNXRTdQQeDqJBoDpKFBqIyUOCm3agA7XJDQ5QQBn2pDNBYwIOJBnqTDeK3YXBwbL0nJS2nsxkOLw+AxS+mcwzZ3z8s34vN08VQRQAJnLIhlGSxUAyAdV6q1MB1Sj1EANRqjpvNqEKRs5cFtIadShdbo9XrUIF9Nzg1LgqdX6ZkCiz3Zz5YLBGZrnwnoFZdXIkrigAzOWG7cjws27w4Bq31qrgBrWid85ih2rnkYwTIKHwAMK4JADrqPA4gCNCggABStJ0cAoVUACUYjVKuoHwBIhKNM0rQDOSSg5IsKG4e8jxIAAdCYmiIZyECYHAhHEiRZIdBhq5EN8UDqOqgi8MqggvG2YH1HAACScBNPA3TMGwXGDAqWh+PctHSfY-wsoIoykLwEHgFYSAwex9RESS5SkRSBFWZxpLtORcBiaQbaiiIAB6AD8QA
TS Playground - An online editor for exploring TypeScript and JavaS...
The Playground lets you write TypeScript or JavaScript online in a safe and sharable way.
3 Replies
Question is in comment at the bottom
is this what your looking for?
Yeah I went this way but it was more complicated ended up doing this , its safe but unsafe but works 🙂 :
the former didn't understand that my array of managedProperties could have multple values of different type it would always match the first one
I have some playground if ever you want them