- Learn React with TypeScript 3
- Carl Rippon
- 71字
- 2021-06-10 19:16:34
Interfaces
An interface is a contract that defines a type with a collection of property and method definitions without any implementation. Interfaces don't exist in JavaScript, so they are purely used by the TypeScript compiler to enforce the contract by type checking.
We create an interface with the interface keyword, followed by its name, followed by the bits that make up the interface in curly braces:
interface Product {
...
}
推薦閱讀
- C++案例趣學
- Boost程序庫完全開發指南:深入C++”準”標準庫(第5版)
- Cocos2D-X權威指南(第2版)
- Monkey Game Development:Beginner's Guide
- jQuery EasyUI網站開發實戰
- Learning Bayesian Models with R
- 編寫高質量代碼:改善C程序代碼的125個建議
- Mastering Ubuntu Server
- HTML5+CSS3 Web前端開發技術(第2版)
- Learning PHP 7
- Extreme C
- 大話Java:程序設計從入門到精通
- Drupal 8 Development Cookbook(Second Edition)
- Python數據可視化之matplotlib實踐
- HTML5+CSS+JavaScript深入學習實錄