Skip to content
| Marketplace
Sign in
Visual Studio Code>Other>C# to TypeScriptNew to Visual Studio Code? Get it now.
C# to TypeScript

C# to TypeScript

Adrian Wilczyński

|
292,775 installs
| (27) | Free
Convert C# Models, ViewModels and DTOs into their TypeScript equivalents.
Installation
Launch VS Code Quick Open (Ctrl+P), paste the following command, and press enter.
Copied to clipboard
More Info

C# to TypeScript

Checkout other versions:

  • Server-side web app - Azure
  • Client-side web app - GitHub Pages
  • CLI (.NET Core Global Tool) - NuGet, GitHub

Convert C# Models, ViewModels and DTOs into their TypeScript equivalents.

In Action

Conversion Example

Commands

  • "C# to TypeScript (Replace)" - converts content of open document (or it's selected part) and replaces it.
  • "C# to TypeScript (To Clipboard)" (keybinding: Alt + /) - writes converted code to clipboard.
  • "C# to TypeScript (Paste As)" (keybinding: Alt + ., editor context menu) - converts content of clipboard and pastes it.
  • "C# to TypeScript (To File)" (explorer context menu) - converts picked file into new file.

Requirements

  • .NET Core (2.2 or newer)

Configuration

  • Uses VS Code's indentation settings.
  • "csharpToTypeScript.export": true controls exporting.
  • "csharpToTypeScript.convertDatesTo": "string" sets output type for dates. You can pick between string, Date and string | Date.
  • "csharpToTypeScript.convertNullablesTo": "null" sets output type for nullables (int?) to either null or undefined.
  • "csharpToTypeScript.toCamelCase": true toggles field name conversion to camel case.
  • "csharpToTypeScript.removeInterfacePrefix": true controls whether to remove interface prefixes (IType -> Type).
  • "csharpToTypeScript.generateImports": false toggles simple import statements generation.
  • "csharpToTypeScript.quotationMark": "double" sets quotation marks for import statements & identifiers (double or single).
  • "csharpToTypeScript.useKebabCase": false - use kebab case for file names.
  • "csharpToTypeScript.appendModelSuffix": false - append ".model" suffix to file names.

Known limitations / design choices

  • Always outputs interface type.
  • Only includes public, non-static properties & fields - not methods, not private members.
  • Import generation assumes flat output directory structure and file names corresponding to type names (e.g. MyType: myType.ts, my-type.ts, my-type.model.ts).
  • Contact us
  • Jobs
  • Privacy
  • Manage cookies
  • Terms of use
  • Trademarks
© 2025 Microsoft