I am attempting to use Ramda.js as follows:
/// <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'
In the case of the ramda/index.d.ts
file, the declaration (with detail omitted) is as follows:
declare var R: R.Static;
declare namespace R {
type Ord = number | string | boolean;
interface Static {
// .........
}
}
export = R;
You have to import it using the import
statement:
import * as R from "ramda";
Also, you don't have to use /// <reference />
anymore, just do npm install --save @types/ramda
.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With