官术网_书友最值得收藏!

  • Expert Angular
  • Mathieu Nayrolles Rajesh Gunasundaram Sridhar Rao
  • 88字
  • 2021-07-15 17:05:32

Hybrid type interfaces

Hybrid type interfaces are used when we want to use the object both as a function and an object. We can call an object like a function if it implements a hybrid type interface, or we can use it as an object and access its properties. This type of interface enables you to use an interface as an object and a function, as follows:

interface Customer { 
    (name: string); 
    name: string; 
    deleteCustomer(id: number): void; 
} 
  
var c: Customer; 
c('Rajesh Gunasundaram'); 
c.name = 'Rajesh Gunasundaram'; 
c.deleteCustomer(101); 
主站蜘蛛池模板: 商城县| 集贤县| 华容县| 贡嘎县| 苍南县| 江川县| 成都市| 新民市| 尼勒克县| 弥渡县| 肇庆市| 京山县| 鄂托克旗| 九龙县| 静乐县| 安溪县| 荔波县| 定兴县| 大丰市| 平乐县| 临泽县| 彰化县| 新竹市| 河间市| 隆尧县| 乌海市| 康乐县| 五峰| 游戏| 北碚区| 巴塘县| 杨浦区| 灌阳县| 云霄县| 视频| 修文县| 翼城县| 潞西市| 伊金霍洛旗| 盱眙县| 林芝县|