Ramda打字稿给打字稿编译错误

时间:2020-03-13 12:59:41

标签: typescript ramda.js

添加了@types/ramda

现在我从@ types / ramda收到打字稿错误

无法编译。

/Users/xx/WebstormProjects/xx/frontend/node_modules/@types/ramda/index.d.ts
TypeScript error: ',' expected.  TS1005

    81 |  * function: the current index, and the entire list.
    82 |  */
  > 83 | export function addIndex<T, U>(fn: (f: (item: T) => U, list: readonly T[]) => U[]): _.F.Curry<(a: (item: T, idx: number, list?: T[]) => U, b: readonly T[]) => U[]>;
       |                                                                       ^
    84 | /* Special case for forEach */
    85 | export function addIndex<T>(fn: (f: (item: T) => void, list: readonly T[]) => T[]): _.F.Curry<(a: (item: T, idx: number, list?: T[]) => void, b: readonly T[]) => T[]>;
    86 | /* Special case for reduce */

我还有许多其他@types,除此以外,没有其他错误。

我的tsconfig.json:

"include": [
    "./typings/**/*",
    "./src/**/*",
    "./test/**/*"
  ],
  "exclude": [
    "node_modules"
  ]

1 个答案:

答案 0 :(得分:0)

我通过使用这里的类型解决了这个问题: https://github.com/types/npm-ramda/

repo 声称支持以下版本。

  • ramda@0.25.0
  • 打字稿@~2.9.2

但是我还没有遇到这种组合的问题:

  • ramda@0.26.1
  • 打字稿@3.9.10
相关问题