Question: I'm trying to create an interface that could have 

```
export interface MenuItem {
  title: string;
  component?: any;
  click?: any;
  icon: string;
}

```

1. Is there a way to require `component` or `click` to be set
2. Is there a way to require that both properties can't be set?

Answer: 
Not with a single interface, since types have no conditional logic and can't depend on each other, but you can by splitting the interfaces:

```
export interface BaseMenuItem {
  title: string;
  icon: string;
}

export interface ComponentMenuItem extends BaseMenuItem {
  component: any;
}

export interface ClickMenuItem extends BaseMenuItem {
    click: any;
}

export type MenuItem = ComponentMenuItem | ClickMenuItem;

```
Yet another solution:

```
type RequiredKeys<T, K extends keyof T> = Required<Pick<T, K>> & Omit<T, K>;

```

```
type MenuItem2 = RequiredKeys<MenuItem, "component" | "click">;

```