// 类型断言function getLength2(str:string|number):number{ if((<string>str).length){ return (<string>str).length }else{ return str.toString().length }}function getLength3(str:string|number){ if((str as string).length){ return (str).length }else{ return str.toString().length }}type Name = string;type NameResolve =()=>string;type NameOrResolve = Name | NameResolve;function getName(n:NameOrResolve):Name{ if(typeof n ==== string){ return (<string>n) }else{ n() }}interface A { msg:string;}function helper(options:A):A{ return options}const xxA:A = {}interface Window { a:number;}interface Window { b:string}const s:Window =''declare module 'koa-swig'{ interface vue { a:number; } interface vue { b:string }}