Understand TypeScript TypeScript项目练习合集

理解 TypeScript 的项目结构和语法用法的 Github 仓库,蛮适合刚学完课程或者想系统回顾的人。项目里有完整的拖拽 demo,类型用得还挺全的,像 接口泛型装饰器命名空间这些都有用到,练手也方便。

结构清晰的 drag-drop-project 文件夹里,ES6 模块导入导出用得比较规范,还带点 代码拆分最佳实践。如果你对模块化组织项目结构还不太熟,这部分内容挺值得看一看的。

namespace-project-split 分支比较有意思,用了 命名空间 的写法,还禁用了装饰器那一块,更偏传统写法,适合理解不同项目风格的对比。你可以顺手改改,看不同写法带来的影响。

整个项目比较适合用来做模板,想试点新写法的时候,拿来改改结构,调试调试类型提示,效率挺高的。尤其是拖放功能那段,浏览器 API 和类型结合得挺紧凑,适合边学边调试。

如果你对 ES6、Webpack 这些还不太熟,可以看看相关的资源:es6 入门Webpack 的 CSS 命名空间加载器。看完再回头撸这个仓库,理解会更顺。

嗯,就是:项目小、上手快、内容全,还不臃肿。如果你正想找个 TypeScript 的综合练习项目,这个蛮合适的。

zip
understand-typescript-master.zip 预估大小:30个文件
folder
understand-typescript-master 文件夹
file
index.html 840B
folder
drag-drop-project 文件夹
file
app.ts 213B
file
index.html 1KB
folder
utils 文件夹
file
validatable.ts 1KB
folder
models 文件夹
file
project.ts 240B
file
drag-drop.ts 302B
folder
state 文件夹
file
project-state.ts 1KB
folder
decorators 文件夹
file
autobind.ts 344B
folder
components 文件夹
file
base-component.ts 974B
file
project-list.ts 2KB
file
project-item.ts 1KB
file
project-input.ts 2KB
file
webpack.config.prod.js 504B
folder
small-map-project 文件夹
file
app.ts 902B
file
webpack.config.js 424B
folder
learning-typescript 文件夹
file
interfaces.ts 526B
file
advanced-types.ts 2KB
file
classes.ts 966B
file
utility-types.ts 503B
file
decorators.ts 4KB
file
generic-types.ts 981B
folder
.vscode 文件夹
file
launch.json 435B
file
tsconfig.json 6KB
folder
third-party-helpers 文件夹
file
class-transformer.ts 551B
file
class-validator.ts 326B
file
README.md 605B
file
app.css 2KB
file
.gitignore 2KB
file
package-lock.json 217KB
file
package.json 669B
zip 文件大小:75.76KB