import R (ramda) into typescript .ts file
问题 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; 回答1: You have to