Exclude keys from a shape that matches the given `Condition`.
6
7
This is useful when you want to create a new type with a specific set of keys from a shape. For example, you might want to exclude all the primitive properties from a class and form a new shape containing everything but the primitive properties.
8
9
@example
10
```
11
import type {Primitive, ConditionalExcept} from 'type-fest';
12
13
class Awesome {
14
name: string;
15
successes: number;
16
failures: bigint;
17
18
run() {}
19
}
20
21
type ExceptPrimitivesFromAwesome = ConditionalExcept<Awesome, Primitive>;
22
//=> {run: () => void}
23
```
24
25
@example
26
```
27
import type {ConditionalExcept} from 'type-fest';
28
29
interface Example {
30
a: string;
31
b: string | number;
32
c: () => void;
33
d: {};
34
}
35
36
type NonStringKeysOnly = ConditionalExcept<Example, string>;