Create a strict object subset.
Source object type
Keys that must be required
Keys that should be optional
Builds a new object type consisting only of explicitly required and optional properties. All other properties are excluded.
type User = { id: number; name: string; email?: string; phone?: string };type UserSubset = StrictSubset< User, 'id', 'email' | 'phone' >;// { id: number; email?: string; phone?: string } Copy
type User = { id: number; name: string; email?: string; phone?: string };type UserSubset = StrictSubset< User, 'id', 'email' | 'phone' >;// { id: number; email?: string; phone?: string }
Create a strict object subset.