1 import {ConditionalKeys} from './conditional-keys';
4 Pick keys from the shape that matches the given `Condition`.
6 This is useful when you want to create a new type from a specific subset of an existing type. For example, you might want to pick all the primitive properties from a class and form a new automatically derived type.
10 import {Primitive, ConditionalPick} from 'type-fest';
20 type PickPrimitivesFromAwesome = ConditionalPick<Awesome, Primitive>;
21 //=> {name: string; successes: number; failures: bigint}
26 import {ConditionalPick} from 'type-fest';
35 type StringKeysOnly = ConditionalPick<Example, string>;
39 export type ConditionalPick<Base, Condition> = Pick<
41 ConditionalKeys<Base, Condition>