interface MyInterface {
        id: number;
        name: string;
        properties: string[];
      }
      type MyShortType = Pick<MyInterface, 'name' | 'id'>;
      
      Typescript language logo

      Pick type interface

      0

      0

      avatar
      Giovanny Gongora
      Codiga's TypeScript Recipes

      Construct a new type based on some properties of an interface with the Pick utility type

      0 Comments

        Add Comment

        Log in to add a comment

        Codiga - All rights reserved 2022.