Skip to content

xiaqi129/ts-knowledge-share

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

6 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

TypeScript-Demo

1、数据类型

  • 布尔类型(boolean)
  • 数字类型(number)
  • 字符串类型(string)
  • 数组类型(array)
  • 元组类型(tuple)
  • 枚举类型(enum)
  • 任意类型(any)
  • null 和 undefined
  • void 类型
  • never类型

详细见demo/type.ts

2、TypeScript中的函数

  • 函数的定义
  • 可选参数
  • 默认参数
  • 剩余参数
  • 函数重载
  • 箭头函数 es6

详细见 demo/function.ts

3、TypeScript中的类

  • 类的定义
  • 继承
  • 类里面的修饰符
  • 静态属性 静态方法
  • 抽象类 继承 多态

4、TypeScript中的接口

  • 属性类接口
  • 函数类接口
  • 可索引接口
  • 类类型接口
  • 接口扩展

详细见demo/interface.ts

5、TypeScript中的泛型

  • 泛型的定义
  • 泛型函数
  • 泛型类
  • 泛型接口

详细见demo/genericity.ts

6、TypScript中的模块

  • 模块的的概念
  • 模块导出的几种方法
    • export 导出声明
    • export 导出语句
    • export default
    • import导入模块

详细见demo/module.ts

启动步骤:

  1. 打开VS Code中的CMD控制台
  2. 点击终端 => 运行任务 => tsc: 监视 - tsconfig.json

About

Typescript knowledge sharing

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published