export interface in typescript 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;
name: string;
}Try
Example 3: export interface typescript
interface Props {}
export interface IRefered {
name: string
}
Example 4: create method in interface for set TS
running: someTask, arg: test