TypeScript学习笔记一:代码与模块(译)

代码和模块(Scripts and Modules)

  ts支持ECMAScript 2015模块和面向CommonJS, AMD等其他模块系统的底层代码生成。

11.1 程序和源文件

  一个ts程序包含一个或多个源文件。

 

  SourceFile:
    ImplementationSourceFile
    DeclarationSourceFile

 

  ImplementationSourceFile:
    ImplementationScript
    ImplementationModule

 

  DeclarationSourceFile:
    DeclarationScript
    DeclarationModule

  源文件:

    实现源文件

    声明源文件  

  实现源文件:

    实现代码

    实现模块

  声明源文件:

    声明代码

    声明模块

  实现源文件扩展名为”.ts“,它包含表达式和声明。声明源文件扩展名为“.d.ts“,只包含声明。

 

posted @ 2016-01-11 19:20  leeberg  阅读(86)  评论(0)    收藏  举报