Copilot Tips: TypeScript Types

Bobby Galli
Working Dev’s Hero
2 min readJul 5, 2023

Use Copilot Chat to Generate Interfaces for Objects

GitHub Copilot Tips & Tricks: TypeScript Types

Video 🎥

Check out the following YouTube video to learn how to generate types for arbitrary objects returned by fetch.

Generate TypeScript Types with Copilot Chat

Summary 📝

  1. To use this tip, TypeScript developers need to install the Visual Studio Code Insider’s build and GitHub Copilot Chat and Copilot Nightly.
  2. This tip can be helpful for developers who frequently work with fetch requests and need to generate types for the received objects.
  3. If you have received an object from a fetch request and need to generate types for it, you can copy the object and ask Copilot to generate an interface for it in the chat.
  4. Sometimes, you may receive a message saying that your response was filtered, but if you paste the response in your editor, you will see that it is correct.
  5. Following Working Devs Hero can provide more tips, tricks, and AI news.

Memorable quote: “You can copy the object and ask Copilot to generate an interface for it in the chat.”

In conclusion, TypeScript developers can use this tip to easily generate types for objects received from fetch requests by using the Visual Studio Code Insider’s build and GitHub Copilot Chat and Copilot Nightly. This can save time and improve productivity in their development process.

--

--

Bobby Galli
Working Dev’s Hero

Software developer at BugSplat. Big friendly giant, golf ball whacker guy, goofball, lover of tacos.