OnlyOne is a utility type that ensures only one of the specified keys in T can be present at a time.
It allows for defining types where only one property can be set, while the others must be never.
Type Parameters
T
The type to apply the OnlyOne constraint to.
Template: K
The keys of T that are mutually exclusive.
Example
typeExample = OnlyOne<{ a: string; b: number; c: boolean }> // This will create a type where only one of 'a', 'b', or 'c' can be present at a time.
OnlyOne is a utility type that ensures only one of the specified keys in T can be present at a time. It allows for defining types where only one property can be set, while the others must be
never.