Our great sponsors
-
SurveyJS
Open-Source JSON Form Builder to Create Dynamic Forms Right in Your App. With SurveyJS form UI libraries, you can build and style forms in a fully-integrated drag & drop form builder, render them in your JS app, and store form submission data in any backend, inc. PHP, ASP.NET Core, and Node.js.
TypeScript has fantastic type inference capabilities, deriving the return types of functions even when quite complex. Additionally, it has the ability to create a type alias from that derived type using `ReturnType` (which just got a LOT more powerful in 4.7 because it added generics support via instantiation expressions). However, one thing that's always bothered me is that, while the type is derived from the return type, you can't then specify that the function returns that alias. I made a small feature request to add a potential solution:
Expanded types get truncated with `...` in previews. This isn't just a VSCode display bug, but baked into the compiler. You get the same ellipsis when trying to emit the type from the compiler api. See https://github.com/microsoft/vscode/issues/94679 & https://github.com/microsoft/TypeScript/issues/28508
Related posts
- Filtering TypeScript value types
- Scripting with VSCode Tasks and Typescript
- React intellisense alternating between "x={}" and "y", have posted on their github but not getting a fix :(
- Setup a modern Jamstack project using Gatsby, TypeScript, Styled Components, and Contentful!
- Has the unsoundness (will explain in the post) actually become a pitfall in practice?