I am working on a simple project for school. And I am wondering if it's possible to omit all properties of certain type in TypeScript.

```
type Student = {
    firstName: string
    lastName: string
    age: number
    gender: Gender
    courses: List<Course>
}

```

So In this case I just want a type with everything from Student without *"courses"*.

**Is it possible to generate a Type** which is Student but without all the properties that has a List type? It needs to be generic so it works on all types for example:

```
type Program = {
    name: string
    errors: List<Error>
    successes: List<Success>
    warnings: List<Warning>
}

```

Now it would give a type which just contains { name: string }

Does anyone know how to do this, if it is even possible? Maybe with conditional types? Omit if List?

All the help is much appreciated!

**Update: add code example:**

```
type WithoutList<T> = {
    [K in keyof T]: T[K] extends List<any> ? never : T[K]
}

const select = <a, b extends keyof WithoutList<a>>(arg: a, ...keys: b[]) => {
    return null!
}

const s1: Student = {
    firstName: 's',
    lastName: 's',
    age: 22,
    gender: 'female',
    courses: List<Course>(),
}

select(s1, 'courses') // courses should not be available here!

```