Definitelytyped: blueimp-md5:blueimp.md5 不是函数

创建于 2016-04-15  ·  3评论  ·  资料来源: DefinitelyTyped/DefinitelyTyped

  • [x] 我尝试在这个 repo 中使用最新的blueimp-md5.d.ts文件,但遇到了问题。
  • [x] 我尝试使用最新的稳定版 tsc。 https://www.npmjs.com/package/typescript
  • [x] 我想谈谈xxxx/xxxx.d.ts
    当我尝试使用这样的定义文件时发生错误hashed = require("blueimg-md5").md5("my string")
    npm page可以看出,这个模块的导出只是一个函数。
    // Use the following version if you installed the package with npm: 
        var md5 = require("blueimp-md5"), 
        query = url.parse(req.url).query;
    // Calculate and print the MD5 hash of the url query: 
    res.end(md5(query));

定义应该是

declare module 'blueimp-md5' {
    function md5(value: string, key?: string, raw?: boolean): string;
    export = md5;
}

而不是

declare module 'blueimp-md5' {
    export function md5(value: string, key?: string, raw?: boolean): string;
}

所有3条评论

我也有同样的问题。 ;| 定义还是一样的。

我也是。

请发送拉取请求。 我会审查它。

此页面是否有帮助?
0 / 5 - 0 等级