typescript extend multiple interfaces code example
Example 1: typescript interface function
interface IEmployee {
empCode: number;
empName: string;
getSalary: (number) => number;
getManagerName(number): string;
}
Example 2: typescript extend interface
interface Vehicle {
brand: string;
plateNumber: number;
}
interface Car extends Vehicle {}
Example 3: typescript interface
interface LabeledValue {
label: string;
}
function printLabel(labeledObj: LabeledValue) {
console.log(labeledObj.label);
}
let myObj = { size: 10, label: "Size 10 Object" };
printLabel(myObj);Try