type Name = string; function getName(n: Name): Name { if (typeof n === 'string') { cc.log('is string'); } return n; } getName('12aa');
类型别名用type来创建