Check out example codes for "interface ts one valu". It will help you in understanding the concepts better.

Code Example 1

// use type instead interface
type StringOrNull = string | null;

Learn ReactJs, React Native from akashmittal.com