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.
To just extends upon the cool answers above! And for the people that land here while searching for a **Partial** version with requiring capability! Here a snippet i made to take!

PartialReq
==========

You want to have a Partial of an interface, but in mean time require some of the fields! Here how it's done

```js
export type PartialReq<T, Keys extends keyof T = keyof T> =
    Pick<Partial<T>, Exclude<keyof T, Keys>>
    & {
        [K in Keys]: T[K]
    };

```

Use example
===========

```js
export interface CacheObj<SigType = any, ValType = any> {
    cache: Map<SigType, ValType>,
    insertionCallback: InsertionCallback<SigType, ValType> // I want this to be required
}

// ...

export class OneFlexibleCache<SigType = any, ValType = any> {
    private _cacheObj: CacheObj<SigType, ValType>;

    constructor(
        cacheObj: PartialReq<CacheObj<SigType, ValType>, 'insertionCallback'> // <-- here
                                                                           //  i used it
    ) {
        cacheObj = cacheObj || {};

        this._cacheObj = {

// ...

// _______________ usage
this._caches.set(
    cacheSignature,
    new OneFlexibleCache<InsertionSigType, InsertionValType>({
        insertionCallback // required need to be provided
    })
);

```

Here you can see that it work perfectly

[![enter image description here](https://i.stack.imgur.com/nrpB0.png)](https://i.stack.imgur.com/nrpB0.png)

If the required not provided

[![enter image description here](https://i.stack.imgur.com/NbAu7.png)](https://i.stack.imgur.com/NbAu7.png)

UPDATE: For the usage that i implied above here a better answer
===============================================================

I just went by the doc and found **Omit**.

<https://www.typescriptlang.org/docs/handbook/utility-types.html#omittk>

I came to add it. But before i do, I just seen this cool answer. It cover all:

<https://stackoverflow.com/a/48216010/7668448>

Just check it out! It show how to do it for all the different version of Typescript! And for the sake of not repeating ! Go and check!