Practical TypeScript

Creating Type-Safe Structures (and Dictionaries) with Tuples

When classes are more structure than you need, tuples let you specify simple type-safe aggregates of other data types. They'll also let you create a dictionary collection…but it won't be type-safe.

Exploiting TypeScript Arrays

TypeScript doesn't have the rich set of native collection classes that you're used to in the .NET Framework -- instead, it has just arrays and tuples. Fortunately, you can do quite a lot with them.

Exploiting Generics in TypeScript

Generic classes and functions are one way to create flexible, reusable classes and functions. But before you start creating your own generic functions, you should be clear on when they’re your best choice.

Overloading TypeScript Functions

TypeScript has some "interesting" limitations when it comes to overloading functions. But it also offers you some options when you need more flexibility in declaring functions, including both optional parameters and infinite parameter lists.

Implementing Strategy Pattern and Callbacks in TypeScript

The TypeScript datatyping support not only applies to simple variables, it also supports you when doing clever things with functions. Specifically, TypeScript ensures you create reliable code when implementing callback functions.

Managing Functions in TypeScript

Functions in TypeScript aren't handled the way you'd expect, based on any other language (including JavaScript). Fortunately, because of the way TypeScript handles functions, you're protected from a common JavaScript error (in addition to getting better IntelliSense support and compile-time checking, of course).

Integrating Updates, Deletes and Inserts with TypeScript and ASP.NET MVC

Peter returns to his AJAX-enabled ASP.NET MVC application to show how Partial Views and TypeScript work together to simplify delivering a Single-page application.

Simplifying Single-Page Applications with ASP.NET MVC Partial Views

Partial Views can make creating Single-Page Applications dramatically easier by better achieving the goals of the MVC design pattern. Here, in TypeScript, is how to leverage Partial Pages to create an AJAX-enabled application in ASP.NET MVC.

Even Better Data Typing with TypeScript 1.4

In TypeScript 1.4, you get type-safe support even when you may be working with multiple types, better type checking when inferring types and aliases for type definitions.

TypeScript Futures

Now that Google is adopting TypeScript as the development tool for Angular 2, TypeScript 1.5 is going to gain some functionality driven by features in Google AtScript. But there's more in the next version of TypeScript than just AtScript features.

Managing Asynchronous Processes in TypeScript

Promises not only provides a simple, flexible interface for assembling chains of asynchronous operations in client-side code, it also makes it easier for you to manage parallel processing.

Asynchronous Processing with TypeScript and Generic Promises

Promises make asynchronous processing simple, consistent and easy to use. And, with TypeScript and Promises.TypeScript providing support for generic Promises, you get both type safety and IntelliSense support.

DataTyping in TypeScript

The TypeScript approach to data typing is different than what you're used to with server-side languages. This allows the language to integrate with other JavaScript libraries, but the results can surprise you.

Supporting Updates and Deletes with Backbone and TypeScript

Peter finishes off his series on creating single-page applications by showing how jQuery integrates with Backbone to support updates and deletes (also: how to convert a string to a number in TypeScript).

Integrating JavaScript with TypeScript (and Backbone and Knockout)

Peter looks at how to call a JavaScript function from your TypeScript code and do it in a type-safe way. Along the way, he dramatically simplifies a Backbone application by integrating Knockout.

Upcoming Events

.NET Insight

Sign up for our newsletter.

I agree to this site's Privacy Policy.