Type Alias ExtractProperties<T, P>

ExtractProperties<T, P>: {
    [K in keyof T as T[K] extends infer Prop
        ? Prop extends P
            ? K
            : never
        : never]: T[K]
}

Extracts an object with properties assignable to P from an object T

Type Parameters

  • T
  • P