Theo's Typesafe CultTTC
Theo's Typesafe Cultβ€’3y agoβ€’
16 replies
Wezter

Require one of two properties

What would you folks say is a clean way to accomplish that either
userToken or ConversationId are set in my type without requiring both? πŸ€”

export type PostChatData = {
  command: Extract<ChatCommand, 'POST'>;
  userToken: string;
  conversationId: string;
  type: ChatType;
  // other crap
};
Was this page helpful?