Does Typescript support “subset types”?

后端 未结 7 1757
青春惊慌失措
青春惊慌失措 2020-12-29 02:36

Let\'s say I have an interface:

interface IUser {
  email: string;
  id: number;
  phone: string;
};

Then I have a function that expects a

7条回答
  •  遥遥无期
    2020-12-29 02:58

    Typescript now supports partial types.

    The correct way to create a partial type is:

    type PartialUser = Partial;
    

提交回复
热议问题