tow types of value in interface for a variable code example
Example 1: typescript interface function
interface IEmployee {
empCode: number;
empName: string;
getSalary: (number) => number; // arrow function
getManagerName(number): string;
}
Example 2: typescript export interface array
interface Animal { name: string; size: "small"; medium; large;}const animalsArray: Animal[] = [ { name: "chicken", size: "small" }, { name: "pig", size: "medium" }, { name: "cow", size: "large" },];