July 2017
Intermediate to advanced
454 pages
10h 1m
English
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);
Read now
Unlock full access