RecipesChapter 5: Conditional Types

Removing Specific Object Properties

Recipe 5.4 from The TypeScript Cookbook

type User = {
  name: string;
  age: number;
  profession?: string;
  posts(): string[];
  greeting(): string;
};

type SerializeableUser = Remove<User, Function>;
Open in TypeScript Playground →