我已经定义了2种类型:
export type Pants = {
__typename?: 'Pants';
id: Scalars['ObjectID'];
price: Scalars['Int'];
color: Scalars['String'];
};
export type Outfits = {
__typename?: 'Outfits';
id: Scalars['ObjectID'];
category: Scalars['String'];
pants: Array<Pants>;
};现在,在我的代码的其他地方,我想导入Outfits类型,但忽略Pants对象嵌套数组的price。
我很难找到合适的方法去做。
我试过:
type Outfit = Omit<Outfits['pants'], 'price'>;但这似乎行不通。
如果我想导入我的Outfit并省略category,我会这样做:
type Outfit = Omit<Outfits, 'category'>;如何导入Outfits类型而忽略Pants对象嵌套数组的price?
https://stackoverflow.com/questions/74427501
复制相似问题