Subscribe - It's FREE!!

Stay Connected Here

Stay Updated With Us Here


Typewriter - Automatic TypeScript Template generation from C# classes in Visual Studio

Share with WhatsApp

This post is to introduce "Typewriter", extension for visual studio that generates TypeScript files from C# code files using TypeScript templates.

Using this awesome extension you can create fully typed TypeScript representations of server side API, models, controllers etc. By installing this extension 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.

Just to give an practical intro, below is the example from the Typewriter site.

Suppose, If you add a CustomerModel class like below.

using System;
using System.Collections.Generic;

namespace Demo
    public class CustomerModel
        public int Id { get; set; }
        public string Name { get; set; }
        public ICollection<OrderModel> Orders { get; set; }

then CustomerModel.ts file gets created automatically like below

module App {
    export class CustomerModel {
        public id: number;
        public name: string;
        public orders: OrderModel[];

Isn't this amazing and time saving?

For this you just need to define the template like below .tst file (this file gets used by typewriter to generate the TypeScript code.)

module App { $Classes(*Model)[
    export class $Name { $Properties[
        public $name: $Type;]

Checkout many more other features here.

Do share your opinion in the comment section and don't forget to share this information with your friends using share buttons provided below.

If you enjoyed this post take 5 seconds to share it! Be Socialable. :-)

Share with WhatsApp

Posts To Read Next

Top 10 Visual Studio things which can boost developers coding speed

Visual Studio 2012 provides some coding features by which you can code faster if use them properly. This post will cover top 10 things among them to boost your development speed.

Visual Studio 2008 Shell and TFS integration

Visual Studio 2008 Shell and TFS integration is the problem for all newbies of BIDS and TFS. Here is the solution.

How to call click or any event only once in jQuery

Know how to execute an click event or any event only once for any element in jQuery. Perform action only once and even not required to unbind event.

Assembla - Free and private repository to manage your source code online with SVN subversion hosting

With Assembla you can share source code with others online. Free & Private source code repository with SVN Subversion, Git & Perforce Hosting.

How to select all checkboxes as per range of numbers in jQuery MVC

JQuery code to select all checkboxes as per range provided with select all and deselect all functionality which can be embedded in ASP.NET MVC too. With validations such as invalid range.

Your opinion is valuable for us! Comments, suggetions are welcome.

Submit your Email Id to stay updated with us and get notified with our new posts. It's FREE!
We know this popup is disturbing you!
But We would greatly appreciate if you share us with your friends below!

It will not take more than 2 seconds but will motivate us greatly to write more,share more!