Skip to content
| Marketplace
Sign in
Visual Studio>Tools>Typewriter
Typewriter

Typewriter

frhagn

|
94,793 installs
| (62) | Free
Typewriter generates TypeScript files from c# code files using TypeScript Templates. This allows you to create fully typed TypeScript representations of server side API that automatically updates when you make changes to your c# code.
Download

Typewriter website | Change log | GitHub | Stack Overflow

Typewriter

Typewriter is a free extension for Visual Studio that generates TypeScript files from c# code files using TypeScript Templates.

This allows you to create fully typed TypeScript representations of server side API, models, controllers, SignalR hubs etc. that automatically updates when you make changes to your c# code.

By doing this you get TypeScript Intellisense and compile-time errors when the client- and server side code differs. This speeds up your development pace and increases the quality of your applications.

Getting started

Step 1: Add a TypeScript Template file (.tst)

Step 2: Add the following code in the template

$Classes(*Model)[ // Find all classes with a name ending with Model  
    class $Name {  
        constructor($Properties[public $name: $Type][, ]) {  
        }  
    }  
]

Step 3: Save the template

Step 4: Add a c# class named TestModel

Step 5: Add the following code to the class

using System;  

namespace TestApplication  
{  
    public class TestModel  
    {  
        public int Id { get; set; }  
        public string Name { get; set; }  
    }  
}

Step 6: Save the class.

Step 7: When the class is saved a new TypeScript class matching the template is added to the project

Custom methods

You can add custom methods to your templates by placing a code block in the template file.

${  
    string LoudName(Class c) => c.Name.ToUpper();  
    string QuietName(Class c)  
    {  
        return c.Name.ToLower();  
    }  
}

$Classes(*Model)[ // Find all classes with a name ending with Model  
    class $LoudName {  
        constructor($Properties[public $name: $Type][, ]) {  
        }  
    }  
]

Lambda filters

You can add custom lambda filter expressions in addition to the simple string based filters.

$Classes(c => c.Attributes.Any(a => a.Name == "Model"))[  
    class $Name {  
        constructor($Properties[public $name: $Type][, ]) {  
        }  
    }  
]
  • Contact us
  • Jobs
  • Privacy
  • Manage cookies
  • Terms of use
  • Trademarks
© 2025 Microsoft