vscode extension that generates interface from typescript class
Interface generator is a VSCode Extension which creates an interface definition from a typescript class. Supports import statements, comments, public properties and methods, generics and optional.
Given class:
export class ExtendsOnly<XY, TG extends string> extends ABC implements DEF {
public NumberProperty: number = 2;
OptionalStringProperty?: string;
}
Since interfaces can not implement anything, implements DEF
is omitted.
Generated interface
export interface IExtendsOnly<XY, TG extends string> extends ABC {
NumberProperty: number;
OptionalStringProperty?: string;
}
You can browse and install extensions from within VS Code. Press Ctrl+P
and narrow down the list commands by typing ext install dotup-vscode-interface-generator
.
https://marketplace.visualstudio.com/items?itemName=dotup.dotup-vscode-interface-generator
Ctrl+Shift+P
to see all commands and start typing Generate interface
and hit Enter
.The extension creates a new file in the same folder as the source file.
The new file has the name of the source file prefixed with I
.
Existing files will be overwritten!
Fixes/Features:
Fixes/Features:
Fixes/Features:
Fixes/Features:
Fixes/Features:
Fixes/Features:
TODO:
Enjoy!