CSharpToTypeScript
A Visual Studio Code extension to convert C# class or properties into a TypeScript interface.
Features
- Convert selected C# properties into TypeScript interface.
- Automatically handle nullable types and comments.
- Format the output using Prettier.
How to Use
- Select C# properties in your editor.
- Open the Command Palette (Ctrl+Shift+P or Cmd+Shift+P on macOS).
- Run the command
Convert C# to TypeScript Interface , use hotkey ctrl+alt+c or right click menu.
- the selected text will be replaced with a TypeScript interface.
Example
public Guid Id { get; set; }
public string? Name { get; set; }
public bool IsActive { get; set; }
```interface
export interface IModule {
id: string;
name?: string;
isActive: boolean;
}
| |