fuzzy-search icon indicating copy to clipboard operation
fuzzy-search copied to clipboard

TS4.1

Open Xample opened this issue 5 years ago • 1 comments

Hi, with typescript 4.1 we can now type path from objects. i.e. generate a string union of path from an object structure.

This would be really helpful to type the array of keypath.

Here is a post on stackoverflow for the same use:

https://stackoverflow.com/questions/64046160/ts4-1-is-there-a-way-to-define-this-property-path-type-that-isnt-excessively-d

enjoy

Xample avatar Nov 27 '20 21:11 Xample

I just gave a try and yes… it looks pretty good

image

I just get a weird error Type instantiation is excessively deep and possibly infinite.

but the POC seems to be functional. Remember, you need TS4.1 or possibly TS4.0 using this long hack

Xample avatar Nov 27 '20 21:11 Xample