Better Module Visibility Rules

TypeScript now only strictly enforces the visibility of types in modules if the —declaration flag is provided. This is very useful for Angular scenarios, for example:

  1. module MyControllers {
  2. interface ZooScope extends ng.IScope {
  3. animals: Animal[];
  4. }
  5. export class ZooController {
  6. // Used to be an error (cannot expose ZooScope), but now is only
  7. // an error when trying to generate .d.ts files
  8. constructor(public $scope: ZooScope) { }
  9. /* more code */
  10. }
  11. }