type 别名 = 类型 type Str = string // 定义 const str1:Str = 'abc' const str2:string = 'abc'
type NewType = string | number let a: NewType = 1 let b: NewType = '1'
别名可以是任意的合法字符串,一般首字母大写