Recently introduces keyof operator will work well for typing functions that accept properties directly on target type.
interfaceSome{a: number,b: string}typeoneOfTheSomeKeys=keyofSome// restricts value to "a", "b"What do you think, is it possible in theory to type deeply nested paths, so that for type:
interfaceSome{a: number,b: {c: numberd: {e: number}}}so that it would be possible to restrict possible path values to:
["a"]
["b"]
["b", "c"]
["b", "d"]
["b", "d, "e"]
This actual for such methods like ramda's path:
R.path(['a','b'],{a: {b: 2}});//=> 2R.path(['a','b'],{c: {b: 2}});//=> undefined?
Recently introduces
keyofoperator will work well for typing functions that accept properties directly on target type.What do you think, is it possible in theory to type deeply nested paths, so that for type:
so that it would be possible to restrict possible path values to:
This actual for such methods like ramda's
path:?