RecipesChapter 3: The Type System

Creating Exclusive Or Models with Optional never

Recipe 3.8 from The TypeScript Cookbook

selectCallback({
  options: ["dracula", "monokai", "vscode"],
  values: ["dracula", "vscode"],
  value: "dracula",
}); 
// ^ Argument of type '{ options: string[]; values: string[]; value: string; }'
//   is not assignable to parameter of type 'SelectProperties'.
Open in TypeScript Playground →