devtypes
    Preparing search index...

    Type Alias ExtractFrom<T, K>

    ExtractFrom: Partial<Pick<T, K>>

    Extract specific properties as optional

    Type Parameters

    • T
    • K extends keyof T
    type User = { id: number; name: string; email?: string; phone?: string };
    type UserContact = ExtractFrom<User, 'email' | 'phone'>;
    // { email?: string; phone?: string }