typescript-tutorial
typescript-tutorial copied to clipboard
TypeScript 入门教程
 该页”类型断言的限制“里相同的代码已经说了两者相互兼容,为何下面就不兼容了?
一些建议
## 用接口定义函数的形状 我们也可以使用接口的方式来定义一个函数需要符合的形状: ```ts interface SearchFunc { (source: string, subString: string): boolean; } let mySearch: SearchFunc; mySearch = function (source: string, subString: string) { return source.search(subString) !== -1; }; ```...
ts-node 报错 
微信群
想入群
[章节地址](https://github.com/xcatliu/typescript-tutorial/blob/master/basics/type-of-object-interfaces.md) ```ts interface Person { name: string; age?: number; [propName: string]: string; } let tom: Person = { name: 'Tom', age: 25, gender: 'male' }; // index.ts(3,5): error TS2411: Property...
目录中漏了一页文章,为什么选择 TypeScript https://github.com/xcatliu/typescript-tutorial/blob/aac1467ac2dd7d49add3a693e53f84e43731eaf4/pagic.config.tsx https://github.com/xcatliu/typescript-tutorial/blob/master/introduction/why-typescript.md https://github.com/xcatliu/typescript-tutorial/blob/master/introduction/README.md
anyway,赞一个!