📜  深度部分打字稿代码示例

📅  最后修改于: 2022-03-11 14:48:22.708000             🧑  作者: Mango

代码示例1
//You can simply create a new type, say, DeepPartial, which basically references itself:
type DeepPartial = {
    [P in keyof T]?: DeepPartial;
};

//Then, you can use it as such:
const foobar: DeepPartial = {
  foo: 1,
  bar: { baz: true }
};