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.
"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.
- .NET Core (2.2 or newer)
- Uses VS Code's indentation settings.
"csharpToTypeScript.export": true
controls exporting."csharpToTypeScript.convertDatesTo": "string"
sets output type for dates. You can pick betweenstring
,Date
andstring | Date
."csharpToTypeScript.convertNullablesTo": "null"
sets output type for nullables (int?
) to eithernull
orundefined
."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
orsingle
)."csharpToTypeScript.useKebabCase": false
- use kebab case for file names."csharpToTypeScript.appendModelSuffix": false
- append ".model" suffix to file names.
- 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
).