import R (ramda) into typescript .ts file
我正在尝试如下使用Ramda.js:
1 2 3 4 5 6 7 | /// <reference path="../../../node_modules/@types/ramda/index.d.ts" /> module App { var settab = R.once((element) => current(element)); function current(li: any) { // ... } } |
I get error, Cannot find name 'R'
对于
1 2 3 4 5 6 7 8 9 | declare var R: R.Static; declare namespace R { type Ord = number | string | boolean; interface Static { // ......... } } export = R; |
您必须使用
1 | import * as R from"ramda"; |
另外,您不必再使用