diff --git a/pages/Functions.md b/pages/Functions.md
index fc07ef3e9..01f11581e 100644
--- a/pages/Functions.md
+++ b/pages/Functions.md
@@ -2,7 +2,7 @@
Functions are the fundamental building block of any applications in JavaScript.
They're how you build up layers of abstraction, mimicking classes, information hiding, and modules.
-In TypeScript, while there are classes and modules, function still play the key role in describing how to `do` things.
+In TypeScript, while there are classes, namespaces, and modules, function still play the key role in describing how to *do* things.
TypeScript also adds some new capabilities to the standard JavaScript functions to make them easier to work with.
# Functions
diff --git a/pages/Generics.md b/pages/Generics.md
index 15b1b99cc..fe728c24a 100644
--- a/pages/Generics.md
+++ b/pages/Generics.md
@@ -190,7 +190,7 @@ When we use `GenericIdentityFn`, we now will also need to specify the correspond
Understanding when to put the type parameter directly on the call signature and when to put it on the interface itself will be helpful in describing what aspects of a type are generic.
In addition to generic interfaces, we can also create generic classes.
-Note that it is not possible to create generic enums and modules.
+Note that it is not possible to create generic enums and namespaces.
# Generic Classes
diff --git a/pages/Modules.md b/pages/Namespaces and Modules.md
similarity index 72%
rename from pages/Modules.md
rename to pages/Namespaces and Modules.md
index cbfc3baab..1614996a4 100644
--- a/pages/Modules.md
+++ b/pages/Namespaces and Modules.md
@@ -1,12 +1,24 @@
# Introduction
-This post outlines the various ways to organize your code using modules in TypeScript.
-We'll be covering internal and external modules and we'll discuss when each is appropriate and how to use them.
-We'll also go over some advanced topics of how to use external modules, and address some common pitfalls when using modules in TypeScript.
+
+This post outlines the various ways to organize your code using namespaces and modules in TypeScript.
+We'll be covering namespaces (previously "internal modules") and modules (previously called "external modules") and we'll discuss when each is appropriate and how to use them.
+We'll also go over some advanced topics of how to use namespaces and modules, and address some common pitfalls when using them in TypeScript.
+
+## A note about terminology
+
+We just alluded to "internal modules" and "external modules".
+If you're vaguely familiar with these terms, it's important to note that in TypeScript 1.5, the nomenclature has changed.
+"Internal modules" are now "namespaces".
+"External modules" are now simply "modules", as to align with ECMAScript 6's terminology.
+
+Additionally, anywhere the `module` keyword was used when declaring an internal module, the `namespace` keyword can and should be used instead.
+
+This avoids confusing new users by overloading them with similarly named terms.
## First steps
Let's start with the program we'll be using as our example throughout this page.
-We've written a small set of simplistic string validators, like you might use when checking a user's input on a form in a webpage or checking the format of an externally-provided data file.
+We've written a small set of simplistic string validators, as you might write to check a user's input on a form in a webpage or check the format of an externally-provided data file.
##### Validators in a single file
@@ -44,20 +56,20 @@ strings.forEach(s => {
});
```
-## Adding Modularity
+## Namespacing
As we add more validators, we're going to want to have some kind of organization scheme so that we can keep track of our types and not worry about name collisions with other objects.
-Instead of putting lots of different names into the global namespace, let's wrap up our objects into a module.
+Instead of putting lots of different names into the global namespace, let's wrap up our objects into a namespace.
-In this example, we'll move all validator-related entities into a module called `Validation`.
-Because we want the interfaces and classes here to be visible outside the module, we preface them with `export`.
-Conversely, the variables `lettersRegexp` and `numberRegexp` are implementation details, so they are left unexported and will not be visible to code outside the module.
-In the test code at the bottom of the file, we now need to qualify the names of the types when used outside the module, e.g. `Validation.LettersOnlyValidator`.
+In this example, we'll move all validator-related entities into a namespace called `Validation`.
+Because we want the interfaces and classes here to be visible outside the namespace, we preface them with `export`.
+Conversely, the variables `lettersRegexp` and `numberRegexp` are implementation details, so they are left unexported and will not be visible to code outside the namespace.
+In the test code at the bottom of the file, we now need to qualify the names of the types when used outside the namespace, e.g. `Validation.LettersOnlyValidator`.
-##### Modularized Validators
+##### Namespaced Validators
```TypeScript
-module Validation {
+namespace Validation {
export interface StringValidator {
isAcceptable(s: string): boolean;
}
@@ -96,17 +108,17 @@ strings.forEach(s => {
As our application grows, we'll want to split the code across multiple files to make it easier to maintain.
-## Multi-file internal modules
+## Multi-file namespaces
-Here, we'll split our `Validation` module across many files.
-Even though the files are separate, they can each contribute to the same module and can be consumed as if they were all defined in one place.
+Here, we'll split our `Validation` namespace across many files.
+Even though the files are separate, they can each contribute to the same namespace and can be consumed as if they were all defined in one place.
Because there are dependencies between files, we'll add reference tags to tell the compiler about the relationships between the files.
Our test code is otherwise unchanged.
##### Validation.ts
```TypeScript
-module Validation {
+namespace Validation {
export interface StringValidator {
isAcceptable(s: string): boolean;
}
@@ -117,7 +129,7 @@ module Validation {
```TypeScript
///
-module Validation {
+namespace Validation {
var lettersRegexp = /^[A-Za-z]+$/;
export class LettersOnlyValidator implements StringValidator {
isAcceptable(s: string) {
@@ -131,7 +143,7 @@ module Validation {
```TypeScript
///
-module Validation {
+namespace Validation {
var numberRegexp = /^[0-9]+$/;
export class ZipCodeValidator implements StringValidator {
isAcceptable(s: string) {
@@ -162,7 +174,8 @@ strings.forEach(s => {
});
```
-Once there are multiple files involved, we'll need to make sure all of the compiled code gets loaded. There are two ways of doing this.
+Once there are multiple files involved, we'll need to make sure all of the compiled code gets loaded.
+There are two ways of doing this.
First, we can use concatenated output using the `--out` flag to compile all of the input files into a single JavaScript output file:
@@ -176,7 +189,8 @@ The compiler will automatically order the output file based on the reference tag
tsc --out sample.js Validation.ts LettersOnlyValidator.ts ZipCodeValidator.ts Test.ts
```
-Alternatively, we can use per-file compilation (the default) to emit one JavaScript file for each input file. If multiple JS files get produced, we'll need to use `