I’ve been beating my head against a wall trying to get the returned type of a callback to propagate through a recursively called generic function. I’m trying to chain callbacks together to act on objects with similar types but some differing methods and properties, so getting the typing going is a must as this is going in a library. The code itself runs exactly as intended when the types are stripped out, so I know I’m on the right track.
The Playground lets you write TypeScript or JavaScript online in a safe and sharable way.