我需要帮助来创建https://github.com/keithamus/R.js
的声明文件我不知道如何解决R(' item')问题。我需要.d.ts文件作为外部commonjs模块才能像这样使用:
import R = require("/i18n/R");
R('item'); // my problem
R.setLocale("en");
答案 0 :(得分:0)
declare module "R" {
interface R {
(name: string): void;
setLocale(locale: string): void;
}
var RModule: R;
export = RModule;
}