下面这段typescript代码:
function rule(name?: string, options?: IRuleOptions)(func: IRuleFunction): Rule
export type IRuleFunction = (
parent?: any,
args?: any,
context?: any,
info?: GraphQLResolveInfo,
) => IRuleResult | Promise<IRuleResult>interface IRuleOptions {
cache?: ICacheOptions
fragment?: IFragment
}问题:
第一行代码如下:
function rule(name?: string, options?: IRuleOptions)(func: IRuleFunction): Rule ------------------------------------- ------------------- ---- (1) (2) (3)
(1)是函数的参数,可以看懂。
(2)和(3)是什么意思?
请大佬指导一下,谢谢
更新:
代码来源:https://github.com/maticzav/g...
largeQ
随时随地看视频慕课网APP
相关分类