For example, in C# and Visual Studio, you can right click on class, and click on an option to extract an interface from a class, which will basically auto-generate all the public methods/properties signatures as an interface. This feature is a pretty handy refactoring when you're trying to make code unit-testable.
Is there a way to do the above using TypeScript and VSCode? It doesn't look like this feature is supported out of the box.
Afaik there is no such thing: https://code.visualstudio.com/docs/typescript/typescript-refactoring
But you could create an extension that parses AST and runs through public functions and creates an interface.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With