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: 
I use this:

```js
type RequireField<T, K extends keyof T> = T & Required<Pick<T, K>>

```

Usage:

```js
let a : RequireField<TypeA, "fieldA" | "fieldB">;

```

This makes `fieldA` *and* `fieldB` required.
I ended up doing:

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

export interface MenuItemComponent extends MenuItem{
  component: any;
}

export interface MenuItemClick extends MenuItem{
  click: any;
}

```

Then I used:

```
 appMenuItems: Array<MenuItemComponent|MenuItemClick>;

```

But was hoping there was a way to model it with a single interface.