0

我有以下类型:

type IQueryResolvers<ContextType = any, ParentType extends {} = {}> = {
me?: ...
profile?: ... 
}

问题是,对于 IQueryResolvers 类型的每个键,我都有一个控制器功能,例如:

const meController = () => {};

我想访问这样的类型:

const meController: IQueryResolvers.me = () => {};

有没有人有解决方案?

4

1 回答 1

0

解决方案是:

const meController: IQueryResolvers['me'] = () => {};
于 2020-05-04T02:17:36.630 回答