类型别名:又称为自定义类型,为任意类型起别名。
    使用场景: 当同一类型(复杂)被多次使用时,可以通过该类型别名,简化该类型的使用。

    1. type CumtomArr = (number|string) [];
    2. let arr:CumtomArr = [1,2,"str"];
    1. //类型别名相当于声明了一个变量
    2. type obj = {
    3. name:string,
    4. age:number
    5. }
    1. type Method = "get"|"post"|"put"|"delete";
    2. function http(method:Method){
    3. console.log(method)
    4. }
    5. http("get")