【发布时间】:2018-10-12 17:57:26
【问题描述】:
我正在尝试为 js 库构建环境类型定义,如下所示:https://github.com/kkemple/graphql-auth
这是我的类型,但这似乎没有按预期工作
// Type definitions for graphql-auth
// Project: https://github.com/kkemple/graphql-auth
// Definitions by: Andréas `ScreamZ` H. <https://github.com/ScreamZ/>
export = withAuth;
declare function withAuth(resolve: Resolver): Resolver;
declare function withAuth(scopes: string[], resolver: Resolver): Resolver;
declare type Resolver = (root: any, args: any, context: any, info: any) => any
当我尝试导入 .ts 文件时,我得到resolves to a non-module entity and cannot be imported using this construct.
我知道他们改变了声明命名空间和声明模块系统。
我无法理解所有这些内容。
有人可以帮助我吗?
最好的问候
【问题讨论】:
标签: typescript typescript-typings