type UserDescriptor = MaximumOneOf<{
id: string;
email: string;
username: string;
}>;
// Valid usage
const user1: UserDescriptor = { id: "123" };
const user2: UserDescriptor = { email: "test@example.com" };
const user3: UserDescriptor = {}; // Allowed (zero properties)
// Invalid usage
const user4: UserDescriptor = { id: "123", email: "test@example.com" }; // Error: Only one property allowed
A utility type that enforces at most one property from
Tto be set.This ensures that: