Add extends to Object Type Literals

Topics: Language Specification
Jun 19, 2013 at 2:24 AM
It would be pretty handy to define an Object Type Literal that extends an interface or class for situations where the type is only used in once place.

For example, when working with angularjs, a function might take scope as a parameter, and then add properties to it without having to define a whole new interface.
/// <reference path="./typings/angularjs/angular.d.ts" />

var app = angular.module("app", []);

app.controller("AppCtrl", function ($scope: { message: string; } extends ng.IScope) {
    $scope.message = "Welcome to scope " + $scope.$id;
});