ts interface arra code example
Example 1: 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" },];
Example 2: typescript interface
interface NumberOrStringDictionary {
[index: string]: number | string;
length: number; // ok, length is a number
name: string; // ok, name is a string
}Try