TypeScript 知识框架

一、TypeScript 基础

1. 类型系统

  • 基本类型: numberstringbooleannullundefinedsymbolbigint

  • 引用类型: objectarrayfunctionclass

  • 特殊类型: anyunknownvoidnever

  • 类型推断与类型注解

  • 类型断言 (as 语法和  语法)

2. 接口与类型别名

  • 接口 (interface) 定义

  • 可选属性与只读属性

  • 索引签名

  • 函数类型接口

  • 类型别名 (type)

  • 接口 vs 类型别名

3. 高级类型

  • 联合类型 (|)

  • 交叉类型 (&)

  • 字面量类型

  • 类型保护 (typeofinstanceofin, 自定义类型保护)

  • 可辨识联合 (Discrim

你可能感兴趣的:(typescript,前端,开发语言,typescript)