/** * Toolkit - Type Helpers * * TypeScript utility types and helper functions. */ /** * Make specific properties optional */ export type PartialBy = Omit & Partial>; /** * Make specific properties required */ export type RequiredBy = Omit & Required>; /** * Deep partial (makes all nested properties optional) */ export type DeepPartial = T extends object ? { [P in keyof T]?: DeepPartial } : T; /** * Extract keys of a certain type */ export type KeysOfType = { [K in keyof T]: T[K] extends U ? K : never; }[keyof T]; /** * Pick properties by value type */ export type PickByValue = Pick< T, { [K in keyof T]: T[K] extends V ? K : never; }[keyof T] >;