PLDB
Languages Features Calendar CSV Lists Blog About Sponsor Add Language
GitHub icon

TypeScript

TypeScript

TypeScript is a pl created in 2012 by Anders Hejlsberg.

#30on PLDB 10Years Old 94.6kUsers
56Books 8Papers 3mRepos

Try now: Web · Riju · TIO

TypeScript is a free and open-source programming language developed and maintained by Microsoft. It is a strict syntactical superset of JavaScript, and adds optional static typing to the language. Anders Hejlsberg, lead architect of C# and creator of Delphi and Turbo Pascal, has worked on the development of TypeScript. Read more on Wikipedia...


Example from Riju:
console.log("Hello, world!");
Example from hello-world:
console.log("Hello World");
Example from the Hello World Collection:
// Hello world in TypeScript alert('Hello world!');
Example from Linguist:
console.log("Hello, World!");
Example from Wikipedia:
class Person { private name: string; private age: number; private salary: number; constructor(name: string, age: number, salary: number) { this.name = name; this.age = age; this.salary = salary; } toString(): string { return `${this.name} (${this.age}) (${this.salary})`; // As of version 1.4 } }

Language features

Feature Supported Example Token
MultiLine Comments
/* A comment
*/
/* */
Comments
// A comment
Algebraic Data Type
declare type numOrString = string | number
Line Comments
// A comment
//
Union Types
declare type numOrString = string | number
Single-Type Arrays
const scores: int[]
Strings
"hello world"
"
Type Parameters
function identity(arg: T): T {
   return arg;
}
Static Typing
Inheritance
class B {}
class A extends B {}
Print() Debugging
console.log("Hi")
console.log
Namespaces
// Typescript even supports splitting namespaces across multiple files:
// Validation.ts
namespace Validation {
    export interface StringValidator {
        isAcceptable(s: string): boolean;
    }
}
// LettersOnlyValidator.ts
/// 
namespace Validation {
    const lettersRegexp = /^[A-Za-z]+$/;
    export class LettersOnlyValidator implements StringValidator {
        isAcceptable(s: string) {
            return lettersRegexp.test(s);
        }
    }
}
Mixins
// https://www.typescriptlang.org/docs/handbook/mixins.html
class SmartObject implements Disposable, Activatable {
}
// Note: still need to do some runtime ops to make that work.
Interfaces
// https://www.typescriptlang.org/docs/handbook/interfaces.html
interface SquareConfig {
   color?: string;
   width?: number;
}
File Imports
import { ZipCodeValidator } from "./ZipCodeValidator";
/// 
/// 
import moo = module('moo');
/// 
Type Casting
something;
Classes
class Person {}
Booleans
const result = true
Generics
function identity(arg: T): T {
   return arg;
}
Abstract Types
abstract class Animal {}
class Dog extends Animal
Access Modifiers
class Person {
  private _age = 2
  public get age() {
    return _age
  }
  protected year = 1990
}
Static Methods
class Person {
  static sayHi() {
    console.log("Hello world")
  }
}
Semantic Indentation ϴ
Operator Overloading ϴ

Books about TypeScript on goodreads

title author year reviews ratings rating
TypeScript for C# programmers Steve Fenton 2013 3 9 3.67
TypeScript for JavaScript Programmers Steve Fenton 2012 1 4 3.50

Books about TypeScript from ISBNdb

title authors year publisher
TypeScript Blueprints Wolff, Ivo Gabe de 2016 Packt Publishing
Beginning Angular 2 with Typescript Lim, Greg 2017 CreateSpace Independent Publishing Platform
Mastering TypeScript: Build enterprise-ready, modular web applications using TypeScript 4 and modern frameworks, 4th Edition Rozentals, Nathan 2021 Packt Publishing
Learn React with TypeScript 3: Beginner's guide to modern React web development with TypeScript 3 Rippon, Carl 2018 Packt Publishing
Vue.js 3 Cookbook: Discover actionable solutions for building modern web apps with the latest Vue features and TypeScript Ribeiro, Heitor Ramon 2020 Packt Publishing
The TypeScript Workshop: A practical guide to confident, effective TypeScript programming Grynhaus, Ben and Hudgens, Jordan and Hunte, Rayon and Morgan, Matt and Stefanovski, Wekoslav 2021 Packt Publishing
TypeScript 4 Design Patterns and Best Practices: Discover effective techniques and design patterns for every programming task Despoudis, Theo 2021 Packt Publishing
Essential TypeScript 4: From Beginner to Pro Freeman, Adam 2021 Apress
Advanced TypeScript Programming Projects: Build 9 different apps with TypeScript 3 and JavaScript frameworks such as Angular, React, and Vue O'Hanlon, Peter 2019 Packt Publishing
Programming with Types: Examples in TypeScript Riscutia, Vlad 2019 Manning
Advanced TypeScript Programming Projects: Build 9 different apps with TypeScript 3 and JavaScript frameworks such as Angular, React, and Vue O'Hanlon, Peter 2019 Packt Publishing
Hands-On Functional Programming with TypeScript: Explore functional and reactive programming to create robust and testable TypeScript applications Jansen, Remo H. 2019-01-30T00:00:01Z Packt Publishing
TypeScript Design Patterns Vane, Vilic 2016 Packt Publishing
Angular Projects: Build nine real-world applications from scratch using Angular 8 and TypeScript Mohammed, Zama Khan 2019 Packt Publishing
Deno Web Development: Write, test, maintain, and deploy JavaScript and TypeScript web applications using Deno Santos, Alexandre Portela dos 2021 Packt Publishing
Beginning Angular with Typescript (updated to Angular 5) Lim, Greg 2017 CreateSpace Independent Publishing Platform
Mastering TypeScript Rozentals, Nathan 2017 Packt Publishing
TypeScript Design Patterns Vane, Vilic 2016 Packt Publishing
TypeScript Revealed Maharry, Dan 2013 Apress
Angular for Material Design: Leverage Angular Material and TypeScript to Build a Rich User Interface for Web Apps Kotaru, Venkata Keerti 2019 Apress
TypeScript Blueprints Wolff, Ivo Gabe de 2016 Packt Publishing
TypeScript 2.x By Example: Build engaging applications with TypeScript, Angular, and NativeScript on the Azure platform Ohri, Sachin 2017 Packt Publishing
Learning TypeScript 2.x: Develop and maintain captivating web applications with ease, 2nd Edition Jansen, Remo H. 2018 Packt Publishing
Building Chatbots in TypeScript with the Microsoft Bot Framework: Programming Useful Bots in the Node.JS SDK Szul, Michael 2019 The October Foundation
TypeScript High Performance: Code for performance, use asynchronous programming, and deliver resources efficiently Kher, Ajinkya 2017-08-24T00:00:01Z Packt Publishing
PROGRAMMING TYPESCRIPT SHROFF
Design Patterns In Typescript Deepak Sukdeo Sapkale 2019 Independently Published
TypeScript Programming(Chinese Edition) [ MEI ] BAO LI SI QIE ER NI 2020 China Electric Power Press
"TypeScript Programming Notebook: A TypeScript Programming Notebook Diary For Daily Use" https://isbndb.com/book/9781686791451 LLC Publishing, Sanders Industries 2019 Independently published
Typescript Programming Zoltan Arvai and Attila Hajdrik 2013 Wrox
Refactoring TypeScript James Hickey 20191018 Packt Publishing
TypeScript Microservices Parth Ghiya 30-05-2018 Packt Publishing
Mastering TypeScript Nathan Rozentals 2015-04-23 Packt Publishing
Effective TypeScript Dan Vanderkam 20191017 O'Reilly Media, Inc.
Learning TypeScript Josh Goldberg 20220603 O'Reilly Media, Inc.
TypeScript Quickly Anton Moiseev; Yakov Fain 20200210 Simon & Schuster
Programming TypeScript Boris Cherny 20190425 O'Reilly Media, Inc.
TypeScript Essentials Christopher Nance 20141021 Packt Publishing
TypeScript High Performance Ajinkya Kher 2017-08-24 Packt Publishing
The TypeScript Workshop Ben Grynhaus; Jordan Hudgens; Rayon Hunte; Matt Morgan; Wekoslav Stefanovski 29-07-2021 Packt Publishing
Mastering Typescript Programming Techniques Tamas Piros 2018
TypeScript for Beginners Sufyan bin Uzayr 20220323 Taylor & Francis
Mastering TypeScript 3 Nathan Rozentals 28-02-2019 Packt Publishing
Typescript Programming Language Typescript Publishing 2019-11-18 Independently Published
Design Patterns In Typescript Dimitris Loukas
TypeScript 3.0 Quick Start Guide Patrick Desjardins 2018-08-30 Packt Publishing
Mastering TypeScript - Second Edition Nathan Rozentals 2017-02-24 Packt Publishing
Angular Development with TypeScript Anton Moiseev; Yakov Fain 20181205 Simon & Schuster
Developing Web Components with TypeScript Jörg Krause 20210312 Springer Nature
Hands-On Functional Programming with TypeScript Remo H. Jansen 30-01-2019 Packt Publishing
TypeScript 2.x for Angular Developers Christian Nwamba 20171207 Packt Publishing
TypeScript 4 Design Patterns and Best Practices Theo Despoudis 15-09-2021 Packt Publishing
Learn TypeScript 3 by Building Web Applications Sebastien Dubois; Alexis Georges; Basarat Ali Syed 22-11-2019 Packt Publishing
Hands-On TypeScript for C# and .NET Core Developers Francesco Abbruzzese 31-10-2018 Packt Publishing

Publications about TypeScript from Semantic Scholar

title authors year citations influentialCitations
Understanding TypeScript G. Bierman and M. Abadi and Mads Torgersen 2014 158 23
Safe & Efficient Gradual Typing for TypeScript Aseem Rastogi and N. Swamy and C. Fournet and G. Bierman and Panagiotis Vekris 2015 93 12
Concrete Types for TypeScript G. Richards and Francesco Zappa Nardelli and J. Vitek 2015 46 7
Checking correctness of TypeScript interfaces for JavaScript libraries Asger Feldthaus and Anders Møller 2014 38 0
An empirical investigation of the effects of type systems and code completion on API usability using TypeScript and JavaScript in MS visual studio Lars Fischer and Stefan Hanenberg 2015 14 0
Mixed Messages: Measuring Conformance and Non-Interference in TypeScript Jack Williams and J. Garrett Morris and P. Wadler and Jakub Zalewski 2017 11 1
Static TypeScript: an implementation of a static compiler for the TypeScript language T. Ball and J. D. Halleux and Michal Moskal 2019 5 1
To Type or Not to Type? A Systematic Comparison of the Software Quality of JavaScript and TypeScript Applications on GitHub J. Bogner and Manuel Merkel 2022 1 0
lua.html · typescript.html · arm.html

View source

PLDB - Build the next great programming language · v2022 · Day 33 · Docs · Build · Acknowledgements · Traffic Today · Traffic Trends · Mirrors · GitHub · feedback@pldb.com