UNPKG

@flex-development/tutils

Version:
16 lines (15 loc) 454 B
/** * @file Type Definitions - PickByType * @module tutils/types/PickByType */ import type ObjectPlain from './object-plain.mjs'; /** * Constructs a type where properties of type `P` will be chosen from `T`. * * @template T - Object type * @template P - Type of properties to pick */ declare type PickByType<T extends ObjectPlain, P> = Pick<T, { [K in keyof T]: T[K] extends P ? K : never; }[keyof T]>; export { type PickByType as default };