Require exactly one property from a set of properties
type Test = { a?: string; b?: number; c: boolean };type Result = RequireExactlyOne<Test, 'a' | 'b'>;// { a: string; b?: never; c: boolean } | { a?: never; b: number; c: boolean } Copy
type Test = { a?: string; b?: number; c: boolean };type Result = RequireExactlyOne<Test, 'a' | 'b'>;// { a: string; b?: never; c: boolean } | { a?: never; b: number; c: boolean }
Require exactly one property from a set of properties