ts interface array code example
Example 1: typescript interface
interface NumberOrStringDictionary {
[index: string]: number | string;
length: number; // ok, length is a number
name: string; // ok, name is a string
}Try
Example 2: create method in interface for set TS
running: someTask, arg: test
Example 3: interface ts one valu
// use type instead interface
type StringOrNull = string | null;