Skip to Content
Learning TypeScript 2.x - Second Edition
book

Learning TypeScript 2.x - Second Edition

by Remo H. Jansen
April 2018
Beginner content levelBeginner
536 pages
13h 21m
English
Packt Publishing
Content preview from Learning TypeScript 2.x - Second Edition

Legacy external modules (design time only)

Before TypeScript 1.5, external modules were declared using a specific design-time syntax. However, once compiled into JavaScript, modules were transformed into AMD, CommonJS, UMD, or SystemJS modules.

We should try to avoid using the legacy external module syntax and use the new ES6 syntax instead. However, we will take a quick look at the external module syntax, because it is still possible to face it sometimes in old applications and documentation.

To export a module using the legacy external module syntax, we need to use the export keyword. We can apply the export keyword directly to a class or interface as follows:

export class User { 
 // ... 
} 

We can also use the export keyword on its own by ...

Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Start your free trial

You might also like

Mastering TypeScript - Fourth Edition

Mastering TypeScript - Fourth Edition

Nathan Rozentals
Learning TypeScript

Learning TypeScript

Josh Goldberg
TypeScript for Beginners

TypeScript for Beginners

Bharath Thippireddy

Publisher Resources

ISBN: 9781788391474Supplemental Content